/* ── Overlay logros (mismo patrón que tutorial) ── */
.logros-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 900;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
.logros-overlay.activo { display: flex; }

.logros-modal {
  width: 100%;
  max-width: 480px;
  max-height: 92dvh;
  background: linear-gradient(160deg, #14141f 0%, #0f0f1c 100%);
  border: 2px solid rgba(245,208,0,0.35);
  border-bottom: none;
  border-radius: 18px 18px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.8), 0 0 30px rgba(245,208,0,0.07);
  animation: tutSlideUp 0.38s cubic-bezier(0.34,1.3,0.64,1) both;
}

/* ── Header ── */
.logros-header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(245,208,0,0.18);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  background: rgba(0,0,0,0.25);
}
.logros-header-icon { font-size: 1.4em; }
.logros-header-info { flex: 1; }
.logros-header-titulo {
  font-family: 'Archivo Black', sans-serif;
  font-size: 0.9em;
  color: var(--acento);
  letter-spacing: 2px;
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(245,208,0,0.3);
}
.logros-header-sub {
  font-size: 0.62em;
  color: var(--texto2);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 2px;
}
.logros-cerrar {
  background: rgba(255,255,255,0.07) !important;
  border: 1px solid rgba(255,255,255,0.15) !important;
  border-bottom: 1px solid rgba(255,255,255,0.08) !important;
  color: var(--texto2);
  width: 30px; height: 30px;
  border-radius: 50%;
  padding: 0;
  font-size: 0.85em;
  box-shadow: none;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
}
.logros-cerrar:active { transform: scale(0.9); border-bottom-width: 1px !important; }

/* ── Marcador compacto ── */
.logros-cancha {
  position: relative;
  padding: 10px 14px 12px;
  background: repeating-linear-gradient(90deg, rgba(0,200,83,0.05) 0px, rgba(0,200,83,0.05) 28px, transparent 28px, transparent 56px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.logros-marcador {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.logros-marcador-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.9em;
  color: var(--acento);
  text-shadow: 0 0 10px rgba(245,208,0,0.4);
  line-height: 1;
}
.logros-marcador-sep {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.4em;
  color: rgba(255,255,255,0.2);
}
.logros-marcador-tot {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.9em;
  color: rgba(255,255,255,0.3);
  line-height: 1;
}
.logros-marcador-label {
  font-family: 'Archivo Black', sans-serif;
  font-size: 0.56em;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--texto2);
}
.logros-estrellas {
  font-size: 0.85em;
  letter-spacing: 2px;
  flex-shrink: 0;
}
.logros-estrellas .e-on  { color: var(--acento); }
.logros-estrellas .e-off { color: rgba(255,255,255,0.12); }

/* ── Body: grilla fija, sin scroll ── */
.logros-body {
  flex: 1;
  overflow: hidden;
  padding: 10px 10px 12px;
  display: flex;
  flex-direction: column;
}

.logros-grilla {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 6px;
  flex: 1;
  min-height: 0;
}

.logro-cromo {
  position: relative;
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.03) 0%, rgba(0,0,0,0.1) 100%);
  border: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6px 10px;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.12s;
  overflow: hidden;
  isolation: isolate;
}
.logro-cromo:active { transform: scale(0.96); }

/* Emoji de fondo gigante, marca de agua */
.logro-cromo-bg {
  position: absolute;
  right: -6px;
  bottom: -14px;
  font-size: 3.4em;
  line-height: 1;
  opacity: 0.16;
  transform: rotate(-8deg);
  z-index: 0;
  filter: grayscale(0.3);
}
.logro-cromo.desbloqueado .logro-cromo-bg { opacity: 0.24; filter: none; }

/* Textura de rayas de cancha, muy sutil */
.logro-cromo::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -35deg,
    rgba(255,255,255,0.025) 0px, rgba(255,255,255,0.025) 6px,
    transparent 6px, transparent 14px
  );
  z-index: 0;
  pointer-events: none;
}

.logro-cromo.bloqueado { border-style: dashed; border-color: rgba(255,255,255,0.12); }
.logro-cromo.bloqueado .logro-cromo-dorsal { color: rgba(255,255,255,0.12); }

.logro-cromo.desbloqueado {
  background: linear-gradient(135deg, rgba(245,208,0,0.1) 0%, rgba(245,208,0,0.02) 100%);
  border-color: rgba(245,208,0,0.45);
  box-shadow: inset 0 0 0 1px rgba(245,208,0,0.08);
}

/* Cintillo superior tipo medalla para los desbloqueados */
.logro-cromo.desbloqueado::after {
  content: '';
  position: absolute;
  top: 0; left: 10px;
  width: 18px; height: 7px;
  background: linear-gradient(180deg, var(--acento), var(--acento2));
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 70%, 0 100%);
  z-index: 1;
}

/* Número de dorsal en la esquina */
.logro-cromo-dorsal {
  position: absolute;
  top: 4px; right: 7px;
  font-family: 'Bebas Neue', 'Archivo Black', sans-serif;
  font-size: 1.5em;
  color: rgba(255,255,255,0.22);
  z-index: 0;
  line-height: 1;
}
.logro-cromo.desbloqueado .logro-cromo-dorsal { color: rgba(245,208,0,0.32); }

