html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background: linear-gradient(180deg, #e9d5ff 0%, #f3e8ff 100%);
}

:root {
  --font-size-multiplier: 1;
}

.rock-salt {
  font-family: 'Rock Salt', cursive;
  font-weight: 400;
  font-style: normal;
}

.great-vibes {
  font-family: 'Great Vibes', cursive;
  font-weight: 500;
}

/* Background floating bubbles styling */
.bg-decor {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bubble {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  animation: floatBG infinite linear;
}

/* Multi-colored glowing bubble layers */
.bubble:nth-child(3n+1) {
  background: radial-gradient(circle, rgba(168, 85, 247, 0.28) 0%, rgba(168, 85, 247, 0) 70%);
}
.bubble:nth-child(3n+2) {
  background: radial-gradient(circle, rgba(245, 158, 11, 0.24) 0%, rgba(245, 158, 11, 0) 70%);
}
.bubble:nth-child(3n+3) {
  background: radial-gradient(circle, rgba(236, 72, 153, 0.24) 0%, rgba(236, 72, 153, 0) 70%);
}

@keyframes floatBG {
  0% {
    transform: translateY(105vh) scale(0.8) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.85;
  }
  90% {
    opacity: 0.85;
  }
  100% {
    transform: translateY(-15vh) scale(1.3) rotate(360deg);
    opacity: 0;
  }
}

/* Scrollbar customization for the inner card contents */
.custom-scrollbar::-webkit-scrollbar {
  width: 5px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.02);
  border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(180, 83, 9, 0.25);
  border-radius: 4px;
  transition: background 0.3s;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgba(180, 83, 9, 0.5);
}

/* Card layout transitions */
#card-wrapper {
  position: relative;
  width: 92vw;
  height: 128vw;
  max-height: 88dvh;
  max-width: calc(88dvh / 1.4);
}

@media (min-width: 640px) {
  #card-wrapper {
    height: min(88dvh, 900px);
    width: calc(min(88dvh, 900px) / 1.4);
  }
}

#card-cover {
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 40px rgba(180, 83, 9, 0.05);
  transform: translateY(0) rotate(0deg);
  opacity: 1;
  transition: transform 1s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.8s ease-in-out, visibility 1s;
}

#card-content {
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transform: scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.9s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.9s ease-in-out;
}

/* State when opened */
#card-wrapper.opened #card-cover {
  transform: translateY(-115%) rotate(-5deg);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

#card-wrapper.opened #card-content {
  transform: scale(1);
  opacity: 1;
  pointer-events: auto;
}

/* Poem animation and text scaling */
.poem-line {
  opacity: 0;
  transform: translateY(15px);
  font-size: calc(1.02rem * var(--font-size-multiplier));
  line-height: 2;
  transition: font-size 0.2s ease;
}

h1.poem-line {
  font-size: calc(1.6rem * var(--font-size-multiplier));
  line-height: 1.4;
}

.poem-line .great-vibes {
  font-size: 1.35em;
}

@media (min-width: 768px) {
  .poem-line {
    font-size: calc(1.35rem * var(--font-size-multiplier));
    line-height: 2.2;
  }
  
  h1.poem-line {
    font-size: calc(2.4rem * var(--font-size-multiplier));
    line-height: 1.4;
  }
}

@media (min-width: 1024px) {
  .poem-line {
    font-size: calc(1.65rem * var(--font-size-multiplier));
    line-height: 2.3;
  }
  
  h1.poem-line {
    font-size: calc(3rem * var(--font-size-multiplier));
    line-height: 1.4;
  }
}

#card-wrapper.opened .poem-line {
  animation: fadeInUp 0.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

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

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  #card-cover, #card-content {
    transition-duration: 0.3s !important;
  }
  #card-wrapper.opened #card-cover {
    transform: none;
    opacity: 0;
  }
  #card-wrapper.opened #card-content {
    transform: none;
    opacity: 1;
  }
  .poem-line {
    opacity: 1;
    transform: none;
    animation: none !important;
  }
  .bubble {
    display: none !important;
  }
}

/* --- Micro-interactions --- */

/* 1. Proper Hot Tea Steam Effect */
.hover-tea {
  position: relative;
  cursor: pointer;
  display: inline-block;
}

