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

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family:
    "Outfit",
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  background: linear-gradient(135deg, #fff0f5 0%, #ffc8de 50%, #ffd6e8 100%);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
  overflow-x: hidden;
  overflow-y: auto;
}

@keyframes gradientBG {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

.container {
  width: 90%;
  max-width: 800px;
  z-index: 10;
  position: relative;
}

h1 {
  color: #d81b60;
  font-size: 2.5rem;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.05);
}

p {
  color: #ad1457;
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.menu {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.4rem;
  perspective: 1000px;
  width: 100%;
}

@media (max-width: 600px) {
  .menu {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding-top: 2rem;
    padding-bottom: 2rem;
  }

  .menu-item {
    padding: 1.5rem 0.75rem 1.25rem;
    font-size: 0.95rem;
    border-radius: 1.6rem;
    animation: none !important;
    transform: none !important;
  }

  .menu-item .icon {
    width: 76px;
    height: 76px;
    border-radius: 1.3rem;
  }

  .menu-item .icon img {
    width: 48px;
    height: 48px;
  }
}

.menu-item {
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 2px solid rgba(216, 27, 96, 0.55);
  border-radius: 2rem;
  padding: 2rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  color: #0284c7;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  box-shadow:
    0 4px 24px rgba(216, 27, 96, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
  animation: none;
  position: relative;
  overflow: hidden;
}

.menu-item::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.45) 0%, rgba(224, 242, 254, 0.12) 100%);
  border-radius: inherit;
  pointer-events: none;
}

.menu-item:hover {
  transform: scale(1.06) translateY(-6px);
  background: rgba(255, 255, 255, 0.88);
  box-shadow:
    0 16px 40px rgba(216, 27, 96, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 1);
  border-color: #d81b60;
}

.menu-item .icon {
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, #ffe4ec 0%, #ffd6e8 100%);
  border-radius: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(216, 27, 96, 0.16);
  transition: all 0.35s ease;
  position: relative;
  z-index: 1;
}

.menu-item:hover .icon {
  background: linear-gradient(135deg, #ffd6e8 0%, #f472b6 100%);
  box-shadow: 0 6px 20px rgba(216, 27, 96, 0.28);
  transform: scale(1.08) rotate(-4deg);
}

.menu-item .icon img {
  width: 70px;
  height: 70px;
  object-fit: contain;
  position: relative;
  z-index: 1;
}

.menu-item:active {
  transform: scale(0.95) translateY(2px);
  box-shadow: 0 2px 10px rgba(216, 27, 96, 0.2);
  transition: all 0.1s ease;
}

/* ── Per-button "personality": distinct icon motion on hover/press ── */
@keyframes iconWiggleLetter {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-9deg); }
  75% { transform: rotate(9deg); }
}

@keyframes iconFlashImage {
  0%, 100% { filter: brightness(1) saturate(1); transform: scale(1.08) rotate(-4deg); }
  50% { filter: brightness(1.35) saturate(1.4); transform: scale(1.16) rotate(-4deg); }
}

@keyframes iconShakeGift {
  0%, 100% { transform: scale(1.08) rotate(-4deg); }
  20% { transform: scale(1.12) rotate(-15deg); }
  40% { transform: scale(1.12) rotate(7deg); }
  60% { transform: scale(1.12) rotate(-11deg); }
  80% { transform: scale(1.12) rotate(3deg); }
}

.menu-music:hover .icon,
.menu-music:active .icon {
  animation: vinylSpin 1.4s linear infinite;
}

.menu-letter:hover .icon,
.menu-letter:active .icon {
  animation: iconWiggleLetter 0.55s ease-in-out infinite;
}

.menu-image:hover .icon,
.menu-image:active .icon {
  animation: iconFlashImage 0.85s ease-in-out infinite;
}

.menu-gift:hover .icon,
.menu-gift:active .icon {
  animation: iconShakeGift 0.65s ease-in-out infinite;
}

