/* Quiz section enhancement */
#quizForm label {
  display: block;
  background: #fff;
  padding: 12px 16px;
  margin: 8px 0;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

#quizForm label:hover {
  background-color: #f0f4f8;
  border-color: #93c5fd;
}

#quizForm input[type="radio"] {
  margin-right: 10px;
}

#quizResult {
  transition: opacity 0.5s ease;
}

.animated-button-success {
  display: inline-block;
  background-color: #10B981; /* Emerald green */
  color: white;
  font-weight: bold;
  font-size: 18px;
  padding: 14px 30px;
  border-radius: 8px;
  text-align: center;
  text-decoration: none;
  animation: glow-success 2.5s infinite alternate, jump 1.5s ease-in-out infinite alternate;
  transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.animated-button-success:hover {
  transform: scale(1.1);
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.9);
}

@keyframes glow-success {
  0% { box-shadow: 0 0 0px rgba(16, 185, 129, 0.5); }
  50% { box-shadow: 0 0 20px rgba(16, 185, 129, 0.8); }
  100% { box-shadow: 0 0 0px rgba(16, 185, 129, 0.5); }
}

.animated-button-primary {
  display: inline-block;
  background-color: #3B82F6; /* Tailwind blue-500 */
  color: white;
  font-weight: bold;
  font-size: 18px;
  padding: 14px 30px;
  border-radius: 8px;
  text-align: center;
  text-decoration: none;
  animation: glow-primary 2.5s infinite alternate, jump 1.5s ease-in-out infinite alternate;
  transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.animated-button-primary:hover {
  transform: scale(1.1);
  box-shadow: 0 0 25px rgba(59, 130, 246, 0.9);
}

@keyframes glow-primary {
  0% { box-shadow: 0 0 0px rgba(59, 130, 246, 0.5); }
  50% { box-shadow: 0 0 20px rgba(59, 130, 246, 0.8); }
  100% { box-shadow: 0 0 0px rgba(59, 130, 246, 0.5); }
}

/* Smooth fade in for results */
#quizResult {
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.4s ease;
}
#quizResult.show {
  opacity: 1;
  transform: translateY(0);
}

/* AC Brand Styling for Radio Buttons */
input[type="radio"] {
  accent-color: #26C6DA; /* Brand aqua blue */
  transform: scale(1.2);
  margin-right: 0.5rem;
  cursor: pointer;
}

/* Button enhancement */
.animated-button-primary {
  transition: all 0.3s ease;
}
.animated-button-primary:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.7);
}

#comingSoonMsg {
  transition: opacity 0.5s ease-in-out;
}

@keyframes fade-in {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fade-in 1s ease forwards;
  opacity: 0;
}

.animate-fade-in.delay-100 { animation-delay: 0.1s; }
.animate-fade-in.delay-200 { animation-delay: 0.2s; }
.animate-fade-in.delay-300 { animation-delay: 0.3s; }

.text-brand-aqua {
  color: #26C6DA;
}

.module-card:hover {
  transform: scale(1.02);
  transition: transform 0.2s ease;
}

.copy-success {
  background-color: #198754 !important;
  color: white !important;
  border-color: #198754 !important;
}

.module-card {
  display: flex;
  flex-direction: column;
}

.module-card p {
  flex-grow: 1;
}

/* Unified CTA style for all module cards */
.module-card a {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.5rem 1.25rem;

  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 0.75rem;

  /* Constant Labs gradient button */
  background: linear-gradient(to right, #06b6d4, #3b82f6);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.25);

  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  text-decoration: none;
}

.module-card a:hover {
  background: linear-gradient(to right, #0891b2, #2563eb);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(15, 118, 110, 0.3);
}

.module-card a:focus-visible {
  outline: 2px solid #22d3ee;
  outline-offset: 2px;
}


/* Newsletter CTA (optional fine-tuning) */
#newsletter-cta {
  transition: all 0.3s ease;
}

#newsletter-cta.hidden {
  display: none;
}

.newsletter-btn {
  transition: all 0.3s ease;
}
/* Fade-out animation */
.fade-out {
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}



/* Module card badges (keep this) */
.badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Difficulty Legend badges — now separated */
.legend-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease-in-out;
  cursor: default;
}

