
*, *::before, *::after{ box-sizing: border-box; }
html, body{ margin: 0; padding: 0; }

:root{
  --bg:        #E9F6FF;
  --bg-deep:   #d3e9f8;
  --purple:    #280274;
  --purple-deep: #1b0152;
  --orange:    #FE7A36;
  --blue:      #3652AD;
  --white:     #ffffff;
  --ink:       #280274;

  --font-display: 'Bungee', system-ui, sans-serif;
  --font-round:   'Baloo 2', system-ui, sans-serif;
  --font-body:    'Poppins', system-ui, sans-serif;

  --gutter: clamp(1rem, 4vw, 3rem);
}

body{
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img{ max-width: 100%; display: block; }
button{ font-family: inherit; cursor: pointer; }
h1,h2,h3,p{ margin: 0; }

@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


.halftone-bg{
  background-color: var(--bg);
  background-image:
    radial-gradient(rgba(40,2,116,0.09) 2.5px, transparent 2.6px),
    radial-gradient(rgba(54,82,173,0.07) 2px, transparent 2.1px);
  background-size: 26px 26px, 40px 40px;
  background-position: 0 0, 13px 20px;
}

.page{
  position: relative;
  width: 100%;
  min-height: 100svh;
  padding: clamp(4rem, 9vh, 5.5rem) var(--gutter) clamp(3rem, 8vh, 5rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  overflow: hidden;
}
.page-alt{ background: var(--white); }

.page-inner{
  max-width: 640px;
  width: 100%;
  position: relative;
  z-index: 2;
}


.burst-bg{
  position: absolute;
  inset: -10% -10%;
  z-index: 0;
  background: repeating-conic-gradient(
    from 0deg,
    rgba(254,122,54,0.10) 0deg 8deg,
    transparent 8deg 16deg
  );
  pointer-events: none;
}
.burst-bg-alt{
  background: repeating-conic-gradient(
    from 0deg,
    rgba(54,82,173,0.10) 0deg 8deg,
    transparent 8deg 16deg
  );
}


#cover{
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.4rem;
  background: var(--purple-deep);
  background-image:
    radial-gradient(circle at 30% 20%, rgba(254,122,54,0.25), transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(54,82,173,0.35), transparent 50%);
  transition: opacity 0.9s ease, visibility 0.9s ease;
}
#cover.hidden{ opacity: 0; visibility: hidden; pointer-events: none; }

.ticket{
  width: min(360px, 100%);
  background: var(--white);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
  animation: ticket-float 4s ease-in-out infinite;
}
@keyframes ticket-float{
  0%,100%{ transform: translateY(0) rotate(-0.4deg); }
  50%{ transform: translateY(-8px) rotate(0.4deg); }
}
.ticket-main{
  padding: clamp(1.8rem, 6vw, 2.4rem) clamp(1.6rem, 6vw, 2.2rem) 1.6rem;
  text-align: center;
}
.ticket-label{
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  color: var(--orange);
}
.ticket-eyebrow{
  font-family: var(--font-round);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--blue);
  margin-top: 0.8rem;
}
.ticket-name{
  font-family: var(--font-display);
  font-size: clamp(2rem, 10vw, 2.7rem);
  color: var(--purple);
  margin: 0.3rem 0;
  line-height: 1.1;
}
.ticket-date{
  font-family: var(--font-round);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
  opacity: 0.75;
}
.ticket-perf{
  height: 0;
  border-top: 3px dashed var(--bg-deep);
  margin: 1.4rem -2.4rem 1.2rem;
  position: relative;
}
.ticket-perf::before,
.ticket-perf::after{
  content: "";
  position: absolute;
  top: -13px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--purple-deep);
}
.ticket-perf::before{ left: -13px; }
.ticket-perf::after{ right: -13px; }
.ticket-seat{
  font-family: var(--font-round);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--blue);
}
.open-btn{
  margin-top: 1.4rem;
  border: none;
  background: var(--orange);
  color: var(--white);
  font-family: var(--font-round);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.85em 1.8em;
  border-radius: 999px;
  box-shadow: 0 8px 0 #c95d1f;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.open-btn:active{ transform: translateY(6px); box-shadow: 0 2px 0 #c95d1f; }
.open-btn:focus-visible{ outline: 2px solid var(--purple); outline-offset: 3px; }

.ticket-stub{
  background: var(--purple);
  padding: 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ticket-stub-text{
  font-family: var(--font-display);
  color: var(--white);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  opacity: 0.85;
}

.badge-pill{
  display: inline-block;
  font-family: var(--font-round);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--white);
  background: var(--blue);
  padding: 0.5em 1.1em;
  border-radius: 999px;
  margin-bottom: 1rem;
  animation: pulse-badge 2.2s ease-in-out infinite;
}
@keyframes pulse-badge{
  0%,100%{ transform: scale(1); box-shadow: 0 0 0 0 rgba(54,82,173,0.4); }
  50%{ transform: scale(1.05); box-shadow: 0 0 0 8px rgba(54,82,173,0); }
}
.poster-title{
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 12vw, 4.6rem);
  line-height: 1.05;
  color: var(--purple);
  text-shadow: 4px 4px 0 var(--orange);
  letter-spacing: 0.01em;
}
.stamp-wrap{ display: flex; justify-content: center; margin: 1.4rem 0; }
.stamp{
  width: 96px; height: 96px;
  border-radius: 50%;
  border: 3px dashed var(--orange);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-round);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--purple);
  text-align: center;
  line-height: 1.2;
  animation: wobble 5s ease-in-out infinite;
}
@keyframes wobble{
  0%,100%{ transform: rotate(-8deg); }
  50%{ transform: rotate(4deg); }
}
.hero-photo-wrap{
  position: relative;
  display: flex;
  justify-content: center;
  margin: 1.6rem auto;
  width: min(260px, 68vw);
}
.ticket-photo{
  width: 100%;
  border-radius: 18px;
  overflow: hidden;
  border: 6px solid var(--white);
  box-shadow: 0 16px 32px rgba(40,2,116,0.28);
  transform: rotate(-2deg);
}
.ticket-photo img,
.ticket-photo .placeholder{
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
  display: block;
}
.confetti-icon{
  position: absolute;
  z-index: 3;
  filter: drop-shadow(0 3px 4px rgba(0,0,0,0.15));
  animation: drift-spin 4.5s ease-in-out infinite;
}
.confetti-icon:nth-of-type(2){ animation-duration: 5.5s; animation-delay: 0.4s; }
.confetti-icon:nth-of-type(3){ animation-duration: 3.8s; animation-delay: 0.8s; }
@keyframes drift-spin{
  0%,100%{ transform: translateY(0) rotate(0deg); }
  50%{ transform: translateY(-8px) rotate(18deg); }
}
.hero-subtitle{
  font-family: var(--font-round);
  font-weight: 600;
  font-size: clamp(1.05rem, 3.2vw, 1.3rem);
  color: var(--ink);
  max-width: 420px;
  margin: 0.6rem auto 0;
  white-space: pre-line;
}
.scroll-cue{
  margin-top: 2rem;
  font-family: var(--font-round);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--blue);
  opacity: 0.7;
  animation: bob 2.2s ease-in-out infinite;
}
@keyframes bob{ 0%,100%{ transform: translateY(0); } 50%{ transform: translateY(6px); } }

