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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, #0f0f1a 0%, #1a0a20 50%, #0f0f1a 100%);
  min-height: 100vh;
  color: white;
  overflow-x: hidden;
}

/* ===== SCREENS ===== */
.screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease, visibility 0.6s ease;
  z-index: 1;
  overflow-y: auto;
  padding: 2rem 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.screen::-webkit-scrollbar {
  display: none;
}

.screen.active {
  opacity: 1;
  visibility: visible;
}

.content {
  text-align: center;
  padding: 1.5rem;
  max-width: 500px;
  width: 100%;
  margin: auto;
}

/* ===== PARTICLES ===== */
.particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(236, 72, 153, 0.4);
  border-radius: 50%;
  animation: rise 10s ease-in infinite;
}

@keyframes rise {
  0% {
    transform: translateY(100vh) scale(0);
    opacity: 0;
  }
  10% { opacity: 1; }
  90% { opacity: 0.5; }
  100% {
    transform: translateY(-10vh) scale(1);
    opacity: 0;
  }
}

/* ===== ANIMATIONS ===== */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeInUp 0.8s ease-out forwards;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.15); }
  30% { transform: scale(1); }
  45% { transform: scale(1.1); }
}

.animate-heartbeat {
  animation: heartbeat 1.5s ease-in-out infinite;
}

/* ===== WELCOME (ACTE 1) ===== */
.heart-icon {
  font-size: 4rem;
  margin-bottom: 2rem;
}

.title {
  font-size: 3.5rem;
  font-weight: 300;
  letter-spacing: 0.2em;
  margin-bottom: 2rem;
  background: linear-gradient(135deg, #fff 0%, #ec4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glow-text {
  text-shadow: 0 0 30px rgba(236, 72, 153, 0.5);
}

.subtitle {
  font-size: 1.1rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 0.5rem;
  line-height: 1.8;
}

/* ===== BUTTON ===== */
.btn-primary {
  background: linear-gradient(135deg, #ec4899 0%, #a855f7 100%);
  border: none;
  padding: 1rem 2.5rem;
  border-radius: 50px;
  color: white;
  font-size: 1.1rem;
  font-weight: 500;
  cursor: pointer;
  margin-top: 2.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(236, 72, 153, 0.3);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(236, 72, 153, 0.5);
}

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

.btn-primary.hidden {
  display: none;
}

/* ===== MODE TOGGLE ===== */
.mode-toggle {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 2rem 0 0.5rem;
}

.mode-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  padding: 0.6rem 1.2rem;
  border-radius: 25px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.mode-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.8);
}

.mode-btn.active {
  background: rgba(236, 72, 153, 0.3);
  border-color: rgba(236, 72, 153, 0.5);
  color: white;
}

/* ===== SECONDARY BUTTON ===== */
.btn-secondary {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.3);
  padding: 0.8rem 1.5rem;
  border-radius: 50px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
  cursor: pointer;
  margin-top: 1rem;
  margin-left: 0.5rem;
  transition: all 0.3s ease;
  display: block;
  margin: 1rem auto 0;
}

.btn-secondary:hover {
  border-color: rgba(255, 255, 255, 0.5);
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

/* ===== SLOT MACHINE (ACTE 2) ===== */
.section-title {
  font-size: 1.8rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #fff 0%, #ec4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.slot-subtitle, .puzzle-subtitle {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 2rem;
}

.slot-machine {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 1.5rem;
}

.slot-window {
  width: 80px;
  height: 90px;
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid rgba(236, 72, 153, 0.3);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
}

.reel {
  font-size: 2.5rem;
  transition: transform 0.1s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reel img {
  width: 55px;
  height: 55px;
  border-radius: 50%;
  object-fit: cover;
}

.reel.spinning {
  animation: spinReel 0.12s linear infinite;
}

@keyframes spinReel {
  0% { transform: translateY(-15px); opacity: 0.5; }
  50% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(15px); opacity: 0.5; }
}

.spins-left {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 1rem;
}

.slot-message {
  min-height: 80px;
  padding: 1rem;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.6;
}

.slot-message.win {
  color: #4ade80;
}

.slot-message.lose {
  color: rgba(255, 255, 255, 0.7);
}

/* ===== PUZZLE (ACTE 3) ===== */
.puzzle-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.puzzle-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px;
  border-radius: 12px;
  border: 2px solid rgba(236, 72, 153, 0.2);
}

