/* ==========================================================================
   Gian Duri's Super-Happy Jolly Shiny Colorful Unicorn Land Stylesheet
   ========================================================================== */

:root {
  --primary-pink: #FF69B4;
  --secondary-purple: #9370DB;
  --bright-yellow: #FFD700;
  --cyan-sky: #00FFFF;
  --cotton-candy: #FFB6C1;
  --soft-lavender: #E6E6FA;
  --dark-indigo: #2E0854;
  --rainbow-gradient: linear-gradient(
    90deg, 
    #ff007f, #ff7f00, #ffec00, #00ff7f, #00bfff, #7f00ff, #ff007f
  );
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.9);
  --shadow-glow: 0 15px 35px rgba(255, 105, 180, 0.35);
  --font-main: 'Fredoka', 'Quicksand', sans-serif;
  --font-title: 'Pacifico', cursive;
}

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

body {
  font-family: var(--font-main);
  background: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 30%, #fbc2eb 70%, #a6c1ee 100%);
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--dark-indigo);
  position: relative;
}

/* Canvases */
#particleCanvas, #magicWandCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 10;
}
#magicWandCanvas {
  z-index: 99;
}

/* Background Sky & Animations */
.sky-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.rainbow-arc {
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 140vw;
  height: 700px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 50% 100%,
    transparent 55%,
    rgba(255, 0, 128, 0.25) 58%,
    rgba(255, 165, 0, 0.25) 61%,
    rgba(255, 255, 0, 0.25) 64%,
    rgba(0, 255, 128, 0.25) 67%,
    rgba(0, 191, 255, 0.25) 70%,
    rgba(138, 43, 226, 0.25) 73%,
    transparent 76%
  );
  animation: rainbowGlow 8s ease-in-out infinite alternate;
}

@keyframes rainbowGlow {
  0% { transform: translateX(-50%) scale(1); filter: hue-rotate(0deg); }
  100% { transform: translateX(-50%) scale(1.05); filter: hue-rotate(360deg); }
}

.sun-sparkle {
  position: absolute;
  top: 30px;
  right: 50px;
  font-size: 4rem;
  animation: spinSun 20s linear infinite, pulse 3s ease-in-out infinite;
}

