/* --- PREMIUM DESIGN VARIABLES --- */
:root {
  --color-gold: #e8c050;
  --color-gold-light: #fef1b8;
  --color-green-dark: #051a12;
  --color-green: #0a2e21;
  --color-white: #ffffff;
  
  --glass-bg: rgba(19, 38, 72, 0.005);
  --glass-border: rgba(232, 192, 80, 0.3);
  --glass-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  
  --font-heading: 'Playfair Display', serif;
  --font-body: 'Outfit', sans-serif;
}

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

body {
  font-family: var(--font-body);
  background:
    radial-gradient(circle at 18% 22%, rgba(124, 92, 255, 0.20), transparent 58%),
    radial-gradient(circle at 78% 72%, rgba(255, 99, 199, 0.10), transparent 55%),
    radial-gradient(circle at 62% 28%, rgba(58, 168, 255, 0.12), transparent 58%),
    radial-gradient(circle at 50% 115%, rgba(0, 0, 0, 0.70), transparent 55%),
    linear-gradient(180deg, #05071c 0%, #01010a 100%);
  color: var(--color-white);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  margin: 0;
}

/* Islamic Geometric Background Pattern */
body::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.85) 1px, transparent 1.6px),
    radial-gradient(circle, rgba(255, 255, 255, 0.55) 1px, transparent 1.7px),
    radial-gradient(circle, rgba(255, 255, 255, 0.35) 1px, transparent 1.8px);
  background-size: 180px 180px, 280px 280px, 420px 420px;
  background-position: 0 0, 60px 120px, 140px 40px;
  opacity: 0.28;
  z-index: -1;
  pointer-events: none;
}

body::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    conic-gradient(from 220deg at 50% 42%, rgba(58, 168, 255, 0.14), transparent 38%, rgba(255, 99, 199, 0.10), transparent 72%, rgba(124, 92, 255, 0.10)),
    radial-gradient(circle at 52% 12%, rgba(255, 255, 255, 0.06), transparent 52%),
    radial-gradient(circle at 20% 85%, rgba(58, 168, 255, 0.10), transparent 58%);
  opacity: 0.85;
  mix-blend-mode: overlay;
  filter: blur(1px);
  z-index: -1;
  pointer-events: none;
}

.hidden {
  display: none !important;
  opacity: 0;
  pointer-events: none;
}

.screen {
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: clamp(12px, 3vw, 20px);
  transition: opacity 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: absolute;
  inset: 0;
}

/* --- WELCOME SCREEN --- */
#welcome-screen {
  z-index: 99;
  background:
    radial-gradient(circle at 18% 22%, rgba(124, 92, 255, 0.22), transparent 58%),
    radial-gradient(circle at 78% 72%, rgba(255, 99, 199, 0.10), transparent 55%),
    linear-gradient(180deg, #070a26 0%, #01010a 100%);
}

.envelope-container-3d {
  text-align: center;
  padding: 34px 26px;
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  background: transparent;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 30px 60px rgba(0,0,0,0.6), inset 0 0 20px rgba(232, 192, 80, 0.1);
  transform-style: preserve-3d;
  animation: float-pulse 4s ease-in-out infinite;
  max-width: 360px;
  width: 100%;
  position: relative;
  overflow: hidden;
  z-index: 2;
}

.envelope-container-3d::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 22% 16%, rgba(255, 255, 255, 0.18), transparent 55%),
    radial-gradient(circle at 85% 28%, rgba(255, 255, 255, 0.10), transparent 48%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.02) 40%, rgba(255, 255, 255, 0.00));
  opacity: 1;
  pointer-events: none;
  z-index: 0;
}

.envelope-container-3d::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 32%, rgba(0, 0, 0, 0.22));
  opacity: 0.7;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 0;
}

.envelope-container-3d > * {
  position: relative;
  z-index: 1;
}

