/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --font-primary: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
  
  /* Color Palette */
  --bg-primary: #0a0712;
  --bg-gradient: linear-gradient(135deg, #090611 0%, #170d26 50%, #0d0617 100%);
  --text-main: #f3f0f7;
  --text-muted: #bdaec6;
  
  --primary: #ff4d6d;
  --primary-glow: rgba(255, 77, 109, 0.4);
  --primary-dark: #c9184a;
  
  --secondary: #d4af37; /* Rose Gold / Gold */
  --secondary-glow: rgba(212, 175, 55, 0.3);
  
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: rgba(0, 0, 0, 0.4);
  
  --success: #38b000;
  --success-bg: rgba(56, 176, 0, 0.15);
  --success-border: rgba(56, 176, 0, 0.35);
  
  --error: #d90429;
  --error-bg: rgba(217, 4, 41, 0.15);
  --error-border: rgba(217, 4, 41, 0.35);
}

body {
  font-family: var(--font-primary);
  background-color: var(--bg-primary);
  background-image: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  overflow-x: hidden;
  position: relative;
}

/* Background Glowing Orbs */
.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  z-index: 0;
  opacity: 0.4;
  pointer-events: none;
  animation: orbFloat 20s infinite alternate ease-in-out;
}

.bg-orb-1 {
  width: 350px;
  height: 350px;
  background: var(--primary);
  top: 10%;
  left: -50px;
}

.bg-orb-2 {
  width: 400px;
  height: 400px;
  background: #7209b7;
  bottom: 10%;
  right: -50px;
  animation-delay: -5s;
}

.bg-orb-3 {
  width: 250px;
  height: 250px;
  background: var(--secondary);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.15;
  animation-duration: 25s;
}

@keyframes orbFloat {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(50px, 30px) scale(1.1);
  }
}

/* Heart Particle Animations */
#particles-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.falling-heart {
  position: absolute;
  color: var(--primary);
  opacity: 0.6;
  pointer-events: none;
  animation: fall linear forwards;
}

@keyframes fall {
  0% {
    transform: translateY(-20px) rotate(0deg) scale(0);
    opacity: 0;
  }
  10% {
    opacity: 0.6;
    transform: translateY(10vh) rotate(45deg) scale(1);
  }
  100% {
    transform: translateY(105vh) rotate(360deg) scale(0.6);
    opacity: 0;
  }
}

/* App Layout */
.app-container {
  width: 100%;
  max-width: 580px;
  padding: 20px;
  margin: auto;
  z-index: 2;
  position: relative;
}

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 40px 30px;
  box-shadow: 0 15px 35px var(--glass-shadow);
  transition: transform 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

/* Screen Transitions */
.screen {
  display: none;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.screen.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 32px;
  border-radius: 14px;
  border: none;
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  box-shadow: 0 5px 15px rgba(255, 77, 109, 0.3);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(255, 77, 109, 0.5);
}

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

.btn-secondary {
  background: linear-gradient(135deg, #7209b7 0%, #560bad 100%);
  color: white;
  box-shadow: 0 5px 15px rgba(114, 9, 183, 0.3);
}

.btn-secondary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(114, 9, 183, 0.5);
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-main);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
}

.glow-btn {
  position: relative;
  overflow: hidden;
}

.glow-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -50%;
  width: 200%;
  height: 100%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: skewX(-25deg);
  transition: 0.75s;
  opacity: 0;
}

.glow-btn:hover::after {
  left: 125%;
  opacity: 1;
}

/* Welcome Screen Specifics */
.welcome-card {
  text-align: center;
}

.welcome-hero-container {
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 25px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  aspect-ratio: 16 / 9;
}

.welcome-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.welcome-card:hover .welcome-hero-img {
  transform: scale(1.03);
}


.anniversary-title {
  font-family: var(--font-serif);
  font-size: 2.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff 30%, var(--primary) 70%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 10px;
  letter-spacing: -0.5px;
}

.sub-headline {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.4rem;
  color: var(--secondary);
  margin-bottom: 30px;
  font-weight: 400;
}