@keyframes spinSun {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.cloud {
  position: absolute;
  font-size: 3.5rem;
  opacity: 0.85;
  animation: floatCloud 25s linear infinite;
  filter: drop-shadow(0 10px 15px rgba(255,255,255,0.8));
}

.cloud-1 { top: 10%; left: -100px; animation-duration: 22s; }
.cloud-2 { top: 35%; left: -120px; animation-duration: 28s; animation-delay: 5s; }
.cloud-3 { top: 65%; left: -80px; animation-duration: 24s; animation-delay: 10s; }

@keyframes floatCloud {
  0% { transform: translateX(0); }
  100% { transform: translateX(115vw); }
}

.floating-stars .star {
  position: absolute;
  font-size: 2rem;
  animation: floatStar 4s ease-in-out infinite alternate;
}
.s1 { top: 15%; left: 15%; animation-delay: 0s; }
.s2 { top: 25%; right: 20%; animation-delay: 1s; }
.s3 { top: 70%; left: 10%; animation-delay: 2s; }
.s4 { top: 80%; right: 15%; animation-delay: 1.5s; }
.s5 { top: 45%; left: 5%; animation-delay: 0.5s; }

@keyframes floatStar {
  0% { transform: translateY(0) scale(0.8) rotate(0deg); opacity: 0.6; }
  100% { transform: translateY(-20px) scale(1.2) rotate(20deg); opacity: 1; }
}

/* Top Audio Bar */
.audio-controls {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
  display: flex;
  gap: 12px;
}

.pill-btn {
  background: linear-gradient(135deg, #FF69B4, #9370DB);
  color: white;
  border: 3px solid #FFF;
  border-radius: 50px;
  padding: 10px 22px;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(147, 112, 219, 0.4);
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pill-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 25px rgba(255, 105, 180, 0.6);
  background: linear-gradient(135deg, #FF1493, #8A2BE2);
}

.pill-btn:active {
  transform: translateY(1px) scale(0.98);
}

/* Main Container */
.main-container {
  position: relative;
  z-index: 5;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 30px 15px;
}

/* Envelope Section */
.envelope-wrapper {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 25px;
  cursor: pointer;
}

.envelope {
  width: 340px;
  height: 230px;
  background: #FFF;
  border-radius: 16px;
  position: relative;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 0 30px rgba(255, 105, 180, 0.4);
  perspective: 1000px;
  transition: transform 0.3s ease;
}

.envelope:hover {
  transform: translateY(-5px) scale(1.02);
}

.envelope-back {
  position: absolute;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #ffc0cb, #e6e6fa);
  border-radius: 16px;
}

.envelope-paper {
  position: absolute;
  top: 15px;
  left: 20px;
  right: 20px;
  height: 190px;
  background: #FFF9FC;
  border-radius: 12px;
  padding: 20px;
  border: 2px dashed #FF69B4;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 10px rgba(255, 182, 193, 0.3);
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.envelope-teaser {
  font-size: 1.3rem;
  color: var(--dark-indigo);
  font-weight: 700;
}

.envelope-front {
  position: absolute;
  bottom: 0;
  width: 0;
  height: 0;
  border-left: 170px solid #FFB6C1;
  border-right: 170px solid #FFB6C1;
  border-top: 115px solid transparent;
  border-bottom: 115px solid #FF99AA;
  border-radius: 0 0 16px 16px;
  z-index: 3;
}

.envelope-top {
  position: absolute;
  top: 0;
  width: 0;
  height: 0;
  border-left: 170px solid transparent;
  border-right: 170px solid transparent;
  border-top: 125px solid #FF8099;
  transform-origin: top;
  transition: transform 0.6s ease;
  z-index: 4;
}

.seal-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90px;
  height: 90px;
  background: linear-gradient(135deg, #FFD700, #FF69B4);
  border: 4px solid white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  box-shadow: 0 8px 20px rgba(255, 215, 0, 0.6);
  animation: pulseSeal 2s infinite alternate;
}

@keyframes pulseSeal {
  0% { transform: translate(-50%, -50%) scale(1); }
  100% { transform: translate(-50%, -50%) scale(1.1); box-shadow: 0 12px 30px rgba(255, 105, 180, 0.8); }
}

.seal-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.seal-unicorn { font-size: 2rem; }
.seal-text { font-size: 0.65rem; font-weight: 700; color: white; margin-top: -2px; }

.tap-hint {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--dark-indigo);
  background: white;
  padding: 8px 20px;
  border-radius: 30px;
  box-shadow: 0 6px 15px rgba(0,0,0,0.1);
  animation: bounceHint 1.5s infinite alternate;
}

@keyframes bounceHint {
  from { transform: translateY(0); }
  to { transform: translateY(-8px); }
}

/* Card View Container */
.card-container {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 25px;
  animation: fadeInPop 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes fadeInPop {
  0% { opacity: 0; transform: scale(0.8) translateY(40px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.hidden {
  display: none !important;
}

/* Header */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: center;
}

.unicorn-svg {
  width: 80px;
  height: 80px;
  filter: drop-shadow(0 6px 10px rgba(255, 105, 180, 0.4));
  animation: floatUnicorn 3s ease-in-out infinite alternate;
}
.mirror { transform: scaleX(-1); }

@keyframes floatUnicorn {
  0% { transform: translateY(0) rotate(-5deg); }
  100% { transform: translateY(-12px) rotate(5deg); }
}

.title-wrap {
  flex: 1;
  padding: 0 10px;
}

.badge-tag {
  background: var(--rainbow-gradient);
  background-size: 200% auto;
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 1.5px;
  padding: 6px 16px;
  border-radius: 20px;
  display: inline-block;
  margin-bottom: 10px;
  animation: rainbowShift 4s linear infinite;
  box-shadow: 0 4px 10px rgba(255, 105, 180, 0.3);
}

@keyframes rainbowShift {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.main-title {
  font-family: var(--font-title);
  font-size: 2.8rem;
  line-height: 1.2;
  color: #4A0E4E;
  text-shadow: 3px 3px 0px #FFF, 6px 6px 0px rgba(255, 105, 180, 0.3);
}

.name-highlight {
  background: linear-gradient(120deg, #FF1493, #8A2BE2, #00BFFF);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 3.4rem;
}

/* Wish Card Main Box */
.wish-card {
  position: relative;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 4px solid var(--glass-border);
  border-radius: 32px;
  padding: 35px 30px;
  box-shadow: var(--shadow-glow);
}

.card-glow {
  position: absolute;
  top: -10px; left: -10px; right: -10px; bottom: -10px;
  background: var(--rainbow-gradient);
  border-radius: 40px;
  z-index: -1;
  opacity: 0.4;
  filter: blur(15px);
  animation: rainbowShift 6s linear infinite;
}

.card-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.sparkle-decoration {
  position: absolute;
  font-size: 2rem;
  animation: spinSparkle 3s linear infinite;
}
.top-left { top: -15px; left: -10px; }
.top-right { top: -15px; right: -10px; }

@keyframes spinSparkle {
  0% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.3) rotate(180deg); }
  100% { transform: scale(1) rotate(360deg); }
}

.swiss-headline {
  text-align: center;
  font-size: 1.7rem;
  color: #6A1B9A;
  font-weight: 700;
}

.swiss-message {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.lead-text {
  font-size: 1.3rem;
  line-height: 1.5;
}

.body-text {
  font-size: 1.15rem;
  line-height: 1.5;
  color: #333;
}

.quote-box {
  background: linear-gradient(135deg, rgba(255, 240, 245, 0.9), rgba(230, 230, 250, 0.9));
  border-left: 6px solid var(--primary-pink);
  padding: 16px 20px;
  border-radius: 12px;
  font-size: 1.2rem;
  font-weight: 700;
  color: #4A0E4E;
  margin-top: 5px;
}

/* Cake Section */
.cake-section {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 24px;
  padding: 25px;
  text-align: center;
  border: 2px solid #FFD1DC;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.section-subtitle {
  font-size: 1.4rem;
  color: #8E24AA;
  margin-bottom: 5px;
}

.cake-instruction {
  font-size: 0.95rem;
  color: #666;
  margin-bottom: 20px;
}

.cake-container {
  position: relative;
  width: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 15px;
  cursor: pointer;
}

.candles-row {
  display: flex;
  gap: 18px;
  z-index: 3;
  margin-bottom: -5px;
}

.candle {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  cursor: pointer;
}

.stick {
  width: 10px;
  height: 35px;
  background: repeating-linear-gradient(
    45deg,
    #FF69B4,
    #FF69B4 6px,
    #FFF 6px,
    #FFF 12px
  );
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.flame {
  width: 14px;
  height: 20px;
  background: radial-gradient(ellipse at bottom, #FFF, #FFD700 40%, #FF4500 80%);
  border-radius: 50% 50% 35% 35%;
  box-shadow: 0 0 12px #FFD700, 0 0 20px #FF4500;
  animation: flicker 0.6s ease-in-out infinite alternate;
  transform-origin: bottom center;
}

@keyframes flicker {
  0% { transform: scale(1) rotate(-3deg); }
  100% { transform: scale(1.15) rotate(3deg); }
}

.candle.extinguished .flame {
  display: none;
}

.candle.extinguished::after {
  content: '💨';
  font-size: 0.9rem;
  position: absolute;
  top: -15px;
  animation: puffSmoke 0.8s ease-out forwards;
}

@keyframes puffSmoke {
  0% { opacity: 1; transform: translateY(0) scale(0.6); }
  100% { opacity: 0; transform: translateY(-20px) scale(1.3); }
}

.cake-top-layer {
  width: 160px;
  height: 45px;
  background: #FFB6C1;
  border-radius: 15px 15px 5px 5px;
  position: relative;
  z-index: 2;
  box-shadow: inset 0 5px 0 rgba(255,255,255,0.4);
}

.icing {
  position: absolute;
  top: 0;
  width: 100%;
  height: 18px;
  background: #FFF;
  border-radius: 15px 15px 10px 10px;
}

.sprinkles {
  display: flex;
  justify-content: space-around;
  padding-top: 18px;
  font-size: 0.8rem;
}

.cake-middle-layer {
  width: 190px;
  height: 45px;
  background: #9370DB;
  border-radius: 8px;
  z-index: 1;
  margin-top: -5px;
  box-shadow: inset 0 5px 0 rgba(255,255,255,0.3);
}

.cake-bottom-layer {
  width: 220px;
  height: 50px;
  background: #FFD700;
  border-radius: 8px 8px 15px 15px;
  margin-top: -5px;
  box-shadow: inset 0 5px 0 rgba(255,255,255,0.4);
}

.cake-plate {
  width: 250px;
  height: 14px;
  background: #E0E0E0;
  border-radius: 10px;
  margin-top: -4px;
  box-shadow: 0 6px 15px rgba(0,0,0,0.15);
}

.wish-outcome {
  font-size: 1.2rem;
  color: #2E0854;
  background: #E8F5E9;
  border: 2px solid #81C784;
  padding: 12px 20px;
  border-radius: 15px;
  margin-top: 10px;
  animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.mini-btn {
  font-size: 0.85rem;
  padding: 6px 16px;
  margin-top: 10px;
  background: #FF9800;
}

/* Generator Section */
.magic-generator-section {
  background: linear-gradient(135deg, rgba(255,235,245,0.8), rgba(230,240,255,0.8));
  border-radius: 24px;
  padding: 25px;
  text-align: center;
  border: 2px dashed #BA68C8;
}

.generator-desc {
  font-size: 1rem;
  margin-bottom: 15px;
}

.oracle-box {
  background: white;
  border-radius: 20px;
  padding: 20px;
  box-shadow: inset 0 0 15px rgba(186, 104, 200, 0.2), 0 8px 20px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  min-height: 110px;
  justify-content: center;
  transition: transform 0.3s ease;
}

.oracle-emoji {
  font-size: 2.5rem;
}

.oracle-text {
  font-size: 1.2rem;
  font-weight: 700;
  color: #4A148C;
}

.draw-btn {
  background: linear-gradient(135deg, #AB47BC, #7E57C2);
  width: 100%;
  max-width: 320px;
  justify-content: center;
}

/* QR Code Section */
.qr-section {
  background: rgba(255, 255, 255, 0.85);
  border-radius: 24px;
  padding: 22px;
  text-align: center;
  border: 2px solid #E1BEE7;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.qr-desc {
  font-size: 0.95rem;
  color: #555;
  margin-bottom: 15px;
}

.qr-wrapper {
  display: flex;
  align-items: center;
  gap: 20px;
  background: #FFF9FC;
  padding: 16px 24px;
  border-radius: 20px;
  border: 2px dashed #FF69B4;
  box-shadow: 0 6px 15px rgba(255, 105, 180, 0.15);
  flex-wrap: wrap;
  justify-content: center;
}

.qr-image {
  width: 140px;
  height: 140px;
  border-radius: 12px;
  border: 3px solid white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.qr-image:hover {
  transform: scale(1.05);
}

.qr-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.qr-url {
  font-size: 1.15rem;
  font-weight: 700;
  color: #4A0E4E;
  background: #F3E5F5;
  padding: 6px 14px;
  border-radius: 8px;
}

.copy-btn {
  background: linear-gradient(135deg, #FF69B4, #9370DB);
  font-size: 0.85rem;
  padding: 6px 14px;
}

.copy-feedback {
  font-size: 0.85rem;
  font-weight: 700;
  color: #2E7D32;
  animation: popIn 0.3s ease;
}

/* Action Buttons Row */
.action-buttons-row {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

.confetti-btn {
  background: linear-gradient(135deg, #FF4081, #FF9100);
}

.song-btn {
  background: linear-gradient(135deg, #00E676, #00B0FF);
}

/* Footer */
.card-footer {
  text-align: center;
  color: var(--dark-indigo);
  font-size: 1rem;
  padding-top: 10px;
}

.sub-text {
  font-size: 0.85rem;
  opacity: 0.85;
  margin-top: 4px;
}

.footer-link {
  color: #8E24AA;
  font-weight: 700;
  text-decoration: none;
}
.footer-link:hover {
  text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .main-title { font-size: 2.1rem; }
  .name-highlight { font-size: 2.5rem; }
  .wish-card { padding: 22px 16px; }
  .bouncing-unicorn-left, .bouncing-unicorn-right { display: none; }
  .action-buttons-row { flex-direction: column; }
  .pill-btn { width: 100%; justify-content: center; }
  .audio-controls { top: 10px; right: 10px; flex-direction: column; gap: 6px; }
  .qr-wrapper { flex-direction: column; text-align: center; }
  .qr-info { align-items: center; }
}
