/* ==========================================================================
   Global Boomer & Generational Era Test - Cyber-Retro Luxury Aesthetic
   ========================================================================== */

:root {
  /* Color Palette - Vibrant Cyber Aurora */
  --bg-primary: #070a16;
  --bg-secondary: #0c1224;
  --bg-card: rgba(14, 21, 42, 0.82);
  --bg-card-hover: rgba(20, 30, 58, 0.9);
  --bg-elevated: #151e38;
  --bg-elevated-hover: #1d2b4f;

  --text-primary: #ffffff;
  --text-secondary: #cbd5e1;
  --text-muted: #8596b5;

  --accent-cyan: #06b6d4;
  --accent-cyan-glow: rgba(6, 182, 212, 0.45);
  --accent-blue: #3b82f6;
  --accent-blue-glow: rgba(59, 130, 246, 0.45);
  --accent-purple: #8b5cf6;
  --accent-purple-glow: rgba(139, 92, 246, 0.45);
  --accent-pink: #ec4899;
  --accent-pink-glow: rgba(236, 72, 153, 0.45);
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.45);
  --accent-amber: #f59e0b;
  --accent-amber-glow: rgba(245, 158, 11, 0.45);
  --accent-coral: #f43f5e;

  --border-glass: rgba(255, 255, 255, 0.16);
  --border-glass-light: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(6, 182, 212, 0.5);

  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  /* Typography */
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Plus Jakarta Sans', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Shadows */
  --shadow-card: 0 24px 50px -12px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.08), inset 0 1px 1px 0 rgba(255, 255, 255, 0.22);
  --shadow-glow-cyan: 0 0 30px rgba(6, 182, 212, 0.45);
  --shadow-glow-purple: 0 0 30px rgba(139, 92, 246, 0.45);
  --shadow-glow-emerald: 0 0 30px rgba(16, 185, 129, 0.45);
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 10% 12%, rgba(6, 182, 212, 0.22) 0px, transparent 48%),
    radial-gradient(at 90% 88%, rgba(236, 72, 153, 0.20) 0px, transparent 52%),
    radial-gradient(at 75% 15%, rgba(139, 92, 246, 0.24) 0px, transparent 48%),
    radial-gradient(at 20% 80%, rgba(16, 185, 129, 0.14) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Particle Canvas Overlay */
#fx-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
}

/* Dynamic Ambient Glow Spheres */
.ambient-glow {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(130px);
  pointer-events: none;
  opacity: 0.4;
  z-index: 0;
  animation: pulseGlow 9s ease-in-out infinite alternate;
}
.glow-1 {
  top: -90px;
  left: -90px;
  background: radial-gradient(circle, var(--accent-cyan), transparent 68%);
}
.glow-2 {
  bottom: -90px;
  right: -90px;
  background: radial-gradient(circle, var(--accent-pink), transparent 68%);
  animation-delay: -4.5s;
}

@keyframes pulseGlow {
  0% { transform: scale(0.9) translate(0, 0); opacity: 0.3; }
  50% { transform: scale(1.2) translate(25px, 20px); opacity: 0.48; }
  100% { transform: scale(1) translate(-20px, -15px); opacity: 0.35; }
}

/* App Layout Wrapper */
.app-wrapper {
  position: relative;
  z-index: 1;
  max-width: 500px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 10px 16px 24px;
}

/* Top Navigation Bar */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(17, 25, 46, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  margin-bottom: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
}

.logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #06b6d4, #8b5cf6);
  border-radius: 9px;
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.4);
}

.logo-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14.5px;
  letter-spacing: -0.2px;
  background: linear-gradient(135deg, #ffffff 30%, #a5f3fc 70%, #c4b5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lang-selector-wrap select {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-glass);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.lang-selector-wrap select:focus,
.lang-selector-wrap select:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.35);
}

