:root {
  --bg-color: #fdf2f8; /* Very light pink */
  --primary-color: #ec4899; /* Pink 500 */
  --secondary-color: #fca5a5; /* Red 300 */
  --accent-color: #fbbf24; /* Amber 400 */
  --text-color: #4b5563;
  --paper-color: #fff1f2;
  --font-heading: "Dancing Script", cursive;
  --font-body: "Outfit", sans-serif;
}

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

body {
  background: linear-gradient(135deg, #fff0f5 0%, #e6e6fa 100%);
  font-family: var(--font-body);
  color: var(--text-color);
  overflow-x: hidden;
  min-height: 100vh;
}

/* --- Envelope Animation --- */
.envelope-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 100;
  background: linear-gradient(135deg, #fce7f3 0%, #fae8ff 100%);
  transition: opacity 1s ease-out;
}

.envelope-wrapper.fade-out {
  opacity: 0;
  pointer-events: none;
}

.envelope {
  position: relative;
  width: 300px;
  height: 200px;
  background: #f472b6;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.5s ease;
}

.envelope:hover {
  transform: scale(1.05);
}

.flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-left: 150px solid transparent;
  border-right: 150px solid transparent;
  border-top: 100px solid #f687b3; /* Slightly lighter */
  transform-origin: top;
  transition: transform 0.6s ease 0.4s, z-index 0.2s;
  z-index: 5;
}

.envelope.open .flap {
  transform: rotateX(180deg);
  z-index: 1;
}

.pocket {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 0 0 10px 10px;
  background: #ec4899;
  clip-path: polygon(0 0, 50% 40%, 100% 0, 100% 100%, 0 100%);
  z-index: 4;
}

.letter {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 90%;
  height: 90%;
  background: white;
  transform: translateX(-50%);
  border-radius: 5px;
  transition: bottom 0.6s ease 1s, z-index 0.2s;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--primary-color);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.envelope.open .letter {
  bottom: 100px; /* Slide out */
  z-index: 6;
}

.wax-seal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  background: #ef4444;
  border-radius: 50%;
  z-index: 6;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-size: 1.2rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: opacity 0.4s ease;
}

.envelope.open .wax-seal {
  opacity: 0;
}

.instruction {
  margin-top: 50px;
  font-family: var(--font-body);
  color: var(--primary-color);
  animation: pulse 2s infinite;
}

/* --- Main Content --- */
.main-content {
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem;
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1s ease, transform 1s ease;
}

.main-content.visible {
  opacity: 1;
  transform: translateY(0);
}

.hidden {
  display: none;
}

.header {
  margin-bottom: 3rem;
}

.title {
  font-family: var(--font-heading);
  font-size: 4rem;
  color: var(--primary-color);
  text-shadow: 2px 2px 0px rgba(255, 182, 193, 0.5);
  margin-bottom: 0.5rem;
}

.subtitle {
  font-size: 1.5rem;
  color: var(--text-color);
  font-weight: 300;
}

/* --- Gallery --- */
.gallery {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 4rem;
}

.polaroid {
  background: white;
  padding: 15px 15px 40px 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  transform: rotate(var(--rotation));
  transition: transform 0.3s ease;
  width: 140px;
}

.polaroid:hover {
  transform: scale(1.1) rotate(0deg);
  z-index: 10;
}

.photo-placeholder {
  width: 100%;
  height: 110px;
  background: #ddd; /* Replace with real image */
  background-image: url("https://placehold.co/200x250/pink/white?text=Photo");
  background-size: cover;
}

.caption {
  font-family: var(--font-heading);
  color: var(--text-color);
  margin-top: 10px;
  font-size: 1.1rem;
}

/* --- Message Card --- */
.message-card {
  margin-bottom: 4rem;
  padding: 2rem;
  perspective: 1000px;
}

.paper-texture {
  background: #fff;
  padding: 2.5rem;
  border-radius: 5px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
  font-family: var(--font-body);
  line-height: 1.8;
  position: relative;
  border: 1px solid #fce7f3;
}