.section-head{ margin-bottom: clamp(1.8rem, 6vh, 2.6rem); }
.eyebrow-tag{
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: var(--orange);
}
.section-title{
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 6vw, 2.3rem);
  color: var(--purple);
  margin-top: 0.4rem;
}
.section-sub{
  font-family: var(--font-round);
  font-weight: 500;
  font-size: 1rem;
  color: var(--blue);
  margin-top: 0.5rem;
  white-space: pre-line;
}

.playlist{
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: left;
}
.track-row{
  display: grid;
  grid-template-columns: 44px 68px 1fr;
  align-items: center;
  gap: 1rem;
  background: var(--bg);
  border-radius: 16px;
  padding: 0.8rem;
  border: 2px solid var(--bg-deep);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.track-row:hover{
  transform: translateX(4px);
  border-color: var(--orange);
  box-shadow: 0 8px 16px rgba(40,2,116,0.1);
}
.track-number{
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--orange);
  text-align: center;
}
.track-cover{
  display: block;
  width: 68px; height: 68px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
}
.track-cover img,
.track-cover video,
.track-cover .placeholder{
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  font-size: 0.55rem;
  padding: 0.3rem;
}
.track-caption{
  display: block;
  font-family: var(--font-round);
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink);
  white-space: pre-line;
}
.track-year{
  display: block;
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--blue);
  margin-top: 0.15rem;
}