/* AdSense Slot (Zero-CLS, Non-Intrusive, Glass Frame) */
.ad-slot-header, .ad-slot-footer, .ad-slot-inline {
  width: 100%;
  min-height: 52px;
  background: rgba(13, 20, 38, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  contain: layout;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.ad-slot-header {
  margin: 6px 0 12px;
  max-height: 90px;
}

.ad-slot-footer {
  margin: 18px 0 10px;
  min-height: 60px;
}

.ad-slot-inline {
  margin: 14px 0;
}

.ad-label {
  font-size: 9.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 2px;
  font-weight: 700;
}

/* Screen Transitions & Global Utility */
.hidden {
  display: none !important;
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  animation: fadeInSlide 0.32s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.screen.hidden {
  display: none !important;
}

@keyframes fadeInSlide {
  from { opacity: 0; transform: translateY(10px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ==========================================================================
   SCREEN 1: WELCOME SCREEN
   ========================================================================== */
.welcome-card {
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 30px 22px 26px;
  text-align: center;
  box-shadow: var(--shadow-card);
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
}

/* Card Top Highlight Line */
.welcome-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(6, 182, 212, 0.9), rgba(236, 72, 153, 0.8), transparent);
}

.welcome-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(139, 92, 246, 0.2));
  border: 1px solid rgba(6, 182, 212, 0.5);
  color: #38bdf8;
  padding: 6px 18px;
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.25);
}

.welcome-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 6.2vw, 32px);
  font-weight: 900;
  line-height: 1.22;
  margin-bottom: 12px;
  letter-spacing: -0.6px;
  background: linear-gradient(135deg, #ffffff 15%, #bae6fd 50%, #fbcfe8 90%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 4px 20px rgba(6, 182, 212, 0.2);
}

.welcome-sub {
  font-size: 15px;
  color: #e2e8f0;
  margin-bottom: 22px;
  font-weight: 600;
  line-height: 1.45;
}

.feature-chips {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #f1f5f9;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
  transition: all 0.2s ease;
}
.chip:hover {
  border-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.12);
}

.disclaimer-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.5;
}

/* Tactile 3D Buttons (Duolingo/Linear Tactile Feel) */
.tactile-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  font-family: var(--font-display);
  font-size: 16.5px;
  font-weight: 800;
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  position: relative;
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.15s ease;
  user-select: none;
  outline: none;
}

/* Primary Hero Button with Shiny Animation */
.btn-primary {
  background: linear-gradient(135deg, #0284c7 0%, #3b82f6 35%, #8b5cf6 70%, #ec4899 100%);
  box-shadow: 0 6px 0 #1d4ed8, 0 14px 30px rgba(59, 130, 246, 0.5), inset 0 1.5px 1.5px rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 16px 22px;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 40%;
  height: 200%;
  background: linear-gradient(
    60deg,
    rgba(255, 255, 255, 0) 20%,
    rgba(255, 255, 255, 0.4) 50%,
    rgba(255, 255, 255, 0) 80%
  );
  transform: rotate(25deg);
  animation: shineSweep 4s ease-in-out infinite;
}

@keyframes shineSweep {
  0% { left: -60%; }
  35%, 100% { left: 140%; }
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-primary:active {
  transform: translateY(5px);
  box-shadow: 0 1px 0 #1d4ed8, 0 4px 14px rgba(59, 130, 246, 0.35);
}

.btn-secondary {
  background: var(--bg-elevated);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  box-shadow: 0 4px 0 #090e1a;
  padding: 10px 16px;
}
.btn-secondary:hover {
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}
.btn-secondary:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #090e1a;
}

/* ==========================================================================
   SCREEN 2: QUIZ SCREEN (IMAGE-CENTRIC & 100DVH MOBILE FIT)
   ========================================================================== */
.quiz-header {
  margin-bottom: 12px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.question-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.16);
  border: 1px solid rgba(6, 182, 212, 0.45);
  padding: 4px 13px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  box-shadow: 0 2px 10px rgba(6, 182, 212, 0.2);
}

.progress-percent {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  color: #38bdf8;
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

/* Luminous Capsule Progress Bar */
.progress-track {
  width: 100%;
  height: 9px;
  background: rgba(14, 21, 42, 0.85);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid var(--border-glass-light);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #38bdf8 0%, #818cf8 35%, #c084fc 70%, #f43f5e 100%);
  border-radius: var(--radius-full);
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 16px rgba(129, 140, 248, 0.75);
}

/* Visual Milestone Card */
.visual-card {
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Image Container */
.milestone-img-wrap {
  position: relative;
  width: 100%;
  height: clamp(170px, 30vh, 225px);
  background: #080e1e;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.milestone-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.4s ease, opacity 0.3s ease;
}

.milestone-img.loading {
  opacity: 0;
}

/* Vignette bottom shadow on image for seamless blend into card content */
.milestone-img-wrap::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to top, rgba(14, 21, 42, 0.98), transparent);
  pointer-events: none;
}

