/* One centered challenge with a glimpse of the next and previous cards. */
.challenge-cards {
  --challenge-card-width: min(72%, 340px);
  --challenge-card-gap: 16px;
  position: relative;
  display: flex;
  align-items: center;
  grid-template-columns: none;
  gap: var(--challenge-card-gap);
  box-sizing: border-box;
  width: min(100%, 1080px);
  max-width: 1080px;
  margin-inline: auto;
  padding: 14px 0 26px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
}

.challenge-cards::-webkit-scrollbar { display: none; }

/* Flex percentages resolve against the track itself, unlike inline padding. */
.challenge-cards::before,
.challenge-cards::after {
  content: "";
  flex: 0 0 max(0px, calc((100% - var(--challenge-card-width)) / 2 - var(--challenge-card-gap)));
  pointer-events: none;
}

.challenge-card {
  flex: 0 0 var(--challenge-card-width);
  width: var(--challenge-card-width);
  min-height: 345px;
  box-sizing: border-box;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  transform-origin: center;
  transition: transform 450ms ease, opacity 450ms ease, border-color 450ms ease, box-shadow 450ms ease;
}

.challenge-cards[data-carousel-ready] .challenge-card {
  transform: scale(.88);
  opacity: .82;
}

.challenge-cards[data-carousel-ready] .challenge-card.is-current {
  border-color: #c99bfc;
  box-shadow: 0 14px 38px #08030d61, 0 0 0 1px #c99bfc55;
  transform: scale(1);
  opacity: 1;
}

.challenge-card:not(.is-current) .hold-fill,
.challenge-card:not(.is-current) .maze-dot,
.challenge-card:not(.is-current) .math-answer,
.challenge-card:not(.is-current) .tic-grid .win {
  animation: none;
}

/* SVG and label share one exact center, including while the progress line rotates. */
.hold-ring {
  display: block;
  flex: 0 0 112px;
  width: 112px;
  height: 112px;
}

.hold-progress {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}

.hold-ring strong {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  text-align: center;
}

.hold-ring strong span { margin-top: 2px; }

@media (max-width: 560px) {
  .challenge-cards { --challenge-card-gap: 12px; }
  .challenge-card { min-height: 320px; padding: 18px; }
  .challenge-card > p { font-size: 15px; line-height: 1.6; }
  .challenge-card .challenge-visual { height: 145px; }
}

@media (prefers-reduced-motion: reduce) {
  .challenge-cards { scroll-behavior: auto; }
  .challenge-card { transition: none; }
}