.bubble{
  position: relative;
  background: var(--white);
  border: 4px solid var(--purple);
  border-radius: 26px;
  padding: clamp(1.8rem, 6vw, 2.6rem);
  box-shadow: 8px 8px 0 var(--blue);
  text-align: left;
}
.bubble-title{
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 5vw, 1.7rem);
  color: var(--orange);
  margin-bottom: 0.9rem;
}
.bubble-body{
  font-family: var(--font-round);
  font-weight: 500;
  font-size: clamp(1rem, 3.2vw, 1.15rem);
  line-height: 1.65;
  color: var(--ink);
  white-space: pre-line;
}
.bubble-sign{
  margin-top: 1.4rem;
  font-family: var(--font-round);
  font-size: 1rem;
  color: var(--blue);
}
.bubble-tail{
  position: absolute;
  bottom: -22px; left: 48px;
  width: 0; height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 22px solid var(--purple);
}
.bubble-tail::before{
  content: "";
  position: absolute;
  top: -25px; left: -10px;
  width: 0; height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 18px solid var(--white);
}


.photobooth-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.4rem, 5vw, 1.8rem);
}
.photo-stub{
  background: var(--white);
  border-radius: 14px;
  padding: 10px 10px 14px;
  box-shadow: 0 10px 20px rgba(40,2,116,0.15);
  min-width: 0;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.photo-stub:hover{
  transform: rotate(0deg) translateY(-4px) !important;
  box-shadow: 0 16px 28px rgba(40,2,116,0.22);
}
.photo-stub .frame{
  display: block;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}
.photo-stub img,
.photo-stub video,
.photo-stub .placeholder{
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
  display: block;
}
.photo-stub figcaption{
  margin-top: 8px;
  font-family: var(--font-round);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--blue);
  text-align: center;
  white-space: pre-line;
}
.photo-stub:nth-child(odd){ transform: rotate(-2deg); }
.photo-stub:nth-child(even){ transform: rotate(1.5deg); }

#page-wish{ background: var(--purple); color: var(--white); }
.wish-instruction{
  font-family: var(--font-round);
  font-weight: 500;
  font-size: 0.95rem;
  color: rgba(255,255,255,0.75);
  margin-top: 0.5rem;
}
.balloon-field{
  position: relative;
  height: clamp(220px, 46vh, 300px);
  margin: 2rem auto 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(1.2rem, 8vw, 3rem);
}
.balloon{
  border: none;
  width: clamp(70px, 20vw, 96px);
  aspect-ratio: 0.85;
  border-radius: 50% 50% 50% 50% / 58% 58% 42% 42%;
  position: relative;
  box-shadow: inset -10px -10px 18px rgba(0,0,0,0.15), 0 10px 18px rgba(0,0,0,0.25);
  transition: transform 0.15s ease, opacity 0.35s ease;
  animation: floaty 3.4s ease-in-out infinite;
}
.balloon::after{
  content: "";
  position: absolute;
  bottom: -34px; left: 50%;
  width: 2px; height: 34px;
  background: rgba(255,255,255,0.5);
  transform: translateX(-50%);
}
.balloon-a{ background: var(--orange); animation-delay: 0s; }
.balloon-b{ background: var(--blue); align-self: center; animation-delay: 0.6s; }
.balloon-c{ background: var(--white); animation-delay: 1.1s; }
@keyframes floaty{ 0%,100%{ transform: translateY(0); } 50%{ transform: translateY(-10px); } }
.balloon:active{ transform: scale(0.94); }
.balloon.popped{
  opacity: 0;
  transform: scale(1.6);
  pointer-events: none;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.wish-message{
  margin-top: 2.2rem;
  font-family: var(--font-round);
  font-weight: 600;
  font-size: clamp(1.2rem, 4vw, 1.5rem);
  max-width: 440px;
  margin-inline: auto;
  opacity: 0;
  transition: opacity 0.8s ease;
  white-space: pre-line;
}
.wish-message.show{ opacity: 1; }

/* confetti burst pieces (shared) */
.confetti-piece{
  position: fixed;
  top: -10px;
  width: 9px; height: 9px;
  z-index: 200;
  pointer-events: none;
  animation: fall linear forwards;
}
@keyframes fall{ to{ transform: translateY(110vh) rotate(360deg); opacity: 0.8; } }

.closing-title{
  font-family: var(--font-round);
  font-weight: 600;
  font-size: clamp(1.2rem, 4vw, 1.5rem);
  color: var(--blue);
  margin-top: 0.6rem;
}
.poster-title--small{ font-size: clamp(1.8rem, 9vw, 3rem); margin: 0.3rem 0; }
.closing-message{
  font-family: var(--font-round);
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--ink);
  max-width: 420px;
  margin: 0.8rem auto 0;
  white-space: pre-line;
}
.closing-note{
  margin-top: 0.8rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--blue);
  opacity: 0.8;
  white-space: pre-line;
}
.restart-btn{
  margin-top: 1.8rem;
  border: 3px solid var(--purple);
  background: var(--white);
  color: var(--purple);
  font-family: var(--font-round);
  font-weight: 700;
  padding: 0.7em 1.6em;
  border-radius: 999px;
  transition: background 0.25s ease, color 0.25s ease;
}
.restart-btn:hover{ background: var(--purple); color: var(--white); }