.img-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #151e38, #0a1022);
  z-index: 1;
}

.img-fallback.hidden {
  display: none !important;
}

.fallback-icon {
  font-size: 60px;
  opacity: 0.85;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.6));
}

.year-badge {
  position: absolute;
  bottom: 12px;
  left: 12px;
  z-index: 2;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.95), rgba(59, 130, 246, 0.95));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 4px 13px;
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.8px;
  box-shadow: 0 4px 16px rgba(6, 182, 212, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.4);
}

.category-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  background: rgba(13, 19, 41, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 4px 13px;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.milestone-content {
  padding: 14px 18px 18px;
  text-align: center;
}

.milestone-title {
  font-family: var(--font-display);
  font-size: clamp(17px, 4.5vw, 20.5px);
  font-weight: 800;
  line-height: 1.3;
  color: #ffffff;
  margin-bottom: 7px;
  letter-spacing: -0.2px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.milestone-desc {
  font-size: clamp(13px, 3.4vw, 14.5px);
  color: #cbd5e1;
  line-height: 1.5;
  font-weight: 500;
}

/* ==========================================================================
   JUICY TACTILE 3D ACTION BUTTONS ("알아요" vs "몰라요")
   ========================================================================== */
.binary-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

/* "👍 알아요!" (I Know It) - Luminous Emerald/Cyan 3D Candy Button */
.btn-action-know {
  background: linear-gradient(135deg, #10b981 0%, #059669 45%, #0284c7 100%);
  box-shadow: 0 6px 0 #047857, 0 12px 26px rgba(16, 185, 129, 0.45), inset 0 1.5px 1.5px rgba(255, 255, 255, 0.45);
  color: #ffffff;
  font-size: clamp(15.5px, 4.3vw, 18px);
  font-weight: 800;
  padding: 15px 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.15s ease;
}

.btn-action-know:hover {
  filter: brightness(1.08);
}

.btn-action-know:active, .btn-action-know.tapped {
  transform: translateY(5px);
  box-shadow: 0 1px 0 #047857, 0 4px 12px rgba(16, 185, 129, 0.35);
}

/* "🤔 몰라요" (Don't Know) - Sleek Velvet Slate + Sunset Rose Accent Button */
.btn-action-dontknow {
  background: linear-gradient(135deg, #2d374e 0%, #1a2334 100%);
  border: 1.5px solid rgba(244, 63, 94, 0.45);
  box-shadow: 0 6px 0 #0f1422, 0 12px 24px rgba(0, 0, 0, 0.5), inset 0 1.5px 1.5px rgba(255, 255, 255, 0.18);
  color: #fed7aa;
  font-size: clamp(15.5px, 4.3vw, 18px);
  font-weight: 800;
  padding: 15px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.15s ease, border-color 0.15s ease;
}

.btn-action-dontknow:hover {
  filter: brightness(1.1);
  border-color: rgba(244, 63, 94, 0.7);
}

.btn-action-dontknow:active, .btn-action-dontknow.tapped {
  transform: translateY(5px);
  box-shadow: 0 1px 0 #0f1422;
}

.action-icon {
  font-size: 20px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.quiz-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.btn-nav-prev {
  width: auto;
  min-width: 76px;
  padding: 8px 14px;
  font-size: 12.5px;
  border-radius: var(--radius-full);
}

.fast-tap-hint {
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
  flex: 1;
  margin-left: 10px;
  font-weight: 600;
}

/* ==========================================================================
   SCREEN 3: ANALYZING SCREEN (1.8s Radar Scan)
   ========================================================================== */
.analyzing-box {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 44px 24px;
  text-align: center;
  box-shadow: var(--shadow-card);
  margin: auto 0;
}

.radar-scanner {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  border: 2px solid var(--accent-cyan);
  margin: 0 auto 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 30px rgba(6, 182, 212, 0.4), inset 0 0 20px rgba(6, 182, 212, 0.2);
}

.radar-scanner::after {
  content: '';
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  border: 1px dashed rgba(6, 182, 212, 0.4);
}

.radar-sweep {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  background: conic-gradient(from 0deg at 0% 0%, rgba(6, 182, 212, 0.7), transparent 55%);
  transform-origin: 0 0;
  animation: radarRotate 1.3s linear infinite;
}

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

.analyzing-title {
  font-family: var(--font-display);
  font-size: 18.5px;
  font-weight: 800;
  margin-bottom: 8px;
  color: #ffffff;
}

.analyzing-sub {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ==========================================================================
   SCREEN 4: MULTI-CARD RESULT SCREEN (PAGINATED LUXURY CARDS)
   ========================================================================== */
.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.result-card-indicator {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.14);
  border: 1px solid rgba(6, 182, 212, 0.4);
  padding: 4px 13px;
  border-radius: var(--radius-full);
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.2);
}

.result-card {
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 26px 20px;
  box-shadow: var(--shadow-card);
  margin-bottom: 14px;
  animation: fadeInSlide 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Card 1: Core Persona */
.persona-hero {
  text-align: center;
  margin-bottom: 18px;
}

.res-icon {
  font-size: 56px;
  margin-bottom: 12px;
  display: inline-block;
  animation: floatBounce 3s ease-in-out infinite;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.6));
}

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

.res-badge {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 800;
  background: linear-gradient(90deg, #ec4899, #8b5cf6);
  color: #fff;
  padding: 5px 18px;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
  box-shadow: 0 4px 18px rgba(236, 72, 153, 0.45);
  letter-spacing: 0.6px;
}

.res-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 5.4vw, 27px);
  font-weight: 900;
  line-height: 1.25;
  margin-bottom: 14px;
  background: linear-gradient(135deg, #ffffff 30%, #bae6fd 70%, #fbcfe8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 4px 20px rgba(6, 182, 212, 0.2);
}

.age-badge-container {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(135deg, rgba(21, 30, 56, 0.9), rgba(11, 17, 34, 0.9));
  border: 1.5px solid var(--accent-cyan);
  border-radius: var(--radius-md);
  padding: 12px 32px;
  margin-bottom: 18px;
  box-shadow: 0 8px 24px rgba(6, 182, 212, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

.res-age-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 2px;
}

.res-age {
  font-family: var(--font-display);
  font-size: 29px;
  font-weight: 900;
  color: #38bdf8;
  text-shadow: 0 0 16px rgba(56, 189, 248, 0.5);
}

.res-tagline {
  font-size: 14.5px;
  font-weight: 600;
  color: #f1f5f9;
  background: rgba(0, 0, 0, 0.35);
  border-left: 3.5px solid var(--accent-cyan);
  padding: 12px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 14px;
  line-height: 1.5;
  text-align: left;
}

.res-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.68;
  text-align: left;
}

/* Card 2: Era Breakdown */
.card-section-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
}

.era-stat-row {
  margin-bottom: 16px;
}

.era-stat-header {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}

.era-stat-label {
  color: var(--text-primary);
}

.era-meter-track {
  height: 10px;
  background: rgba(14, 21, 42, 0.9);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid var(--border-glass-light);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.era-meter-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Card 3: Traits & Peers */
.traits-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.trait-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-glass-light);
  padding: 12px 15px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  line-height: 1.5;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}

.trait-bullet {
  color: var(--accent-emerald);
  font-weight: 900;
  font-size: 16px;
}

.peers-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1.5px solid rgba(245, 158, 11, 0.45);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.15);
}

