* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
:root {
  --pink: #ff6eb4;
  --pink-light: #ffb3d9;
  --pink-pale: #fff0f7;
  --mint: #7ee8c8;
  --mint-light: #c5f5e8;
  --lavender: #c9a7ff;
  --lav-light: #eedeff;
  --yellow: #ffe066;
  --yellow-light: #fff8cc;
  --peach: #ffb085;
  --blue: #a0d4ff;
  --text: #5a2d6e;
}
#bg-music-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 5px;
  margin-right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
  color: var(--pink);
}
#bg-music-btn:hover {
  transform: scale(1.1);
}
#bg-music-btn.muted {
  opacity: 0.5;
  filter: grayscale(1);
}
html,
body {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
}
body {
  font-family: "Baloo 2", cursive;
  background: linear-gradient(135deg, #fff0f7 0%, #f0e8ff 50%, #e8f8ff 100%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
}
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--pink-light);
}
.paw {
  font-size: 16px;
  opacity: 0.25;
  transition: all 0.4s;
  transform: scale(0.8);
}
.paw.active {
  opacity: 1;
  transform: scale(1.25);
}
.paw.done {
  opacity: 0.6;
  transform: scale(1);
}
#chapter-label {
  font-size: 10px;
  font-weight: 800;
  color: var(--pink);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-left: 6px;
  white-space: nowrap;
}
.screen {
  display: none;
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 72px 18px 50px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  animation: fadeUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.screen.active {
  display: flex;
}
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.card {
  background: rgba(255, 255, 255, 0.93);
  border-radius: 28px;
  padding: 26px 22px;
  box-shadow: 0 8px 48px rgba(255, 110, 180, 0.16);
  max-width: 430px;
  width: 100%;
  border: 2px solid var(--pink-light);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  top: -50px;
  right: -50px;
  width: 140px;
  height: 140px;
  background: radial-gradient(
    circle,
    rgba(255, 179, 217, 0.3) 0%,
    transparent 70%
  );
  pointer-events: none;
}
.card::after {
  content: "";
  position: absolute;
  bottom: -40px;
  left: -40px;
  width: 100px;
  height: 100px;
  background: radial-gradient(
    circle,
    rgba(201, 167, 255, 0.2) 0%,
    transparent 70%
  );
  pointer-events: none;
}
.btn {
  display: inline-block;
  padding: 13px 28px;
  border-radius: 50px;
  font-family: "Baloo 2", cursive;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.22s;
  position: relative;
}
.btn-main {
  background: linear-gradient(135deg, var(--pink), var(--lavender));
  color: #fff;
  box-shadow: 0 4px 22px rgba(255, 110, 180, 0.38);
}
.btn-main:hover {
  transform: translateY(-3px) scale(1.04);
}
.btn-main:active {
  transform: scale(0.97);
}
.btn-yellow {
  background: linear-gradient(135deg, var(--yellow), var(--peach));
  color: #7a4a00;
  box-shadow: 0 4px 18px rgba(255, 224, 102, 0.4);
}
.btn-yellow:hover {
  transform: translateY(-3px) scale(1.04);
}
.big-title {
  font-size: clamp(22px, 6vw, 32px);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 10px;
}
.sub-title {
  font-size: clamp(13px, 3.8vw, 15px);
  font-weight: 600;
  line-height: 1.7;
  margin-bottom: 18px;
  color: #8a5a9a;
}
.chapter-tag {
  display: inline-block;
  padding: 5px 16px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  background: var(--pink-light);
  color: var(--text);
  margin-bottom: 14px;
}
.love-msg {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.95;
  color: #7a4a9a;
  margin: 12px 0;
}
.divider {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--pink), var(--lavender));
  border-radius: 4px;
  margin: 12px auto;
}
.badge {
  display: inline-block;
  padding: 4px 13px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  background: var(--mint-light);
  color: #1a6a4a;
  margin: 3px;
}
.char {
  display: inline-block;
  font-size: 48px;
  animation: float 3s ease-in-out infinite;
}
.char-row {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 14px 0;
}
@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}
#gift-box {
  font-size: 88px;
  cursor: pointer;
  animation: bounce-gift 1.1s ease-in-out infinite;
  filter: drop-shadow(0 10px 24px rgba(255, 110, 180, 0.4));
  display: inline-block;
  user-select: none;
  transition: all 0.3s;
}
@keyframes bounce-gift {
  0%,
  100% {
    transform: scale(1) rotate(-3deg);
  }
  50% {
    transform: scale(1.12) rotate(3deg);
  }
}
/* STAR TILES */
.star-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin: 4px;
  border-radius: 14px;
  cursor: pointer;
  user-select: none;
  background: linear-gradient(135deg, var(--yellow), var(--peach));
  border: 2px solid rgba(255, 224, 102, 0.7);
  font-size: 22px;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 3px 10px rgba(255, 224, 102, 0.3);
  position: relative;
  overflow: hidden;
}
.star-tile:hover {
  transform: scale(1.14) rotate(6deg);
}
.star-tile.flipped {
  background: linear-gradient(135deg, var(--lav-light), var(--mint-light));
  border-color: var(--lavender);
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  padding: 4px;
  animation: pop-tile 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes pop-tile {
  0% {
    transform: scale(0.2) rotate(-20deg);
  }
  65% {
    transform: scale(1.25) rotate(6deg);
  }
  100% {
    transform: scale(1) rotate(0);
  }
}
.star-tile:not(.flipped)::after {
  content: "⭐";
  position: absolute;
  font-size: 22px;
}
#star-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: 12px 0;
  gap: 2px;
}
#star-reveal-msg {
  font-size: 15px;
  font-weight: 700;
  color: var(--pink);
  background: var(--pink-pale);
  border-radius: 14px;
  padding: 12px 14px;
  margin: 10px 0;
  line-height: 1.85;
  border: 2px dashed var(--pink-light);
  opacity: 0;
  transition: opacity 0.5s;
  min-height: 54px;
}
/* CAROUSEL */
#moment-carousel {
  position: relative;
  width: 100%;
  max-width: 370px;
  height: 200px;
  margin: 14px auto;
}
.moment-card {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  background: linear-gradient(135deg, #fff0f7, #eedeff);
  border-radius: 22px;
  padding: 20px 16px;
  border: 2px solid var(--pink-light);
  opacity: 0;
  transform: scale(0.88) translateX(40px);
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
}
.moment-card.active {
  opacity: 1;
  transform: scale(1) translateX(0);
}
.moment-card .m-emoji {
  font-size: 34px;
}
.moment-card .m-text {
  line-height: 1.75;
  font-style: italic;
}
/* CROWN */
#crown-btn {
  font-size: 76px;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-block;
  filter: drop-shadow(0 5px 14px rgba(255, 224, 102, 0.6));
}
#crown-btn:hover {
  transform: scale(1.12) rotate(8deg);
}
.crown-sparkle {
  position: fixed;
  pointer-events: none;
  font-size: 22px;
  animation: sparkle-fly 1s ease-out both;
}
@keyframes sparkle-fly {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--tx), var(--ty)) scale(0.15);
  }
}
/* CATCH GAME */
#catch-field {
  position: relative;
  width: 100%;
  height: 250px;
  border-radius: 22px;
  background: linear-gradient(180deg, #eedeff 0%, #fff0f7 60%, #e8f8ff 100%);
  border: 2px solid var(--lavender);
  overflow: hidden;
  margin: 12px 0;
}
.catch-item {
  position: absolute;
  cursor: pointer;
  user-select: none;
  animation: fall-item linear both;
  font-size: 34px;
}
@keyframes fall-item {
  0% {
    transform: translateY(-50px) rotate(var(--sr));
  }
  100% {
    transform: translateY(280px) rotate(var(--er));
  }
}
#combined-score-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.score-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 800;
}
.score-pill-pink {
  background: var(--pink-pale);
  color: var(--pink);
  border: 2px solid var(--pink-light);
}
.score-pill-lav {
  background: var(--lav-light);
  color: #7730d0;
  border: 2px solid var(--lavender);
}
/* PLAYLIST */
.playlist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #fff0f7, #eedeff);
  border-radius: 18px;
  padding: 13px 14px;
  margin: 7px 0;
  border: 2px solid var(--pink-light);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-align: left;
}
.playlist-item:hover {
  transform: translateX(6px) scale(1.01);
}
.playlist-item.playing {
  background: linear-gradient(135deg, var(--pink-light), var(--lav-light));
  border-color: var(--pink);
  box-shadow: 0 4px 20px rgba(255, 110, 180, 0.28);
}
.pl-icon {
  font-size: 26px;
  flex-shrink: 0;
  animation: none;
}
.playlist-item.playing .pl-icon {
  animation: spin-icon 1.5s linear infinite;
}
@keyframes spin-icon {
  to {
    transform: rotate(360deg);
  }
}
.pl-info {
  flex: 1;
}
.pl-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
}
.pl-sub {
  font-size: 11px;
  font-weight: 600;
  color: #9a6aaa;
  margin-top: 2px;
  line-height: 1.5;
}
.pl-check {
  font-size: 18px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.35s;
}
.playlist-item.played .pl-check {
  opacity: 1;
}
#vibe-msg {
  font-size: 13px;
  font-weight: 700;
  color: #7730d0;
  background: var(--lav-light);
  border-radius: 14px;
  padding: 12px;
  margin: 10px 0;
  line-height: 1.85;
  border: 2px dashed var(--lavender);
  opacity: 0;
  transition: opacity 0.6s;
  min-height: 44px;
}
/* LETTER */
#envelope {
  font-size: 80px;
  cursor: pointer;
  transition: all 0.4s;
  display: inline-block;
  filter: drop-shadow(0 6px 18px rgba(255, 110, 180, 0.32));
}
#envelope:hover {
  transform: scale(1.12) rotate(-4deg);
}
.letter-line {
  opacity: 0;
  transform: translateY(8px);
  font-size: 13.5px;
  line-height: 1.95;
  color: var(--text);
  font-weight: 600;
  transition: all 0.5s;
  padding: 3px 0;
}
.letter-line.visible {
  opacity: 1;
  transform: translateY(0);
}
.letter-line.italic-line {
  font-style: italic;
  color: #9a4a8a;
}
.letter-line.big-line {
  font-size: 15px;
  font-weight: 800;
  color: var(--pink);
}
#letter-box {
  background: linear-gradient(135deg, #fffdf5, #fff5f9);
  border-radius: 18px;
  padding: 18px 16px;
  border: 2px solid var(--pink-light);
  text-align: left;
  margin-top: 14px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.8s ease;
}
#letter-box.open {
  max-height: 2200px;
}
.letter-divider {
  width: 40px;
  height: 2px;
  background: linear-gradient(90deg, var(--pink), var(--lavender));
  border-radius: 4px;
  margin: 7px auto;
  opacity: 0;
  transition: opacity 0.5s;
}
.letter-divider.visible {
  opacity: 1;
}
/* FINALE */
#couple-reveal {
  font-size: 72px;
  display: inline-block;
  opacity: 0;
  transform: scale(0) rotate(-15deg);
  transition: all 0.9s cubic-bezier(0.34, 1.56, 0.64, 1);
}
#couple-reveal.show {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}
.finale-title {
  font-size: clamp(17px, 4.3vw, 23px);
  font-weight: 800;
  line-height: 1.6;
  background: linear-gradient(
    135deg,
    var(--pink),
    var(--lavender),
    #ff9a9e,
    var(--pink)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 14px 0;
}
.music-box-icon {
  font-size: 80px;
  cursor: pointer;
  display: inline-block;
  filter: drop-shadow(0 6px 22px rgba(126, 232, 200, 0.5));
  animation: music-pulse 2s ease-in-out infinite;
}
@keyframes music-pulse {
  0%,
  100% {
    transform: scale(1) rotate(-2deg);
  }
  50% {
    transform: scale(1.1) rotate(2deg);
  }
}
.mil-card {
  background: linear-gradient(135deg, #fff8f0, #fff5f9, #f5fff8);
  border-radius: 20px;
  padding: 18px;
  margin-top: 16px;
  border: 3px solid var(--yellow);
  position: relative;
  overflow: hidden;
}
.mil-card::before {
  content: "👸";
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 26px;
  opacity: 0.25;
}
/* CONFETTI */
.confetti-piece {
  position: fixed;
  top: -20px;
  pointer-events: none;
  z-index: 9999;
  font-size: 18px;
  animation: confetti-fall linear both;
}
@keyframes confetti-fall {
  0% {
    transform: translateY(0) rotate(0);
    opacity: 1;
  }
  100% {
    transform: translateY(110vh) rotate(720deg);
    opacity: 0;
  }
}
/* PEEKABOO */
.peekaboo {
  position: fixed;
  font-size: 36px;
  z-index: 50;
  pointer-events: none;
  animation: peekL 5s ease-in-out infinite;
}
@keyframes peekL {
  0%,
  100%,
  60% {
    transform: translateX(-55px);
  }
  35%,
  50% {
    transform: translateX(0);
  }
}
.peekaboo-r {
  animation: peekR 5s ease-in-out infinite;
  animation-delay: 2.5s;
}
@keyframes peekR {
  0%,
  100%,
  60% {
    transform: translateX(55px);
  }
  35%,
  50% {
    transform: translateX(0);
  }
}
/* GALLERY PICTURE BOOK */
.gallery-book {
  position: relative;
  width: 100%;
  max-width: 380px;
  height: 320px;
  margin: 18px auto;
  perspective: 1000px;
}
.gallery-page {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  opacity: 0;
  transform: rotateY(-15deg) scale(0.9);
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-page.active {
  opacity: 1;
  transform: rotateY(0deg) scale(1);
  pointer-events: auto;
  z-index: 2;
}
.gallery-page.prev {
  opacity: 0;
  transform: rotateY(20deg) scale(0.9) translateX(-40px);
}
.gallery-item {
  background: white;
  padding: 10px;
  border-radius: 20px;
  box-shadow: 0 8px 25px rgba(255, 110, 180, 0.15);
  border: 1px solid var(--pink-light);
  width: 100%;
}
.gallery-img {
  width: 100%;
  height: 100%;
  border-radius: 14px;
  display: block;
  object-fit: cover;
}
.gallery-caption {
  font-size: 11px;
  font-weight: 700;
  color: #9a6aaa;
  margin-top: 8px;
  line-height: 1.5;
}

.score-ring {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: conic-gradient(var(--pink) 0%, var(--pink-light) 0%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: var(--pink);
  margin: 0 auto 8px;
  border: 3px solid var(--pink-light);
  transition:
    background 0.3s,
    transform 0.3s;
}
.score-ring:active {
  transform: scale(0.9);
}
.progress-text {
  font-size: 11px;
  color: #9a6aaa;
  font-weight: 700;
  margin: 6px 0;
}
