:root {
  --bg: #1a0a14;
  --fg: #fff4f7;
  --pink: #ff6fa0;
  --gold: #ffd98a;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: env(safe-area-inset-top, 0px);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: Georgia, "Times New Roman", serif;
  overflow-x: hidden;
}
#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
section {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 12vh 6vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}
section::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--g);
  background-size: 300% 300%;
  opacity: 0.72;
  animation: gr 18s ease-in-out infinite;
}
@keyframes gr {
  50% {
    background-position: 100% 100%;
  }
}
h1 {
  font-size: clamp(2.2rem, 8vw, 5.5rem);
  margin: 0 0 1rem;
  line-height: 1.05;
  text-shadow: 0 0 30px #ff6fa0aa;
  perspective: 600px;
}
h2 {
  font-size: clamp(1.6rem, 5vw, 3rem);
  margin: 0 0 1.2rem;
  color: var(--gold);
}
p {
  font-size: clamp(1rem, 2.4vw, 1.35rem);
  max-width: 640px;
  line-height: 1.7;
  margin: 0.6rem auto;
}
.ch,
.wd {
  display: inline-block;
  white-space: pre;
}
.mask {
  overflow: hidden;
  display: block;
}
#s0 {
  --g: linear-gradient(135deg, #3b0a2a, #7a1f4d, #2a0a3a);
}
#s1 {
  --g: linear-gradient(135deg, #2a0a3a, #4a1250, #1a0a30);
}
#s2 {
  --g: linear-gradient(135deg, #1a0a14, #3a1030, #2a0a20);
}
#s3 {
  --g: linear-gradient(135deg, #2a0a20, #5a1a40, #2a1030);
}
#s4 {
  --g: linear-gradient(135deg, #301030, #6a2050, #3a1020);
}
#s5 {
  --g: linear-gradient(135deg, #4a1030, #8a2a50, #3a0a30);
}
#s6 {
  --g: linear-gradient(135deg, #1a1030, #3a1a50, #1a0a20);
}
#s7 {
  --g: linear-gradient(135deg, #2a0a20, #601a3a, #2a0a30);
}
#s8 {
  --g: linear-gradient(135deg, #4a0a30, #9a2a5a, #2a0a40);
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 14px;
  width: 100%;
  max-width: 1100px;
  perspective: 900px;
}
figure {
  margin: 0;
  transform-style: preserve-3d;
  transition:
    transform 0.3s,
    box-shadow 0.3s;
  border: 2px solid #ff6fa066;
  border-radius: 10px;
  overflow: hidden;
  background: #0006;
  cursor: pointer;
}
figure:hover {
  box-shadow: 0 0 22px #ff6fa0aa;
}
figure img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 3/4;
  object-fit: contain;
  background: #000;
}
figcaption {
  font-size: 0.8rem;
  padding: 6px;
}
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  perspective: 1000px;
  max-width: 100%;
}
.row figure {
  width: min(300px, 42vw);
}
.glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 200px;
  height: 200px;
  margin: -100px;
  border-radius: 50%;
  background: radial-gradient(#ffd98a, #ff6fa000 70%);
  opacity: 0;
  pointer-events: none;
}
.cake {
  position: relative;
  width: 200px;
  height: 170px;
  margin: 30px auto;
}
.tier {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 10px;
  box-shadow: inset 0 -8px 0 #0003;
}
.t1 {
  bottom: 0;
  width: 200px;
  height: 70px;
  background: #f7a8c4;
}
.t2 {
  bottom: 70px;
  width: 140px;
  height: 55px;
  background: #fff0f4;
}
.can {
  position: absolute;
  bottom: 125px;
  width: 8px;
  height: 28px;
  background: #ffd98a;
  border-radius: 2px;
}
.fl {
  position: absolute;
  bottom: 152px;
  width: 12px;
  height: 20px;
  border-radius: 50% 50% 50% 50%/60% 60% 40% 40%;
  background: radial-gradient(#fff, #ffb030 60%, #ff600000);
  transform-origin: 50% 100%;
  animation: fk 0.25s infinite alternate;
}
@keyframes fk {
  to {
    transform: scale(0.85, 1.15) rotate(5deg);
  }
}
.bl {
  position: absolute;
  bottom: -80px;
  width: 46px;
  height: 58px;
  border-radius: 50%;
  animation: up linear infinite;
  opacity: 0.85;
}
@keyframes up {
  to {
    transform: translateY(-120vh) rotate(15deg);
  }
}
.cf {
  position: absolute;
  top: -20px;
  width: 8px;
  height: 14px;
  animation: fall linear infinite;
}
@keyframes fall {
  to {
    transform: translateY(110vh) rotate(720deg);
  }
}
.gifts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 16px;
  width: 100%;
  max-width: 900px;
  perspective: 900px;
}
.gift {
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 8px;
}
.box {
  width: 70px;
  height: 60px;
  margin: 0 auto 8px;
  position: relative;
  background: var(--c);
  border-radius: 6px;
  box-shadow:
    0 8px 14px #0006,
    inset 0 0 20px #fff3;
  animation: fy var(--d) ease-in-out infinite alternate;
}
.box::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 10px;
  margin-left: -5px;
  background: var(--gold);
}
.box::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -14px;
  width: 28px;
  height: 18px;
  margin-left: -14px;
  border: 5px solid var(--gold);
  border-radius: 50% 50% 0 0;
}
@keyframes fy {
  to {
    transform: translateY(-8px) rotateY(18deg);
  }
}
.gm {
  font-size: 0.85rem;
  min-height: 2.6em;
  opacity: 0;
}
.env {
  position: relative;
  width: min(320px, 80vw);
  height: 210px;
  background: #e8a0b8;
  border-radius: 6px;
  cursor: pointer;
  margin: 30px auto 0;
  animation: fy 3s ease-in-out infinite alternate;
  perspective: 800px;
}
.flap {
  position: absolute;
  inset: 0 0 auto 0;
  height: 110px;
  background: #d77f9f;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top;
  transition: transform 0.8s;
  z-index: 3;
}
.seal {
  position: absolute;
  left: 50%;
  top: 92px;
  width: 34px;
  height: 34px;
  margin-left: -17px;
  border-radius: 50%;
  background: #b01040;
  z-index: 4;
  box-shadow: 0 0 16px #ff3070;
  animation: pl 1.6s infinite alternate;
}
@keyframes pl {
  to {
    box-shadow: 0 0 30px #ff90b0;
  }
}
.env.open .flap {
  transform: rotateX(180deg);
  z-index: 0;
}
.env.open .seal {
  opacity: 0;
}
.paper {
  position: relative;
  width: min(560px, 90vw);
  margin: 0 auto;
  background: #fff8ee;
  color: #3a1a24;
  border-radius: 6px;
  padding: 0 24px;
  max-height: 0;
  overflow: hidden;
  text-align: left;
  transition:
    max-height 1.4s,
    padding 1.4s;
  box-shadow: 0 10px 40px #0008;
}
.paper.open {
  max-height: 900px;
  padding: 24px;
}
.paper p {
  font-size: 1.05rem;
  color: #3a1a24;
  margin: 0.5rem 0;
}
#lb {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #000d;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
}
#lb img {
  max-width: 90vw;
  max-height: 78vh;
  object-fit: contain;
}
#lb button {
  padding: 8px 16px;
  margin: 0 6px;
}
#aud {
  position: fixed;
  right: 12px;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  z-index: 20;
  padding: 8px 12px;
  border-radius: 20px;
  border: 0;
  background: #ff6fa0;
  color: #fff;
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
  }
}