.puzzle-slot {
  width: 90px;
  height: 90px;
  background: rgba(236, 72, 153, 0.1);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.puzzle-slot.highlight {
  background: rgba(236, 72, 153, 0.3);
}

.puzzle-slot.filled {
  background: transparent;
  padding: 0;
}

.puzzle-pieces {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 320px;
}

.puzzle-piece {
  width: 90px;
  height: 90px;
  border-radius: 8px;
  cursor: grab;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  background-size: 270px 270px;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.puzzle-piece:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 20px rgba(236, 72, 153, 0.3);
}

.puzzle-piece.dragging {
  opacity: 0.8;
  cursor: grabbing;
  transform: scale(1.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.puzzle-piece.placed {
  cursor: default;
  border-color: transparent;
}

.puzzle-message {
  margin-top: 2rem;
  animation: fadeInUp 0.8s ease-out;
}

.puzzle-message p {
  font-size: 1.2rem;
  font-weight: 300;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 1.5rem;
}

.hidden {
  display: none !important;
}

/* ===== FINAL MESSAGE (ACTE 4) ===== */
.final-content {
  max-width: 700px;
  padding-bottom: 2rem;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 2rem;
  text-align: left;
}

@media (max-width: 600px) {
  .final-content {
    flex-direction: column;
    text-align: center;
  }
}

.final-photo-container {
  flex-shrink: 0;
  animation: fadeInUp 1s ease-out;
}

.final-photo {
  width: 100%;
  max-width: 250px;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(236, 72, 153, 0.3);
  border: 3px solid rgba(255, 255, 255, 0.1);
}

.final-text {
  text-align: center;
}

.final-line {
  font-size: 1.15rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 0.8rem;
  opacity: 0;
  animation: fadeInUp 0.8s ease-out forwards;
}

.final-line:nth-child(1) { animation-delay: 0.5s; }
.final-line:nth-child(2) { animation-delay: 1.2s; }
.final-line:nth-child(3) { animation-delay: 1.9s; }
.final-line:nth-child(4) { animation-delay: 2.6s; }

.final-letter {
  text-align: left;
}

@media (max-width: 600px) {
  .final-letter {
    text-align: center;
  }
}

.letter-text {
  font-size: 1.05rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.7;
  margin-bottom: 1.2rem;
  opacity: 0;
  animation: fadeInUp 0.8s ease-out forwards;
}

.letter-text:nth-child(1) { animation-delay: 0.5s; }
.letter-text:nth-child(2) { animation-delay: 1.5s; }
.letter-text:nth-child(3) { animation-delay: 2.5s; }

.final-signature {
  margin-top: 2rem;
  font-size: 1.3rem;
  font-weight: 400;
  line-height: 1.8;
  opacity: 0;
  animation: fadeInUp 1s ease-out forwards;
  animation-delay: 3.5s;
}

.signature {
  font-size: 1.5rem;
  background: linear-gradient(135deg, #ec4899 0%, #f472b6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
  .title {
    font-size: 2.8rem;
  }

  .slot-window {
    width: 70px;
    height: 80px;
  }

  .reel {
    font-size: 2rem;
  }

  .puzzle-slot, .puzzle-piece {
    width: 80px;
    height: 80px;
  }

  .puzzle-piece {
    background-size: 240px 240px;
  }

  .final-photo {
    max-width: 250px;
  }
}

/* ===== ENVELOPE ANIMATION ===== */
.envelope-container {
  position: relative;
  cursor: pointer;
  margin-bottom: 2rem;
}

.envelope {
  width: 120px;
  height: 80px;
  background: linear-gradient(135deg, #ec4899 0%, #f472b6 100%);
  border-radius: 8px;
  position: relative;
  margin: 0 auto;
  transition: transform 0.3s ease;
  box-shadow: 0 10px 30px rgba(236, 72, 153, 0.3);
}

.envelope:hover {
  transform: scale(1.05);
}

.envelope::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(135deg, #db2777 0%, #ec4899 100%);
  clip-path: polygon(0 0, 50% 100%, 100% 0);
  border-radius: 8px 8px 0 0;
}

.envelope.opening {
  animation: envelopeOpen 0.6s ease forwards;
}

@keyframes envelopeOpen {
  0% { transform: scale(1); }
  50% { transform: scale(1.1) rotateX(20deg); }
  100% { transform: scale(0) rotateX(90deg); opacity: 0; }
}

.envelope-heart {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  z-index: 2;
}

/* ===== CONFETTI ===== */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
  overflow: hidden;
}

.confetti {
  position: absolute;
  top: -20px;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* ===== PUZZLE COMPLETE ANIMATION ===== */
.puzzle-board.complete {
  animation: puzzleComplete 0.8s ease;
}

@keyframes puzzleComplete {
  0% { transform: scale(1); }
  25% { transform: scale(1.05); }
  50% { transform: scale(1); box-shadow: 0 0 30px rgba(236, 72, 153, 0.6); }
  75% { transform: scale(1.02); }
  100% { transform: scale(1); box-shadow: 0 0 50px rgba(236, 72, 153, 0.4); }
}

.puzzle-board.complete .puzzle-slot {
  animation: slotGlow 0.5s ease forwards;
}

@keyframes slotGlow {
  0% { box-shadow: none; }
  100% { box-shadow: inset 0 0 10px rgba(236, 72, 153, 0.3); }
}

/* ===== SLOT WIN ANIMATION ===== */
.slot-machine.win {
  animation: slotWin 0.5s ease;
}

@keyframes slotWin {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.05); }
  50% { transform: scale(1.02); }
}

.slot-window.win {
  animation: windowGlow 0.8s ease;
}

@keyframes windowGlow {
  0%, 100% { box-shadow: 0 0 0 rgba(74, 222, 128, 0); }
  50% { box-shadow: 0 0 20px rgba(74, 222, 128, 0.5); }
}
