:root {
  --text-main: #3f2a53;
  --text-soft: #6f5a84;
  --card-bg: rgba(255, 255, 255, 0.88);
  --card-border: rgba(255, 255, 255, 0.78);
  --accent: #ff6fa0;
  --accent-soft: #ffd9ea;
  --accent-blue: #9ad7ff;
  --accent-gold: #ffe5a6;
  --shadow: 0 16px 45px rgba(89, 56, 105, 0.18);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: "Outfit", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 185, 213, 0.5) 0, rgba(255, 185, 213, 0) 36%),
    radial-gradient(circle at 86% 24%, rgba(167, 222, 255, 0.46) 0, rgba(167, 222, 255, 0) 34%),
    radial-gradient(circle at 48% 84%, rgba(255, 237, 190, 0.44) 0, rgba(255, 237, 190, 0) 33%),
    linear-gradient(145deg, #fff2f8 0%, #f3f8ff 46%, #fff8e9 100%);
  overflow-x: hidden;
  position: relative;
}

.party-bg {
  position: relative;
}

.party-bg::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.8) 1px, transparent 1.5px),
    radial-gradient(circle, rgba(255, 200, 222, 0.55) 1.1px, transparent 1.6px),
    radial-gradient(circle, rgba(161, 222, 255, 0.55) 0.9px, transparent 1.5px);
  background-size: 24px 24px, 30px 30px, 36px 36px;
  background-position: 0 0, 12px 6px, 6px 16px;
  opacity: 0.55;
  z-index: 0;
}

.party-bg::after {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  height: 120px;
  pointer-events: none;
  background:
    linear-gradient(135deg, #ff7ea8 50%, transparent 52%) 0 0 / 42px 46px repeat-x,
    linear-gradient(225deg, #8ecfff 50%, transparent 52%) 21px 0 / 42px 46px repeat-x,
    linear-gradient(135deg, #ffd89d 50%, transparent 52%) 10px 0 / 42px 46px repeat-x;
  opacity: 0.58;
  z-index: 0;
}

#confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

.party-decor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.bunting {
  position: absolute;
  top: 92px;
  left: 8%;
  right: 8%;
  height: 2px;
  background: rgba(115, 86, 135, 0.45);
}

.balloon-lane {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 14vw;
  min-width: 72px;
}

.balloon-lane.left {
  left: 0;
}

.balloon-lane.right {
  right: 0;
}

.balloon {
  position: absolute;
  width: 36px;
  height: 46px;
  border-radius: 50% 50% 48% 48%;
  box-shadow: inset -8px -12px 18px rgba(255, 255, 255, 0.35), 0 8px 18px rgba(85, 50, 100, 0.2);
  animation: balloonFloat linear infinite;
}

.balloon::after {
  content: "";
  position: absolute;
  bottom: -20px;
  left: 50%;
  width: 1.2px;
  height: 20px;
  transform: translateX(-50%);
  background: rgba(122, 94, 139, 0.45);
}

.sparkles {
  position: absolute;
  inset: 0;
}

.spark {
  position: absolute;
  width: 4px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.9);
  animation: sparkle 2.4s ease-in-out infinite;
}

.music-toggle {
  position: fixed;
  right: 0.95rem;
  bottom: 0.95rem;
  z-index: 28;
  border: none;
  border-radius: 999px;
  padding: 0.72rem 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  font-family: "Outfit", sans-serif;
  font-weight: 600;
  color: #4e2f64;
  background: linear-gradient(130deg, #ffe4f0, #dbedff);
  box-shadow: 0 10px 25px rgba(86, 58, 108, 0.24);
  cursor: pointer;
}

.page-shell {
  width: min(1200px, 100%);
  margin: 0 auto;
  min-height: 100vh;
  display: grid;
  align-items: center;
  padding: 7.7rem 1rem 4.3rem;
  position: relative;
  z-index: 3;
}

.hero-shell,
.ending-shell {
  place-items: center;
}

.content-card {
  width: min(980px, 100%);
  margin: 0 auto;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  padding: clamp(1.1rem, 3.5vw, 2.2rem);
  position: relative;
  z-index: 3;
}

.hero-card,
.ending-card {
  text-align: center;
  width: min(840px, 100%);
}

.kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.78rem;
  color: #9f6db3;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  word-break: break-word;
}

h1 {
  margin: 0.35rem 0 0;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2.1rem, 7.8vw, 4.8rem);
  line-height: 1.05;
}

h2 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(1.9rem, 5vw, 3.2rem);
}