.legend-badge:hover {
  transform: scale(1.05);
}

/* Individual Styles */
.badge-beginner {
  background-color: #bbf7d0; /* green-200 */
  color: #065f46;            /* green-900 */
}

.badge-intermediate {
  background-color: #fef9c3; /* yellow-200 */
  color: #854d0e;            /* yellow-900 */
}

.badge-advanced {
  background-color: #fecaca; /* red-200 */
  color: #7f1d1d;            /* red-900 */
}

.badge-expert {
  background: linear-gradient(270deg, #6b21a8, #4f46e5, #6b21a8);
  color: white;
  background-size: 400% 100%;
  animation: shimmer 3s infinite linear;
}

.badge-expert,
.legend-badge.badge-expert {
  border: 1px solid #a78bfa; /* Tailwind's purple-400 */
}


/* Expert-only shimmer */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.legend-badge span:first-child {
  line-height: 1;
  transform: translateY(1px);
}

.legend-badge {
  position: relative;
}

.legend-badge::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: -2.5rem;
  left: 50%;
  transform: translateX(-50%);
  background-color: #1f2937; /* gray-800 */
  color: #fff;
  font-size: 0.75rem;
  padding: 0.4rem 0.6rem;
  border-radius: 0.375rem;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 10;
}

.legend-badge:hover::after {
  opacity: 1;
}

.tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 0.5rem;
  background-color: #1f2937; /* Tailwind gray-800 */
  color: white;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 0.375rem;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 50;
}