.envelope-container-3d h1 {
  font-family: var(--font-heading);
  font-size: 2.35rem;
  color: var(--color-gold);
  margin-bottom: 5px;
  text-shadow: 0 4px 15px rgba(0,0,0,0.8);
  transform: translateZ(30px);
}

.envelope-container-3d p {
  color: var(--color-gold-light);
  font-size: 1.05rem;
  margin-bottom: 24px;
  letter-spacing: 1px;
  transform: translateZ(20px);
}

.glow-btn {
  background: linear-gradient(135deg, var(--color-gold), #b8860b);
  color: var(--color-green-dark);
  border: none;
  padding: 18px 40px;
  font-size: 1.2rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-body);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 10px 30px rgba(232, 192, 80, 0.4);
  transform: translateZ(40px);
}

.glow-btn:hover {
  transform: translateY(-5px) translateZ(50px) scale(1.05);
  box-shadow: 0 15px 40px rgba(232, 192, 80, 0.6);
}

/* --- 3D DECORATIONS --- */
.scene-3d {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  perspective: 1000px;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.welcome-scene {
  z-index: 0;
}

.welcome-scene .star-1 {
  --star-size: 70px;
  top: 10%;
  right: 18%;
}

.welcome-scene .star-2 {
  --star-size: 54px;
  top: 18%;
  left: 72%;
}

.welcome-scene .star-4 {
  --star-size: 44px;
  top: 34%;
  left: 16%;
}

.welcome-scene .moon-1 {
  width: 120px;
  height: 120px;
  top: 16%;
  left: 10%;
  animation: moon-float-welcome 10s ease-in-out infinite alternate;
}

.flare {
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  pointer-events: none;
  transform: translateZ(-220px);
  mix-blend-mode: screen;
  opacity: 0.7;
  filter: blur(0.2px);
}

.flare-1 {
  top: -18%;
  left: -10%;
  background:
    radial-gradient(circle at 30% 32%, rgba(255, 255, 255, 0.25), transparent 55%),
    radial-gradient(circle at 55% 52%, rgba(124, 92, 255, 0.20), transparent 62%),
    radial-gradient(circle at 42% 40%, rgba(58, 168, 255, 0.16), transparent 62%),
    conic-gradient(from 200deg, rgba(255, 255, 255, 0.10), transparent 40%, rgba(255, 99, 199, 0.08), transparent 72%, rgba(58, 168, 255, 0.10));
  animation: flare-pulse 7s ease-in-out infinite;
}

.flare-2 {
  bottom: -26%;
  right: -18%;
  width: 520px;
  height: 520px;
  background:
    radial-gradient(circle at 58% 46%, rgba(255, 255, 255, 0.20), transparent 58%),
    radial-gradient(circle at 40% 55%, rgba(255, 99, 199, 0.12), transparent 62%),
    conic-gradient(from 20deg, rgba(255, 255, 255, 0.08), transparent 42%, rgba(124, 92, 255, 0.08), transparent 70%, rgba(58, 168, 255, 0.08));
  opacity: 0.55;
  animation: flare-pulse 9s ease-in-out infinite reverse;
}

.flare-main-1 {
  top: -22%;
  right: -18%;
  width: 560px;
  height: 560px;
  opacity: 0.45;
  background:
    radial-gradient(circle at 38% 34%, rgba(255, 255, 255, 0.18), transparent 58%),
    radial-gradient(circle at 62% 56%, rgba(58, 168, 255, 0.14), transparent 62%),
    conic-gradient(from 120deg, rgba(255, 255, 255, 0.08), transparent 42%, rgba(124, 92, 255, 0.08), transparent 70%, rgba(255, 99, 199, 0.06));
  animation: flare-pulse 8s ease-in-out infinite;
}

.flare-main-2 {
  bottom: -34%;
  left: -22%;
  width: 620px;
  height: 620px;
  opacity: 0.35;
  background:
    radial-gradient(circle at 52% 48%, rgba(255, 255, 255, 0.16), transparent 60%),
    radial-gradient(circle at 42% 62%, rgba(255, 99, 199, 0.10), transparent 62%),
    conic-gradient(from 340deg, rgba(255, 255, 255, 0.07), transparent 44%, rgba(58, 168, 255, 0.07), transparent 72%, rgba(124, 92, 255, 0.06));
  animation: flare-pulse 11s ease-in-out infinite reverse;
}

.scene-3d::before {
  content: "";
  position: absolute;
  inset: -20%;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.92) 1px, transparent 1.7px),
    radial-gradient(circle, rgba(255, 255, 255, 0.55) 1px, transparent 1.8px),
    radial-gradient(circle, rgba(255, 255, 255, 0.35) 1px, transparent 1.9px);
  background-size: 160px 160px, 260px 260px, 420px 420px;
  background-position: 20px 10px, 140px 120px, 80px 200px;
  opacity: 0.55;
  transform: translateZ(-280px);
  animation: twinkle 7s ease-in-out infinite alternate;
}