/* Previous Button */
#pv {
    cursor: pointer;
    background-color: #26358F;
    color: #ffffff;
    border: none;
    transition: all 0.3s ease;
}

#pv:hover {
    background-color: #1B2568;
    color: #ffffff;
}

/* Next Button */
#nx {
    cursor: pointer;
    background-color: #26358F;
    color: #ffffff;
    border: none;
    transition: all 0.3s ease;
}

#nx:hover {
    background-color: #1B2568;
    color: #ffffff;
}

/* Close Button */
#cl {
    cursor: pointer;
    background-color: #dc3545;
    color: #ffffff;
    border: none;
    transition: all 0.3s ease;
}

#cl:hover {
    background-color: #a71d2a;
    color: #ffffff;
}




/* =====================================
   BIRTHDAY 3D PAGE LOADER
===================================== */

.birthday-loader {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    background:
        radial-gradient(circle at 50% 45%, #fff0f5 0%, #ffe4ee 45%, #fff7fa 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999999;
    overflow: hidden;
    perspective: 1200px;
    opacity: 1;
    visibility: visible;
    transition:
        opacity 0.9s ease,
        visibility 0.9s ease;
}

.birthday-loader.hide {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.birthday-loader-content {
    position: relative;
    z-index: 5;
    width: min(90%, 380px);
    text-align: center;
    animation: birthdayLoaderAppear 1.2s ease both;
}

/* 3D CENTER */

.birthday-loader-3d {
    position: relative;
    width: 190px;
    height: 190px;
    margin: 0 auto 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-style: preserve-3d;
    animation: birthdayLoaderFloat 3s ease-in-out infinite;
}

.birthday-loader-center {
    width: 115px;
    height: 115px;
    border-radius: 50%;
    background: linear-gradient(145deg, #ffffff, #ffd2e2);
    box-shadow:
        0 15px 35px rgba(214, 63, 120, 0.22),
        inset 0 5px 12px rgba(255,255,255,0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    transform: translateZ(40px);
}

.birthday-loader-cake {
    font-size: 65px;
    animation: birthdayCakeBounce 2s ease-in-out infinite;
    filter: drop-shadow(0 8px 8px rgba(180, 60, 100, 0.2));
}

.birthday-loader-heart-icon {
    position: absolute;
    font-size: 25px;
    color: #f04483;
    right: 0;
    top: 0;
    animation: birthdayHeartBeat 1s infinite;
}

/* ROTATING 3D RINGS */

.birthday-loader-ring {
    position: absolute;
    border: 2px solid rgba(238, 76, 135, 0.45);
    border-radius: 50%;
    transform-style: preserve-3d;
}

.ring-one {
    width: 150px;
    height: 150px;
    animation: birthdayRingOne 5s linear infinite;
}

.ring-two {
    width: 180px;
    height: 180px;
    border-color: rgba(255, 149, 185, 0.65);
    animation: birthdayRingTwo 6s linear infinite;
}

.ring-three {
    width: 165px;
    height: 165px;
    border-style: dashed;
    border-color: rgba(218, 78, 132, 0.5);
    animation: birthdayRingThree 9s linear infinite;
}

/* BACKGROUND HEARTS */

.birthday-loader-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.birthday-loader-heart,
.birthday-loader-star {
    position: absolute;
    color: #f276a4;
    animation: birthdayParticleFloat 5s ease-in-out infinite;
}

.birthday-loader-heart {
    font-size: 30px;
    opacity: 0.55;
}

.heart-one {
    left: 15%;
    top: 20%;
}

.heart-two {
    right: 15%;
    top: 25%;
    font-size: 45px;
    animation-delay: 1s;
}

.heart-three {
    left: 20%;
    bottom: 20%;
    animation-delay: 2s;
}

.heart-four {
    right: 20%;
    bottom: 18%;
    font-size: 25px;
    animation-delay: 1.5s;
}

.birthday-loader-star {
    font-size: 35px;
    color: #e9a52c;
}

.star-one {
    top: 15%;
    left: 45%;
}

.star-two {
    right: 30%;
    bottom: 25%;
    animation-delay: 1.5s;
}

.star-three {
    left: 30%;
    bottom: 35%;
    animation-delay: 2s;
}

/* TEXT */

.birthday-loader-content h2 {
    font-size: clamp(25px, 5vw, 34px);
    color: #c52c69;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin: 0 0 10px;
}

.birthday-loader-subtitle {
    font-size: 14px;
    color: #956477;
    margin-bottom: 25px;
    letter-spacing: 0.5px;
}

/* PROGRESS */

.birthday-loader-progress {
    width: 100%;
    height: 7px;
    background: #f5cadb;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.08);
}

.birthday-loader-progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #ed4d91, #ff9fbd, #d52e75);
    border-radius: 20px;
    transition: width 0.2s ease;
    box-shadow: 0 0 12px rgba(237, 77, 145, 0.5);
}

.birthday-loader-bottom {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    font-size: 12px;
    color: #bb6385;
    font-weight: 600;
    letter-spacing: 1px;
}

/* ANIMATIONS */

@keyframes birthdayLoaderAppear {
    from {
        opacity: 0;
        transform: translateY(35px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes birthdayLoaderFloat {
    0%, 100% {
        transform: translateY(0) rotateY(0deg);
    }
    50% {
        transform: translateY(-12px) rotateY(8deg);
    }
}

@keyframes birthdayCakeBounce {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-8px) scale(1.08);
    }
}

@keyframes birthdayHeartBeat {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.4);
    }
}

@keyframes birthdayRingOne {
    from {
        transform: rotateX(65deg) rotateZ(0deg);
    }
    to {
        transform: rotateX(65deg) rotateZ(360deg);
    }
}

@keyframes birthdayRingTwo {
    from {
        transform: rotateY(70deg) rotateZ(0deg);
    }
    to {
        transform: rotateY(70deg) rotateZ(360deg);
    }
}

@keyframes birthdayRingThree {
    from {
        transform: rotateX(55deg) rotateY(30deg) rotateZ(0deg);
    }
    to {
        transform: rotateX(55deg) rotateY(30deg) rotateZ(360deg);
    }
}

@keyframes birthdayParticleFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg) scale(1);
    }
    50% {
        transform: translateY(-25px) rotate(20deg) scale(1.2);
    }
}