.group:hover .tooltip {
  opacity: 1;
}

  #antMeetModal {
    animation: fadeIn 0.3s ease;
  }
  @keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
  }

    .binary-path {
    font-family: 'Courier New', monospace;
    background: linear-gradient(to right, #f3e8ff, #e9d5ff);
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.3s ease-in-out;
  }

  .bit-path.correct {
    border-color: #10b981;
    background-color: #d1fae5;
    animation: glow 1s ease-in-out;
  }

  .bit-path.incorrect {
    border-color: #ef4444;
    background-color: #fee2e2;
  }

  @keyframes glow {
    0% { box-shadow: 0 0 0px #34d399; }
    100% { box-shadow: 0 0 15px #34d399; }
  }

   .xor-tunnel:hover {
    background-color: #f3e8ff;
    transform: scale(1.03);
  }
  .xor-tunnel.correct {
    border-color: #10b981 !important;
    background-color: #d1fae5;
  }
  .xor-tunnel.incorrect {
    border-color: #f87171 !important;
    background-color: #fee2e2;
  }

  .draggable-bit {
  width: 2.5rem;
  text-align: center;
  font-weight: bold;
  user-select: none;
}

.drop-box {
  font-weight: bold;
  font-size: 1.25rem;
}

  .tile {
    width: 80px;
    height: 80px;
    background-color: #e0e7ff;
    font-weight: bold;
    font-size: 1.5rem;
    color: #1e40af;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 0.5rem;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
  }
  .empty {
    background-color: transparent;
    border: 2px dashed #cbd5e1;
    cursor: default;
  }

   .dialogue-box {
    background: #f8f5ff;
    border: 2px solid #d6bbfb;
    padding: 1.5rem;
    border-radius: 1rem;
    max-width: 600px;
    margin: 2rem auto;
    box-shadow: 0 8px 20px rgba(102, 51, 153, 0.15);
    transition: all 0.4s ease-in-out;
  }

  .prompt {
    font-size: 1.125rem;
    color: #4c1d95;
    font-weight: 600;
    margin-bottom: 1rem;
  }

  .choice {
    display: block;
    background-color: #ede9fe;
    color: #4b5563;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin: 0.5rem 0;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
  }

  .choice:hover {
    background-color: #c4b5fd;
    transform: scale(1.02);
  }

  .feedback {
    margin-top: 1rem;
    font-size: 0.95rem;
    color: #065f46;
    font-weight: 500;
    transition: opacity 0.3s;
  }

  /* Progress Bar Container */
.progress-wrapper {
  width: 100%;
}

/* Track (background) */
.progress-track {
  background-color: #e5e7eb; /* Tailwind's gray-200 */
  border-radius: 9999px;
  height: 10px;
  overflow: hidden;
}

/* Bar (fills based on JS % width) */
.progress-bar {
  background: linear-gradient(to right, #06b6d4, #3b82f6); /* aqua to blue gradient */
  height: 10px;
  width: 0%;
  transition: width 0.6s ease;
  border-radius: 9999px;
}

/* Label */
.progress-label {
  font-size: 0.875rem;
  color: #4b5563; /* gray-700 */
  margin-top: 0.5rem;
  text-align: right;
}

.wave {
  position: relative;
  z-index: 0;
  margin-top: -5px;
}

.wave-bottom {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  z-index: 1;
}
@keyframes waveSway {
  0% { transform: translateX(0); }
  100% { transform: translateX(-20px); }
}

.animate-wave-sway svg path {
  animation: waveSway 8s ease-in-out infinite alternate;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.animate-float {
  animation: float 4s ease-in-out infinite;
}



.palm {
  position: absolute;
  bottom: 0;
  max-height: 250px;
  z-index: 10; /* Palm trees appear above wave */
  pointer-events: none;
  opacity: 0.95;
}

.palm-left {
  left: 0;
  transform: rotate(-5deg);
}

.palm-right {
  right: 0;
  transform: rotate(5deg) scaleX(-1);
}



/* ☁️ Clouds */
/* Base cloud style */
.cloud {
  position: absolute;
  opacity: 0.2;
  width: 120px;
  animation: floatClouds linear infinite;
  z-index: 5;
  filter: brightness(250%) saturate(150%);
}

/* Direction variants */
.cloud-left  { animation-name: floatCloudLeft; }
.cloud-right { animation-name: floatCloudRight; }

/* Cloud variations */
.cloud-1 { top: 20px;  left: -150px; animation-duration: 50s; }
.cloud-2 { top: 80px;  right: -200px; animation-duration: 60s; animation-delay: 10s; }
.cloud-3 { top: 40px;  left: -300px; animation-duration: 70s; animation-delay: 5s; }
.cloud-4 { top: 100px; right: -250px; animation-duration: 65s; animation-delay: 20s; }
.cloud-5 { top: 60px;  left: -180px; animation-duration: 55s; animation-delay: 15s; }

/* Keyframes */
@keyframes floatCloudLeft {
  0% { transform: translateX(0); }
  100% { transform: translateX(1600px); }
}
@keyframes floatCloudRight {
  0% { transform: translateX(0); }
  100% { transform: translateX(-1600px); }
}


/* ☀️ Sun Rays */
.sun-rays {
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255,239,184,0.25) 0%, transparent 70%);
  border-radius: 50%;
  animation: pulseSun 8s ease-in-out infinite;
  z-index: 0;
}

@keyframes pulseSun {
  0%, 100% { transform: scale(1) translateX(-50%); }
  50% { transform: scale(1.1) translateX(-50%); }
}

/* ✨ Sparkles */
.sparkle {
  position: absolute;
  background: radial-gradient(circle, white 0%, transparent 70%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  opacity: 0.8;
  animation: sparkleTwinkle 2s ease-in-out infinite;
  z-index: 1;
}

.sparkle-1 { top: 60px; left: 40%; animation-delay: 0s; }
.sparkle-2 { top: 120px; left: 55%; animation-delay: 1.2s; }
.sparkle-3 { top: 80px; left: 68%; animation-delay: 2s; }

@keyframes sparkleTwinkle {
  0%, 100% { opacity: 0.2; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.3); }
}
.bubble {
  position: absolute;
  width: 12px;
  height: 12px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 9999px;
  animation: rise 8s linear infinite;
}
.bubble-1 { left: 20%; bottom: 0; animation-delay: 0s; }
.bubble-2 { left: 50%; bottom: 0; animation-delay: 2s; }
.bubble-3 { left: 80%; bottom: 0; animation-delay: 4s; }

@keyframes rise {
  0% { transform: translateY(0); opacity: 0.6; }
  100% { transform: translateY(-300px); opacity: 0; }
}

@keyframes shine {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}
.animate-gradient {
  background-size: 200% 200%;
  animation: shine 5s ease infinite;
}

.answer-tile {
  display: block;
  cursor: pointer;
}

.tile-content {
  background-color: #f9fafb;
  border: 2px solid #dbeafe;
  padding: 1rem;
  border-radius: 0.75rem;
  font-weight: 600;
  color: #1e40af;
  transition: all 0.3s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.tile-content:hover {
  background-color: #eff6ff;
  transform: scale(1.02);
}










@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.animate-fade-in {
  animation: fade-in 0.6s ease-out forwards;
}


#driftGrid {
  display: grid;
  grid-template-columns: repeat(4, 50px);
  gap: 8px;
}
.drift-tile {
  width: 3rem;
  height: 3rem;
  font-size: 1.25rem;
  font-weight: bold;
  border: 2px solid #6366f1;
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
}

.highlight-active {
  background-color: #c7d2fe; /* Indigo-200 */
}

.highlight-path {
  background-color: #e0f2fe; /* Light blue */
}



/* General Puzzle Tile Style (keep this) */
.puzzle-tile {
  width: 5rem;
  height: 5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.5rem;
  border: 2px solid #e5e7eb;
  background-color: #ffffff;
  border-radius: 0.5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  cursor: pointer;
  user-select: none;
}
.puzzle-tile.blank {
  background-color: #e5e7eb;
  cursor: default;
}

/* ✅ New Class for 3x3 Puzzle */
.puzzle-grid-3x3 {
  display: grid;
  grid-template-columns: repeat(3, 5rem);
  grid-template-rows: repeat(3, 5rem);
  gap: 0.75rem;
  justify-content: center;
  margin: 2rem auto;
}

/* ✅ New Class for 4x4 Puzzle */
.puzzle-grid-4x4 {
  display: grid;
  grid-template-columns: repeat(4, 5rem);
  grid-template-rows: repeat(4, 5rem);
  gap: 0.75rem;
  justify-content: center;
  margin: 2rem auto;
}

/* 🌊 Puzzle 2 – Drift Alignment Styling */
.puzzle-grid-4x4 {
  display: grid;
  grid-template-columns: repeat(4, 5rem);
  grid-template-rows: repeat(4, 5rem);
  gap: 0.75rem;
  justify-content: center;
  margin: 2rem auto;
}

.puzzle-tile {
  width: 5rem;
  height: 5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.5rem;
  border: 2px solid #e0e7eb;
  background-color: #ffffff;
  color: #1e3a8a;
  border-radius: 0.5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.puzzle-tile.blank {
  background-color: #e0e7ff;
  border: 2px dashed #cbd5e1;
  cursor: default;
}

.puzzle-tile:not(.blank):hover {
  background-color: #e0f2fe;
  transform: scale(1.05);
}

#resetPuzzle,
#hintPuzzle {
  padding: 0.5rem 1.25rem;
  font-weight: 600;
  font-size: 1rem;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
}

#resetPuzzle {
  background-color: #6366f1; /* Indigo */
  color: white;
}

#resetPuzzle:hover {
  background-color: #4f46e5;
}

#hintPuzzle {
  background-color: #f97316; /* Orange */
  color: white;
}