@keyframes float {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.06);
  }
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-7.5-4.8-10-9.5C0.5 7.5 2 3 6 3c2 0 3.5 1 4 2 0.5-1 2-2 4-2 4 0 5.5 4.5 4 8.5C19.5 16.2 12 21 12 21z' fill='white' fill-opacity='0.16'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-7.5-4.8-10-9.5C0.5 7.5 2 3 6 3c2 0 3.5 1 4 2 0.5-1 2-2 4-2 4 0 5.5 4.5 4 8.5C19.5 16.2 12 21 12 21z' fill='white' fill-opacity='0.16'/%3E%3C/svg%3E");
  background-size: 36px 36px, 36px 36px;
  background-position: 0 0, 18px 18px;
  background-repeat: repeat, repeat;
  pointer-events: none;
  z-index: 1;
}

.heart {
  position: fixed;
  bottom: -50px;
  color: #ffb3d1;
  font-size: 20px;
  user-select: none;
  pointer-events: none;
  z-index: -1;
  animation: flyUp linear forwards;
}

@keyframes flyUp {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }

  100% {
    transform: translateY(-110vh) rotate(360deg);
    opacity: 0;
  }
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Envelope Styles */
.envelope-wrapper {
  perspective: 1000px;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 10;
}

.envelope {
  position: relative;
  width: 360px;
  height: 240px;
  background: linear-gradient(135deg, #ffd6e8, #f472b6);
  border-radius: 0 0 16px 16px;
  box-shadow:
    0 15px 35px rgba(216, 27, 96, 0.2),
    0 0 0 6px rgba(255, 255, 255, 0.25);
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1), background 0.6s ease, box-shadow 0.6s ease;
  cursor: pointer;
}

.envelope:not(.open) {
  animation: floatEnvelope 3s ease-in-out infinite;
}

@keyframes floatEnvelope {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(-8px) rotate(1.2deg);
  }
}

.envelope.open {
  background: transparent;
  box-shadow: none;
}

.envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #ffd6e8, #f472b6);
  clip-path: polygon(0 0, 50% 58%, 100% 0);
  transform-origin: top;
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1), z-index 0s 0.25s, opacity 0.5s ease;
  z-index: 3;
  border-radius: 16px 16px 0 0;
}

.envelope.open .envelope-flap {
  transform: rotateX(180deg);
  z-index: 1;
  opacity: 0;
  pointer-events: none;
}

.envelope-pocket {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(150deg, #ffd6e8, #ffb3d1);
  clip-path: polygon(0 40%, 50% 68%, 100% 40%, 100% 100%, 0 100%);
  z-index: 4;
  border-radius: 0 0 16px 16px;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.envelope.open .envelope-pocket {
  opacity: 0;
}

.wax-seal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -20%) scale(1);
  width: 60px;
  height: 60px;
  background: radial-gradient(circle, #d81b60 0%, #880e4f 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  box-shadow:
    0 6px 15px rgba(204, 0, 82, 0.4),
    inset 0 2px 4px rgba(255, 255, 255, 0.4),
    inset 0 -2px 4px rgba(0, 0, 0, 0.3);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.wax-seal i {
  color: white;
  font-size: 20px;
  animation: heartPulse 1.2s infinite;
}

@keyframes heartPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.2);
  }
}

.wax-seal .seal-text {
  position: absolute;
  bottom: -28px;
  white-space: nowrap;
  font-size: 0.8rem;
  font-weight: 700;
  color: #0284c7;
  background: rgba(255, 255, 255, 0.95);
  padding: 3px 12px;
  border-radius: 20px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(224, 242, 254, 0.5);
  transition: all 0.3s;
}

.envelope:hover .wax-seal {
  transform: translate(-50%, -20%) scale(1.1) rotate(6deg);
  box-shadow: 0 8px 20px rgba(204, 0, 82, 0.5);
}

.envelope.open .wax-seal {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -20%) scale(0);
}