.welcome-text {
  color: var(--text-muted);
  line-height: 1.7;
  font-size: 15px;
  margin-bottom: 35px;
  text-align: justify;
  text-align-last: center;
}

/* Quiz Screen Specifics */
.quiz-header {
  margin-bottom: 25px;
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(to right, var(--primary), var(--secondary));
  width: 0%;
  border-radius: 10px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.quiz-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.meta-badge {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.question-title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 30px;
  color: #fff;
  text-align: center;
}

.options-grid {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
}

.option-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 18px 24px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex;
  align-items: center;
  gap: 15px;
  position: relative;
  overflow: hidden;
}

.option-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.option-marker {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.option-card:hover .option-marker {
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

.option-text {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text-main);
}

/* Selected, Correct and Incorrect States */
.option-card.correct {
  background: var(--success-bg);
  border-color: var(--success);
  box-shadow: 0 0 15px rgba(56, 176, 0, 0.1);
  pointer-events: none;
}

.option-card.correct .option-marker {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.option-card.incorrect {
  background: var(--error-bg);
  border-color: var(--error);
  pointer-events: none;
}

.option-card.incorrect .option-marker {
  background: var(--error);
  border-color: var(--error);
  color: white;
}

.option-card.disabled {
  pointer-events: none;
  opacity: 0.6;
}

/* Story Card Panel */
.story-card {
  margin-top: 30px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 24px;
  display: none;
  transform: translateY(10px);
  animation: slideUp 0.4s forwards ease-out;
}

@keyframes slideUp {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.story-images-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  width: 100%;
}

.story-images-grid.cols-1 {
  grid-template-columns: 1fr;
}

.story-images-grid.cols-2 {
  grid-template-columns: 1fr 1fr;
}

.story-images-grid.cols-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.story-image-item {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.story-image-item:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.story-image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


.story-header {
  margin-bottom: 12px;
}

.story-badge {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.story-body {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* Results Screen Specifics */
.results-card {
  text-align: center;
}

.trophy-container {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.surprise-icon {
  font-size: 4.5rem;
  color: var(--secondary);
  filter: drop-shadow(0 0 15px var(--secondary-glow));
}

.animate-bounce {
  animation: bounce 2s infinite;
}

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

.results-title {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #ffffff 40%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.results-score-text {
  font-size: 18px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 8px;
}

.results-comment {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 35px;
  font-style: italic;
}

/* Surprise Cards Layout */
.surprise-container {
  margin-bottom: 35px;
  text-align: left;
}

.surprise-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: #fff;
  margin-bottom: 18px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 10px;
}

.surprise-grid {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.surprise-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  gap: 18px;
  align-items: center;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.surprise-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--secondary);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.surprise-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(212, 175, 55, 0.25);
  transform: translateX(4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.surprise-card:hover::before {
  opacity: 1;
}

.surprise-card-icon {
  font-size: 2.2rem;
  color: var(--secondary);
  flex-shrink: 0;
}

.surprise-card-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.surprise-card-content h4 {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}

.surprise-card-content p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

.action-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--secondary);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

.action-text i {
  transition: transform 0.2s ease;
}

.surprise-card:hover .action-text i {
  transform: translateX(3px);
}

/* Footer styling */
.app-footer {
  width: 100%;
  padding: 25px;
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.02);
  z-index: 2;
}

/* Responsiveness */
@media (max-width: 480px) {
  .app-container {
    padding: 15px;
  }
  
  .glass-card {
    padding: 30px 20px;
    border-radius: 20px;
  }
  
  .anniversary-title {
    font-size: 2.2rem;
  }
  
  .question-title {
    font-size: 1.35rem;
    margin-bottom: 25px;
  }
  
  .option-card {
    padding: 14px 18px;
  }
  
  .option-text {
    font-size: 14px;
  }
  
  .surprise-card {
    padding: 15px;
    gap: 12px;
  }
  
  .surprise-card-icon {
    font-size: 1.8rem;
  }
}