.paper-texture::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 20px;
  background: repeating-linear-gradient(
    -45deg,
    #fbcfe8,
    #fbcfe8 10px,
    #f9a8d4 10px,
    #f9a8d4 20px
  );
  border-radius: 5px 5px 0 0;
  opacity: 0.5;
}

.signature {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--primary-color);
  text-align: right;
  margin-top: 1rem;
}

/* --- Cake --- */
.cake-section {
  position: relative;
  margin-bottom: 4rem;
}

.cake-container {
  width: 200px;
  height: 200px;
  margin: 0 auto;
  position: relative;
}

.plate {
  width: 220px;
  height: 10px;
  background: #ddd;
  border-radius: 10px;
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
}

.layer {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 150px;
  height: 50px;
  border-radius: 10px;
  background: #fbcfe8; /* Light Pink */
}

.layer-bottom {
  bottom: 10px;
  width: 180px;
  background: #f9a8d4;
}
.layer-middle {
  bottom: 60px;
  width: 160px;
  background: #f472b6;
}
.layer-top {
  bottom: 110px;
  width: 140px;
  background: #ec4899;
}

.icing {
  position: absolute;
  bottom: 160px;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 15px;
  background: white;
  border-radius: 10px 10px 0 0;
}

.candle {
  position: absolute;
  bottom: 160px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 35px;
  background: linear-gradient(#bfdbfe, #3b82f6);
  z-index: 2;
}

.flame {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 18px;
  background: #fbbf24;
  border-radius: 50% 50% 20% 20%;
  box-shadow: 0 0 10px #fbbf24;
  animation: flicker 1s infinite alternate;
}

.flame.out {
  display: none;
}

.btn-wish {
  margin-top: 2rem;
  padding: 12px 30px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50px;
  font-family: var(--font-body);
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 5px 15px rgba(236, 72, 153, 0.4);
  transition: transform 0.2s;
}

.btn-wish:hover {
  transform: scale(1.05);
}

/* Music Control */
.music-control {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 50;
}

.music-control button {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: white;
  border: none;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  color: var(--primary-color);
  font-size: 1.2rem;
  cursor: pointer;
}

/* Animations */
@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.1);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0.8;
  }
}

@keyframes flicker {
  0% {
    transform: translateX(-50%) rotate(-2deg);
    opacity: 0.9;
  }
  100% {
    transform: translateX(-50%) rotate(2deg);
    opacity: 1;
  }
}

#confetti {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 200;
}

/* Shake Section */
.shake-section {
    margin-top: 3rem;
    margin-bottom: 2rem;
    text-align: center;
    animation: fadeIn 1s ease;
}

.shake-icon {
    font-size: 4rem;
    display: inline-block;
    margin-bottom: 1rem;
    cursor: pointer;
    animation: shake-animation 2s infinite;
}

@keyframes shake-animation {
    0% { transform: rotate(0deg); }
    10% { transform: rotate(-10deg); }
    20% { transform: rotate(10deg); }
    30% { transform: rotate(-10deg); }
    40% { transform: rotate(10deg); }
    50% { transform: rotate(0deg); }
    100% { transform: rotate(0deg); }
}

/* Gift Overlay */
.gift-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 300;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.gift-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.gift-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    max-width: 90%;
    width: 300px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.gift-overlay.visible .gift-card {
    transform: scale(1);
}

.gift-box {
    font-size: 5rem;
    margin: 1rem 0;
    animation: bounce 2s infinite;
}

.btn-claim {
    display: inline-block;
    padding: 10px 25px;
    background: #10b981; /* Emerald 500 */
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-family: var(--font-body);
    font-weight: 500;
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.4);
    transition: transform 0.2s;
}

.btn-claim:hover {
    transform: scale(1.05);
}

.btn-close {
    display: block;
    margin: 1rem auto 0;
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    text-decoration: underline;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