/* Letter Modal (Stationery Card) inside Envelope */
.envelope .letter-modal {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 340px;
  height: 220px;
  padding: 20px;
  background: radial-gradient(circle, #fffefb 0%, #faf6ee 100%);
  border-radius: 16px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  transform: translateY(0) translateZ(0);
  transition:
    top 0.8s cubic-bezier(0.25, 1, 0.5, 1),
    left 0.8s cubic-bezier(0.25, 1, 0.5, 1),
    width 0.8s cubic-bezier(0.25, 1, 0.5, 1),
    height 0.8s cubic-bezier(0.25, 1, 0.5, 1),
    transform 0.8s cubic-bezier(0.25, 1, 0.5, 1),
    opacity 0.4s ease,
    z-index 0s 0.3s;

  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 2px solid #ffe4ec;
  outline: 1px solid #ffe4ec;
  outline-offset: -6px;
}

.envelope.open .letter-modal {
  opacity: 1;
  pointer-events: auto;
  z-index: 10;
  top: -170px;
  left: -50px;
  width: 460px;
  height: 600px;
  transform: translateY(0) translateZ(20px);
  box-shadow:
    0 20px 50px rgba(216, 27, 96, 0.22),
    0 0 0 10px rgba(255, 255, 255, 0.85),
    inset 0 0 30px rgba(230, 200, 180, 0.1);
  border-radius: 24px;
}

.close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 36px;
  height: 36px;
  background: rgba(216, 27, 96, 0.85);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: all 0.3s ease;
  backdrop-filter: blur(4px);
  box-shadow: 0 4px 10px rgba(216, 27, 96, 0.3);
}

.close-btn:hover {
  background: #d81b60;
  transform: rotate(90deg) scale(1.1);
  box-shadow: 0 6px 15px rgba(216, 27, 96, 0.5);
}

.deco-flower {
  position: absolute;
  width: 75px;
  height: auto;
  pointer-events: none;
  z-index: 3;
  opacity: 0.8;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.05));
  transition: opacity 0.5s ease;
}

.deco-tf {
  top: 10px;
  left: 10px;
  transform: rotate(-8deg);
}

.deco-br {
  bottom: 10px;
  right: 10px;
  transform: rotate(172deg) scaleX(-1);
}

.letter-content {
  color: #444;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  z-index: 2;
  padding: 25px 10px 10px 10px;
}

.letter-body {
  font-family: "Dancing Script", cursive;
  font-size: 1.6rem;
  line-height: 1.9;
  color: #112d2a;
  overflow-y: auto;
  flex-grow: 1;
  padding: 10px 10px 10px 5px;
  scrollbar-width: none;
  text-shadow: 1px 1px 0px rgba(255, 255, 255, 0.5);
  text-align: justify;
  text-justify: inter-word;
}

.letter-body::-webkit-scrollbar {
  display: none;
}

.letter-body p {
  margin-bottom: 22px;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
  text-indent: 15px;
}

.letter-gif {
  position: absolute;
  bottom: 25px;
  right: 25px;
  width: 100px;
  height: auto;
  pointer-events: none;
  z-index: 999;
  opacity: 0.65;
  filter: drop-shadow(0 5px 12px rgba(0, 0, 0, 0.08));
}

.letter-footer {
  text-align: right;
  margin-top: 25px;
  font-size: 1.7rem !important;
  font-weight: bold;
  color: #d81b60 !important;
}

@media (max-width: 480px) {
  .envelope {
    width: 290px;
    height: 190px;
  }

  .envelope .letter-modal {
    width: 270px;
    height: 170px;
    padding: 15px;
  }

  .envelope.open .letter-modal {
    top: -165px;
    left: -15px;
    width: 320px;
    height: 520px;
    border-radius: 20px;
    transform: translateY(0) translateZ(20px);
  }

  .deco-flower {
    width: 55px;
  }

  .letter-body {
    font-size: 1.25rem;
    line-height: 1.7;
  }

  .letter-body p {
    margin-bottom: 15px;
  }

  .letter-gif {
    width: 80px;
    bottom: 15px;
    right: 15px;
  }
}

.music-modal {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  width: 92%;
  max-width: 720px;
  height: 520px;
  padding: 28px 30px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow:
    0 25px 50px -12px rgba(216, 27, 96, 0.2),
    0 0 0 8px rgba(255, 255, 255, 0.4);
  position: relative;
  color: #d81b60;
  transform: translateY(50px) scale(0.9);
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
}

.overlay.active .music-modal {
  transform: translateY(0) scale(1);
}

.spotify-player {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex-grow: 1;
  overflow: hidden;
}

.player-body {
  display: flex;
  flex-direction: row;
  gap: 0;
  flex: 1;
  overflow: hidden;
}

.player-divider {
  width: 1px;
  background: rgba(216, 27, 96, 0.12);
  margin: 0 20px;
  border-radius: 1px;
  flex-shrink: 0;
}

.player-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 1rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 800;
  color: #ad1457;
  opacity: 0.8;
}

.spotify-logo {
  width: 28px;
  height: 28px;
  filter: drop-shadow(0 4px 6px rgba(216, 27, 96, 0.3));
}

