@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

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

body {
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.background-particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.particle {
  position: absolute;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(180deg); }
}

.container {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 25px;
  padding: 40px;
  box-shadow: 
    0 25px 50px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.3);
  max-width: 600px;
  width: 90%;
  text-align: center;
  position: relative;
  z-index: 10;
  min-height: 600px;
}

h1 {
  color: #4a5568;
  margin-bottom: 30px;
  font-size: 2.5rem;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.subtitle {
  color: #718096;
  margin-bottom: 40px;
  font-size: 1.1rem;
  font-weight: 300;
}

.cookie-container {
  position: relative;
  width: 250px;
  height: 150px;
  margin: 20px auto 30px auto;
  perspective: 1000px;
}

.fortune-cookie {
  position: relative;
  width: 100%;
  height: 100%;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.fortune-cookie:hover {
  transform: scale(1.05);
}

.cookie-half {
  position: absolute;
  width: 120px;
  height: 120px;
  background: linear-gradient(145deg, #f6ad55, #ed8936);
  border-radius: 50%;
  top: 15px;
  transition: all 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  box-shadow: 
    inset -5px -5px 15px rgba(0,0,0,0.2),
    inset 5px 5px 15px rgba(255,255,255,0.3),
    0 10px 20px rgba(0,0,0,0.3);
}

.cookie-half::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 20px;
  width: 80px;
  height: 80px;
  background: linear-gradient(145deg, #fbb040, #f6ad55);
  border-radius: 50%;
  box-shadow: inset 2px 2px 8px rgba(255,255,255,0.4);
}

.cookie-half::after {
  content: '';
  position: absolute;
  top: 35px;
  left: 35px;
  width: 15px;
  height: 15px;
  background: #ed8936;
  border-radius: 50%;
  box-shadow: 
    25px 10px 0 -5px #ed8936,
    15px 25px 0 -3px #ed8936,
    -10px 15px 0 -4px #ed8936;
}

.left-half {
  left: 15px;
  transform-origin: right center;
  clip-path: polygon(0 0, 50% 0, 50% 100%, 0 100%);
}

.right-half {
  right: 15px;
  transform-origin: left center;
  clip-path: polygon(50% 0, 100% 0, 100% 100%, 50% 100%);
}

.fortune-cookie.cracked .left-half {
  transform: translateX(-80px) rotateY(-25deg);
}

.fortune-cookie.cracked .right-half {
  transform: translateX(80px) rotateY(25deg);
}

.fortune-cookie.united .left-half,
.fortune-cookie.united .right-half {
  transform: translateX(0) rotateY(0);
  transition: all 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.fortune-paper {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  background: linear-gradient(145deg, #fffef7, #f7fafc);
  border: 2px solid #e2e8f0;
  border-radius: 15px;
  padding: 15px;
  width: 280px;
  min-height: 80px;
  box-shadow: 
    0 15px 30px rgba(0,0,0,0.2),
    0 0 0 1px rgba(255,255,255,0.5);
  transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  opacity: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.fortune-cookie.cracked .fortune-paper {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  transition-delay: 0.4s;
}

.fortune-cookie.united .fortune-paper {
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  transition-delay: 0s;
}

.fortune-type {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.fortune-type.derecho {
  color: #38a169;
  text-shadow: 0 0 10px rgba(56, 161, 105, 0.3);
}

.fortune-type.deber {
  color: #e53e3e;
  text-shadow: 0 0 10px rgba(229, 62, 62, 0.3);
}

.fortune-message {
  font-size: 0.95rem;
  line-height: 1.5;
  color: #2d3748;
  font-weight: 500;
  margin: 0;
  max-width: 100%;
  word-wrap: break-word;
}

.quiz-container {
  margin-top: 40px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease;
  min-height: 200px;
}

.quiz-container.show {
  opacity: 1;
  transform: translateY(0);
}

.quiz-question {
  font-size: 1.2rem;
  font-weight: 600;
  color: #4a5568;
  margin-bottom: 20px;
}

.quiz-options {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-bottom: 20px;
}

.quiz-option {
  background: linear-gradient(145deg, #f7fafc, #edf2f7);
  border: 2px solid #e2e8f0;
  padding: 12px 25px;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.quiz-option:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
  border-color: #cbd5e0;
}

.quiz-option.correct {
  background: linear-gradient(145deg, #68d391, #38a169);
  color: white;
  border-color: #38a169;
  animation: correctPulse 0.6s ease;
}

.quiz-option.incorrect {
  background: linear-gradient(145deg, #fc8181, #e53e3e);
  color: white;
  border-color: #e53e3e;
  animation: shake 0.6s ease;
}

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

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.quiz-result {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 15px;
  padding: 15px;
  border-radius: 15px;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.5s ease;
}

.quiz-result.show {
  opacity: 1;
  transform: translateY(0);
}

.quiz-result.correct {
  background: linear-gradient(145deg, #c6f6d5, #9ae6b4);
  color: #22543d;
  border: 2px solid #38a169;
}

.quiz-result.incorrect {
  background: linear-gradient(145deg, #fed7d7, #feb2b2);
  color: #742a2a;
  border: 2px solid #e53e3e;
}

.reset-button {
  background: linear-gradient(145deg, #667eea, #764ba2);
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 20px;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.reset-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.reset-button:active {
  transform: translateY(0);
}

.instructions {
  color: #718096;
  font-size: 0.9rem;
  margin-top: 20px;
  opacity: 0.8;
}

@keyframes sparkle {
  0%, 100% { opacity: 0; transform: scale(0) rotate(0deg); }
  50% { opacity: 1; transform: scale(1) rotate(180deg); }
}

.sparkle {
  position: absolute;
  width: 6px;
  height: 6px;
  background: #fbbf24;
  border-radius: 50%;
  pointer-events: none;
  animation: sparkle 1.5s ease-in-out infinite;
}

@media (max-width: 600px) {
  .container {
    padding: 30px 20px;
    min-height: 500px;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  .cookie-container {
    width: 200px;
    height: 120px;
  }
  
  .cookie-half {
    width: 100px;
    height: 100px;
  }
  
  .fortune-paper {
    width: 260px;
    padding: 12px;
    min-height: 70px;
  }

  .fortune-message {
    font-size: 0.9rem;
    line-height: 1.4;
  }

  .quiz-options {
    flex-direction: column;
    align-items: center;
  }

  .quiz-option {
    width: 200px;
  }
}