/* ============================================================
   ACADEMIA DE CRACKS · Achievements grid + toast (iter6)
   ============================================================
   Scope-eado a .ach-grid / .ach-grid-preview / .ach-toast para no
   colisionar con el .ach-card legacy del strip de home.css.
   ============================================================ */

.ach-grid,
.ach-grid-preview {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 16px;
}

.ach-grid-preview {
  opacity: 0.6;
  padding-top: 0;
  filter: blur(0.5px);
}

.ach-grid .ach-card,
.ach-grid-preview .ach-card {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  min-height: 140px;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.ach-grid .ach-card.unlocked {
  background: linear-gradient(155deg, rgba(255,158,0,0.18), rgba(255,158,0,0.06));
  border-color: rgba(255,158,0,0.45);
  box-shadow: 0 4px 18px rgba(255,158,0,0.12);
}

.ach-grid .ach-card.unlocked:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255,158,0,0.22);
}

.ach-grid .ach-card.locked,
.ach-grid-preview .ach-card.locked {
  opacity: 0.55;
  filter: grayscale(0.6);
}

.ach-card-icon {
  font-size: 36px;
  line-height: 1;
  margin-bottom: 4px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.25));
}

.ach-card-title {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--white);
  line-height: 1.2;
}

.ach-grid .ach-card.locked .ach-card-title,
.ach-grid-preview .ach-card-title {
  color: var(--smoke-dim);
}

.ach-card-desc {
  font-size: 11px;
  color: var(--smoke-dim);
  line-height: 1.35;
  margin-top: 2px;
}

.ach-card-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--orange);
  color: var(--carbon);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 2px 8px rgba(255,158,0,0.45);
}

.ach-card-share {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.1s ease;
}
.ach-card-share:hover {
  background: var(--orange);
  border-color: var(--orange);
  transform: scale(1.08);
}
.ach-card-share:disabled {
  cursor: wait;
  opacity: 0.5;
}

/* ---- Toast "Logro desbloqueado" ---- */
.ach-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 120%);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  min-width: 280px;
  max-width: calc(100% - 32px);
  background: linear-gradient(135deg, #1a1410 0%, #2a1f15 100%);
  border: 1px solid rgba(255,158,0,0.55);
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,158,0,0.1);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.4), opacity 0.25s ease;
  pointer-events: auto;
}
.ach-toast-body { flex: 1; min-width: 0; }
.ach-toast-share {
  background: var(--orange);
  color: var(--carbon);
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.1s ease;
}
.ach-toast-share:hover { transform: scale(1.1); }

.ach-toast.visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

.ach-toast-icon {
  font-size: 32px;
  line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(255,158,0,0.4));
}

.ach-toast-kicker {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 2px;
}

.ach-toast-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--white);
  line-height: 1.2;
}

/* ============================================================
   Install PWA toast recurrente (iter6 · install-prompt.js)
   ============================================================ */
.install-toast {
  position: fixed;
  left: 50%;
  bottom: 80px; /* arriba del tabbar */
  transform: translate(-50%, 130%);
  z-index: 9998;
  width: calc(100% - 24px);
  max-width: 360px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 36px 1fr;
  grid-template-areas:
    'icon body'
    'actions actions';
  column-gap: 12px;
  row-gap: 12px;
  background: linear-gradient(135deg, #0f1620 0%, #1a2334 100%);
  border: 1px solid rgba(255,158,0,0.4);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.55);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.4), opacity 0.25s ease;
}
.install-toast.visible {
  transform: translate(-50%, 0);
  opacity: 1;
}
.install-toast-icon {
  grid-area: icon;
  font-size: 28px;
  line-height: 1;
  align-self: center;
}
.install-toast-body { grid-area: body; }
.install-toast-title {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 2px;
}
.install-toast-desc {
  font-size: 12px;
  color: var(--smoke-dim);
  line-height: 1.35;
}
.install-toast-actions {
  grid-area: actions;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.install-toast-primary {
  background: var(--orange);
  color: var(--carbon);
  border: none;
  padding: 9px 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  font-family: 'Chakra Petch', sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.install-toast-secondary {
  background: transparent;
  color: var(--white);
  border: 1px solid var(--glass-border);
  padding: 9px 14px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
}
.install-toast-link {
  background: transparent;
  border: none;
  color: var(--smoke-dim);
  font-size: 11px;
  cursor: pointer;
  text-decoration: underline;
  padding: 4px 0;
  margin-left: auto;
}