#hintPuzzle:hover {
  background-color: #ea580c;
}

#puzzleHint.show {
  display: block;
}



/* 🌌 Celestial Drift Grid - Expert Puzzle Styles */

/* 5x5 Grid Layout */
.puzzle-grid-5x5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  padding: 0 1rem;
  max-width: 100%;
  margin: 2rem auto;
}


/* Puzzle Tiles */
.puzzle-tile {
  width: 4rem;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.25rem;
  border: 2px solid #e0e7ff;
  background-color: #f9fafb;
  color: #1e3a8a;
  border-radius: 0.5rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

/* Blank Tile */
.puzzle-tile.blank {
  background-color: #e0e7ff;
  border: 2px dashed #cbd5e1;
  cursor: default;
}

/* Hover effect for active tiles */
.puzzle-tile:not(.blank):hover {
  background-color: #e0f2fe;
  transform: scale(1.05);
}

/* Feedback Styles */
#puzzleFeedback3 {
  transition: opacity 0.3s ease;
}

/* Buttons – Expert theme */
#resetPuzzle3,
#hintPuzzle3 {
  padding: 0.5rem 1rem;
  font-weight: 600;
  border-radius: 0.5rem;
  transition: background-color 0.2s ease;
}

#resetPuzzle3 {
  background-color: #7c3aed; /* Violet */
  color: white;
}

