:root {
  --night-bg: #1a1a2e;
  --night-lighter: #16213e;
  --yalda-red: #e94560;
  --yalda-green: #2ecc71;
  --warm-gold: #fccb06;
  --text-color: #eee;
  --card-bg: #0f3460;
  --font-main: 'Comic Sans MS', 'Chalkboard SE', sans-serif; /* Playful font stack */
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--night-bg);
  color: var(--text-color);
  font-family: var(--font-main);
  line-height: 1.6;
  overflow-x: hidden;
}

header {
  text-align: center;
  padding: 2rem;
  background: linear-gradient(180deg, #0b1021 0%, var(--night-bg) 100%);
}

h1 {
  font-size: 3rem;
  color: var(--yalda-red);
  text-shadow: 0 0 10px var(--yalda-red);
  margin-bottom: 0.5rem;
}

.subtitle {
  font-size: 1.5rem;
  color: var(--warm-gold);
}

main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1rem;
}

section {
  margin-bottom: 3rem;
  padding: 2rem;
  background-color: var(--card-bg);
  border-radius: 20px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
  border: 4px solid var(--night-lighter);
}

h2 {
  color: var(--warm-gold);
  border-bottom: 2px dashed var(--yalda-green);
  padding-bottom: 0.5rem;
  display: inline-block;
}

/* Yalda Table Section */
/* Yalda Table Section - The Korsi */
/* Yalda Table Section - The Korsi */
.yalda-table-container {
  position: relative;
  text-align: center;
  min-height: 550px;
  /* Korsi Blanket Effect: Darker rich red pattern */
  background: repeating-linear-gradient(
    45deg,
    #600000,
    #600000 20px,
    #350000 20px,
    #350000 40px
  );
  background-color: #600000;
  border-radius: 20px;
  padding: 3rem 2rem;
  border: 8px solid var(--yalda-gold, #fccb06);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.8), inset 0 0 80px rgba(0, 0, 0, 0.7);
  margin-top: 2rem;
  z-index: 10; /* Establish stacking context above snowflakes */
}

.table-layout {
  position: relative;
  width: 100%;
  height: 400px;
  margin: 0 auto;
  z-index: 20; /* Above container background */
}

.item-wrapper {
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: absolute;
  top: 60%;
  left: 50%;
  width: 170px;
  height: 170px;
  margin-top: -85px;
  margin-left: -85px;
  /* Grounding shadow */
  filter: drop-shadow(0 10px 10px rgba(0, 0, 0, 0.5));
  z-index: 1000; /* Nuclear Z-index */
  pointer-events: auto; /* Ensure it catches clicks */
}

/* Distribute 5 items in a circle (radius increased to 180px for larger items) */
/* 1: Watermelon - Top */
.item-wrapper:nth-child(1) {
  transform: translateY(-180px);
}
/* 2: Pomegranate - Top Right */
.item-wrapper:nth-child(2) {
  transform: rotate(72deg) translateY(-180px) rotate(-72deg);
}
/* 3: Nuts - Bottom Right */
.item-wrapper:nth-child(3) {
  transform: rotate(144deg) translateY(-180px) rotate(-144deg);
}
/* 4: Candle - Bottom Left */
.item-wrapper:nth-child(4) {
  transform: rotate(216deg) translateY(-180px) rotate(-216deg);
}
/* 5: Hafez - Top Left */
.item-wrapper:nth-child(5) {
  transform: rotate(288deg) translateY(-180px) rotate(-288deg);
}

.item-wrapper:hover {
  filter: drop-shadow(0 0 25px rgba(255, 203, 6, 0.8));
  z-index: 1001;
}

.item-wrapper:hover img {
  transform: scale(1.2);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Ensure images (SVGs) fit nicely */
.item-wrapper img {
  height: 100%;
  width: auto;
  display: block;
  margin: 0 auto;
  transition: transform 0.3s ease;
  pointer-events: none; /* Let clicks pass through to wrapper */
}

.character-sun {
  position: absolute;
  top: -40px; /* Pop out of the top! */
  right: -20px; /* Pop out of the side! */
  width: 130px; /* Bigger sun */
  animation: float 4s infinite ease-in-out;
  z-index: 5;
  filter: drop-shadow(0 0 15px rgba(255, 223, 0, 0.8)); /* Glowing sun */
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-15px) rotate(5deg);
  }
}

/* Popup Styles (Restored & Boosted) */
.explanation-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  background-color: #fff;
  color: #333;
  padding: 2rem;
  border-radius: 20px;
  width: 80%;
  max-width: 400px;
  z-index: 2000; /* Must be > 1000 to cover items */
  text-align: center;
  box-shadow: 0 0 20px rgba(255, 203, 6, 0.8);
  transition: transform 0.3s ease;
  border: 5px solid var(--yalda-red);
}