.now-playing {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  flex: 0 0 220px;
  justify-content: center;
}

.song-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  width: 100%;
}

.album-art {
  margin-top: 20px;
  width: 175px;
  height: 175px;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(216, 27, 96, 0.25);
  background: linear-gradient(135deg, #fff0f5, #f472b6);
  position: relative;
  transition: transform 0.5s ease;
}

.album-art:hover {
  transform: scale(1.05) rotate(2deg);
}

.album-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.song-details {
  margin-top: 5px;
}

.song-details h3 {
  margin: 0;
  font-size: 1.4rem;
  color: #d81b60;
  font-weight: 800;
}

.song-details p {
  margin: 4px 0 0;
  font-size: 1rem;
  color: #ad1457;
  opacity: 0.7;
}

.player-controls {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.progress-container {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  color: #ad1457;
  font-weight: 600;
}

.progress-bar {
  flex-grow: 1;
  height: 8px;
  background: rgba(216, 27, 96, 0.1);
  border-radius: 10px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.progress {
  height: 100%;
  background: linear-gradient(90deg, #f472b6, #d81b60);
  border-radius: 10px;
  width: 0%;
  position: relative;
  transition: width 0.1s linear;
}

.control-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 25px;
}

.ctrl-btn {
  background: none;
  border: none;
  color: #f472b6;
  font-size: 1.8rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ctrl-btn:hover {
  color: #d81b60;
  transform: scale(1.2);
}

.ctrl-btn.play-pause {
  width: 65px;
  height: 65px;
  background: linear-gradient(135deg, #d81b60, #ad1457);
  color: white;
  border-radius: 50%;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(216, 27, 96, 0.4);
}

.ctrl-btn.play-pause:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 12px 25px rgba(216, 27, 96, 0.5);
}

.song-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(216, 27, 96, 0.2) transparent;
}

.song-list::-webkit-scrollbar {
  width: 4px;
}

.song-list::-webkit-scrollbar-thumb {
  background: rgba(216, 27, 96, 0.2);
  border-radius: 10px;
}

.song-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.3);
  border: 1px solid transparent;
}

.song-item:hover {
  background: rgba(255, 255, 255, 0.6);
  transform: translateX(5px);
  border-color: rgba(216, 27, 96, 0.1);
}

.song-item.active {
  background: rgba(216, 27, 96, 0.1);
  border-color: rgba(216, 27, 96, 0.2);
}

.song-item img {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.song-item-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.song-item-title {
  font-size: 1rem;
  font-weight: 700;
  color: #d81b60;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-item-artist {
  font-size: 0.85rem;
  color: #ad1457;
  opacity: 0.7;
}

.image-modal {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  width: 90%;
  max-width: 600px;
  height: 650px;
  padding: 40px 20px;
  position: relative;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow:
    0 25px 50px -12px rgba(216, 27, 96, 0.2),
    0 0 0 8px rgba(255, 255, 255, 0.4);
  transform: translateY(50px) scale(0.9);
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.overlay.active .image-modal {
  transform: translateY(0) scale(1);
}

.gallery-container {
  display: flex;
  flex-direction: column;
  gap: 30px;
  width: 100%;
  overflow: hidden;
  cursor: grab;
}

.gallery-container:active {
  cursor: grabbing;
}

.gallery-row {
  display: flex;
  width: max-content;
  pointer-events: auto;
}

.gallery-row img {
  height: 200px;
  width: 150px;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  border: 4px solid white;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  margin-right: 20px;
}

.gallery-row img:hover {
  transform: scale(1.1) translateY(-10px) rotate(2deg);
  box-shadow: 0 15px 30px rgba(216, 27, 96, 0.2);
  z-index: 10;
}

.row-top {
  animation: scroll-left 30s linear infinite;
}

.row-bottom {
  animation: scroll-right 30s linear infinite;
}

@keyframes scroll-left {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }
}

@keyframes scroll-right {
  0% {
    transform: translateX(-50%);
  }

  100% {
    transform: translateX(0);
  }
}

.lightbox-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#lightbox-img {
  max-width: 100%;
  max-height: 85vh;
  border-radius: 8px;
  box-shadow: 0 5px 30px rgba(0, 0, 0, 0.5);
  border: 5px solid white;
}

@media (max-width: 480px) {
  .image-modal {
    height: 500px;
  }

  .gallery-row img {
    height: 140px;
    width: 110px;
  }

  .gallery-gif-wrapper.top {
    top: 5px;
    left: 5px;
  }

  .gallery-gif-wrapper.bottom {
    bottom: 5px;
    right: 5px;
  }

  .gallery-gif {
    width: 40px !important;
  }

  .gallery-gif-wrapper.bottom .gallery-gif {
    width: 100px !important;
  }

  .gallery-gif-wrapper.top .gallery-gif {
    width: 100px !important;
  }

  .flying-text {
    font-size: 0.8rem !important;
  }
}

.gallery-gif-wrapper {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 15px;
  pointer-events: none;
  z-index: 10;
  max-width: calc(100% - 20px);
  overflow: hidden;
}

.gallery-gif-wrapper.top {
  top: 10px;
  left: 10px;
  flex-direction: row;
}

.gallery-gif-wrapper.bottom {
  bottom: 10px;
  right: 10px;
  flex-direction: row;
}

.gallery-gif {
  width: 80px;
  height: auto;
  opacity: 0.9;
  z-index: 11;
}

.gallery-gif-wrapper.bottom .gallery-gif {
  width: 100px;
}

.flying-text {
  font-size: 1.2rem;
  font-weight: bold;
  color: #ff1493;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
  white-space: nowrap;
}

.text-right {
  animation: run-right 8s linear infinite;
}

.text-left {
  animation: run-left 8s linear infinite;
}

@keyframes run-right {
  0% {
    transform: translateX(-100%);
    opacity: 0;
  }

  10% {
    opacity: 1;
  }

  90% {
    opacity: 1;
  }

  100% {
    transform: translateX(100%);
    opacity: 0;
  }
}

@keyframes run-left {
  0% {
    transform: translateX(100%);
    opacity: 0;
  }

  10% {
    opacity: 1;
  }

  90% {
    opacity: 1;
  }

  100% {
    transform: translateX(-100%);
    opacity: 0;
  }
}

.gift-modal {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  width: 95%;
  max-width: 900px;
  height: 85vh;
  position: relative;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow:
    0 25px 50px -12px rgba(216, 27, 96, 0.3),
    0 0 0 8px rgba(255, 255, 255, 0.4);
  transform: translateY(50px) scale(0.9);
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.overlay.active .gift-modal {
  transform: translateY(0) scale(1);
}

.gift-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.gift-modal .close-btn {
  top: 15px !important;
  right: 15px !important;
  z-index: 100 !important;
}

.gift-modal .fullscreen-btn {
  position: absolute;
  top: 15px;
  right: 65px;
  width: 40px;
  height: 40px;
  background: #d81b60;
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(216, 27, 96, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: all 0.3s ease;
}

.gift-modal .fullscreen-btn:hover {
  transform: scale(1.1);
}

.gift-modal:fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  border-radius: 0;
  box-shadow: none;
  border: none;
}

.gift-modal:fullscreen .close-btn {
  display: none;
}

@media (max-width: 600px) {
  .gift-modal {
    height: 80vh;
  }
}

/* Lock Screen Styles */
.lock-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #fff0f5 0%, #ffd9e8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5000;
  transition: transform 0.8s cubic-bezier(0.8, 0, 0.2, 1), opacity 0.5s ease;
}

.lock-screen::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-7.5-4.8-10-9.5C0.5 7.5 2 3 6 3c2 0 3.5 1 4 2 0.5-1 2-2 4-2 4 0 5.5 4.5 4 8.5C19.5 16.2 12 21 12 21z' fill='white' fill-opacity='0.16'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-7.5-4.8-10-9.5C0.5 7.5 2 3 6 3c2 0 3.5 1 4 2 0.5-1 2-2 4-2 4 0 5.5 4.5 4 8.5C19.5 16.2 12 21 12 21z' fill='white' fill-opacity='0.16'/%3E%3C/svg%3E");
  background-size: 36px 36px, 36px 36px;
  background-position: 0 0, 18px 18px;
  background-repeat: repeat, repeat;
  pointer-events: none;
}

