/* ===== RESET ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
}

body {
  min-height: 100svh;
  background: linear-gradient(135deg, #2b1d0e 0%, #4e342e 100%);
  font-family: 'Poppins', sans-serif;
  color: #f3e5f5;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

/* ===== PAGE SYSTEM ===== */
.page {
  position: absolute;
  width: 90%;
  max-width: 520px;
  text-align: center;
  display: none;
  flex-direction: column;
  align-items: center;
  animation: fadeUp .8s ease;
}

.active-page {
  display: flex
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(40px)
  }

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

/* ===== TEXT ===== */
h1 {
  font-family: 'Pacifico', cursive;
  font-size: clamp(2.2rem, 6vw, 3rem);
  color: #ffcc80;
  text-shadow: 2px 2px 0 #3e2723;
  margin-bottom: 10px;
}

p {
  font-size: 1.1rem;
  color: #d7ccc8;
  margin-bottom: 25px;
}

/* ===== BUTTON ===== */
.btn {
  background: linear-gradient(45deg, #ffd700, #ffca28);
  border: none;
  padding: 12px 30px;
  color: #3e2723;
  font-weight: bold;
  font-size: 1.1rem;
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 0 5px 15px rgba(0, 0, 0, .3);
  transition: .3s;
}

.btn:hover {
  transform: scale(1.1);
  box-shadow: 0 0 25px #ffca28;
}

/* ===== PAGE 1 ===== */
.choco-hero {
  width: 200px;
  animation: float 3s infinite ease-in-out;
}

/* ===== PAGE 2 ===== */
.choco-grid {
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
}

.choco-bar {
  width: 90px;
  height: 130px;
  border-radius: 8px;
  font-size: 2.4rem;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 5px 5px 15px rgba(0, 0, 0, .35);
  transition: .3s;
}

.choco-bar:hover {
  transform: translateY(-12px) scale(1.05);
}

.dark {
  background: #3e2723;
  border: 2px solid #5d4037
}

.milk {
  background: #795548;
  border: 2px solid #8d6e63
}

.white {
  background: #f5f5f5;
  border: 2px solid #e0e0e0
}

/* ===== PAGE 3 GIFT ===== */
.gift-box-container {
  position: relative;
  width: 220px;
  height: 150px;
  margin-top: 110px;
  cursor: pointer;
}

.box-lid {
  position: absolute;
  top: -40px;
  left: -10px;
  width: 240px;
  height: 60px;
  background: #d32f2f;
  border-radius: 6px;
  border: 2px solid #b71c1c;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: .8s;
  z-index: 5;
}

.ribbon {
  width: 40px;
  height: 60px;
  background: gold
}

.box-body {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: #880e4f;
  border: 2px solid #560027;
  border-radius: 0 0 10px 10px;
}

.box-body::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 100%;
  background: #ad1457;
}

/* ===== MEMORIES CARD (IMPROVED) ===== */
.photo-card-popout {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translate(-50%, 0) scale(.6);
  width: 100%;
  background: #fff;
  padding: 24px;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  opacity: 0;
  transition: all 1s cubic-bezier(.68, -0.55, .27, 1.55);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.photo-row {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* Cute polaroid style */
.mini-photo {
  width: 120px;
  height: 120px;
  object-fit: cover;
  background: #fff;
  padding: 6px 6px 14px;
  border-radius: 6px;
  box-shadow: 0 6px 12px rgba(0, 0, 0, .35);
  transform: rotate(var(--r));
}

/* rotations */
.mini-photo:nth-child(1) {
  --r: -6deg
}

.mini-photo:nth-child(2) {
  --r: 2deg
}

.mini-photo:nth-child(3) {
  --r: 6deg
}

.gift-open .box-lid {
  transform: translateY(-180px) rotate(-20deg);
  opacity: 0;
}

.gift-open .photo-card-popout {
  transform: translate(-50%, -180px) scale(1);
  opacity: 1;
}

/* ===== PAGE 4 ===== */
.message-card {
  background: rgba(255, 255, 255, .9);
  color: #3e2723;
  padding: 22px;
  border-radius: 12px;
  transform: rotate(-2deg);
  box-shadow: 0 8px 25px rgba(0, 0, 0, .3);
}

/* ===== PAGE 5 ===== */
#choco-rain {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0)
  }

  50% {
    transform: translateY(-15px)
  }
}

/* ===== MOBILE ===== */
@media(max-width:420px) {
  .photo-card-popout {
    width: 260px
  }

  .mini-photo {
    width: 75px;
    height: 75px
  }

  .choco-bar {
    width: 80px;
    height: 120px
  }
}