/* achievements.css */

.achTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.achTopRight {
  display: flex;
  align-items: center;
  gap: 12px;
}
.achProfileLink {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: color .15s, border-color .15s;
}
.achProfileLink:hover {
  color: var(--text);
  border-color: var(--text);
}

/* Summary */
.achSummary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 20px 0 16px;
}
.achStat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 12px;
  text-align: center;
}
.achStatVal {
  font-size: 28px;
  font-weight: 800;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--text);
}
.achStatLabel {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

@media (max-width: 520px) {
  .achSummary { grid-template-columns: repeat(2, 1fr); }
  .achStatVal { font-size: 22px; }
}

/* Progress bar */
.achProgressWrap {
  margin: 0 0 20px;
}
.achProgressBar {
  height: 6px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
}
.achProgressFill {
  height: 100%;
  background: linear-gradient(90deg, #4aa0ff, #a078ff);
  border-radius: 3px;
  transition: width .4s ease;
}

/* Filter chips */
.achFilters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 20px;
}
.achChip {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}
.achChip:hover {
  color: var(--text);
  border-color: var(--text);
}
.achChip.active {
  background: rgba(74, 160, 255, .12);
  border-color: rgba(74, 160, 255, .4);
  color: #4aa0ff;
}

/* Achievement grid */
.achGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin: 0 0 32px;
}

.achCard {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  transition: border-color .2s, transform .15s;
  position: relative;
  overflow: hidden;
}
.achCard:hover {
  border-color: rgba(74, 160, 255, .3);
}
.achCard.locked {
  opacity: .5;
}
.achCard.locked .achIcon {
  filter: grayscale(1);
}
.achCard.unlocked {
  border-color: rgba(74, 160, 255, .25);
}
.achCard.unlocked::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, #4aa0ff, #a078ff);
}

.achIcon {
  font-size: 32px;
  line-height: 1;
  flex-shrink: 0;
  width: 40px;
  text-align: center;
}
.achInfo {
  flex: 1;
  min-width: 0;
}
.achName {
  font-weight: 700;
  font-size: 15px;
  margin: 0 0 4px;
}
.achDesc {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  margin: 0 0 8px;
}
.achDate {
  font-size: 11px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Progress bar on card */
.achCardProgress {
  height: 4px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 6px;
}
.achCardProgressFill {
  height: 100%;
  background: #4aa0ff;
  border-radius: 2px;
  transition: width .3s;
}
.achProgressLabel {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Unlocked badge */
.achCheck {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 16px;
  color: #4aa0ff;
}

/* Recently unlocked */
.achRecent {
  margin: 0 0 32px;
}
.achSectionTitle {
  font-size: 18px;
  margin: 0 0 12px;
}
.achRecentList {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.achRecentPill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid rgba(74, 160, 255, .25);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 14px;
}
.achRecentIcon {
  font-size: 20px;
}
.achRecentName {
  font-weight: 600;
}
.achRecentDate {
  font-size: 11px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Toast notification for newly unlocked */
.achToast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--card);
  border: 1px solid rgba(74, 160, 255, .4);
  border-radius: 14px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 9999;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
  opacity: 0;
  transition: transform .4s cubic-bezier(.34,1.56,.64,1), opacity .3s;
  pointer-events: none;
}
.achToast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.achToastIcon { font-size: 28px; }
.achToastText { font-weight: 600; font-size: 15px; }
.achToastSub { font-size: 12px; color: var(--muted); }

/* Card entrance animation */
@keyframes achFadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.achCard {
  animation: achFadeUp .35s ease both;
}
.achCard:nth-child(1)  { animation-delay: .02s; }
.achCard:nth-child(2)  { animation-delay: .05s; }
.achCard:nth-child(3)  { animation-delay: .08s; }
.achCard:nth-child(4)  { animation-delay: .11s; }
.achCard:nth-child(5)  { animation-delay: .14s; }
.achCard:nth-child(6)  { animation-delay: .17s; }
.achCard:nth-child(7)  { animation-delay: .20s; }
.achCard:nth-child(8)  { animation-delay: .23s; }
.achCard:nth-child(9)  { animation-delay: .26s; }
.achCard:nth-child(10) { animation-delay: .29s; }
@media (prefers-reduced-motion: reduce) {
  .achCard { animation: none; }
}

/* Unlocked card shimmer on hover */
.achCard.unlocked:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(74, 160, 255, .12);
}

/* Empty state (no achievements yet) */
.achEmpty {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
}
.achEmptyIcon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: .5;
}
.achEmptyTitle {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.achEmptyDesc {
  font-size: 14px;
  line-height: 1.5;
  max-width: 360px;
  margin: 0 auto 16px;
}
.achEmptyCTA {
  display: inline-block;
  padding: 10px 22px;
  background: linear-gradient(135deg, #4aa0ff, #6d8fff);
  color: #fff;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  transition: opacity .15s;
}
.achEmptyCTA:hover { opacity: .85; }

/* Light theme adjustments */
:root[data-theme="light"] .achCard.unlocked:hover {
  box-shadow: 0 4px 16px rgba(74, 160, 255, .08);
}
:root[data-theme="light"] .achToast,
:root[data-theme="light"] .achRecentPill {
  box-shadow: 0 4px 20px rgba(0,0,0,.1);
}

/* Footer */
.footer { margin-top: 40px; }
.footlinks { text-align: center; margin-bottom: 8px; }
.footlinks a { color: var(--muted); text-decoration: none; font-size: 13px; }
.footlinks a:hover { color: var(--text); }
.sep { color: var(--muted); margin: 0 6px; font-size: 12px; }
.fineprint { text-align: center; font-size: 12px; color: var(--muted); }