.explanation-popup.active {
  transform: translate(-50%, -50%) scale(1);
}

.close-btn {
  background: var(--yalda-red);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.2rem;
  margin-top: 1rem;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1999; /* Just below popup */
  display: none;
}

.overlay.active {
  display: block;
}

/* Stars background */
.stars {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  background-image: radial-gradient(
      white,
      rgba(255, 255, 255, 0.2) 2px,
      transparent 3px
    ),
    radial-gradient(white, rgba(255, 255, 255, 0.15) 1px, transparent 2px),
    radial-gradient(white, rgba(255, 255, 255, 0.1) 2px, transparent 3px);
  background-size: 550px 550px, 350px 350px, 250px 250px;
  background-position: 0 0, 40px 60px, 130px 270px;
}

.instruction {
  text-align: center;
  font-style: italic;
  margin-top: 1rem;
  opacity: 0.8;
}

.activity-list li {
  margin-bottom: 0.5rem;
  list-style-type: '🍉 ';
  padding-left: 0.5rem;
}

.talking-points li {
  margin-bottom: 0.5rem;
  list-style-type: '☀️ ';
  padding-left: 0.5rem;
}

/* Gallery Section */
.gallery-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  margin-top: 1rem;
}

.gallery-item {
  border-radius: 15px;
  overflow: hidden;
  border: 4px solid var(--yalda-gold, #fccb06);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease;
  background: #000;
  width: 100%;
  max-width: 600px; /* As requested */
  /* Remove aspect-ratio if we want natural height, OR keep it if we want uniformity. 
     User said "make it look like I used width 600px". 
     Usually this means let height adjust or keep fixed. 
     I'll stick to a flexible height but keep the container styles. */
}

/* 
   User removed aspect-ratio in their inline style by omission.
   I will remove it too to let images dictate height naturally, 
   OR keep it if they want uniformity. 
   Given "fit" comment earlier, natural height might be safer unless they want a grid.
   But since it's a vertical stack now, natural height is fine.
*/

.gallery-item:hover {
  transform: scale(1.02); /* Subtle zoom */
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
  z-index: 10;
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
}

.caption {
  text-align: center;
  padding: 0.5rem;
  color: var(--text-color);
  background: rgba(0, 0, 0, 0.8);
  font-size: 0.9rem;
  margin: 0;
}

/* Snowflakes Animation */
.snowflakes {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1; /* Below header/content but above stars */
}

.snowflakes i {
  position: absolute;
  top: -10px;
  background: white;
  border-radius: 50%;
  opacity: 0.2; /* Subtle */
  animation: snow linear infinite;
}

/* Creating varied snowflakes */
.snowflakes i:nth-child(1) {
  left: 10%;
  width: 5px;
  height: 5px;
  animation-duration: 10s;
  animation-delay: 0s;
}
.snowflakes i:nth-child(2) {
  left: 20%;
  width: 8px;
  height: 8px;
  animation-duration: 12s;
  animation-delay: 2s;
}
.snowflakes i:nth-child(3) {
  left: 30%;
  width: 4px;
  height: 4px;
  animation-duration: 8s;
  animation-delay: 4s;
}
.snowflakes i:nth-child(4) {
  left: 40%;
  width: 6px;
  height: 6px;
  animation-duration: 15s;
  animation-delay: 1s;
}
.snowflakes i:nth-child(5) {
  left: 50%;
  width: 5px;
  height: 5px;
  animation-duration: 11s;
  animation-delay: 3s;
}
.snowflakes i:nth-child(6) {
  left: 60%;
  width: 7px;
  height: 7px;
  animation-duration: 13s;
  animation-delay: 5s;
}
.snowflakes i:nth-child(7) {
  left: 70%;
  width: 4px;
  height: 4px;
  animation-duration: 9s;
  animation-delay: 2s;
}
.snowflakes i:nth-child(8) {
  left: 80%;
  width: 6px;
  height: 6px;
  animation-duration: 14s;
  animation-delay: 6s;
}
.snowflakes i:nth-child(9) {
  left: 90%;
  width: 5px;
  height: 5px;
  animation-duration: 10s;
  animation-delay: 1s;
}
.snowflakes i:nth-child(10) {
  left: 95%;
  width: 8px;
  height: 8px;
  animation-duration: 16s;
  animation-delay: 4s;
}

@keyframes snow {
  0% {
    transform: translateY(0) translateX(0);
  }
  25% {
    transform: translateY(25vh) translateX(10px);
  }
  50% {
    transform: translateY(50vh) translateX(-10px);
  }
  75% {
    transform: translateY(75vh) translateX(10px);
  }
  100% {
    transform: translateY(100vh) translateX(0);
  }
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .snowflakes i,
  .character-sun,
  .item-wrapper:hover {
    animation: none;
    transition: none;
    transform: none;
  }
}