#resetPuzzle3:hover {
  background-color: #6d28d9;
}

#hintPuzzle3 {
  background-color: #f43f5e; /* Rose-500 */
  color: white;
}

#hintPuzzle3:hover {
  background-color: #e11d48;
}

/* Expert hint style */
#puzzleHint3 {
  font-style: italic;
  font-size: 0.875rem;
  text-align: center;
  color: #9d174d; /* Rose-700 */
  background-color: #fff1f2;
  border: 1px solid #fbcfe8;
  padding: 0.5rem;
  border-radius: 0.375rem;
  margin-top: 1rem;
  display: none;
}

/* Show hint class */
#puzzleHint3.show {
  display: block;
}

/* Core grid styling */
.puzzle-grid-5x5 {
  display: grid;
  grid-template-columns: repeat(5, minmax(2rem, 1fr));
  gap: 0.5rem;
  justify-items: center;
  width: 100%;
  max-width: 20rem;
  margin: 2rem auto;
}

/* Puzzle tile styling */
.puzzle-tile {
  width: 100%;
  aspect-ratio: 1;
  max-width: 3.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.2rem;
  border: 2px solid #e0e7ff;
  background-color: #f9fafb;
  color: #1e3a8a;
  border-radius: 0.5rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

/* Blank tile */
.puzzle-tile.blank {
  background-color: #e0e7ff;
  border: 2px dashed #cbd5e1;
  cursor: default;
}

#vortexGrid {
  display: grid;
  grid-template-columns: repeat(5, 3rem);
  gap: 0.5rem;
  justify-content: center;
}

.drift-tile {
  width: 3rem;
  height: 3rem;
  font-size: 1.25rem;
  font-weight: bold;
  border: 2px solid #6366f1;
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
  background-color: #fff;
}

.highlight-active {
  background-color: #c7d2fe;
}

.highlight-path {
  background-color: #e0f2fe;
}

.drift-tile {
  text-align: center;
  font-size: 1.25rem;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  font-weight: bold;
  transition: 0.3s ease;
}

.drift-tile.highlight-path {
  background-color: #dbeafe;
}

.drift-tile.highlight-active {
  background-color: #c7d2fe;
}

.drift-tile {
  width: 3rem;
  height: 3rem;
  font-size: 1.25rem;
  font-weight: bold;
  border: 2px solid #a78bfa;
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f9f5ff;
  transition: background 0.3s ease;
}

.highlight-path {
  background-color: #e0e7ff;
}

.highlight-active {
  background-color: #d8b4fe;
}

