/* HexBit Challenge — animated leaderboard page */
.hc-page {
  --hc-gold: #ffd24a;
  --hc-pink: #ff5ec8;
  --hc-orange: #ff8a3d;
}

.hc-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(ellipse 60% 40% at 20% 10%, rgba(255, 94, 200, 0.18), transparent 55%),
    radial-gradient(ellipse 50% 45% at 90% 20%, rgba(61, 231, 255, 0.2), transparent 50%),
    radial-gradient(ellipse 45% 40% at 50% 90%, rgba(124, 255, 178, 0.12), transparent 55%),
    #05070f;
}
.hc-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.55;
  animation: hc-float 12s ease-in-out infinite;
}
.hc-orb-a {
  width: 280px; height: 280px;
  left: -60px; top: 18%;
  background: rgba(255, 94, 200, 0.45);
}
.hc-orb-b {
  width: 320px; height: 320px;
  right: -80px; top: 8%;
  background: rgba(61, 231, 255, 0.4);
  animation-delay: -4s;
}
.hc-orb-c {
  width: 240px; height: 240px;
  left: 40%; bottom: 5%;
  background: rgba(255, 210, 74, 0.28);
  animation-delay: -7s;
}
.hc-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(61, 231, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(61, 231, 255, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 20%, transparent 75%);
  animation: hc-grid-drift 28s linear infinite;
}
#hc-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.55;
}

@keyframes hc-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(18px, -22px) scale(1.06); }
}
@keyframes hc-grid-drift {
  from { background-position: 0 0; }
  to { background-position: 48px 48px; }
}

.hc-hero {
  position: relative;
  padding: clamp(1.4rem, 4vw, 2.8rem) 0 1.5rem;
  text-align: center;
  max-width: 920px;
  margin: 0 auto;
}
.hc-hero-art {
  margin: 0 auto 1.25rem;
  max-width: 860px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(61, 231, 255, 0.28);
  box-shadow:
    0 0 40px rgba(255, 94, 200, 0.18),
    0 0 50px rgba(61, 231, 255, 0.14);
  opacity: 0;
  transform: translateY(14px) scale(0.985);
  animation: hc-rise 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.05s forwards;
}
.hc-hero-art img {
  display: block;
  width: 100%;
  height: auto;
}
.hc-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.9rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 210, 74, 0.35);
  background: rgba(255, 210, 74, 0.08);
  color: var(--hc-gold);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.hc-pulse {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--volt);
  box-shadow: 0 0 0 0 rgba(124, 255, 178, 0.7);
  animation: hc-pulse 1.8s ease-out infinite;
}
@keyframes hc-pulse {
  0% { box-shadow: 0 0 0 0 rgba(124, 255, 178, 0.55); }
  70% { box-shadow: 0 0 0 12px rgba(124, 255, 178, 0); }
  100% { box-shadow: 0 0 0 0 rgba(124, 255, 178, 0); }
}
.hc-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 8vw, 4.2rem);
  letter-spacing: 0.04em;
  line-height: 1.05;
  background: linear-gradient(105deg, #fff 10%, var(--cyan) 45%, var(--hc-gold) 75%, var(--hc-pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: hc-title-shine 6s ease-in-out infinite;
  background-size: 180% 100%;
}
.hc-title span { font-family: var(--font-brush), var(--font-display); }
@keyframes hc-title-shine {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.hc-lead {
  margin: 1rem auto 0;
  max-width: 36rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}
.hc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.4rem;
}
.hc-stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 2rem;
}
.hc-stat {
  padding: 0.9rem 0.7rem;
  border-radius: 16px;
  border: 1px solid rgba(61, 231, 255, 0.22);
  background: rgba(8, 14, 26, 0.55);
  backdrop-filter: blur(8px);
}
.hc-stat b {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 3vw, 1.45rem);
  color: var(--ink);
  letter-spacing: 0.03em;
}
.hc-stat span {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hc-board-section {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1rem 1.25rem 2.5rem;
}
.hc-board-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
}
.hc-board-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan);
}
.hc-tabs {
  display: inline-flex;
  padding: 0.25rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
}
.hc-tab {
  padding: 0.55rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.hc-tab.is-active {
  color: #061018;
  background: linear-gradient(135deg, var(--cyan), var(--volt));
  box-shadow: 0 0 18px rgba(61, 231, 255, 0.35);
}

.hc-podium {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  gap: 0.75rem;
  align-items: end;
  margin-bottom: 1.2rem;
}
.hc-podium-card {
  position: relative;
  padding: 1rem 0.85rem 1.15rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 14, 26, 0.65);
  text-align: center;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px);
  animation: hc-rise 0.65s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.hc-podium-card:nth-child(1) { animation-delay: 0.12s; order: 2; min-height: 168px; }