h3 {
  margin: 0;
  font-size: clamp(1.06rem, 2.8vw, 1.3rem);
}

.highlight {
  color: var(--accent);
  text-shadow: 0 10px 26px rgba(255, 111, 160, 0.27);
}

.subtitle {
  margin-top: 0.9rem;
  color: var(--text-soft);
  font-size: clamp(1rem, 2.8vw, 1.34rem);
}

.section-head {
  text-align: center;
  max-width: 780px;
  margin: 0 auto 1.8rem;
}

.section-head p {
  margin-top: 0.6rem;
  color: var(--text-soft);
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  padding: 0.75rem 1.2rem;
  min-width: 130px;
  background: linear-gradient(130deg, #ffd8e9, #ffe9ba);
  color: #4f315f;
  font-weight: 700;
  font-family: "Outfit", sans-serif;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(93, 63, 111, 0.2);
  transition: transform 0.24s ease, box-shadow 0.24s ease;
}

.page-btn.secondary {
  background: linear-gradient(130deg, #d9ebff, #f5ddff);
}

.page-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 29px rgba(93, 63, 111, 0.24);
}

.page-btn:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  transform: none;
}

.page-btn.is-disabled,
.page-btn[aria-disabled="true"] {
  pointer-events: none;
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
  filter: saturate(0.82);
}

.pager {
  margin-top: 1.4rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
}

img {
  display: block;
  width: 100%;
  height: auto;
}

.memory-grid,
.songs-grid,
.food-grid {
  width: 100%;
  display: grid;
  gap: 1rem;
}

.memory-grid {
  grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
}

.memory-card {
  background: rgba(255, 255, 255, 0.93);
  border: 9px solid #fff;
  border-bottom-width: 15px;
  border-radius: 16px;
  box-shadow: 0 14px 34px rgba(87, 60, 102, 0.2);
  transition: transform 0.27s ease;
}

.memory-card:hover {
  transform: translateY(-6px) rotate(-0.5deg);
}

.memory-card img {
  aspect-ratio: 5 / 4;
  object-fit: cover;
  border-radius: 8px;
}

.memory-card p {
  margin: 0.8rem 0 0.2rem;
  text-align: center;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.12rem;
  font-weight: 700;
}

.songs-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.song-card {
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 14px 34px rgba(87, 60, 102, 0.18);
  transition: transform 0.25s ease;
}

.song-card:hover {
  transform: translateY(-5px);
}

.song-card img {
  aspect-ratio: 16 / 11;
  object-fit: cover;
}

.song-media {
  position: relative;
  overflow: hidden;
}

.song-video {
  width: 100%;
  aspect-ratio: 16 / 11;
  object-fit: cover;
  display: block;
  background: #000;
}

.song-info {
  padding: 0.95rem;
}

.song-info p {
  color: var(--text-soft);
  margin: 0.3rem 0 0.7rem;
}

.song-play {
  border: none;
  border-radius: 999px;
  padding: 0.5rem 0.9rem;
  font-weight: 700;
  font-family: "Outfit", sans-serif;
  color: #523269;
  background: linear-gradient(115deg, #ffd9ea, #daecff);
  cursor: pointer;
}

.song-play.active {
  background: linear-gradient(115deg, #daecff, #ffd9ea);
}

.song-progress {
  margin-top: 0.7rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-soft);
}

.song-progress .time {
  font-variant-numeric: tabular-nums;
}

.progress-bar {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff9bbf 0%, #ff9bbf 0%, #e3efff 0%, #e3efff 100%);
  outline: none;
  cursor: pointer;
}

.progress-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ff7fa8;
  border: 2px solid #fff;
  box-shadow: 0 4px 10px rgba(92, 54, 116, 0.25);
}