/* Background Twinkle and Drift */
.twinkling-stars {
  animation: twinkle 6s ease-in-out infinite, drift 200s linear infinite;
  opacity: 0.8;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

@keyframes drift {
  from { transform: translate(0, 0); }
  to { transform: translate(-50px, -30px); }
}

/* Floating Animation for Planets */
@keyframes floatPlanet {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Earth: Spins Clockwise and Floats */
.planet-earth {
  animation: spinEarth 60s linear infinite, floatPlanet 6s ease-in-out infinite;
  z-index: 1;
  opacity: 0.85;
  pointer-events: none;
}

/* Mars: Spins Counter-Clockwise and Floats */
.planet-mars {
  animation: spinMars 80s linear infinite, floatPlanet 8s ease-in-out infinite;
  z-index: 1;
  opacity: 0.8;
  pointer-events: none;
}

/* Saturn: Tilted, Spins, and Floats */
.planet-saturn {
  position: absolute;
  top: 45%;
  left: 65%;
  width: 8rem;
  height: 8rem;
  animation: spinSaturn 100s linear infinite, floatPlanet 10s ease-in-out infinite;
  transform: rotate(25deg);
  z-index: 1;
  opacity: 0.9;
  pointer-events: none;
}


/* Spin Animations */
@keyframes spinEarth {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes spinMars {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}

@keyframes spinSaturn {
  from { transform: rotate(25deg); }
  to { transform: rotate(385deg); } /* 360 + 25 to maintain tilt */
}
.nebula-overlay {
  opacity: 0;
  animation: fadeInNebula 4s ease-out forwards;
  pointer-events: none;
  z-index: 1;
}

@keyframes fadeInNebula {
  to { opacity: 0.25; }
}
.comet {
  width: 80px;
  height: auto;
  top: -10%; /* Start off screen */
  left: -20%;
  opacity: 0.7;
  transform: rotate(45deg); /* Diagonal direction */
  animation: cometFly 30s linear infinite;
  pointer-events: none;
  z-index: 2; /* Above nebula, below planets */
}

@keyframes cometFly {
  0% {
    transform: translate(0, 0) rotate(45deg);
    opacity: 0.7;
  }
  70% {
    opacity: 0.9;
  }
  100% {
    transform: translate(150vw, 100vh) rotate(45deg); /* Move diagonally across screen */
    opacity: 0;
  }
}
.comet-1 { animation: cometFly 30s linear infinite; }
.comet-2 { animation: cometFly 45s linear infinite; animation-delay: 10s; }
.twinkling-stars {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2; /* Above background, below planets */
  overflow: hidden;
}

/* Each star */
.twinkling-stars::before,
.twinkling-stars::after {
  content: '';
  position: absolute;
  width: 2px;
  height: 2px;
  background: white;
  border-radius: 50%;
  box-shadow:
    20vw 30vh white,
    40vw 20vh white,
    60vw 70vh white,
    80vw 50vh white,
    10vw 60vh white,
    30vw 90vh white,
    50vw 40vh white,
    70vw 80vh white,
    90vw 10vh white,
    25vw 75vh white;
  animation: twinkle 2s infinite ease-in-out alternate;
}

/* Second layer for more random stars */
.twinkling-stars::after {
  animation-delay: 1s;
  box-shadow:
    15vw 20vh white,
    35vw 15vh white,
    55vw 65vh white,
    75vw 45vh white,
    5vw 55vh white,
    28vw 85vh white,
    48vw 35vh white,
    68vw 75vh white,
    88vw 5vh white,
    22vw 70vh white;
}

/* Twinkle animation */
@keyframes twinkle {
  0% { opacity: 0.3; transform: scale(1); }
  100% { opacity: 1; transform: scale(1.4); }
}
.text-brand-blue {
  color: #00B6E3; /* Exact branding blue */
}
.text-brand-blue:hover {
  color: #00D5FF; /* Lighter hover variant */
}
.falling-leaf {
  position: absolute;
  width: 40px;
  opacity: 0.8;
  pointer-events: none;
  animation-name: fall;
  animation-timing-function: ease-in;
  animation-iteration-count: infinite;
}

.leaf1 { left: 10%; animation-duration: 7s; animation-delay: 0s; }
.leaf2 { left: 45%; animation-duration: 9s; animation-delay: 2s; }
.leaf3 { left: 80%; animation-duration: 6s; animation-delay: 4s; }

@keyframes fall {
  0% {
    transform: translateY(-10%) rotate(0deg);
    opacity: 0;
  }
  30% {
    opacity: 1;
  }
  100% {
    transform: translateY(120vh) rotate(360deg);
    opacity: 0;
  }
}



.celestial-trees {
  position: absolute;
  bottom: -40px;
  left: 5%;
  width: 40%;
  max-width: 400px;
  z-index: 1;
  pointer-events: none;
  opacity: 0.95;
  animation: floatUpDown 8s ease-in-out infinite, pulseGlow 3.5s ease-in-out infinite;
  filter: drop-shadow(0 0 4px #66ccff); /* base soft glow */
}



/* Pulse glow for the constellation veins */
@keyframes pulseGlow {
  0%, 100% {
    filter: drop-shadow(0 0 4px #66ccff);
  }
  50% {
    filter: drop-shadow(0 0 12px #99e6ff);
  }
}

.logic-rune-totem {
  position: absolute;
  right: -15%;
  bottom: -20px;
  width: 140px;
  max-width: 30vw;
  z-index: 2;
  pointer-events: none;
  animation: pulseTotem 4s ease-in-out infinite;
}

/* Pulse glow effect */
@keyframes pulseTotem {
  0%, 100% {
    filter: drop-shadow(0 0 6px #00ccff);
  }
  50% {
    filter: drop-shadow(0 0 12px #33ffff);
  }
}

/* Responsive for small screens */
@media (max-width: 640px) {
  .logic-rune-totem {
    width: 90px;
    right: 10px;
    bottom: -10px;
  }
}
.bush-deco {
  position: absolute;
  bottom: -10px;
  width: 240px;
  max-width: 40vw;
  pointer-events: none;
  opacity: 0.96;
  z-index: 1;
}

.bush-left {
  left: 20%;
  transform: scaleX(1);
}

.bush-right {
  right: 20%;
  transform: scaleX(-1); /* Flip horizontally */
}

@media (max-width: 640px) {
  .bush-deco {
    width: 150px;
    bottom: -6px;
  }

  .bush-left {
    left: 10%;
  }

  .bush-right {
    right: 10%;
  }
}
#xorForm button[type="submit"] {
  background-color: #92400e; /* fallback amber tone */
  color: white;
  font-weight: 600;
}
/* Memory Challenge Base */
#memory-challenge {
  background: linear-gradient(to bottom right, #fff7ed, #fdf2e9);
  border-radius: 1rem;
  box-shadow: 0 3px 20px rgba(0, 0, 0, 0.08);
  padding: 2rem;
}

/* Glyph Sequence Display */
#glyphSequence span {
  display: inline-block;
  margin: 0 0.5rem;
  font-size: 2rem;
  transition: all 0.4s ease;
  opacity: 0.6;
}

/* Glyph Buttons */
.glyph-btn {
  font-size: 1.75rem;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  border: 2px solid transparent;
  cursor: pointer;
}

.glyph-btn:hover {
  transform: scale(1.1);
  border-color: #fcd34d;
}

/* Feedback Text */
#memoryFeedback {
  font-size: 0.9rem;
  margin-top: 0.75rem;
}

/* Fade Animation */
@keyframes fade-in {
  from { opacity: 0; transform: translateY(0.25rem); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fade-in 0.5s ease forwards;
}
.wither-tile {
  width: 3.5rem;
  height: 3.5rem;
  background: #fffbe6;
  border: 2px solid #facc15;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 0.5rem;
  user-select: none;
}

.wither-tile.used {
  background: #fef3c7;
  opacity: 0.5;
  cursor: not-allowed;
}

.wither-tile.decayed {
  background: #fcd34d;
  color: #9a3412;
  animation: pulse-rot 1s infinite alternate;
}

@keyframes pulse-rot {
  from { transform: scale(1); opacity: 0.6; }
  to { transform: scale(1.05); opacity: 1; }
}
.wither-tile.decayed {
  background-color: #fcd34d; /* amber decay hue */
  text-shadow: 0 0 4px #92400e;
  filter: grayscale(80%) blur(1px);
  transition: all 0.5s ease-in-out;
}
@keyframes rotSpread {
  from {
    filter: grayscale(0%) blur(0px);
  }
  to {
    filter: grayscale(100%) blur(1px);
  }
}
.wither-tile.decayed {
  animation: rotSpread 0.5s ease forwards;
}
#witherDriftGrid:empty {
  display: none;
}
.wither-tile.start {
  background-color: #ecfccb;
  border-color: #4ade80;
}
.wither-tile.end {
  background-color: #e0f2fe;
  border-color: #38bdf8;
}
.filter-btn {
  transition: all 0.2s ease;
}

.filter-btn.active {
  box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.25); /* aqua halo */
  transform: translateY(-1px);
}
.main-title {
  letter-spacing: -0.03em;
}
@keyframes bounce-slow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.animate-bounce-slow {
  animation: bounce-slow 1.6s infinite;
}
/* 🚀 Force styling for the Load More button */
#load-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;

  /* Force the gradient + text color */
  background: linear-gradient(to right, #06b6d4, #3b82f6) !important;
  color: #ffffff !important;

  border: none;
  border-radius: 0.75rem;
  box-shadow: 0 8px 20px rgba(15, 118, 110, 0.35);
}

#load-more-btn span {
  color: #ffffff !important;
}
/* Logic Lab 1 tile styling */
#puzzleGrid button,
#puzzleGrid .tile {
  background: linear-gradient(to right, #0891b2, #2563eb);
  color: #ffffff;
  font-weight: 600;
  border-radius: 0.5rem;
  padding: 0.75rem;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

#puzzleGrid button:hover,
#puzzleGrid .tile:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.25);
}
/* 🌌 Logic Lab 3 – Celestial Drift Grid buttons */
#resetPuzzle5x5,
#hintPuzzle5x5 {
  padding: 0.5rem 1.25rem;
  font-weight: 600;
  font-size: 1rem;
  border-radius: 0.5rem;
  border: none;
  transition: all 0.3s ease;
}

/* Reset – keep on-brand blue gradient */
#resetPuzzle5x5 {
  background: linear-gradient(to right, #3b82f6, #6366f1);
  color: #ffffff !important;
}

#resetPuzzle5x5:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(79, 70, 229, 0.45);
}

/* Hint – orange CTA, force visible text */
#hintPuzzle5x5 {
  background: #f97316;              /* orange-500 */
  color: #ffffff !important;        /* make sure text is visible */
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.35);
}

