/* =============================================
   LOGROS.CSS — Aviso al desbloquear y página /logros/
   FutbolHUB
   Prefijo .fhl- para no chocar con los estilos de cada juego.

   El aviso solo existe si js/logros.js ha decidido enseñar la interfaz (lo
   crea él), así que en producción, hoy, esta hoja no pinta nada.
   ============================================= */

/* ── Aviso arriba a la derecha, estilo PlayStation ──
   Oscuro en los dos temas a propósito: tiene que leerse igual encima de un
   juego claro que de uno oscuro. No se puede tocar (pointer-events:none):
   durante unos segundos tapa la esquina del círculo de perfil, y un toque
   ahí no debe sacarte de la partida. */
.fhl-avisos {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  right: calc(env(safe-area-inset-right, 0px) + 12px);
  z-index: 100001;                 /* por encima del modal de ajustes del perfil */
  width: min(340px, calc(100vw - 24px));
  pointer-events: none;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
.fhl-aviso {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 10px 10px;
  border-radius: var(--r-md, 10px);
  background: rgba(22, 24, 29, .96);
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .45);
  color: #f4efe3;
  opacity: 0;
  transform: translateX(24px);
  transition: opacity .3s ease, transform .35s cubic-bezier(.2, .9, .3, 1.2);
}
.fhl-aviso.fhl-dentro { opacity: 1; transform: none; }
.fhl-aviso.fhl-fuera  { opacity: 0; transform: translateX(24px); transition-duration: .3s, .3s; }

.fhl-aviso-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.fhl-aviso-kicker {
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #b7bac0;
}
.fhl-aviso-nombre {
  font-size: .95rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fhl-aviso-desc {
  font-size: .78rem;
  color: #cfd2d6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .fhl-aviso, .fhl-aviso.fhl-fuera { transform: none; transition: opacity .2s linear; }
}

/* ── Medalla ──
   Mientras no haya dibujos: círculo del color del metal con el nivel
   dentro (III/II/I) o una estrella en los sueltos. Con dibujo, el metal
   queda como aro alrededor. */
.fhl-aviso-medalla,
.fhl-medalla {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-family: 'Inter', 'Inter', system-ui, sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: #16181d;
  border: 3px solid rgba(0, 0, 0, .25);
  background: var(--fhl-metal, #e8c96a);
  overflow: hidden;
}
.fhl-aviso-medalla img,
.fhl-medalla img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fhl-metal-bronce { --fhl-metal: #c98a4b; }
.fhl-metal-plata  { --fhl-metal: #c9ced6; }
.fhl-metal-oro    { --fhl-metal: #e8c96a; }
.fhl-metal-unico  { --fhl-metal: #7fc4b8; }

/* Con dibujo, y solo en los logros marcados (clase fhl-tinte, ver TINTES en
   logros-catalogo.js), el metal se pone ENCIMA como tinte (mismo dibujo,
   bronce / plata / oro), sin quitarle el fondo a la imagen. Los sueltos
   (unico) no llevan tinte. */
.fhl-aviso-medalla,
.fhl-medalla { position: relative; isolation: isolate; }
.fhl-tinte:is(.fhl-metal-bronce, .fhl-metal-plata, .fhl-metal-oro):has(> img)::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--fhl-metal);
  mix-blend-mode: color;
  opacity: var(--fhl-tinte, .75);
  pointer-events: none;
}
.fhl-metal-plata { --fhl-tinte: .35; }

/* ── Página /logros/ ── */
.fhl-pagina .fhl-resumen {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin: 1.2rem 0 1.4rem;
}
.fhl-dato {
  padding: 12px 14px;
  border: 1px solid var(--line, rgba(22, 24, 29, .15));
  background: var(--paper-2, #ece5d6);
}
.fhl-dato span { display: block; font-size: .8rem; color: var(--ink-soft, #5b5f66); }
.fhl-dato strong { font-size: 1.4rem; }

.fhl-filtros {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 1.2rem;
}
.fhl-filtro {
  font: inherit;
  font-size: .82rem;
  padding: 5px 10px;
  border: 1px solid var(--line, rgba(22, 24, 29, .15));
  background: transparent;
  color: var(--ink, #16181d);
  cursor: pointer;
}
.fhl-filtro[aria-pressed="true"] {
  background: var(--ink, #16181d);
  color: var(--paper, #f4efe3);
  border-color: var(--ink, #16181d);
}

.fhl-grupo { margin-bottom: 1.6rem; }
.fhl-grupo h2 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.fhl-grupo h2 small { font-size: .8rem; font-weight: 400; color: var(--ink-soft, #5b5f66); }

.fhl-lista {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 10px;
}
.fhl-tarjeta {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--line, rgba(22, 24, 29, .15));
  background: var(--paper, #f4efe3);
}
.fhl-tarjeta.fhl-bloqueado .fhl-medalla { filter: grayscale(1); opacity: .45; }
.fhl-tarjeta.fhl-secreto { border-style: dashed; }
.fhl-cuerpo { min-width: 0; flex: 1; }
.fhl-cuerpo h3 { margin: 0 0 2px; font-size: 1rem; }
.fhl-cuerpo p { margin: 0 0 6px; font-size: .85rem; color: var(--ink-soft, #5b5f66); }
.fhl-barra {
  height: 6px;
  background: var(--paper-2, #ece5d6);
  border: 1px solid var(--line, rgba(22, 24, 29, .15));
}
.fhl-barra i {
  display: block;
  height: 100%;
  background: var(--accent, #b5221e);
}
.fhl-pie { margin-top: 4px; font-size: .75rem; color: var(--ink-soft, #5b5f66); }
.fhl-pie .fhl-ok { color: #2f7d4f; font-weight: 600; }
.fhl-escalones { display: flex; gap: 4px; margin-top: 6px; }
.fhl-escalon {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--fhl-metal, #e8c96a);
}
.fhl-escalon.fhl-lleno { background: var(--fhl-metal, #e8c96a); }

.fhl-cerrado {
  padding: 2rem 0;
  text-align: center;
}
@media (prefers-color-scheme: dark) {
  .fhl-pie .fhl-ok { color: #6fcf97; }
}