.lock-screen.unlocked {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

.lock-content {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 50px;
  border-radius: 50px;
  text-align: center;
  box-shadow:
    0 30px 60px rgba(216, 27, 96, 0.2),
    0 0 0 10px rgba(255, 255, 255, 0.1);
  width: 90%;
  max-width: 850px;
  animation: fadeIn 1s ease;
  display: flex;
  align-items: center;
  gap: 50px;
  position: relative;
  z-index: 10;
}

.lock-image {
  flex: 1;
  max-width: 350px;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  cursor: none;
}

.lock-image img {
  width: 100%;
  height: auto;
  border-radius: 20px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  border: 5px solid white;
}

.lock-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lock-icon {
  font-size: 3rem;
  color: #d81b60;
  margin-bottom: 20px;
  animation: heartbeat 1.5s ease infinite;
}

@keyframes heartbeat {
  0% {
    transform: scale(1);
  }

  15% {
    transform: scale(1.15);
  }

  30% {
    transform: scale(1);
  }

  45% {
    transform: scale(1.15);
  }

  60% {
    transform: scale(1);
  }
}



.pass-dots {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 40px;
}

.dot {
  width: 16px;
  height: 16px;
  border: 2px solid #d81b60;
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.dot.active {
  background: #d81b60;
  transform: scale(1.2);
  box-shadow: 0 0 10px rgba(216, 27, 96, 0.5);
}

.numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.num-btn {
  width: 75px;
  height: 75px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: #d81b60;
  font-size: 1.6rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
}

.num-btn:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: scale(1.1);
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 10px 20px rgba(216, 27, 96, 0.1);
}

.num-btn:active {
  transform: scale(0.9);
  background: #d81b60;
  color: white;
}

.num-btn.blank {
  visibility: hidden;
}

.num-btn.delete-btn {
  font-size: 1.4rem;
  border: none;
  background: transparent;
}

.num-btn.delete-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Shake Animation */
.shake {
  animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shake {

  10%,
  90% {
    transform: translate3d(-1px, 0, 0);
  }

  20%,
  80% {
    transform: translate3d(2px, 0, 0);
  }

  30%,
  50%,
  70% {
    transform: translate3d(-4px, 0, 0);
  }

  40%,
  60% {
    transform: translate3d(4px, 0, 0);
  }
}

.main-content-hidden {
  filter: blur(20px);
  opacity: 0.3;
  transition: all 1s ease;
}

.main-content-visible {
  filter: blur(0);
  opacity: 1;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

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

@media (max-width: 768px) {
  .lock-content {
    flex-direction: column;
    padding: 20px 15px;
    max-width: 320px;
    /* Nhỏ hơn cho điện thoại */
    gap: 15px;
    border-radius: 30px;
  }

  .lock-image {
    max-width: 140px;
    /* Ảnh nhỏ hơn */
  }

  .lock-image img {
    border-width: 3px;
  }

  .lock-icon {
    font-size: 2rem;
    margin-bottom: 10px;
  }

  .pass-dots {
    margin-bottom: 25px;
    gap: 10px;
  }

  .dot {
    width: 12px;
    height: 12px;
  }

  .num-btn {
    width: 55px;
    /* Nút bấm nhỏ lại */
    height: 55px;
    font-size: 1.2rem;
  }

  .numpad {
    gap: 12px;
  }

  .reset-lock-btn {
    bottom: 15px;
    right: 15px;
    width: 45px;
    height: 45px;
  }
}

.reset-lock-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.5);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  color: #d81b60;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(216, 27, 96, 0.2);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 100;
  display: none;
  /* Ẩn mặc định */
}

/* Hiển thị nút khi đã mở khóa */
.main-content-visible~.reset-lock-btn {
  display: flex;
}

.reset-lock-btn:hover {
  transform: scale(1.1) rotate(10deg);
  background: white;
  box-shadow: 0 8px 25px rgba(216, 27, 96, 0.3);
}

.reset-lock-btn:active {
  transform: scale(0.9);
}

@media (max-width: 768px) {
  .reset-lock-btn {
    bottom: 15px;
    right: 15px;
    width: 45px;
    height: 45px;
  }
}

/* Flower Burst on Numpad */
.flower-burst {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  animation: flowerFloat var(--dur, 1s) ease-out forwards;
}

@keyframes flowerFloat {
  0% {
    transform: scale(1) rotate(var(--rot-start, -20deg));
    opacity: 1;
  }

  100% {
    transform: translateX(var(--dx, 0px)) translateY(180px) scale(0.5) rotate(var(--rot-end, 30deg));
    opacity: 0;
  }
}

/* Full-screen Flower Bloom (unlock effect) */
@keyframes flowerBloom {
  0% {
    transform: translate(-50%, -50%) scale(0) rotate(0deg);
    opacity: 0;
  }

  20% {
    opacity: 1;
  }

  100% {
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1) rotate(var(--spin));
    opacity: 1;
  }
}