.logro-cromo-texto { position: relative; z-index: 1; min-width: 0; padding-right: 4px; }
.logro-cromo-nombre {
  font-family: 'Bebas Neue', 'Archivo Black', sans-serif;
  font-size: 1.25em;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #ffffff;
  line-height: 1.05;
  margin-bottom: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.logro-cromo.bloqueado .logro-cromo-nombre { color: rgba(255,255,255,0.6); }
.logro-cromo.desbloqueado .logro-cromo-nombre { color: var(--acento); }
.logro-cromo-desc {
  font-family: 'Archivo', sans-serif;
  font-size: 0.72em;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.logro-cromo.bloqueado .logro-cromo-desc { color: rgba(255,255,255,0.4); }
.logro-cromo.desbloqueado .logro-cromo-desc { color: rgba(255,255,255,0.92); }

.logro-cromo-estado {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 5px;
  font-family: 'Archivo Black', sans-serif;
  font-size: 0.62em;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.logro-cromo.desbloqueado .logro-cromo-estado { color: var(--acento); text-shadow: 0 0 6px rgba(245,208,0,0.4); }
.logro-cromo.bloqueado .logro-cromo-estado { color: rgba(255,255,255,0.45); }

/* ── Ficha de detalle (al tocar un cromo) ── */
.logro-ficha-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 950;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.logro-ficha-overlay.activo { display: flex; }
.logro-ficha {
  width: 100%;
  max-width: 300px;
  background: linear-gradient(160deg, #1a1a28 0%, #11111c 100%);
  border-radius: 18px;
  padding: 30px 22px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
  animation: fichaPop 0.25s cubic-bezier(0.34,1.4,0.64,1) both;
}
@keyframes fichaPop {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.logro-ficha::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent, transparent 60px, rgba(255,255,255,0.02) 60px, rgba(255,255,255,0.02) 61px);
  pointer-events: none;
}
.logro-ficha.desbloqueada {
  border: 2px solid rgba(245,208,0,0.4);
  box-shadow: 0 10px 40px rgba(0,0,0,0.7), 0 0 30px rgba(245,208,0,0.1);
}
.logro-ficha.bloqueada {
  border: 2px dashed rgba(255,255,255,0.16);
  box-shadow: 0 10px 40px rgba(0,0,0,0.7);
}
.logro-ficha-x {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07) !important;
  border: 1px solid rgba(255,255,255,0.15) !important;
  color: var(--texto2);
  font-size: 0.78em;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: none;
  z-index: 2;
}
.logro-ficha-x:active { transform: scale(0.9); }
.logro-ficha-icono-wrap {
  position: relative;
  z-index: 1;
  width: 84px;
  height: 84px;
  margin: 4px auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.logro-ficha-icono-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(245,208,0,0.3);
}
.logro-ficha.bloqueada .logro-ficha-icono-ring { border-color: rgba(255,255,255,0.12); }
.logro-ficha-icono {
  position: relative;
  z-index: 1;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.1em;
  background: linear-gradient(145deg, #232336, #161624);
  box-shadow: 0 0 22px rgba(245,208,0,0.18);
}
.logro-ficha.bloqueada .logro-ficha-icono {
  filter: grayscale(1) brightness(0.55);
  box-shadow: none;
}
.logro-ficha-estado {
  position: relative;
  z-index: 1;
  display: inline-block;
  font-family: 'Archivo Black', sans-serif;
  font-size: 0.6em;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 10px;
}
.logro-ficha.desbloqueada .logro-ficha-estado {
  background: rgba(245,208,0,0.15);
  color: var(--acento);
  border: 1px solid rgba(245,208,0,0.35);
}
.logro-ficha.bloqueada .logro-ficha-estado {
  background: rgba(255,255,255,0.06);
  color: var(--texto2);
  border: 1px solid rgba(255,255,255,0.12);
}
.logro-ficha-nombre {
  position: relative;
  z-index: 1;
  font-family: 'Archivo Black', sans-serif;
  font-size: 1.1em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.logro-ficha.desbloqueada .logro-ficha-nombre { color: var(--texto); }
.logro-ficha.bloqueada .logro-ficha-nombre { color: var(--texto2); }
.logro-ficha-desc {
  position: relative;
  z-index: 1;
  font-family: 'Archivo', sans-serif;
  font-size: 0.82em;
  color: var(--texto2);
  line-height: 1.55;
}
.logro-ficha-fecha {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  font-family: 'Archivo Black', sans-serif;
  font-size: 0.64em;
  letter-spacing: 0.5px;
  color: var(--acento);
}

/* ── Toast de logro desbloqueado ── */
.logro-toast {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: linear-gradient(135deg, #1a1a2e, #12121f);
  border: 1.5px solid rgba(245,208,0,0.6);
  border-radius: 12px;
  padding: 10px 16px;
  display: flex;
  gap: 10px;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  box-shadow: 0 4px 24px rgba(0,0,0,0.7), 0 0 20px rgba(245,208,0,0.15);
  pointer-events: none;
  max-width: 340px;
  width: 90%;
}
.logro-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.logro-toast-icono { font-size: 1.6em; flex-shrink: 0; }
.logro-toast-info { min-width: 0; }
.logro-toast-titulo {
  font-family: 'Archivo Black', sans-serif;
  font-size: 0.62em;
  color: var(--acento);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 1px;
}
.logro-toast-nombre {
  font-family: 'Archivo Black', sans-serif;
  font-size: 0.85em;
  color: #fff;
  letter-spacing: 0.5px;
}