/* MOBILE RESPONSIVE */

@media (max-width: 600px) {

    .birthday-loader-content {
        width: 85%;
    }

    .birthday-loader-3d {
        width: 155px;
        height: 155px;
        margin-bottom: 25px;
    }

    .birthday-loader-center {
        width: 95px;
        height: 95px;
    }

    .birthday-loader-cake {
        font-size: 52px;
    }

    .ring-one {
        width: 125px;
        height: 125px;
    }

    .ring-two {
        width: 150px;
        height: 150px;
    }

    .ring-three {
        width: 140px;
        height: 140px;
    }

    .birthday-loader-heart {
        font-size: 23px;
    }

    .birthday-loader-star {
        font-size: 25px;
    }

    .birthday-loader-subtitle {
        font-size: 12px;
    }
}

/* SMALL MOBILE */

@media (max-width: 360px) {
    .birthday-loader-3d {
        transform: scale(0.85);
        margin-bottom: 15px;
    }

    .birthday-loader-content h2 {
        font-size: 25px;
    }
}

/* REDUCED MOTION */

@media (prefers-reduced-motion: reduce) {
    .birthday-loader *,
    .birthday-loader *::before,
    .birthday-loader *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}




/* BIRTHDAY LOADER FIX */

.birthday-loader {
    position: fixed !important;
    inset: 0 !important;
    z-index: 99999999 !important;
    width: 100% !important;
    height: 100vh !important;
    height: 100dvh !important;
    overflow: hidden !important;
    transition: opacity 0.7s ease, visibility 0.7s ease !important;
}