@keyframes flowerExit {
  0% {
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1) rotate(var(--spin));
    opacity: 1;
  }

  60% {
    opacity: 1;
  }

  100% {
    transform: translate(calc(-50% + var(--dx) + var(--exit-x)), calc(-50% + var(--dy))) scale(0.4) rotate(calc(var(--spin) + var(--exit-rot)));
    opacity: 0;
  }
}

/* Hint Modal */
#hint-overlay {
  z-index: 6000;
}

.hint-modal {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  width: 90%;
  max-width: 340px;
  padding: 45px 30px 35px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow:
    0 25px 50px -12px rgba(216, 27, 96, 0.25),
    0 0 0 8px rgba(255, 255, 255, 0.4);
  transform: translateY(50px) scale(0.9);
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-align: center;
  position: relative;
}

.overlay.active .hint-modal {
  transform: translateY(0) scale(1);
}

.hint-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}

.hint-header i {
  font-size: 1.5rem;
  color: #d81b60;
}

.hint-header h3 {
  font-size: 1.4rem;
  font-weight: 800;
  color: #d81b60;
}

.hint-subtitle {
  font-size: 0.95rem;
  color: #ad1457;
  opacity: 0.85;
  margin-bottom: 22px;
}

.scratch-card {
  position: relative;
  width: 220px;
  height: 88px;
  margin: 0 auto;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(216, 27, 96, 0.25);
  border: 3px solid rgba(216, 27, 96, 0.15);
}