.scene-3d::after {
  content: "";
  position: absolute;
  inset: -40%;
  background:
    radial-gradient(circle at 22% 28%, rgba(124, 92, 255, 0.22), transparent 52%),
    radial-gradient(circle at 78% 70%, rgba(255, 99, 199, 0.14), transparent 55%),
    radial-gradient(circle at 55% 38%, rgba(58, 168, 255, 0.14), transparent 55%),
    radial-gradient(circle at 45% 80%, rgba(0, 0, 0, 0.55), transparent 55%);
  opacity: 0.7;
  transform: translateZ(-240px);
}

.shape-3d {
  position: absolute;
  transform-style: preserve-3d;
}

/* Positioning & Animation rules */
.star-1 {
  --star-size: 92px;
  top: 18%;
  right: 10%;
  animation: rotate-3d-slow 26s linear infinite reverse;
}
.star-2 {
  --star-size: 64px;
  top: 10%;
  left: 70%;
  animation: rotate-3d-slow 22s linear infinite;
}
.star-3 {
  --star-size: 76px;
  top: 26%;
  left: 8%;
  animation: rotate-3d-slow 28s linear infinite reverse;
}

.star-4 {
  --star-size: 52px;
  top: 36%;
  left: 22%;
  animation: rotate-3d-slow 18s linear infinite;
}

.moon-1 {
  top: 12%;
  left: 8%;
  width: 150px;
  height: 150px;
  animation: moon-float 9s ease-in-out infinite alternate;
}

.cloud-1 {
  top: 16%;
  left: 18%;
  animation: cloud-drift-1 22s linear infinite;
}

.cloud-2 {
  top: 30%;
  left: 52%;
  opacity: 0.85;
  animation: cloud-drift-2 28s linear infinite reverse;
}

.moon-2 {
  top: 74%;
  left: 78%;
  width: 130px;
  height: 130px;
  animation: moon-float 10s ease-in-out infinite alternate;
  opacity: 0.92;
  transform: translateZ(-90px) rotateZ(10deg);
}

.moon {
  position: absolute;
  transform-style: preserve-3d;
  filter: drop-shadow(0 28px 40px rgba(0, 0, 0, 0.55));
}

.moon-sphere {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 28% 26%, rgba(255, 255, 255, 0.42), transparent 46%),
    radial-gradient(circle at 60% 70%, rgba(0, 0, 0, 0.35), transparent 52%),
    radial-gradient(circle at 45% 40%, #f2f6ff, #bfc9dd 55%, #9099b1);
  box-shadow:
    inset 0 0 30px rgba(0, 0, 0, 0.25),
    inset 0 0 12px rgba(255, 255, 255, 0.10);
  transform: translateZ(14px);
}