.birthday-loader.hide {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Prevent scrolling while loader is visible */
body:not(.birthday-page-loaded) {
    overflow: hidden !important;
}

/* Restore scrolling after loader */
body.birthday-page-loaded {
    overflow: auto !important;
}

/* Mobile fix */
@media (max-width: 600px) {
    .birthday-loader {
        min-height: 100dvh;
    }
}






.music-control {
  position: fixed;
  top: 20px;
  right: 20px;
  bottom: auto;
  left: auto;
  z-index: 99999;
  perspective: 1000px;
}

/* Main Music Button */
.music-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 19px;
  border: none;
  outline: none;
  border-radius: 50px;
  color: #fff;
  background: linear-gradient(145deg, #ff5fa2, #c21870);
  /* box-shadow:
    0 8px 0 #850d4d,
    0 13px 25px rgba(194, 24, 112, 0.35),
    inset 0 2px 5px rgba(255, 255, 255, 0.35); */
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.3s ease;
  transform: translateY(0);
  user-select: none;
}

/* Hover Effect */
.music-btn:hover {
  transform: translateY(-5px) rotateX(8deg);
  /* box-shadow:
    0 12px 0 #850d4d,
    0 18px 30px rgba(194, 24, 112, 0.4); */
}

/* Click Effect */
.music-btn:active {
  transform: translateY(5px);
  box-shadow: 0 3px 0 #850d4d;
}

/* Music Icon */
.music-icon {
  font-size: 19px;
  line-height: 1;
}

/* Playing Button */
.music-btn.playing {
  background: linear-gradient(145deg, #ff5fa2, #c21870);
}

/* Stopped Button */
.music-btn.stopped {
  background: linear-gradient(145deg, #ff5fa2, #c21870);
  /* box-shadow:
    0 8px 0 #ff5fa2,
    0 13px 25px #ff5fa2,
    inset 0 2px 5px rgba(255, 255, 255, 0.35); */
}

/* .music-btn.stopped:hover {
  box-shadow:
    0 12px 0 #ff5fa2,
    0 18px 30px #ff5fa2
} */

/* .music-btn.stopped:active {
  box-shadow: 0 3px 0 #ff5fa2;
} */

/* Music Wave */
.music-wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 19px;
}

.music-wave i {
  display: block;
  width: 3px;
  height: 5px;
  border-radius: 5px;
  background: #fff;
}

/* Wave Animation When Music Plays */
.music-btn.playing .music-wave i {
  animation: musicWave 0.7s ease-in-out infinite alternate;
}

.music-btn.playing .music-wave i:nth-child(1) {
  animation-delay: 0.1s;
}

.music-btn.playing .music-wave i:nth-child(2) {
  animation-delay: 0.2s;
}

.music-btn.playing .music-wave i:nth-child(3) {
  animation-delay: 0.4s;
}

.music-btn.playing .music-wave i:nth-child(4) {
  animation-delay: 0.3s;
}

/* Stop Wave Animation */
.music-btn.stopped .music-wave i {
  animation: none;
  height: 4px;
}

/* Wave Keyframes */
@keyframes musicWave {
  from {
    height: 4px;
  }
  to {
    height: 19px;
  }
}

/* Mobile Responsive */
@media (max-width: 576px) {
  .music-control {
    top: 12px;
    right: 12px;
  }

  .music-btn {
    padding: 10px 14px;
    gap: 7px;
    font-size: 12px;
  }

  .music-icon {
    font-size: 16px;
  }

  .music-wave {
    height: 16px;
  }
}

/* Small Mobile Screens */
@media (max-width: 360px) {
  .music-control {
    top: 10px;
    right: 10px;
  }

  .music-btn {
    padding: 9px 12px;
    font-size: 11px;
  }
}