.scratch-reveal {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fff0f5, #fff0f5);
}

.pin-display {
  font-size: 2.8rem;
  font-weight: 900;
  color: #d81b60;
  letter-spacing: 10px;
  font-family: 'Courier New', monospace;
  text-shadow: 2px 2px 8px rgba(216, 27, 96, 0.3);
  padding-left: 10px;
}

.scratch-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}

/* ── Album art: circular + vinyl ring shadow ── */
.album-art {
  border-radius: 50%;
  box-shadow:
    0 0 0 4px rgba(216, 27, 96, 0.12),
    0 0 0 9px rgba(216, 27, 96, 0.06),
    0 15px 35px rgba(216, 27, 96, 0.25);
}

.album-art:hover {
  transform: none;
}

@keyframes vinylSpin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.album-art.spinning {
  animation: vinylSpin 6s linear infinite;
}

/* ── Song title continuous marquee ── */
#song-title {
  overflow: hidden;
  white-space: nowrap;
  width: 100%;
  max-width: 200px;
  position: relative;
  mask-image: linear-gradient(to right, black 60%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, black 60%, transparent 100%);
}

#song-title-text {
  display: inline-block;
  white-space: nowrap;
}

@keyframes marqueeTitle {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }
}

#song-title-text.scrolling {
  animation: marqueeTitle var(--mdur, 7s) linear infinite;
}

/* ── Playlist toggle button — always hidden ── */
.song-list-toggle {
  display: none;
}

/* ── Small screens (≤768px): stacked layout + image-only song list ── */
@media (max-width: 768px) {

  /* Re-apply: base .player-body{flex-direction:row} was declared after the earlier query */
  .music-modal {
    height: 85vh;
    padding: 20px;
  }

  .player-body {
    flex-direction: column;
    overflow-y: auto;
  }

  .now-playing {
    flex: 0 0 auto;
  }

  .player-divider {
    width: 100%;
    height: 1px;
    margin: 12px 0;
  }

  /* Shrink main album art */
  .album-art {
    width: 110px;
    height: 110px;
  }

  /* Song list: vertical list below player */
  .song-list {
    flex: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 4px 2px;
    overflow-y: auto;
    max-height: 220px;
  }

  /* Compact row: circle image + name */
  .song-item {
    flex-direction: row;
    align-items: center;
    padding: 8px 10px;
    gap: 12px;
  }

  .song-item img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    flex-shrink: 0;
  }

  .song-item-info {
    display: flex;
  }

  .song-item-title {
    font-size: 0.88rem;
  }
}

