:root {
  --pink:       #FF40A0;
  --pink-light: #FFB7E6;
  --yellow:     #F0FE72;
  --teal:       #60A3A6;
  --bg:         #0A0E27;
  --surface:    #1A203A;
  --border:     rgba(255, 255, 255, 0.08);
  --text-white: #FFFFFC;
  --text-muted: #BDC2C9;
  --text-body:  #C8D0E7;
  --font:       'Inter', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text-body);
  font-family: var(--font);
  min-height: 100vh;
}

/* ── HERO ─────────────────────────────────── */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 52px 40px 36px;
  gap: 18px;
}

.hero h1 {
  font-size: 50px;
  font-weight: 800;
  color: var(--text-white);
  line-height: 1.15;
}

.hero p {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 560px;
  line-height: 1.7;
}

.btn-test-skills {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(240, 254, 114, 0.45);
  color: var(--yellow);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  padding: 9px 22px;
  border-radius: 30px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.btn-test-skills:hover {
  background: rgba(240, 254, 114, 0.1);
  border-color: rgba(240, 254, 114, 0.75);
}

/* ── SECTION ──────────────────────────────── */
.challenges-section {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 36px 60px;
}

/* ── STATS ────────────────────────────────── */
.stats-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 44px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 30px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stat-card i   { font-size: 26px; }
.icon-pink     { color: var(--pink); }
.icon-yellow   { color: var(--yellow); }
.icon-teal     { color: var(--teal); }

.stat-card h3  { font-size: 38px; font-weight: 800; color: var(--text-white); line-height: 1; }
.stat-card p   { font-size: 14px; color: var(--text-muted); }

/* ── FILTERS ──────────────────────────────── */
.filters {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 18px;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.filter-row > span {
  font-size: 13px;
  color: var(--text-muted);
  min-width: 68px;
}

.filter-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btns button {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-body);
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 500;
  padding: 7px 18px;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}

.filter-btns button:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.35);
  color: var(--text-white);
}

/* Difficulty active = pink */
[data-type="difficulty"] button.active {
  background: var(--pink);
  border-color: var(--pink);
  color: #fff;
}

/* Category active = teal */
[data-type="category"] button.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

/* ── RESULTS COUNT ────────────────────────── */
#results-count {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* ── CHALLENGE GRID ───────────────────────── */
.challenges-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* ── CHALLENGE CARD ───────────────────────── */
.challenge-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 24px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
  height: 270px;
}

.challenge-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.14);
}

/* left accent stripe */
.challenge-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
}
.challenge-card.easy::before   { background: var(--teal); }
.challenge-card.medium::before { background: var(--yellow); }
.challenge-card.hard::before   { background: var(--pink); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* difficulty badges */
.badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
}

.badge-easy   { background: rgba(96, 163, 166, 0.2);  color: var(--teal);   }
.badge-medium { background: rgba(240, 254, 114, 0.15); color: var(--yellow); }
.badge-hard   { background: rgba(255, 64, 160, 0.15);  color: var(--pink);   }

.card-pts {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  color: var(--yellow);
}

.challenge-card h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-white);
  line-height: 1.3;
}

.challenge-card p {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.65;
  flex: 1;
  max-height: 88px;
  overflow: hidden;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}

.card-category {
  font-size: 13px;
  color: var(--teal);
  font-weight: 500;
  text-transform: capitalize;
}

.btn-view {
  background: transparent;
  border: 1.5px solid var(--pink);
  text-decoration: none;
  color: var(--pink);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}

.btn-view:hover {
  background: var(--pink);
  color: #fff;
}

/* ── RESPONSIVE ───────────────────────────── */
@media (max-width: 1024px) {
  .challenges-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  .stats-container  { grid-template-columns: 1fr; }
  .challenges-grid  { grid-template-columns: 1fr; }
  .hero h1          { font-size: 34px; }
  .challenges-section { padding: 0 20px 40px; }
}

/* ── PAGINATION ── */
.pagination-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 32px 0 48px;
}
.pagination-wrap.hidden { display: none; }

.page-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  background: #1A203A;
  color: #9aa5b8;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, color 0.2s;
}
.page-btn:hover:not(:disabled) { border-color: var(--pink); color: var(--pink); }
.page-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.page-numbers {
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-num {
  min-width: 40px;
  height: 40px;
  padding: 0 6px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  background: #1A203A;
  color: #9aa5b8;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  font-family: 'Inter', sans-serif;
}
.page-num:hover { border-color: var(--pink); color: var(--pink); }
.page-num.active {
  background: var(--pink);
  border-color: var(--pink);
  color: #fff;
  font-weight: 700;
}

.page-dot {
  color: #9aa5b8;
  font-size: 14px;
  padding: 0 4px;
  user-select: none;
}