/* Challenges page styles (extracted) */
.challenges-section .container { max-width: 1100px; margin: 0 auto; }
.challenges-section h1 { font-size: 2.2rem; margin-bottom: 6px; }
.challenges-section .lead { color: #cfd8e6; margin-bottom: 18px; }
.controls { display:flex; gap:12px; align-items:center; margin-bottom:18px; }
.controls input[type=search] { flex:1; padding:10px 12px; border-radius:8px; border:1px solid rgba(255,255,255,0.06); background: rgba(255,255,255,0.03); color:inherit; }
.controls select { padding:10px 12px; border-radius:8px; border:1px solid rgba(255,255,255,0.06); background: rgba(255,255,255,0.03); color:inherit; }
.challenge-grid { display:grid; grid-template-columns: repeat(auto-fill,minmax(260px,1fr)); gap:18px; }

/* stronger, grid-scoped transition to avoid being overridden */

@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.challenge-card {
    background: rgba(255,255,255,0.10);
    padding:16px;
    border-radius:12px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.36);
  pointer-events: auto;
  transition: transform 320ms cubic-bezier(.16,.8,.24,1), box-shadow 320ms cubic-bezier(.16,.8,.24,1), opacity 260ms;
    position: relative;
    cursor: default;
}
/* Make cards uniform height and layout */
.challenge-grid .challenge-card {
  display: flex;
  flex-direction: column;
  height: 220px;
  min-height: 220px;
}

.challenge-card .meta {
  flex: 0 0 auto;
}

.challenge-card h3 {
  margin: 0 0 6px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.15em;
  max-height: calc(1.15em * 2);
}

.challenge-card .desc {
  flex: 1 1 1px;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2em;
}

.challenge-card .card-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Buttons inside cards: consistent sizing */
.challenge-card button,
.challenge-card .play-button,
.challenge-card a.button {
  height: 40px;
  min-width: 96px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.challenge-card h3 { margin:0 0 6px 0; }
.challenge-card .sub { color:#cbd7ea; font-size:0.9rem; margin-bottom:8px; }
.challenge-card .desc { color:#d6dee9; font-size:0.95rem; margin-bottom:12px; }
.challenge-card .card-foot { display:flex; justify-content:space-between; color:#bcd0ef; font-weight:600; }
.challenge-card .stars { color:#ffd56b; }
.challenge-card .id { opacity:0.9 }

/* Optional load animation: add `animate` class to run cardFadeIn without blocking hover */
.challenge-card.animate { animation: cardFadeIn 420ms ease both; }

/* stronger selector to override accidental resets */

.empty { color:#9fb0d0; padding:28px; text-align:center; }

/* Failsafe: force hover lift and transition if other rules override */
.challenge-card:hover,
.challenge-card:focus-within {
  transform: translateY(-6px);
  box-shadow: 0 8px 18px rgba(0,0,0,0.32);
}

/* JS-driven class for pointer delegation */
.challenge-card.is-hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 18px rgba(0,0,0,0.32);
}