.peers-label {
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 800;
  color: var(--accent-amber);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.peers-content {
  font-size: 13.5px;
  color: #f1f5f9;
  line-height: 1.5;
}

/* Card 4: Sharing & Rahostudio Ecosystem */
.share-action-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.share-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 8px;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.15s ease;
}

.share-btn:hover {
  filter: brightness(1.1);
}

.share-btn:active {
  transform: translateY(2px);
}

.share-btn-copy {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  box-shadow: 0 4px 0 #4338ca, 0 8px 18px rgba(99, 102, 241, 0.35);
  color: #ffffff;
}
.share-btn-copy:active {
  box-shadow: 0 1px 0 #4338ca;
}

.share-btn-x {
  background: linear-gradient(135deg, #27272a 0%, #09090b 100%);
  box-shadow: 0 4px 0 #000000, 0 8px 18px rgba(0, 0, 0, 0.45);
  color: #f4f4f5;
}
.share-btn-x:active {
  box-shadow: 0 1px 0 #000000;
}

.share-btn-wa {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 4px 0 #047857, 0 8px 18px rgba(16, 185, 129, 0.35);
  color: #ffffff;
}
.share-btn-wa:active {
  box-shadow: 0 1px 0 #047857;
}

.eco-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border-glass);
}

.eco-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 12px;
}