#hintPuzzle5x5:hover {
  background: #ea580c;              /* orange-600 */
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(234, 88, 12, 0.45);
}
.drift-tile {
  width: 3rem;
  height: 3rem;
  font-size: 1.25rem;
  font-weight: bold;
  border: 2px solid #a78bfa;
  border-radius: 0.375rem;
  display: flex;
  flex-direction: column;           /* 👈 stack arrow + label vertically */
  align-items: center;
  justify-content: center;
  background-color: #f9f5ff;
  transition: background 0.3s ease;
}

/* Optional fine-tuning if you added inner spans/divs */
.drift-tile .tile-arrow {
  line-height: 1;
}

.drift-tile .tile-label {
  font-size: 0.6rem;
  margin-top: 0.1rem;
  letter-spacing: 0.03em;
}
/* Drift Vector Grid – tile layout */
#challenge-4 .drift-tile {
  display: flex;
  flex-direction: column;    /* stack arrow above label */
  align-items: center;
  justify-content: center;
  font-size: 1rem;           /* base size */
}

/* Arrow symbol */
#challenge-4 .drift-tile .tile-arrow {
  font-size: 1.25rem;
  line-height: 1;
}

/* START / GOAL label */
#challenge-4 .drift-tile .tile-label {
  font-size: 0.6rem;
  margin-top: 0.1rem;
  letter-spacing: 0.05em;
}
/* 🌌 Logic Lab 6 – Celestial Drift Relay buttons */
#startRelay {
  /* match the blue CTA style used in other labs */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;

  background: linear-gradient(to right, #06b6d4, #3b82f6) !important;
  color: #ffffff !important;

  font-weight: 700;
  font-size: 1rem;
  padding: 0.75rem 1.75rem;
  border-radius: 0.75rem;
  border: none;

  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#startRelay:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.6);
}

/* Hint button – orange, clearly visible text */
#hintRelay {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;

  background: #f97316 !important;   /* orange-500 */
  color: #ffffff !important;        /* force visible text */
  font-weight: 600;
  font-size: 0.95rem;

  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  border: none;

  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

#hintRelay:hover {
  background: #ea580c !important;   /* orange-600 */
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(234, 88, 12, 0.45);
}
/* 🔹 Tactical Kit primary CTA */
.tactical-primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;

  padding: 0.75rem 1.75rem;
  border-radius: 0.75rem;
  border: none;

  font-weight: 600;
  font-size: 0.95rem;

  color: #ffffff !important;
  background: linear-gradient(to right, #06b6d4, #3b82f6) !important;
  box-shadow: 0 8px 20px rgba(15, 118, 110, 0.35);

  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.tactical-primary-btn:hover {
  background: linear-gradient(to right, #0891b2, #2563eb) !important;
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.55);
}
/* Logic Lab 2 – Drift hint visibility helper */
#puzzleHint {
  display: none;
}

#puzzleHint.is-visible {
  display: block !important;
}
