/* ── Achievements gallery (My Dashboard → Achievements tab) ─────────────
   Rendered by js/achievements.js into #ach-categories / #ach-jump. Moved
   from achievements.html (now a redirect). Everything sits on solid cards —
   never text straight on the page scene — and each game section is tinted
   by its --ach-game-color / --ach-game-bg (CAT_VISUALS in achievements.js).
   Accent colours used as text are mixed with --btn-text so they stay
   readable on dark themes. */

/* Summary: big X / Y, progress bar */
.ach-summary {
  display: flex;
  align-items: center;
  gap: 16px 26px;
  flex-wrap: wrap;
  padding: 22px 26px;
  margin-bottom: 14px;
  background: var(--surface);
  border: 1.5px solid var(--btn-border);
  border-radius: 18px;
}
.ach-count-num {
  font-size: 44px;
  font-weight: 800;
  color: color-mix(in srgb, var(--purple) 80%, var(--btn-text));
  letter-spacing: -.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.ach-count-num.ach-count-total { color: var(--text-muted); }
.ach-count-sep { font-size: 26px; color: var(--text-muted); margin: 0 3px; }
.ach-progress-wrap { flex: 1; min-width: 180px; }
.ach-progress-label { font-size: 13px; font-weight: 600; color: color-mix(in srgb, var(--text-muted) 60%, var(--btn-text)); margin-bottom: 8px; }
.ach-progress-track { height: 12px; background: color-mix(in srgb, var(--purple) 12%, var(--surface-2, var(--surface))); border-radius: 99px; overflow: hidden; margin-bottom: 6px; }
.ach-progress-fill { height: 100%; width: 0%; background: var(--purple); border-radius: 99px; transition: width .8s cubic-bezier(.4,0,.2,1); }
.ach-pct { font-size: 12.5px; font-weight: 700; color: var(--text-muted); }

/* "Jump to" chips — one per game */
.ach-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px;
  margin-bottom: 18px;
  background: var(--surface);
  border: 1.5px solid var(--btn-border);
  border-radius: 18px;
}
.ach-jump:empty { display: none; }
.ach-jump-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 5px;
  border-radius: 999px;
  background: var(--surface-2, var(--surface));
  border: 1.5px solid var(--btn-border);
  color: var(--btn-text);
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  transition: border-color .12s, background .12s;
}
.ach-jump-chip:hover { border-color: var(--ach-game-color); background: color-mix(in srgb, var(--ach-game-color) 8%, var(--surface)); }
.ach-jump-chip:focus-visible { outline: 3px solid color-mix(in srgb, var(--ach-game-color) 50%, transparent); outline-offset: 2px; }
.ach-jump-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ach-game-color) 16%, var(--surface));
  color: var(--ach-game-color);
}
.ach-jump-icon svg { width: 14px; height: 14px; display: block; }
.ach-jump-icon .bi { font-size: 12px; line-height: 1; }
.ach-jump-count { font-size: 11px; font-weight: 800; color: var(--text-muted); }
.ach-jump-chip.complete .ach-jump-count { color: #16A34A; }

/* One game's section: a solid card with a tinted header */
.ach-section {
  scroll-margin-top: 16px;   /* the scroll box starts below the nav */
  margin-bottom: 14px;
  padding: 16px 18px 18px;
  background: var(--surface);
  border: 1.5px solid color-mix(in srgb, var(--ach-game-color, var(--btn-border)) 22%, var(--btn-border));
  border-radius: 18px;
}
.ach-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.ach-section-header h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: var(--btn-text);
}
.ach-header-game-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  color: var(--ach-game-color, var(--btn-text));
  background: color-mix(in srgb, var(--ach-game-color, var(--purple)) 15%, var(--surface));
}
.ach-header-game-icon svg { width: 20px; height: 20px; }
.ach-header-game-icon i { font-size: 18px; line-height: 1; }
.ach-cat-pill {
  flex: none;
  font-size: 12px;
  font-weight: 800;
  padding: 3px 11px;
  border-radius: 99px;
  background: var(--surface-2, var(--surface));
  border: 1.5px solid var(--btn-border);
  color: var(--text-muted);
}
.ach-cat-pill.complete { background: #16A34A; border-color: #16A34A; color: #fff; }

/* Achievement cards */
.ach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}
.ach-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 70px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1.5px solid var(--btn-border);
  background: var(--surface-2, var(--surface));
}
.ach-card.unlocked {
  border-color: color-mix(in srgb, var(--ach-game-color, var(--purple)) 55%, var(--btn-border));
  background: color-mix(in srgb, var(--ach-game-color, var(--purple)) 8%, var(--surface));
}
.ach-card.locked .ach-body { opacity: .72; }
.ach-card.secret-locked { border-style: dashed; }
.ach-card.secret-locked .ach-body { opacity: .6; }

/* Icon circle: the game's SVG — coloured when earned, grey when not */
.ach-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--btn-text) 7%, var(--surface));
  color: color-mix(in srgb, var(--text-muted) 80%, var(--surface));
}
.ach-icon svg { width: 21px; height: 21px; display: block; }
.ach-icon .bi { font-size: 18px; line-height: 1; }
.ach-card.unlocked .ach-icon {
  background: var(--ach-game-color, var(--purple));
  color: #fff;
  box-shadow: 0 3px 10px color-mix(in srgb, var(--ach-game-color, var(--purple)) 35%, transparent);
}

.ach-body { flex: 1; min-width: 0; }
.ach-title { font-size: 13.5px; font-weight: 800; color: var(--btn-text); line-height: 1.3; margin-bottom: 3px; padding-right: 22px; }
.ach-desc { font-size: 12.5px; color: color-mix(in srgb, var(--text-muted) 70%, var(--btn-text)); line-height: 1.45; }
.ach-earned { margin-top: 5px; font-size: 11.5px; font-weight: 700; color: color-mix(in srgb, var(--ach-game-color, var(--purple)) 70%, var(--btn-text)); }
.ach-check {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #16A34A;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

@media (max-width: 480px) {
  .ach-grid { grid-template-columns: 1fr; }
  .ach-count-num { font-size: 36px; }
  .ach-section { padding: 14px 12px; }
}