#music-control{
  position: fixed;
  right: clamp(0.9rem, 3vw, 1.6rem);
  bottom: clamp(0.9rem, 3vw, 1.6rem);
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--purple);
  border-radius: 999px;
  padding: 0.5rem 0.9rem 0.5rem 0.5rem;
  box-shadow: 0 8px 18px rgba(0,0,0,0.25);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
#music-control.active{ opacity: 1; visibility: visible; }
#music-toggle{
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--orange);
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
}
.music-status{
  font-family: var(--font-round);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--white);
}
.music-bars{ display: inline-flex; gap: 2px; align-items: flex-end; height: 10px; }
.music-bars span{ width: 2px; background: var(--white); animation: eq 0.9s ease-in-out infinite; }
.music-bars span:nth-child(1){ height: 40%; }
.music-bars span:nth-child(2){ height: 100%; animation-delay: 0.15s; }
.music-bars span:nth-child(3){ height: 65%; animation-delay: 0.3s; }
#music-control.paused .music-bars span{ animation-play-state: paused; height: 30%; }
@keyframes eq{ 0%,100%{ height: 30%; } 50%{ height: 100%; } }


.reveal{ opacity: 0; transform: translateY(26px) scale(0.97); transition: opacity 0.7s ease, transform 0.65s cubic-bezier(0.22, 1.4, 0.36, 1); }
.reveal.visible{ opacity: 1; transform: translateY(0) scale(1); }


.placeholder{
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  font-family: var(--font-body);
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--blue);
  background: repeating-linear-gradient(45deg, #eaf5ff, #eaf5ff 10px, #d3e8f7 10px, #d3e8f7 20px);
  padding: 0.6rem;
}

.ticket-eyebrow,
.ticket-seat,
.wish-instruction,
.bubble-title,
.bubble-sign,
.closing-title,
.track-year{
  white-space: pre-line;
}

.playlist .track-row:nth-child(1){ transition-delay: 0s; }
.playlist .track-row:nth-child(2){ transition-delay: 0.08s; }
.playlist .track-row:nth-child(3){ transition-delay: 0.16s; }
.playlist .track-row:nth-child(4){ transition-delay: 0.24s; }
.playlist .track-row:nth-child(n+5){ transition-delay: 0.3s; }

.photobooth-grid .photo-stub:nth-child(odd){ transition-delay: 0s; }
.photobooth-grid .photo-stub:nth-child(even){ transition-delay: 0.1s; }

@media (max-width: 480px){
  .photobooth-grid{ gap: 1.2rem; }
  .photo-stub:nth-child(n){ transform: none; }
  .balloon-field{ gap: 1rem; }
  .track-row{ grid-template-columns: 34px 56px 1fr; padding: 0.65rem; gap: 0.7rem; }
  .track-cover{ width: 56px; height: 56px; }
}

@media (min-width: 700px){
  .playlist{ max-width: 560px; margin: 0 auto; }
}