.hc-podium-card:nth-child(2) { animation-delay: 0.22s; order: 1; min-height: 140px; }
.hc-podium-card:nth-child(3) { animation-delay: 0.32s; order: 3; min-height: 128px; }
.hc-podium-card.is-1 {
  border-color: rgba(255, 210, 74, 0.55);
  box-shadow: 0 0 32px rgba(255, 210, 74, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 210, 74, 0.18), transparent 55%),
    rgba(8, 14, 26, 0.7);
}
.hc-podium-card.is-2 {
  border-color: rgba(190, 210, 230, 0.45);
  box-shadow: 0 0 24px rgba(190, 210, 230, 0.12);
}
.hc-podium-card.is-3 {
  border-color: rgba(255, 138, 61, 0.45);
  box-shadow: 0 0 24px rgba(255, 138, 61, 0.12);
}
.hc-podium-rank {
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.hc-podium-nick {
  margin: 0.45rem 0 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.03em;
  word-break: break-word;
}
.hc-podium-km {
  margin: 0.35rem 0 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--volt);
}
.hc-podium-sub {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
}
@keyframes hc-rise {
  to { opacity: 1; transform: translateY(0); }
}

.hc-board-card {
  border-radius: 20px;
  border: 1px solid rgba(61, 231, 255, 0.25);
  background: rgba(6, 10, 20, 0.72);
  backdrop-filter: blur(12px);
  overflow: hidden;
  box-shadow: 0 0 40px rgba(61, 231, 255, 0.08);
}
.hc-board-meta {
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid rgba(61, 231, 255, 0.12);
  font-size: 0.85rem;
  color: var(--muted);
}
.hc-list {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0;
  max-height: min(62vh, 640px);
  overflow: auto;
}
.hc-row {
  display: grid;
  grid-template-columns: 3rem 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.8rem 1.1rem;
  border-bottom: 1px solid rgba(61, 231, 255, 0.08);
  opacity: 0;
  transform: translateX(-12px);
  animation: hc-row-in 0.45s ease forwards;
}
.hc-row:nth-child(odd) {
  background: rgba(61, 231, 255, 0.03);
}
.hc-row.is-top {
  background: linear-gradient(90deg, rgba(255, 210, 74, 0.1), transparent 55%);
}
.hc-rank {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--cyan);
}
.hc-row.is-top .hc-rank { color: var(--hc-gold); }
.hc-nick {
  font-weight: 700;
  font-size: 0.98rem;
}
.hc-sub {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.hc-km {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--volt);
  white-space: nowrap;
}
.hc-badges {
  display: inline-flex;
  gap: 0.25rem;
  margin-left: 0.35rem;
  vertical-align: middle;
}
.hc-badge {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(255, 94, 200, 0.18);
  color: #ffb3e4;
  border: 1px solid rgba(255, 94, 200, 0.35);
}
.hc-empty {
  margin: 0;
  padding: 2.2rem 1.4rem;
  text-align: center;
  color: var(--muted);
  line-height: 1.55;
}
@keyframes hc-row-in {
  to { opacity: 1; transform: translateX(0); }
}

.hc-how { padding-top: 1rem; }
.hc-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.hc-step {
  padding: 1.15rem 1.1rem;
  border-radius: 18px;
  border: 1px solid rgba(61, 231, 255, 0.22);
  background:
    linear-gradient(145deg, rgba(255, 94, 200, 0.08), transparent 50%),
    var(--panel);
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.hc-step:hover {
  transform: translateY(-4px);
  border-color: rgba(61, 231, 255, 0.5);
}
.hc-step-n {
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  color: var(--hc-pink);
}
.hc-step h4 {
  margin: 0.45rem 0 0.4rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
}
.hc-step p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

/* Homepage challenge promo */
.hc-home-promo {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 0;
  min-height: min(52vh, 420px);
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(61, 231, 255, 0.28);
  box-shadow: 0 0 40px rgba(255, 94, 200, 0.12), 0 0 50px rgba(61, 231, 255, 0.1);
  opacity: 0;
  transform: translateY(16px);
  animation: hc-promo-in 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.1s forwards;
}
.hc-home-promo-media {
  position: relative;
  min-height: 240px;
  background: #05070f center / cover no-repeat;
}
.hc-home-promo-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 40%, rgba(5, 7, 15, 0.92));
}
.hc-home-promo-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.6rem 1.5rem;
  background:
    linear-gradient(135deg, rgba(255, 94, 200, 0.12), transparent 50%),
    rgba(6, 10, 20, 0.94);
}
.hc-home-promo-copy .hc-kicker { align-self: flex-start; margin: 0; }
.hc-home-promo-copy h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  letter-spacing: 0.04em;
  line-height: 1.15;
}
.hc-home-promo-copy h3 span {
  background: linear-gradient(90deg, var(--cyan), var(--hc-gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hc-home-promo-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  max-width: 28rem;
}
.hc-home-promo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.35rem;
}
@keyframes hc-promo-in {
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 860px) {
  .hc-stat-row, .hc-steps { grid-template-columns: 1fr; }
  .hc-podium { grid-template-columns: 1fr; }
  .hc-podium-card:nth-child(1),
  .hc-podium-card:nth-child(2),
  .hc-podium-card:nth-child(3) {
    order: initial;
    min-height: 0;
  }
  .hc-home-promo {
    grid-template-columns: 1fr;
  }
  .hc-home-promo-media {
    min-height: 200px;
  }
  .hc-home-promo-media::after {
    background: linear-gradient(180deg, transparent 30%, rgba(5, 7, 15, 0.95));
  }
}

@media (prefers-reduced-motion: reduce) {
  .hc-orb, .hc-grid, .hc-title, .hc-pulse, .hc-podium-card, .hc-row, .hc-home-promo {
    animation: none !important;
  }
  .hc-podium-card, .hc-row, .hc-home-promo {
    opacity: 1;
    transform: none;
  }
}