.moon-craters {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 62% 36%, rgba(0, 0, 0, 0.16) 0 9px, rgba(255, 255, 255, 0.14) 10px 14px, transparent 15px),
    radial-gradient(circle at 42% 62%, rgba(0, 0, 0, 0.14) 0 7px, rgba(255, 255, 255, 0.12) 8px 12px, transparent 13px),
    radial-gradient(circle at 28% 44%, rgba(0,  0, 0, 0.12) 0 6px, rgba(255, 255, 255, 0.10) 7px 10px, transparent 11px),
    radial-gradient(circle at 70% 68%, rgba(0, 0, 0, 0.10) 0 5px, rgba(255, 255, 255, 0.10) 6px 9px, transparent 10px);
  opacity: 0.85;
  transform: translateZ(18px);
  mix-blend-mode: multiply;
}

.cloud {
  position: absolute;
  width: 260px;
  height: 120px;
  transform-style: preserve-3d;
  filter: drop-shadow(0 24px 32px rgba(0, 0, 0, 0.45));
  pointer-events: none;
}

.cloud-p {
  position: absolute;
  border-radius: 999px;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.60), rgba(255, 255, 255, 0.22) 42%, rgba(183, 201, 255, 0.10) 70%, rgba(0, 0, 0, 0.16));
  box-shadow:
    inset 0 0 18px rgba(255, 255, 255, 0.14),
    inset 0 0 22px rgba(0, 0, 0, 0.18);
  transform: translateZ(10px);
}

.cloud-1 .puff-1 { width: 110px; height: 78px; left: 10px; top: 32px; }
.cloud-1 .puff-2 { width: 140px; height: 92px; left: 70px; top: 18px; }
.cloud-1 .puff-3 { width: 120px; height: 80px; left: 160px; top: 34px; }
.cloud-1 .puff-4 { width: 220px; height: 68px; left: 32px; top: 58px; transform: translateZ(14px); opacity: 0.95; }

.cloud-2 .puff-1 { width: 100px; height: 70px; left: 6px; top: 38px; }
.cloud-2 .puff-2 { width: 126px; height: 86px; left: 60px; top: 22px; }
.cloud-2 .puff-3 { width: 112px; height: 76px; left: 146px; top: 40px; }
.cloud-2 .puff-4 { width: 210px; height: 62px; left: 26px; top: 62px; transform: translateZ(14px); opacity: 0.95; }

.planet-1 {
  width: 170px;
  height: 170px;
  top: 58%;
  left: 72%;
  animation: planet-float 10s ease-in-out infinite alternate;
}

.planet-2 {
  width: 130px;
  height: 130px;
  top: 32%;
  left: 62%;
  animation: planet-float 12s ease-in-out infinite alternate;
}

.fireworks-layer {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 5;
}

.fireworks-layer.welcome {
  z-index: 1;
}

.firework {
  position: absolute;
  width: 4px;
  height: 4px;
  transform-style: preserve-3d;
}

.spark {
  position: absolute;
  left: 0;
  top: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,1), rgba(255,255,255,0.2) 60%, transparent 70%);
  box-shadow:
    0 0 12px rgba(255,255,255,0.9),
    0 0 22px var(--spark-color, rgba(255,255,255,0.8));
  transform: translate3d(0,0,0);
  animation: spark-move var(--spark-time, 1.2s) ease-out forwards, spark-fade var(--spark-time, 1.2s) linear forwards;
}

@keyframes spark-move {
  to {
    transform: translate3d(var(--tx, 0px), var(--ty, 0px), var(--tz, 0px));
  }
}

@keyframes spark-fade {
  0% { opacity: 0; }
  15% { opacity: 1; }
  100% { opacity: 0; }
}

.comet-1 {
  top: 26%;
  left: 86%;
  animation: comet-fly 4.5s linear infinite;
}

.comet-2 {
  top: 70%;
  left: 12%;
  animation: comet-fly 6s linear infinite;
  animation-delay: 1.2s;
  opacity: 0.7;
}