/* ── Lightbox: column layout + nav + heart ── */
.lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 92%;
  max-height: none;
  position: relative;
}

.lightbox-img-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

#lightbox-img {
  max-width: 100%;
  max-height: 74vh;
  border-radius: 8px;
  box-shadow: 0 5px 30px rgba(0, 0, 0, 0.5);
  border-style: solid;
  border-color: white;
  border-width: 6px 6px 22px 6px;
  display: block;
  transition: opacity 0.18s ease;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.5);
  color: white;
  font-size: 1.05rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  z-index: 5;
}

.lightbox-nav.prev {
  left: -62px;
}

.lightbox-nav.next {
  right: -62px;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.55);
  transform: translateY(-50%) scale(1.12);
}

.lightbox-nav:active {
  transform: translateY(-50%) scale(0.92);
}

.lightbox-heart {
  background: rgba(255, 200, 220, 0.2);
  border: 2px solid rgba(255, 105, 150, 0.5);
  border-radius: 50%;
  width: 62px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  animation: heartbeat 1.5s ease infinite;
}

.lightbox-heart:hover {
  animation: none;
  transform: scale(1.15);
  background: rgba(255, 160, 200, 0.35);
  border-color: rgba(255, 80, 130, 0.7);
}

.lightbox-heart:active {
  animation: none;
  transform: scale(0.88);
}

/* Floating flower animation (shared by lightbox + modal backgrounds) */
@keyframes lbFlowerFloat {
  0% {
    transform: rotate(var(--lbf-r0)) translate(0, 0);
  }

  50% {
    transform: rotate(var(--lbf-r1)) translate(var(--lbf-dx), var(--lbf-dy));
  }

  100% {
    transform: rotate(var(--lbf-r0)) translate(0, 0);
  }
}

/* Lightbox decorative background flowers */
.lightbox-bg-flowers {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: 12px;
}

.lightbox-bg-flowers img {
  position: absolute;
  pointer-events: none;
  animation: lbFlowerFloat var(--lbf-dur, 6s) ease-in-out infinite;
}

/* Modal decorative background flowers */
.modal-bg-flowers {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: inherit;
}

.modal-bg-flowers img {
  position: absolute;
  pointer-events: none;
  animation: lbFlowerFloat var(--lbf-dur, 7s) ease-in-out infinite;
}

@keyframes flowerFall {
  0% {
    transform: translateY(0);
    opacity: 1;
  }

  80% {
    opacity: 1;
  }

  100% {
    transform: translateY(110vh);
    opacity: 0;
  }
}

@keyframes flowerSpin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes heartFlowerBurst {
  0% {
    transform: translate(0, 0) scale(1) rotate(0deg);
    opacity: 1;
  }

  75% {
    opacity: 1;
  }

  100% {
    transform: translate(var(--hf-dx), var(--hf-dy)) scale(0.25) rotate(var(--hf-rot));
    opacity: 0;
  }
}

@media (max-width: 600px) {
  .lightbox-nav.prev {
    left: 6px;
  }

  .lightbox-nav.next {
    right: 6px;
  }

  .lightbox-nav {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.35);
    width: 40px;
    height: 40px;
  }

  #lightbox-img {
    max-width: 94vw;
    max-height: 68vh;
  }
}

/* ── Photo album grid modal ── */
.image-modal {
  height: 82vh;
  padding: 20px 16px 16px;
  justify-content: flex-start;
  overflow: hidden;
}

.gallery-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  cursor: default;
  padding: 4px 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(216, 27, 96, 0.2) transparent;
}

.gallery-container::-webkit-scrollbar {
  width: 4px;
}

.gallery-container::-webkit-scrollbar-thumb {
  background: rgba(216, 27, 96, 0.2);
  border-radius: 10px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.photo-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 14px;
  border: 3px solid white;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    box-shadow 0.25s ease;
  display: block;
}

.photo-grid img:hover {
  transform: scale(1.06);
  box-shadow: 0 8px 24px rgba(216, 27, 96, 0.3);
  position: relative;
  z-index: 2;
}

@media (max-width: 480px) {
  .image-modal {
    height: 88vh;
    padding: 14px 10px 10px;
  }

  .photo-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
}