@import url('https://fonts.googleapis.com/css2?family=Titan+One&family=Sriracha&family=Dancing+Script:wght@700&display=swap');

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

:root {
  --pink: #feecea;
  --white: #fff;
  --black: #333;
  --accent: #FF7882;
  --paper: #fff8e4;
}

html, body { height: 100%; }
body { background: var(--pink); font-family: 'Sriracha', cursive; overflow-x: hidden; }

#wrapper {
  position: relative;
  min-height: 100%;
  overflow: hidden;
  background-image:
    linear-gradient(0deg, transparent 24%, #fff 25%, #fff 26%, transparent 27%, transparent 74%, #fff 75%, #fff 76%, transparent 77%),
    linear-gradient(90deg, transparent 24%, #fff 25%, #fff 26%, transparent 27%, transparent 74%, #fff 75%, #fff 76%, transparent 77%);
  background-size: 80px 80px;
}

/* Bunting */
.bunting {
  height: 40px;
  transform: translateY(-80px);
  animation: drop 1.2s 0.5s forwards;
  background:
    linear-gradient(135deg, var(--accent) 25%, transparent 25%) -20px 0 / 40px 40px,
    linear-gradient(225deg, var(--accent) 25%, transparent 25%) -20px 0 / 40px 40px,
    linear-gradient(315deg, #ffd166 25%, transparent 25%) 0 0 / 40px 40px,
    linear-gradient(45deg, #ffd166 25%, transparent 25%) 0 0 / 40px 40px;
  opacity: .9;
}
@keyframes drop { to { transform: translateY(0); } }

.content { display: flex; padding: 3rem 1rem 4rem; align-items: center; }
.left, .right { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.left { width: 45%; }
.right { width: 55%; }

/* Title */
.title { position: relative; display: flex; flex-direction: column; align-items: center; font-family: 'Titan One', sans-serif; font-size: 3.2rem; }
.title h1 { display: flex; font-weight: bold; text-shadow: 4px 4px var(--black), -4px 4px var(--black), 4px -4px var(--black), -4px -4px var(--black), 4px 8px 0 var(--black); }
.title .happy { color: var(--white); }
.title .birthday { color: var(--accent); }
.title span { opacity: 0; transform: translateY(50px); animation: letterIn .5s var(--t) forwards; }
@keyframes letterIn { to { opacity: 1; transform: translateY(0); } }
.title .hat { position: absolute; right: -10px; top: -45px; font-size: 3rem; transform: rotate(20deg); opacity: 0; animation: fadeIn 1s 3s forwards; }
@keyframes fadeIn { to { opacity: 1; } }

/* Date pill */
.date__of__birth {
  margin-top: 28px; padding: 8px 28px; background: var(--accent); color: #fff;
  border: 3px solid var(--black); border-radius: 50px; font-size: 1.2rem;
  opacity: 0; animation: fadeIn 1s 3.5s forwards;
}

/* Countdown */
.countdown { margin-top: 22px; display: flex; gap: 10px; opacity: 0; animation: fadeIn 1s 4s forwards; }
.countdown .unit { background: #fff; border: 3px solid var(--black); border-radius: 14px; padding: 6px 12px; text-align: center; min-width: 64px; }
.countdown b { display: block; font-size: 1.5rem; color: var(--accent); }
.countdown small { font-size: .7rem; text-transform: uppercase; }
.countdown .today { font-family: 'Titan One', sans-serif; color: var(--accent); font-size: 1.4rem; padding: 6px 12px; }

/* Button */
#btn__letter {
  margin-top: 26px; background: var(--accent); border: 3px solid var(--black); border-radius: 50px;
  padding: 8px 22px; font-family: 'Sriracha', cursive; font-size: 1.05rem; cursor: pointer;
  opacity: 0; animation: fadeIn 1s 4.5s forwards; transition: transform .3s, background .3s;
}
#btn__letter:hover { background: #ff5a68; color: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.25); }
#btn__letter:active { transform: scale(.92); }

/* Photos */
.box__account { position: relative; display: flex; flex-direction: column; align-items: center; transform: translateY(600px); animation: rise 3s 1s forwards ease-out; }
@keyframes rise { to { transform: translateY(0); } }
.photos { position: relative; width: 380px; height: 380px; }
.image {
  position: relative; width: 300px; height: 300px; border-radius: 50%; overflow: hidden;
  border: 6px solid var(--black); background: #fff; display: flex; align-items: center; justify-content: center;
}
.image .emoji { font-size: 6rem; }
.image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.image.small { position: absolute; width: 150px; height: 150px; right: 0; bottom: 0; }
.image.small .emoji { font-size: 3.4rem; }
.name {
  margin-top: -10px; padding: 4px 20px; background: var(--accent); border: 3px solid var(--black);
  border-radius: 50px; display: flex; align-items: center; gap: 10px;
  font-family: 'Dancing Script', cursive; font-size: 1.6rem; color: #fff; text-align: center;
}
.fa-heart { color: #fff; animation: pulse 1s infinite linear; }
@keyframes pulse { 50% { transform: scale(1.25); } }

.balloon { position: absolute; font-size: 4rem; animation: sway 2s infinite linear; transform-origin: bottom center; }
.balloon_one { top: -30px; left: -50px; }
.balloon_two { top: 120px; right: -40px; animation-delay: -1s; }
@keyframes sway { 0%,50%,100% { transform: rotate(0); } 25% { transform: rotate(5deg); } 75% { transform: rotate(-5deg); } }

/* Stars */
.decorate_star { position: absolute; background: var(--black); transform: scale(0); clip-path: polygon(0 50%, 35% 35%, 50% 0, 65% 35%, 100% 50%, 65% 65%, 50% 100%, 35% 65%); animation: pop 2s var(--t) forwards, twinkle 2s 8s infinite ease-in-out; }
.star1 { width: 20px; height: 20px; top: 120px; left: 8%; }
.star2 { width: 16px; height: 16px; top: 90px; right: 30%; }
.star3 { width: 14px; height: 14px; top: 55%; left: 48%; }
.star4 { width: 18px; height: 18px; bottom: 60px; left: 5%; }
.star5 { width: 16px; height: 16px; bottom: 100px; right: 8%; }
@keyframes pop { 0% { transform: scale(0); } 30% { transform: scale(1.3); } 60% { transform: scale(.8); } 100% { transform: scale(1); } }
@keyframes twinkle { 50% { transform: scale(1.2); } }

/* Card overlay */
.boxMail {
  position: fixed; inset: 0; background: rgba(0,0,0,.75); display: flex; justify-content: center; align-items: center;
  opacity: 0; visibility: hidden; transform: scale(.4); transition: all .5s; z-index: 100;
}
.boxMail.active { opacity: 1; visibility: visible; transform: scale(1); }
.boxMail .fa-xmark { position: fixed; top: 10px; right: 20px; font-size: 32px; color: #fff; cursor: pointer; }
.card {
  width: min(620px, 92vw); max-height: 88vh; overflow-y: auto; background: var(--paper);
  border: 8px solid #fff; border-radius: 24px; padding: 28px 26px; box-shadow: 0 10px 30px rgba(0,0,0,.4);
  font-family: 'Dancing Script', cursive; color: #444; text-align: center;
}
.card h2 { font-size: 2.2rem; color: var(--accent); margin-bottom: 14px; }
.card p { font-size: 1.45rem; line-height: 1.5; white-space: pre-wrap; text-align: left; min-height: 8em; }
.card .sign { margin-top: 16px; font-size: 1.6rem; color: var(--accent); text-align: right; }

#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 200; }

/* Button inside the card */
.memBtn {
  display: block; margin: 20px auto 4px; padding: 8px 24px; background: var(--accent);
  border: 3px solid var(--black); border-radius: 50px; cursor: pointer;
  font-family: 'Sriracha', cursive; font-size: 1.05rem; color: #fff;
  animation: btnPop .8s ease-out both, btnPulse 1.6s 1s infinite ease-in-out;
}
.memBtn[hidden] { display: none; }
.memBtn:hover { background: #ff5a68; }
@keyframes btnPop { 0% { transform: scale(0); } 60% { transform: scale(1.2); } 100% { transform: scale(1); } }
@keyframes btnPulse { 50% { transform: scale(1.07); } }

/* Rolling intro (film reel) */
.intro {
  position: fixed; inset: 0; z-index: 170; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 40%, #5a2a45, #1d0f1f 70%);
  opacity: 0; visibility: hidden; transition: opacity .6s ease;
}
.intro.active { opacity: 1; visibility: visible; }
.intro__text {
  font-family: 'Titan One', sans-serif; font-size: clamp(2.2rem, 9vw, 4.5rem); color: #fff; text-align: center;
  text-shadow: 3px 3px var(--accent); min-height: 1.4em; padding: 0 12px;
}
.intro__text.pop { animation: introPop .8s ease-out; }
@keyframes introPop { 0% { transform: scale(.2) rotate(-15deg); opacity: 0; } 60% { transform: scale(1.25) rotate(4deg); opacity: 1; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
.intro__sub { font-family: 'Dancing Script', cursive; font-size: 1.6rem; color: #ffd6da; margin-top: 8px; text-align: center; padding: 0 12px; }

.reel { width: 100%; overflow: hidden; margin: 30px 0 18px; background: #111; padding: 22px 0; border-top: 12px dotted #f3f3f3; border-bottom: 12px dotted #f3f3f3; transform: rotate(-3deg) scale(1.05); box-shadow: 0 0 30px rgba(255,120,130,.5); }
.reel__track { display: flex; width: max-content; animation: reelRoll 16s linear infinite; }
.reel__frame { flex: none; width: 150px; height: 200px; margin-right: 16px; border: 4px solid #333; border-radius: 4px; overflow: hidden; background: #000; }
.reel__frame img { width: 100%; height: 100%; object-fit: cover; display: block; filter: sepia(.25) saturate(1.15); }
@keyframes reelRoll { to { transform: translateX(-50%); } }

.skipBtn { position: absolute; bottom: 22px; right: 20px; background: transparent; border: 2px solid #fff; color: #fff; border-radius: 50px; padding: 6px 18px; font-family: 'Sriracha', cursive; font-size: 1rem; cursor: pointer; }
.skipBtn:hover { background: var(--accent); border-color: var(--accent); }

/* Music button */
.musicBtn {
  position: fixed; bottom: 16px; left: 16px; z-index: 300; width: 48px; height: 48px; border-radius: 50%;
  border: 3px solid var(--black); background: var(--accent); font-size: 1.3rem; cursor: pointer; box-shadow: 0 3px 8px rgba(0,0,0,.3);
}
.musicBtn[hidden] { display: none; }
.musicBtn.on { animation: btnPulse 1.4s infinite ease-in-out; }

/* Memories gallery */
.gallery {
  position: fixed; inset: 0; z-index: 150; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background-color: var(--pink);
  background-image:
    linear-gradient(0deg, transparent 24%, #fff 25%, #fff 26%, transparent 27%, transparent 74%, #fff 75%, #fff 76%, transparent 77%),
    linear-gradient(90deg, transparent 24%, #fff 25%, #fff 26%, transparent 27%, transparent 74%, #fff 75%, #fff 76%, transparent 77%);
  background-size: 80px 80px;
  opacity: 0; visibility: hidden; transform: translateY(40px); transition: all .6s ease;
}
.gallery.active { opacity: 1; visibility: visible; transform: translateY(0); }
.gallery .fa-xmark { position: fixed; top: 12px; right: 20px; font-size: 32px; color: var(--black); cursor: pointer; z-index: 5; background: #fff; border-radius: 50%; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.gallery__inner { max-width: 1000px; margin: 0 auto; padding: 50px 16px 80px; text-align: center; }
.gallery__title { font-family: 'Titan One', sans-serif; font-size: 2.6rem; color: var(--accent); text-shadow: 3px 3px var(--black); }
.gallery__sub { font-family: 'Dancing Script', cursive; font-size: 1.5rem; color: #555; margin: 10px 0 36px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 36px 28px; align-items: start; }
.polaroid {
  background: #fff; padding: 12px 12px 14px; border-radius: 6px; box-shadow: 0 8px 20px rgba(0,0,0,.25);
  transform: rotate(var(--r)) translateY(80px) scale(.7); opacity: 0;
  transition: transform .9s cubic-bezier(.2,1.3,.4,1), opacity .9s ease;
}
.polaroid.show { transform: rotate(var(--r)) translateY(0) scale(1); opacity: 1; }
.polaroid:hover { transform: rotate(0deg) scale(1.05); z-index: 2; }
.polaroid .pic { aspect-ratio: 4 / 5; background: #eee; overflow: hidden; border-radius: 3px; }
.polaroid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.polaroid .note { margin-top: 12px; font-family: 'Dancing Script', cursive; font-size: 1.35rem; color: #444; line-height: 1.2; }
.polaroid .tape { display: block; width: 70px; height: 22px; margin: -22px auto 8px; background: rgba(255,120,130,.65); transform: rotate(-3deg); border-radius: 2px; }

.gallery__end { margin-top: 60px; font-family: 'Dancing Script', cursive; font-size: 2rem; color: var(--accent); line-height: 1.3; opacity: 0; transform: scale(.8); transition: all 1s; }
.gallery__end.show { opacity: 1; transform: scale(1); }

.floaty { position: fixed; bottom: -40px; font-size: 1.6rem; pointer-events: none; z-index: 160; animation: floatUp var(--d) linear forwards; }
@keyframes floatUp { to { transform: translateY(-110vh) rotate(25deg); opacity: 0; } }

@media (max-width: 760px) {
  .gallery__title { font-size: 1.8rem; }
  .gallery__sub { font-size: 1.2rem; }
  .grid { grid-template-columns: 1fr 1fr; gap: 28px 14px; }
  .polaroid { padding: 8px 8px 10px; }
  .polaroid .note { font-size: 1.05rem; }
  .gallery__end { font-size: 1.5rem; }
}
@media (max-width: 400px) { .grid { grid-template-columns: 1fr; } }

/* Mobile */
@media (max-width: 760px) {
  .content { flex-direction: column; gap: 30px; padding-top: 2rem; }
  .left, .right { width: 100%; }
  .title { font-size: 2rem; }
  .countdown { gap: 6px; }
  .countdown .unit { min-width: 54px; padding: 4px 8px; }
  .photos { width: 260px; height: 260px; }
  .image { width: 210px; height: 210px; }
  .image.small { width: 105px; height: 105px; }
  .image .emoji { font-size: 4rem; }
  .name { font-size: 1.2rem; }
  .balloon { font-size: 2.6rem; }
  .balloon_one { left: -20px; }
  .balloon_two { right: -10px; }
  .card p { font-size: 1.15rem; }
}