/* 2D Camel Background */
.camel-2d-bg {
  position: absolute;
  bottom: -50px; /* Slight overflow to anchor it to bottom */
  left: 20px;
  opacity: 0.9; /* More visible than before since it's a realistic picture */
  z-index: 1; /* Bring it slightly forward so it sits on the ground layer */
  width: 300px; /* Adjusted scale */
  height: 300px;
  pointer-events: none;
}
.camel-2d-bg img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* Ensure the image doesn't stretch */
  filter: drop-shadow(0 10px 15px rgba(0,0,0,0.5)); /* Make it pop */
}

/* 3D Standard Ketupat (Woven Diamond) */
.ketupat-cube {
  position: relative;
  width: 90px; height: 90px;
  transform-style: preserve-3d;
  /* Rotate to stand on its corner like a diamond */
  transform: rotateX(45deg) rotateY(45deg);
}

.ketupat-cube .face {
  position: absolute;
  width: 90px; height: 90px;
  /* Woven Checkerboard Texture (Green & Yellow) */
  background-color: #0b9e38; /* Brighter Green */
  background-image: 
    conic-gradient(#e1bd2f 90deg, transparent 90deg 180deg, #e1bd2f 180deg 270deg, transparent 270deg);
  background-size: 30px 30px; /* Larger Checkerboard size */
  background-position: 0 0;
  
  /* Give it the puffy, rounded look from the reference image */
  border-radius: 12px; 
  border: 1px solid rgba(0,0,0,0.2); 
  box-shadow: inset 0 0 20px rgba(0,0,0,0.5), inset 0 0 5px rgba(255,255,255,0.4);
}

/* Ensure the faces line up their checkers */
.ketupat-cube .front  { transform: translateZ(45px); background-position: 15px 15px; }
.ketupat-cube .back   { transform: translateZ(-45px) rotateY(180deg); }
.ketupat-cube .right  { transform: translateX(45px) rotateY(90deg); }
.ketupat-cube .left   { transform: translateX(-45px) rotateY(-90deg); background-position: 15px 15px; }
.ketupat-cube .top    { transform: translateY(-45px) rotateX(90deg); }
.ketupat-cube .bottom { transform: translateY(45px) rotateX(-90deg); background-position: 15px 15px; }

/* Ribbons (Tails) */
.ketupat-tail {
  position: absolute;
  background: linear-gradient(to right, #097d2c, #0b9e38, #097d2c);
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.5);
  transform-style: preserve-3d;
}

.top-tail {
  width: 12px; height: 60px;
  top: -45px; left: 40px;
  transform: translateZ(45px) rotateZ(-45deg) rotateX(20deg);
  border-radius: 10px 10px 0 0;
}

.bottom-tail-1 {
  width: 12px; height: 70px;
  bottom: -50px; left: 30px;
  transform: translateZ(45px) rotateZ(-30deg) rotateX(-20deg);
  border-radius: 0 0 10px 10px;
}

.bottom-tail-2 {
  width: 12px; height: 60px;
  bottom: -40px; left: 50px;
  transform: translateZ(35px) rotateZ(-60deg) rotateX(-10deg);
  border-radius: 0 0 10px 10px;
  background: linear-gradient(to right, #075e21, #097d2c, #075e21); /* Slightly darker for depth */
}

/* Extruded 3D Star styling */
.item-star {
  width: var(--star-size, 80px);
  height: var(--star-size, 80px);
  transform-style: preserve-3d;
}

.star-layer {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5));
}

/* Layer thickness translates */
.layer-1 { transform: translateZ(8px); }
.layer-2 { transform: translateZ(4px); filter: brightness(0.9); }
.layer-3 { transform: translateZ(0px); filter: brightness(0.8); }
.layer-4 { transform: translateZ(-4px); filter: brightness(0.6); }
.layer-5 { transform: translateZ(-8px); filter: brightness(0.4); }

