/* ════════════════════════════════════════
   ACHIEVEMENTS + RECORDS — sub-pages
════════════════════════════════════════ */

/* ── Sub-page header (shared) ─────────── */
.subpage-header {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 20px;
}
.subpage-back {
  background: none; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 7px 14px;
  font-size: 0.85rem; font-weight: 600; cursor: pointer;
  color: var(--text-muted); font-family: inherit;
  transition: border-color 0.15s, color 0.15s; flex-shrink: 0;
}
.subpage-back:hover { border-color: var(--purple); color: var(--purple); }
.subpage-title {
  font-size: 1.15rem; font-weight: 800; color: var(--text);
  margin: 0; display: flex; align-items: center; gap: 10px;
}

/* ── Achievements grid ────────────────── */
.ach-earned-count {
  font-size: 0.8rem; font-weight: 700;
  background: var(--purple-light); color: var(--purple);
  border-radius: 20px; padding: 2px 10px;
}
.ach-section-title {
  font-size: 0.78rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 10px;
}
.ach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
}
.ach-card {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; padding: 14px 8px 10px;
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); border: 1.5px solid var(--border);
  cursor: default; text-align: center;
  transition: transform 0.15s, border-color 0.15s;
}
.ach-card-done  { border-color: var(--purple); }
.ach-card-locked{ opacity: 0.5; filter: grayscale(0.5); }
.ach-card:hover { transform: translateY(-2px); }
.ach-card-icon  { font-size: 1.8rem; line-height: 1; }
.ach-card-title { font-size: 0.7rem; font-weight: 700; color: var(--text); line-height: 1.3; }
.ach-card-date  {
  font-size: 0.62rem; color: #059669; font-weight: 700;
  line-height: 1.2; margin-top: 1px;
}
.ach-card-lock  {
  font-size: 0.65rem; opacity: 0.5;
}

/* ── Achievement progress bar ─────────── */
.ach-progress-bar {
  width: 100%; height: 4px;
  background: rgba(0,0,0,0.1);
  border-radius: 2px; overflow: hidden;
  margin-top: 2px;
}
.ach-progress-fill {
  height: 100%; background: var(--purple);
  border-radius: 2px;
  transition: width 0.3s ease;
  min-width: 2px;
}
.ach-progress-text {
  font-size: 0.6rem; color: var(--text-muted);
  font-weight: 600; margin-top: 1px;
}

/* ── Records grid ─────────────────────── */
.rec-list { display: block; }
.rec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}
.rec-tile {
  border-radius: var(--radius);
  padding: 14px 12px 12px;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 3px;
  border: 1.5px solid transparent;
}
.rec-tile-icon { font-size: 1.4rem; line-height: 1; margin-bottom: 2px; }
.rec-tile-val  {
  font-size: 1.25rem; font-weight: 800;
  color: var(--text); line-height: 1.1;
}
.rec-tile-unit {
  font-size: 0.72rem; font-weight: 600;
  color: var(--text-muted); margin-left: 3px;
}
.rec-tile-label {
  font-size: 0.72rem; color: var(--text-muted);
  font-weight: 500; line-height: 1.3;
}

/* ── Achievement modal ────────────────── */
.ach-modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
}
.ach-modal-overlay.ach-modal-visible {
  opacity: 1; pointer-events: all;
}
.ach-modal-box {
  background: var(--surface); border-radius: 22px;
  padding: 40px 28px 28px;
  text-align: center; max-width: 300px; width: 88%;
  box-shadow: 0 24px 60px rgba(0,0,0,0.22);
  position: relative; overflow: hidden;
  transform: scale(0.75) translateY(24px);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.ach-modal-overlay.ach-modal-visible .ach-modal-box {
  transform: scale(1) translateY(0);
}
.ach-modal-confetti {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
}
.ach-confetti-piece {
  position: absolute; top: -10px;
  animation: ach-confetti-fall linear forwards;
}
@keyframes ach-confetti-fall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateY(340px) rotate(400deg); opacity: 0; }
}
.ach-modal-icon {
  font-size: 4.2rem; line-height: 1; margin-bottom: 14px;
  display: block;
  animation: ach-icon-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) 0.12s both;
}
@keyframes ach-icon-pop {
  0%   { transform: scale(0) rotate(-15deg); }
  100% { transform: scale(1) rotate(0deg); }
}
.ach-modal-badge {
  font-size: 0.7rem; font-weight: 800; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--purple);
  background: var(--purple-light); border-radius: 20px;
  padding: 3px 14px; display: inline-block; margin-bottom: 10px;
}
.ach-modal-title {
  font-size: 1.35rem; font-weight: 800; color: var(--text); margin-bottom: 6px;
}
.ach-modal-desc {
  font-size: 0.85rem; color: var(--text-muted); margin-bottom: 24px; line-height: 1.5;
}
.ach-modal-btn {
  background: var(--purple); color: #fff;
  border: none; border-radius: var(--radius);
  padding: 12px 36px; font-size: 0.95rem; font-weight: 700;
  cursor: pointer; font-family: inherit; width: 100%;
  transition: opacity 0.15s;
}
.ach-modal-btn:hover { opacity: 0.88; }

/* ── Stats nav cards ──────────────────── */
.stats-nav-row  { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.stats-nav-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 16px;
  border: 1.5px solid var(--border); cursor: pointer;
  font-family: inherit; text-align: left; transition: border-color 0.15s;
  width: 100%;
}
.stats-nav-card:hover { border-color: var(--purple); }
.snc-icon  { font-size: 1.6rem; flex-shrink: 0; }
.snc-body  { flex: 1; min-width: 0; }
.snc-title { font-size: 0.9rem; font-weight: 700; color: var(--text); }
.snc-sub   { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.snc-arrow { font-size: 1.1rem; color: var(--text-muted); }