.eco-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.eco-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 13px 15px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 3px 0 #090e1a;
  transition: transform 0.08s ease, box-shadow 0.08s ease, border-color 0.15s ease, background 0.15s ease;
}

.eco-card:hover {
  border-color: rgba(255, 255, 255, 0.25);
  background: var(--bg-elevated-hover);
}

.eco-card:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #090e1a;
}

.eco-card-psy {
  border-left: 3.5px solid var(--accent-pink);
}

.eco-card-util {
  border-left: 3.5px solid var(--accent-cyan);
}

.eco-icon-wrap {
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  min-width: 42px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.eco-info {
  flex: 1;
}

.eco-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3px;
}

.eco-title {
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 800;
  color: #ffffff;
}

.eco-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
}

.eco-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Result Card Pagination Controls */
.result-nav-row {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.btn-result-prev {
  min-width: 110px;
  font-size: 13.5px;
  padding: 13px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-glass);
  box-shadow: 0 4px 0 #090e1a;
  color: var(--text-secondary);
}
.btn-result-prev:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
}
.btn-result-prev:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #090e1a;
}

.btn-result-next {
  flex: 1;
  font-size: 15px;
  padding: 14px 20px;
  background: linear-gradient(135deg, #0284c7 0%, #4f46e5 50%, #8b5cf6 100%);
  box-shadow: 0 5px 0 #1e1b4b, 0 10px 24px rgba(79, 70, 229, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
}
.btn-result-next:hover {
  filter: brightness(1.08);
}
.btn-result-next:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #1e1b4b, 0 3px 10px rgba(79, 70, 229, 0.3);
}

.retake-row {
  margin-top: 16px;
  text-align: center;
}

/* Toast Message */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1e293b;
  color: #38bdf8;
  border: 1px solid var(--accent-cyan);
  padding: 10px 22px;
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10000;
}

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

.toast.hidden {
  display: none;
}

/* Responsive adjustments for mobile & small screens */
@media (max-width: 380px) {
  .app-wrapper {
    padding: 8px 10px 20px;
  }
  .milestone-title {
    font-size: 15px;
  }
  .btn-action-know, .btn-action-dontknow {
    padding: 13px 8px;
    font-size: 14px;
  }
  .share-action-grid {
    grid-template-columns: 1fr;
  }
}

/* Ensure non-intrusive ad fit on compact vertical screens (iPhone SE, Galaxy, etc.) */
@media (max-height: 740px) {
  .top-nav {
    padding: 6px 12px;
    margin-bottom: 8px;
  }
  .ad-slot-header {
    margin: 4px 0 8px;
    max-height: 70px;
  }
  .quiz-header {
    margin-bottom: 8px;
  }
  .milestone-img-wrap {
    height: 145px;
  }
  .milestone-content {
    padding: 10px 14px 12px;
  }
  .milestone-title {
    font-size: 16px;
    margin-bottom: 4px;
  }
  .milestone-desc {
    font-size: 12.5px;
  }
  .binary-actions-row {
    gap: 8px;
    margin-bottom: 8px;
  }
  .btn-action-know, .btn-action-dontknow {
    padding: 12px 10px;
    font-size: 15px;
  }
  .ad-slot-footer {
    margin: 12px 0 8px;
  }
}