/* Glowing Orbs */
.orb-3d {
  position: absolute;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--color-gold-light), transparent 70%);
  filter: blur(8px);
  animation: float 8s ease-in-out infinite alternate;
}
.orb-1 { top: 70%; left: 20%; animation-delay: 1s; opacity: 0.4;}
.orb-2 { top: 20%; right: 25%; animation-delay: 2s; opacity: 0.5;}

.planet {
  position: absolute;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.25), transparent 42%),
    radial-gradient(circle at 65% 70%, rgba(0, 0, 0, 0.35), transparent 55%),
    radial-gradient(circle at 40% 60%, rgba(58, 168, 255, 0.35), rgba(124, 92, 255, 0.20) 40%, rgba(255, 99, 199, 0.10) 72%, rgba(0, 0, 0, 0.25));
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.55),
    inset 0 0 26px rgba(255, 255, 255, 0.10);
  transform: translateZ(-120px) rotateZ(8deg);
  filter: saturate(1.15);
}

.planet::before {
  content: "";
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  background: radial-gradient(circle at 28% 24%, rgba(255, 255, 255, 0.22), transparent 55%);
  filter: blur(0.4px);
  opacity: 0.8;
}

.planet.ringed::after {
  content: "";
  position: absolute;
  left: -30%;
  top: 44%;
  width: 160%;
  height: 42%;
  border-radius: 50%;
  background:
    radial-gradient(closest-side, rgba(255, 255, 255, 0.14), transparent 68%),
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
  transform: rotateZ(-18deg) rotateX(66deg);
  filter: blur(0.2px);
  opacity: 0.85;
}

.comet {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95), rgba(183, 201, 255, 0.55), transparent 72%);
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.45);
  transform: translateZ(-160px);
}

.comet::after {
  content: "";
  position: absolute;
  right: 6px;
  top: 50%;
  width: 130px;
  height: 3px;
  transform: translateY(-50%) rotateZ(-12deg);
  transform-origin: right center;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.00), rgba(183, 201, 255, 0.32), rgba(255, 255, 255, 0.78));
  filter: blur(0.2px);
  opacity: 0.9;
}

/* --- MAIN CAROUSEL STAGE --- */
#main-content {
  flex-direction: column;
  z-index: 10;
}

.carousel-stage {
  perspective: 1200px;
  width: 100%;
  max-width: 1000px;
  height: min(720px, 92vh);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.carousel-container {
  position: relative;
  width: 100%;
  height: min(600px, 78vh);
  transform-style: preserve-3d;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* 3D Glass Card Items */
.carousel-item {
  position: absolute;
  background: var(--glass-bg);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 40px 30px;
  width: min(92vw, 450px);
  height: 100%;
  box-shadow: var(--glass-shadow), inset 0 0 40px rgba(232, 192, 80, 0.05);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  
  transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
  opacity: 0;
  pointer-events: none;
  transform: translateZ(-500px) scale(0.6);
}

/* Coverflow Logic */
.carousel-item.active {
  z-index: 5;
  opacity: 1;
  pointer-events: auto;
  transform: translateZ(0) scale(1);
  filter: none;
  box-shadow: 0 30px 60px rgba(0,0,0,0.8), inset 0 0 40px rgba(232, 192, 80, 0.15);
}

.carousel-item.prev {
  z-index: 4;
  opacity: 0.6;
  transform: translateX(-60%) translateZ(-250px) rotateY(25deg) scale(0.85);
  filter: brightness(0.85) saturate(0.92);
  cursor: pointer;
  pointer-events: auto;
}

.carousel-item.next {
  z-index: 4;
  opacity: 0.6;
  transform: translateX(60%) translateZ(-250px) rotateY(-25deg) scale(0.85);
  filter: brightness(0.85) saturate(0.92);
  cursor: pointer;
  pointer-events: auto;
}

/* Card Internals */
.card-header h2 {
  font-family: var(--font-heading);
  font-size: 2rem;
  color: var(--color-gold);
  margin-bottom: 5px;
}

.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 25px;
}

.divider::before, .divider::after {
  content: "";
  height: 2px; width: 60px;
  background: linear-gradient(90deg, transparent, var(--color-gold), transparent);
}

.divider .star {
  color: var(--color-gold-light);
  margin: 0 10px; font-size: 1.2rem;
  animation: spin-slow 8s linear infinite;
}

.profile-container {
  position: relative;
  width: 2.2in;
  height: 1.7in;
  aspect-ratio: 2.2 / 1.7;
  margin: 0 auto 22px;
  border-radius: 18px;
  padding: 6px;
  background: linear-gradient(135deg, var(--color-gold-light), var(--color-gold));
  box-shadow: 0 15px 35px rgba(0,0,0,0.6);
  transform: translateZ(20px);
  overflow: hidden;
}

.profile-container img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 14px;
  border: 4px solid var(--color-green-dark);
  backface-visibility: hidden;
  transform: translateZ(0);
}

