/* Conquistas — gamificação */
.ach-page {
  width: 100%;
  max-width: var(--lm-content-max);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.ach-page .med-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.85rem;
  align-items: flex-end;
}

.ach-page .med-header h2 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.ach-page .med-header p {
  margin: 0.3rem 0 0;
  color: var(--lm-text-muted);
  font-size: 0.92rem;
}

.ach-page .med-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.ach-content {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.ach-hero {
  display: grid;
  gap: 1rem;
  padding: 1.25rem 1.35rem;
  border-radius: var(--lm-radius);
  background:
    linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(20, 184, 166, 0.12)),
    var(--lm-surface);
  border: 1px solid var(--lm-border);
  box-shadow: var(--lm-shadow);
}

@media (min-width: 800px) {
  .ach-hero {
    grid-template-columns: auto 1fr auto;
    align-items: center;
  }
}

.ach-level-badge {
  width: 88px;
  height: 88px;
  border-radius: 1.25rem;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--lm-primary), var(--lm-secondary));
  color: #fff;
  text-align: center;
  box-shadow: 0 12px 28px rgba(59, 130, 246, 0.28);
}

.ach-level-badge strong {
  display: block;
  font-size: 1.75rem;
  line-height: 1;
  letter-spacing: -0.03em;
}

.ach-level-badge span {
  font-size: 0.72rem;
  opacity: 0.9;
  font-weight: 600;
}

.ach-hero-main h3 {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.ach-hero-main p {
  margin: 0.25rem 0 0.75rem;
  color: var(--lm-text-muted);
  font-size: 0.9rem;
}

.ach-xp-bar {
  height: 0.65rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  overflow: hidden;
  border: 1px solid var(--lm-border);
}

.ach-xp-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--lm-primary), var(--lm-secondary));
  transition: width 0.45s var(--lm-ease);
}

.ach-xp-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.4rem;
  font-size: 0.78rem;
  color: var(--lm-text-muted);
}

.ach-hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.ach-stat {
  padding: 0.65rem 0.75rem;
  border-radius: var(--lm-radius-sm);
  background: var(--lm-bg);
  border: 1px solid var(--lm-border);
  text-align: center;
}

.ach-stat strong {
  display: block;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.ach-stat span {
  font-size: 0.72rem;
  color: var(--lm-text-muted);
}

.ach-next {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1rem;
  padding: 1rem 1.15rem;
  border-radius: var(--lm-radius);
  background: var(--lm-surface);
  border: 1px dashed rgba(59, 130, 246, 0.35);
}

.ach-next-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--lm-primary-soft);
  color: var(--lm-primary);
  font-size: 1.2rem;
  flex-shrink: 0;
}

.ach-next-copy {
  flex: 1 1 180px;
  min-width: 0;
}

.ach-next-copy strong {
  display: block;
  font-size: 0.95rem;
}

.ach-next-copy p {
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
  color: var(--lm-text-muted);
}

.ach-next-progress {
  flex: 1 1 200px;
  min-width: 160px;
  max-width: 320px;
}

.ach-next-progress label {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.78rem;
  color: var(--lm-text-muted);
  margin-bottom: 0.4rem;
}

.ach-next-progress .ach-mini-bar {
  height: 0.55rem;
}

.ach-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.ach-filter {
  border: 1px solid var(--lm-border);
  background: var(--lm-surface);
  color: var(--lm-text-muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
}

.ach-filter.is-active {
  background: var(--lm-primary-soft);
  color: var(--lm-primary);
  border-color: rgba(59, 130, 246, 0.35);
}

.ach-grid {
  display: grid;
  grid-template-columns: 1fr;
  column-gap: 1.25rem;
  row-gap: 1.25rem;
  align-content: start;
}

@media (min-width: 720px) {
  .ach-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {
  .ach-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.ach-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0;
  padding: 1.1rem;
  border-radius: var(--lm-radius);
  background: var(--lm-surface);
  border: 1px solid var(--lm-border);
  opacity: 0.78;
  transition: transform 0.2s var(--lm-ease), box-shadow 0.2s var(--lm-ease), opacity 0.2s;
  overflow: hidden;
  min-height: 100%;
  box-sizing: border-box;
}

.ach-card:hover {
  transform: translateY(-2px);
}

.ach-card.is-unlocked {
  opacity: 1;
  box-shadow: var(--lm-shadow);
}

.ach-card.is-unlocked::after {
  content: '';
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--lm-primary), var(--lm-secondary));
}

.ach-card-top {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}

.ach-icon {
  width: 52px;
  height: 52px;
  border-radius: 1rem;
  display: grid;
  place-items: center;
  background: var(--lm-primary-soft);
  color: var(--lm-primary);
  font-size: 1.35rem;
  flex-shrink: 0;
}

.ach-card.is-unlocked .ach-icon {
  background: linear-gradient(145deg, var(--lm-primary-soft), var(--lm-secondary-soft));
}

.ach-card h3 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.ach-card p {
  margin: 0.3rem 0 0;
  font-size: 0.85rem;
  color: var(--lm-text-muted);
  line-height: 1.4;
}

.ach-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.55rem;
}

.ach-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(148, 163, 184, 0.18);
  color: var(--lm-text-muted);
}

.ach-pill.is-common { background: rgba(148, 163, 184, 0.18); }
.ach-pill.is-rare { background: rgba(59, 130, 246, 0.15); color: var(--lm-primary); }
.ach-pill.is-epic { background: rgba(168, 85, 247, 0.16); color: #a855f7; }
.ach-pill.is-legendary { background: rgba(245, 158, 11, 0.18); color: #d97706; }
.ach-pill.is-xp { background: var(--lm-secondary-soft); color: var(--lm-secondary); }
.ach-pill.is-ok { background: rgba(34, 197, 94, 0.15); color: var(--lm-success); }

.ach-progress {
  margin-top: auto;
}

.ach-progress label {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--lm-text-muted);
  margin-bottom: 0.3rem;
}

.ach-mini-bar {
  height: 0.45rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  overflow: hidden;
}

.ach-mini-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--lm-primary), var(--lm-secondary));
}

.ach-toast {
  position: fixed;
  left: 50%;
  bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(120%);
  z-index: 1200;
  transition: transform 0.35s var(--lm-ease);
  pointer-events: none;
  width: min(100% - 2rem, 420px);
}

.ach-toast.is-visible {
  transform: translateX(-50%) translateY(0);
}

.ach-toast-inner {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  padding: 0.95rem 1.1rem;
  border-radius: var(--lm-radius);
  background: var(--lm-surface);
  border: 1px solid rgba(59, 130, 246, 0.35);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.28);
}

.ach-toast-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--lm-primary), var(--lm-secondary));
  color: #fff;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.ach-toast strong {
  display: block;
  font-size: 0.95rem;
}

.ach-toast p {
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
  color: var(--lm-text-muted);
}

.ach-toast span {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--lm-secondary);
}

.ach-empty {
  grid-column: 1 / -1;
  padding: 1.5rem;
  text-align: center;
  color: var(--lm-text-muted);
  border: 1px dashed var(--lm-border);
  border-radius: var(--lm-radius);
}
