/* Life Stats – Clean Story Deck & Telemetry Styling */
:root {
  --bg-color: #fdfbf7;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --card-bg: #ffffff;
  --card-border: #e2e8f0;
  --accent-coral: #ff7979;
  --accent-coral-hover: #eb4d4b;
  --accent-blue: #0984e3;
  --accent-purple: #6c5ce7;
  --accent-gold: #f39c12;
  --accent-green: #00b894;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Outfit", "Segoe UI", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
}

.app-wrapper {
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Background Emoji Pattern Frame */
.bg-emoji-pattern {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  opacity: 0.04;
  background-image: radial-gradient(#000000 1px, transparent 1px);
  background-size: 32px 32px;
  z-index: 1;
}

/* Top Navigation Bar */
.top-nav {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 50px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  transition: all 0.2s ease;
}

.back-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
}

.sound-toggle-btn {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  font-size: 0.9rem;
  padding: 8px 14px;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  transition: all 0.2s ease;
}

.sound-toggle-btn:hover {
  transform: translateY(-2px);
}

/* 1. Landing Screen (Birthday Input) */
.landing-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.landing-screen.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.95);
}

.landing-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 28px;
  padding: 44px 38px;
  width: 90%;
  max-width: 460px;
  text-align: center;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.avatar-graphic-box {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: #fff0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  box-shadow: 0 8px 24px rgba(255, 121, 121, 0.2);
  animation: pulseAvatar 2.5s infinite ease-in-out;
}

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

.landing-title {
  font-size: 2.8rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.landing-subtitle {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: -10px;
}

/* 3 Date Input Boxes */
.date-inputs-group {
  display: flex;
  gap: 12px;
  width: 100%;
  justify-content: center;
}

.date-input-field {
  width: 90px;
  background: #f8fafc;
  border: 2px solid var(--card-border);
  border-radius: 14px;
  padding: 12px 8px;
  font-family: inherit;
  font-size: 1.25rem;
  font-weight: 800;
  text-align: center;
  color: var(--text-main);
  outline: none;
  transition: all 0.2s ease;
}

.date-input-field:focus {
  border-color: var(--accent-coral);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(255, 121, 121, 0.15);
}

.date-input-field.year-field {
  width: 120px;
}

.btn-go {
  width: 100%;
  background: var(--accent-coral);
  color: #ffffff;
  border: none;
  font-family: inherit;
  font-size: 1.15rem;
  font-weight: 800;
  padding: 16px;
  border-radius: 16px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(255, 121, 121, 0.35);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-go:hover {
  background: var(--accent-coral-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(255, 121, 121, 0.45);
}

.btn-go:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* 2. Interactive Multi-Slide Story Presentation */
.deck-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.deck-container.active {
  opacity: 1;
  pointer-events: auto;
}

.slides-wrapper {
  width: 100%;
  max-width: 680px;
  min-height: 520px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.story-slide {
  position: absolute;
  width: 100%;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 32px;
  padding: 40px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
  opacity: 0;
  transform: translateY(30px) scale(0.96);
  pointer-events: none;
  transition: all 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.story-slide.active-slide {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  z-index: 10;
}

.slide-category-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 50px;
}

.pill-heart { background: #fff0f0; color: #ff7979; }
.pill-space { background: #ebf5fb; color: #0984e3; }
.pill-world { background: #f4ecf7; color: #6c5ce7; }
.pill-daily { background: #eafaf1; color: #00b894; }
.pill-history { background: #fef9e7; color: #f39c12; }
.pill-summary { background: #f1f2f6; color: #2f3542; }

.slide-heading {
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

/* Stat Counters Display */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  width: 100%;
  margin-top: 8px;
}

.stat-card-box {
  background: #f8fafc;
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.stat-icon {
  font-size: 1.8rem;
}

.stat-odometer {
  font-family: "Space Mono", monospace;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main);
}

.stat-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* Animated Beating Heart */
.beating-heart-svg {
  width: 48px;
  height: 48px;
  fill: #ff7979;
  animation: heartPulse 0.75s infinite ease-in-out;
}

@keyframes heartPulse {
  0%, 100% { transform: scale(1); }
  35% { transform: scale(1.22); }
  50% { transform: scale(1.1); }
  65% { transform: scale(1.26); }
}

/* Timeline Capsule */
.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  text-align: left;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
  background: #f8fafc;
  padding: 18px 24px;
  border-radius: 18px;
  border: 1px solid var(--card-border);
}

.timeline-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Slide Navigation Footer */
.deck-navigation-bar {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.deck-navigation-bar.active {
  opacity: 1;
  pointer-events: auto;
}

.nav-arrow-btn {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text-main);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 1.2rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
}

.nav-arrow-btn:hover {
  transform: scale(1.08);
  border-color: var(--accent-coral);
}

.nav-arrow-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.slide-dots-group {
  display: flex;
  gap: 8px;
}

.slide-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #cbd5e1;
  cursor: pointer;
  transition: all 0.25s ease;
}

.slide-dot.active {
  width: 28px;
  border-radius: 10px;
  background: var(--accent-coral);
}

/* Final Summary Actions */
.summary-actions-row {
  display: flex;
  gap: 12px;
  width: 100%;
  margin-top: 10px;
}

.btn-summary-action {
  flex: 1;
  background: #f1f5f9;
  border: 1px solid var(--card-border);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  padding: 12px;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-summary-action:hover {
  background: var(--text-main);
  color: #ffffff;
}

.btn-summary-action.primary-action {
  background: var(--accent-coral);
  color: #ffffff;
  border: none;
}

.btn-summary-action.primary-action:hover {
  background: var(--accent-coral-hover);
}

/* Hidden SEO Article */
.seo-article {
  position: absolute;
  top: 100000px;
  left: 0;
  width: 100%;
}

/* Responsive Mobile Layout */
@media (max-width: 640px) {
  .landing-card {
    padding: 32px 24px;
  }
  .landing-title {
    font-size: 2.2rem;
  }
  .story-slide {
    padding: 28px 20px;
  }
  .slide-heading {
    font-size: 1.7rem;
  }
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  .summary-actions-row {
    flex-direction: column;
  }
}