.frame-glow {
  position: absolute;
  top: -10px; left: -10px; right: -10px; bottom: -10px;
  border-radius: 22px;
  border: 2px dashed rgba(232, 192, 80, 0.6);
  animation: spin-slow 20s linear infinite;
}

.speech-box {
  background: rgba(0,0,0,0.3);
  border-left: 3px solid var(--color-gold);
  border-right: 3px solid var(--color-gold);
  padding: 16px 18px;
  border-radius: 12px;
  position: relative;
  width: 100%;
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateZ(10px);
}

.quote-icon {
  color: rgba(232, 192, 80, 0.25);
  font-size: 1.8rem;
  position: absolute;
}
.quote-icon:not(.right-quote) { top: -12px; left: 15px; }
.right-quote { bottom: -12px; right: 15px; }

.speech-box p {
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--color-white);
  font-weight: 300;
}

/* Dots */
.carousel-dots {
  display: flex;
  gap: 12px;
  margin-top: 30px;
  z-index: 20;
}

.dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.dot:hover {
  background: rgba(232, 192, 80, 0.6);
}

.dot.active {
  background: var(--color-gold);
  width: 30px;
  border-radius: 6px;
  box-shadow: 0 0 15px var(--color-gold);
}

/* Music Controls */
.music-controls {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 50;
}

.icon-btn {
  background: rgba(10, 46, 33, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid var(--color-gold);
  color: var(--color-gold);
  width: 50px; height: 50px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

.icon-btn:hover {
  background: var(--color-gold);
  color: var(--color-green-dark);
  transform: scale(1.1);
}

/* Keyframes */
@keyframes float-pulse {
  0%, 100% { transform: translateY(0) scale(1) translateZ(0); }
  50% { transform: translateY(-15px) scale(1.02) translateZ(20px); box-shadow: 0 40px 80px rgba(0,0,0,0.7), inset 0 0 30px rgba(232, 192, 80, 0.2); }
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes rotate-3d-slow {
  0% { transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg); }
  100% { transform: rotateX(360deg) rotateY(360deg) rotateZ(360deg); }
}

@keyframes float-rotate-3d {
  0% { transform: translateY(0) rotateY(0deg) rotateZ(5deg); }
  50% { transform: translateY(-40px) rotateY(180deg) rotateZ(-5deg); }
  100% { transform: translateY(0) rotateY(360deg) rotateZ(5deg); }
}

@keyframes float {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-30px) scale(1.1); }
}

@keyframes twinkle {
  0% { opacity: 0.35; filter: brightness(0.9); }
  100% { opacity: 0.65; filter: brightness(1.08); }
}

@keyframes planet-float {
  0% { transform: translateZ(-120px) rotateZ(8deg) translateY(0); }
  100% { transform: translateZ(-120px) rotateZ(8deg) translateY(-34px); }
}

@keyframes comet-fly {
  0% { transform: translate3d(0, 0, -160px) rotateZ(-12deg); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translate3d(-520px, 220px, -160px) rotateZ(-12deg); opacity: 0; }
}