.progress-bar::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ff7fa8;
  border: 2px solid #fff;
  box-shadow: 0 4px 10px rgba(92, 54, 116, 0.25);
}

.food-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.food-card {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 14px 34px rgba(87, 60, 102, 0.17);
  transition: transform 0.24s ease;
}

.food-card:hover {
  transform: translateY(-5px);
}

.food-card img {
  aspect-ratio: 5 / 4;
  object-fit: cover;
}

.food-card h3 {
  margin: 0;
  padding: 0.84rem;
  text-align: center;
  font-family: "Cormorant Garamond", serif;
}

.quiz-card {
  width: min(760px, 100%);
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.83);
  border: 1px solid rgba(255, 255, 255, 0.83);
  border-radius: 20px;
  padding: clamp(1rem, 3vw, 1.8rem);
  box-shadow: 0 16px 35px rgba(87, 60, 102, 0.16);
}

.quiz-top {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  color: var(--text-soft);
  font-weight: 600;
  margin-bottom: 1rem;
}

.quiz-options {
  margin-top: 0.9rem;
  display: grid;
  gap: 0.65rem;
}

.option-btn {
  border: 1px solid rgba(198, 173, 219, 0.7);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-main);
  border-radius: 11px;
  padding: 0.7rem 0.9rem;
  text-align: left;
  font-family: "Outfit", sans-serif;
  cursor: pointer;
  transition: 0.2s ease;
}

.option-btn:hover {
  transform: translateX(3px);
  border-color: #b88fd0;
}

.option-btn.correct {
  background: rgba(198, 244, 206, 0.8);
  border-color: rgba(62, 161, 79, 0.6);
}

.option-btn.wrong {
  background: rgba(255, 205, 215, 0.85);
  border-color: rgba(190, 89, 115, 0.6);
}

.quiz-feedback {
  min-height: 1.2rem;
  margin: 0.75rem 0 0;
  color: var(--text-soft);
  font-weight: 600;
}

.quiz-result {
  margin: 1rem 0 0;
  font-weight: 700;
  color: #5c3872;
}

.message-stage {
  width: min(760px, 100%);
  margin: 0 auto;
}

.message-card {
  min-height: 150px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  background: linear-gradient(145deg, rgba(255, 234, 245, 0.9), rgba(227, 241, 255, 0.88));
  box-shadow: 0 14px 32px rgba(87, 60, 102, 0.18);
  display: grid;
  place-items: center;
  padding: clamp(1.1rem, 4vw, 1.9rem);
  text-align: center;
  font-size: clamp(1.1rem, 3vw, 1.42rem);
  color: #57386d;
}

.video-panel {
  text-align: center;
}

.video-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  place-items: center;
  background: rgba(49, 30, 60, 0.78);
  padding: 1rem;
}

.video-modal.open {
  display: grid;
}

.video-modal-content {
  position: relative;
  width: min(920px, 100%);
  border-radius: 18px;
  background: #fff;
  padding: 2.1rem 1rem 1rem;
}

.close-video {
  position: absolute;
  right: 0.75rem;
  top: 0.4rem;
  border: none;
  background: transparent;
  font-size: 2rem;
  line-height: 1;
  color: #664b79;
  cursor: pointer;
}

#specialVideo {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
  border-radius: 12px;
  background: #000;
}

.lock-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  place-items: center;
  background: rgba(41, 26, 56, 0.72);
  padding: 1rem;
}

.lock-modal.open {
  display: grid;
}

.lock-card {
  position: relative;
  width: min(420px, 100%);
  background: #fff;
  border-radius: 18px;
  padding: 2.2rem 1.4rem 1.6rem;
  box-shadow: 0 18px 40px rgba(65, 42, 84, 0.25);
  text-align: center;
}

.lock-card h3 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.8rem;
}

.lock-card p {
  margin: 0.6rem 0 1rem;
  color: var(--text-soft);
}

.lock-card input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(162, 129, 190, 0.4);
  padding: 0.7rem 0.85rem;
  font-family: "Outfit", sans-serif;
  font-size: 1rem;
  outline: none;
  background: #faf7ff;
}