.steam-line {
  position: absolute;
  bottom: 95%;
  width: 2px;
  height: 15px;
  background: linear-gradient(to top, rgba(180, 83, 9, 0.45), rgba(180, 83, 9, 0));
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

.steam-line.line-1 { left: 20%; }
.steam-line.line-2 { left: 50%; }
.steam-line.line-3 { left: 80%; }

.hover-tea:hover .steam-line {
  animation: steamRise 1.6s ease-in-out infinite;
}
.hover-tea:hover .steam-line.line-1 { animation-delay: 0.1s; }
.hover-tea:hover .steam-line.line-2 { animation-delay: 0.5s; }
.hover-tea:hover .steam-line.line-3 { animation-delay: 0.9s; }

@keyframes steamRise {
  0% {
    transform: translateY(0) scaleX(1) skewX(0deg);
    opacity: 0;
  }
  20% {
    opacity: 0.6;
  }
  60% {
    transform: translateY(-15px) scaleX(1.8) skewX(10deg);
    opacity: 0.3;
  }
  100% {
    transform: translateY(-28px) scaleX(0.5) skewX(-10deg);
    opacity: 0;
  }
}

/* 2. Marvelous Run Sparkle Effect */
.hover-sparkle {
  position: relative;
  cursor: pointer;
  display: inline-block;
}

.sparkle {
  position: absolute;
  color: #d97706;
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  line-height: 1;
}

.sparkle.s-1 { top: -6px; left: 15%; }
.sparkle.s-2 { top: -12px; left: 50%; }
.sparkle.s-3 { top: -6px; left: 85%; }

.hover-sparkle:hover .sparkle {
  animation: sparkleFloat 1.4s ease-in-out infinite;
}
.hover-sparkle:hover .sparkle.s-1 { animation-delay: 0s; }
.hover-sparkle:hover .sparkle.s-2 { animation-delay: 0.4s; }
.hover-sparkle:hover .sparkle.s-3 { animation-delay: 0.8s; }

@keyframes sparkleFloat {
  0% {
    transform: scale(0) rotate(0deg);
    opacity: 0;
  }
  40% {
    transform: scale(1.3) rotate(90deg);
    opacity: 0.95;
  }
  80% {
    transform: scale(0.8) translateY(-12px) rotate(180deg);
    opacity: 0.4;
  }
  100% {
    transform: scale(0) translateY(-18px) rotate(270deg);
    opacity: 0;
  }
}

/* 3. Wonderful Years Glow Effect */
.hover-glow {
  transition: all 0.35s cubic-bezier(0.25, 1, 0.5, 1);
  cursor: pointer;
  display: inline-block;
}

.hover-glow:hover {
  text-shadow: 0 0 10px rgba(217, 119, 6, 0.7), 0 0 20px rgba(217, 119, 6, 0.3);
  transform: scale(1.05);
  color: #b45309;
}

/* 4. Wondergirl Heart Pop Effect */
.hover-pulse-text {
  position: relative;
  cursor: pointer;
  display: inline-block;
}

.heart-pulse {
  position: absolute;
  font-size: 14px;
  top: -14px;
  left: 50%;
  transform: translateX(-50%) scale(0);
  opacity: 0;
  pointer-events: none;
}

.hover-pulse-text:hover .heart-pulse {
  animation: heartPop 1.3s ease-in-out infinite;
}

@keyframes heartPop {
  0% {
    transform: translateX(-50%) scale(0) translateY(0);
    opacity: 0;
  }
  30% {
    transform: translateX(-50%) scale(1.5) translateY(-5px);
    opacity: 1;
  }
  80% {
    transform: translateX(-50%) scale(1.1) translateY(-18px);
    opacity: 0.4;
  }
  100% {
    transform: translateX(-50%) scale(0.6) translateY(-25px);
    opacity: 0;
  }
}

/* Custom filters for coloring external SVGs */
.heart-filter-white {
  filter: brightness(0) invert(1);
}
.heart-filter-gold {
  filter: invert(53%) sepia(93%) saturate(1251%) hue-rotate(5deg) brightness(96%) contrast(97%);
}
.heart-filter-pink {
  filter: invert(51%) sepia(84%) saturate(2135%) hue-rotate(318deg) brightness(97%) contrast(96%);
}