@keyframes moon-float {
  0% { transform: translateZ(-90px) rotateZ(-12deg) translateY(0); }
  100% { transform: translateZ(-90px) rotateZ(-12deg) translateY(-24px); }
}

@keyframes moon-float-welcome {
  0% { transform: translateZ(-90px) rotateZ(-10deg) translateY(0); }
  100% { transform: translateZ(-90px) rotateZ(-10deg) translateY(-18px); }
}

@keyframes flare-pulse {
  0% { transform: translateZ(-220px) rotateZ(0deg) scale(0.96); opacity: 0.55; }
  100% { transform: translateZ(-220px) rotateZ(26deg) scale(1.04); opacity: 0.78; }
}

@keyframes cloud-drift-1 {
  0% { transform: translate3d(-40px, 0, -120px); }
  100% { transform: translate3d(440px, -10px, -120px); }
}

@keyframes cloud-drift-2 {
  0% { transform: translate3d(60px, 0, -110px) scale(0.9); }
  100% { transform: translate3d(-420px, 12px, -110px) scale(0.9); }
}

/* Responsive */
@media (max-width: 768px) {
  .envelope-container-3d h1 { font-size: 2.2rem; }
  .carousel-stage { height: min(680px, 92vh); }
  .carousel-container { height: min(520px, 74vh); }
  .carousel-item { width: min(92vw, 380px); padding: 28px 18px; height: min(560px, 76vh); }
  .card-header h2 { font-size: 1.5rem; }
  .profile-container { width: min(92vw, 2.2in); height: min(34vh, 1.7in); margin-bottom: 14px; }
  .speech-box { padding: 16px 16px; }
  .speech-box p { font-size: 0.95rem; }
  .carousel-item.prev { transform: translateX(-28%) translateZ(-260px) rotateY(14deg) scale(0.82); }
  .carousel-item.next { transform: translateX(28%) translateZ(-260px) rotateY(-14deg) scale(0.82); }
  .cloud { opacity: 0.65; }
  .moon-1 { width: 120px; height: 120px; }
  .moon-2 { width: 110px; height: 110px; }
  .music-controls { bottom: 14px; right: 14px; }
  .icon-btn { width: 46px; height: 46px; }
  .carousel-dots { gap: 10px; margin-top: 18px; }
  .dot { width: 10px; height: 10px; }
  .dot.active { width: 24px; }
  .frame-glow { top: 0; left: 0; right: 0; bottom: 0; border-radius: 16px; }
}

@media (max-width: 480px) {
  .envelope-container-3d { padding: 34px 18px; }
  .envelope-container-3d p { font-size: 1.05rem; }
  .glow-btn { padding: 14px 22px; font-size: 1.05rem; }
  .welcome-scene .flare { display: none; }
  .flare-main-1, .flare-main-2 { display: none; }
  .carousel-stage { height: min(620px, 92vh); }
  .carousel-container { height: min(480px, 74vh); }
  .carousel-item { width: 92vw; padding: 20px 12px; height: min(520px, 78vh); }
  .card-header h2 { font-size: 1.35rem; }
  .divider::before, .divider::after { width: 44px; }
  .profile-container { width: 92vw; max-width: 2.2in; height: min(26vh, 1.7in); padding: 4px; border-radius: 16px; }
  .profile-container img { border-width: 3px; border-radius: 12px; }
  .frame-glow { top: 0; left: 0; right: 0; bottom: 0; border-radius: 16px; }
  .quote-icon { font-size: 1.4rem; }
  .speech-box { padding: 14px 12px; }
  .speech-box p { font-size: 0.9rem; line-height: 1.5; }
  .carousel-item.prev, .carousel-item.next { opacity: 0.25; }
  .cloud, .comet { display: none; }
  .planet { opacity: 0.65; }
  .moon-1 { left: 6%; top: 12%; }
  .moon-2 { left: 70%; top: 74%; }
}