.lock-card input:focus {
  border-color: rgba(145, 106, 176, 0.7);
  box-shadow: 0 0 0 3px rgba(190, 161, 218, 0.25);
}

.lock-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 1rem;
}

.lock-error {
  min-height: 1.2rem;
  margin: 0.6rem 0 0;
  color: #c94f73;
  font-weight: 600;
}

.lock-close {
  position: absolute;
  right: 1rem;
  top: 0.8rem;
  border: none;
  background: transparent;
  font-size: 1.7rem;
  color: #6d4a88;
  cursor: pointer;
}

.letter-paper {
  width: min(820px, 100%);
  margin: 0 auto;
  border-radius: 16px;
  border: 1px solid #f2e0cb;
  background: linear-gradient(180deg, #fffdf8 0%, #fff7ec 100%);
  box-shadow: 0 14px 34px rgba(122, 93, 65, 0.16);
  padding: clamp(1.1rem, 4vw, 2rem);
  font-family: "Great Vibes", cursive;
  color: #67492f;
  font-size: clamp(1.55rem, 4.7vw, 2.25rem);
  line-height: 1.35;
}

.letter-paper p {
  margin: 0 0 0.8rem;
}

.letter-paper .sign {
  text-align: right;
  margin-top: 1.1rem;
}

.typewriter {
  visibility: hidden;
}

.ending-card h2 {
  margin-top: 0;
}

.text-animated {
  will-change: transform, opacity, filter;
}

.page-transition-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 34;
  opacity: 0;
  transform: scale(1.22);
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 216, 237, 0.95), rgba(255, 216, 237, 0) 42%),
    radial-gradient(circle at 82% 26%, rgba(171, 225, 255, 0.9), rgba(171, 225, 255, 0) 40%),
    linear-gradient(150deg, rgba(255, 241, 247, 0.95), rgba(242, 248, 255, 0.95), rgba(255, 246, 224, 0.95));
}

.page-transition-layer::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.95) 1px, transparent 1.3px),
    radial-gradient(circle, rgba(255, 188, 216, 0.85) 1.1px, transparent 1.8px),
    radial-gradient(circle, rgba(150, 217, 255, 0.8) 1.1px, transparent 1.8px);
  background-size: 22px 22px, 30px 30px, 36px 36px;
  background-position: 0 0, 8px 14px, 16px 4px;
  opacity: 0.58;
}

.page-transition-layer.enter {
  animation: pageReveal 0.72s cubic-bezier(0.25, 0.78, 0.2, 1) forwards;
}

.page-transition-layer.leave {
  animation: pageCover 0.64s cubic-bezier(0.3, 0.8, 0.3, 1) forwards;
}

@keyframes balloonFloat {
  0% {
    transform: translateY(102vh) rotate(-4deg);
    opacity: 0;
  }
  12% {
    opacity: 0.92;
  }
  100% {
    transform: translateY(-30vh) rotate(6deg);
    opacity: 0;
  }
}

@keyframes sparkle {
  0%,
  100% {
    transform: scale(0.5);
    opacity: 0.2;
  }
  50% {
    transform: scale(1.3);
    opacity: 1;
  }
}

@keyframes pageReveal {
  from {
    opacity: 0.95;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(1.3);
  }
}

@keyframes pageCover {
  from {
    opacity: 0;
    transform: scale(1.22);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 900px) {
  .page-shell {
    padding-top: 6.7rem;
  }

  .balloon-lane {
    width: 11vw;
    min-width: 52px;
  }
}

@media (max-width: 640px) {
  .page-shell {
    padding: 6.2rem 0.85rem 4.4rem;
  }

  .content-card {
    border-radius: 20px;
    padding: 1rem;
  }

  .music-toggle {
    right: 0.6rem;
    bottom: 0.6rem;
    padding: 0.6rem 0.82rem;
    font-size: 0.89rem;
  }

  .quiz-top {
    font-size: 0.9rem;
  }

  .bunting {
    top: 84px;
    left: 2%;
    right: 2%;
  }
}
