.challenges-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 32px;
  margin-top: 32px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.challenge-card {
  background: var(--card-bg, #181b2a);
  border-radius: 18px;
  box-shadow: 0 4px 24px 0 rgba(0,0,0,0.16);
  overflow: hidden;
  width: calc(33.33% - 22px);
  min-width: 300px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  transition: transform 0.2s;
}

.challenge-card:hover {
  transform: translateY(-4px) scale(1.02);
}

.card-image {
  height: 180px;
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

.status {
  position: absolute;
  top: 14px;
  right: 14px;
  background: #36e67d;
  color: #fff;
  font-size: 0.9em;
  font-weight: bold;
  border-radius: 8px;
  padding: 4px 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.card-content {
  padding: 20px 18px 16px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.challenge-details {
  margin: 14px 0 10px 0;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 1em;
}

.prize-section {
  margin: 12px 0 8px 0;
}

.submit-button {
  margin-top: 10px;
  padding: 8px 0;
  border-radius: 8px;
  border: none;
  font-weight: bold;
  font-size: 1em;
  background: var(--button-bg, #2c2f47);
  color: #fff;
  cursor: pointer;
  transition: all 0.2s;
}

.submit-button:hover {
  background: var(--button-hover-bg, #3a3e5c);
}

.challenges-tabs {
  display: flex;
  gap: 16px;
  margin: 24px 0;
}

.tab-button {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  background: var(--button-bg, #2c2f47);
  color: #fff;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 600;
}

.tab-button.active {
  background: var(--accent-color, #36e67d);
  box-shadow: 0 2px 8px rgba(54,230,125,0.3);
}

.tab-button:hover:not(.active) {
  background: var(--button-hover-bg, #3a3e5c);
}

@media (max-width: 1200px) {
  .challenge-card {
    width: calc(50% - 16px);
  }
}

@media (max-width: 768px) {
  .challenge-card {
    width: 100%;
  }
}

@media (max-width: 900px) {
  .challenges-grid {
    gap: 18px;
  }
  .challenge-card {
    width: 90vw;
    min-width: 220px;
    max-width: 360px;
  }
}

@media (max-width: 600px) {
  .challenges-grid {
    flex-direction: column;
    align-items: center;
    gap: 14px;
  }
  .challenge-card {
    width: 96vw;
    min-width: 0;
    max-width: 98vw;
  }
}

.rules-content-container {
    display: flex;
    justify-content: center;
    align-items: center;
    
}

.rules-content {
    background: rgba(20, 20, 25, 0.98);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 12px;
    padding: 2rem;
    max-width: 800px;
    width: 100%;
    position: relative;
    transform: translateY(-30px);
    transition: all 0.3s ease;
    margin: 2rem;
    margin-top: 50px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.rules-popup.active .rules-content {
    transform: translateY(0);
    opacity: 1;
}

.rules-content h2 {
    color: #ffc107;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    text-align: center;
}

.rules-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}

.rules-content li {
    color: #fff;
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.5;
    text-align: left;
}

.rules-content li::before {
    content: "•";
    color: #ffc107;
    position: absolute;
    left: 0;
    font-size: 1.2rem;
    text-align: left;
}

.prize-section {
   color: var(--accent-color, #36e67d);
}

.challenges-container > .challenges-header > .challenges-title {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  color: #ffcc01;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(255, 204, 1, 0.5);
  position: relative;
  display: inline-block;
  margin-block-start: 0.67em;
  margin-block-end: 0.67em;
  margin-inline-start: 0px;
  margin-inline-end: 0px;
  font-weight: bold;
  unicode-bidi: isolate;
}    

.challenges-container > .challenges-header > .challenges-title::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 3px;
  background: linear-gradient(90deg, transparent, #ffcc01, transparent);
}

.challenges-subtitle {
  font-size: 1.5rem;
  color: rgb(255, 206, 0);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 4px;
  margin-bottom: 2rem;
  animation: 
  subtitleGlow 2s ease-in-out infinite alternate,
  subtitleFloat 3s ease-in-out infinite;
  text-shadow: 
  0 0 5px #eeff00,
  0 0 10px rgba(255, 217, 0, 0.4),
  0 0 20px rgb(255, 0, 0, 0.2);
  perspective: 500px;
  transform-style: preserve-3d;
}

@keyframes subtitleGlow {
  0% {
    opacity: 0.4;
    text-shadow: 
    0 0 5px rgb(238, 255, 0, 0.5),
    0 0 10px rgba(255, 217, 0, 0.3),
    0 0 20px rgb(255, 0, 0, 0.1);
  }
  100% {
    opacity: 1;
    text-shadow: 
    0 0 5px #eeff00,
    0 0 10px rgba(255, 217, 0, 0.9),
    0 0 20px rgb(255, 0, 0, 0.7);
  }
}

@keyframes subtitleFloat {
  0%, 100% {
    transform: translateY(0) rotateX(5deg);
  }
  50% {
    transform: translateY(-5px) rotateX(-5deg);
  }
}


.challenges-subtitle {
  display: flex;
  justify-content: center;
  gap: 1rem;
  font-size: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 4px;
  margin-bottom: 2rem;
}

.challenges-subtitle span {
  position: relative;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.word-1 { color: #009246; } /* Green */
.word-2 { color: #ffffff; } /* White */
.word-3 { color: #CE2B37; } /* Red */

.challenges-subtitle:hover span {
  cursor: default;
  animation: wave 0.8s ease-in-out forwards;
  animation-delay: calc(var(--i) * 0.1s);
}
.challenges-subtitle:hover {
  cursor: default;
}

@keyframes wave {
  0%, 100% {
      transform: translateY(0) scale(1);
  }
  25% {
      transform: translateY(calc(var(--amplitude) * -1px)) scale(1.1);
  }
  50% {
      transform: translateY(0) scale(1.05);
  }
  75% {
      transform: translateY(calc(var(--amplitude) * 0.5px)) scale(1.08);
  }
}

/* Futuristic dot styling */
.challenges-subtitle::before,
.challenges-subtitle::after {
  content: '•';
  color: #fbff00;
  animation: dotPulse 2s infinite;
}

@keyframes dotPulse {
  0%, 100% { opacity: 0.2; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.5); }
}

