/* =========================================================================
   GRUPOS: ranking y ficha con la misma paleta del ranking general
   (tarjeta clara .ranking-card, cabecera azul --grad-pes-header, tabla
   .table-crew con filas por división). Aquí solo va lo propio de grupos.
   ========================================================================= */

/* ---- escudo del grupo: imagen subida o monograma con color propio ---- */
.grp-shield {
  --h: 215;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(160deg,
      hsl(var(--h) 85% 62%) 0%, hsl(var(--h) 70% 40%) 55%, hsl(var(--h) 75% 24%) 100%);
}

.grp-shield span {
  font-family: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.45);
}

.grp-shield--sm { width: 34px; height: 34px; }
.grp-shield--sm span { font-size: 0.95rem; }
.grp-shield--lg { width: 72px; height: 72px; }
.grp-shield--lg span { font-size: 1.9rem; }

.grp-shield.has-img { background: #0f172a; }

.grp-shield.has-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---- fotos de miembros apiladas (sin nombres) ---- */
.grp-avatars {
  display: flex;
  align-items: center;
  padding-left: 6px;
}

.grp-avatars img,
.grp-avatars__more {
  width: 24px;
  height: 24px;
  margin-left: -6px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  background: #e2e8f0;
  transition: transform 0.15s ease;
}

.grp-avatars img:hover {
  position: relative;
  z-index: 2;
  transform: translateY(-2px) scale(1.15);
}

.grp-avatars__more {
  display: inline-grid;
  place-items: center;
  font-size: 0.6rem;
  font-weight: 800;
  color: #1e3a8a;
  background: #dbeafe;
}

/* ---- ranking de grupos ---- */
.groups-ranking .group-cell { display: flex; align-items: center; gap: 0.6rem; }
.groups-ranking .group-cell__text { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.groups-ranking .group-cell__leader { font-size: 0.72rem; color: #475569; }
.groups-ranking .group-cell__leader .bi { color: #f59e0b; font-size: 0.65rem; }
.groups-ranking .group-cell__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem; }
.groups-ranking .badge { font-size: 0.62rem; }

/* ---- ficha del grupo ---- */
.group-page { display: flex; flex-direction: column; gap: 1rem; }

.group-back {
  align-self: flex-start;
  font-size: 0.85rem;
  font-weight: 700;
  color: #bfdbfe;
  text-decoration: none;
}

.group-back:hover { color: #fff; }

.group-hero {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.1rem 1.25rem;
  text-transform: none;
  background:
    radial-gradient(420px 160px at 0% 0%, hsl(var(--h) 85% 55% / 0.35), transparent 70%),
    var(--grad-pes-header);
}

.group-hero__main { flex: 1 1 220px; min-width: 0; }

.group-hero__name {
  margin: 0;
  font-family: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  font-weight: 800;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  line-height: 1;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: #fff;
  overflow-wrap: anywhere;
}

.group-hero__sub {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.9rem;
  margin-top: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0;
  color: #dbeafe;
}

.group-hero__sub .bi { color: #fbbf24; }
.group-hero__sub a { color: #fff; font-weight: 800; }

.group-hero__tags { display: flex; flex-direction: column; align-items: flex-end; gap: 0.35rem; }

.group-comment {
  margin: 0 0 1rem;
  padding: 0.6rem 0.85rem;
  border-left: 3px solid #2563eb;
  border-radius: 0 10px 10px 0;
  background: #eff6ff;
  color: #1e293b;
  font-style: italic;
  white-space: pre-line;
}

.group-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.group-stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.15rem;
  padding: 0.65rem 0.8rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.07);
}

.group-stat--main {
  flex-direction: row;
  align-items: center;
  gap: 0.6rem;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border-color: #bfdbfe;
}

.group-stat--main > div { display: flex; flex-direction: column; }

.group-stat__label {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}

.group-stat__value {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  font-weight: 800;
  font-size: 1.7rem;
  line-height: 1;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.group-stat__value--sm { font-size: 1.35rem; }
.group-stat__div { width: 26px; height: 26px; object-fit: contain; }

.group-bar {
  display: block;
  height: 5px;
  margin-top: 0.25rem;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.group-bar span { display: block; height: 100%; background: linear-gradient(90deg, #22c55e, #86efac); }

.group-section {
  margin: 0 0 0.6rem;
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #1e3a8a;
}

/* miembros: misma tabla del ranking general */
.group-members-table .member-avatar { position: relative; flex: 0 0 auto; }

.group-members-table .member-avatar.is-leader .rank-avatar {
  outline: 2px solid #f59e0b;
  outline-offset: 1px;
}

.group-members-table .member-avatar .bi {
  position: absolute;
  right: -4px;
  bottom: -4px;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 0.55rem;
  color: #fff;
  background: #f59e0b;
  border: 2px solid #fff;
}

.group-members-table .member-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.group-members-table .member-text small { font-size: 0.7rem; color: #64748b; }
.group-members-table .member-group-pts { font-weight: 800; color: #1d4ed8; }
.group-members-table .member-group-rec { font-size: 0.68rem; color: #64748b; }

/* partidos de grupo */
.group-match {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.55rem 0;
  font-size: 0.86rem;
  border-top: 1px solid #ededed;
}

.group-match:first-child { border-top: 0; padding-top: 0; }
.group-match__body { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.group-match__score { margin: 0 0.3rem; font-weight: 800; color: #1d4ed8; }

.group-result {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 800;
  color: #fff;
  background: #94a3b8;
}

.group-result.is-win { background: #16a34a; }
.group-result.is-loss { background: #e11d48; }

/* unirse / administrar */
.group-recruit {
  margin: 0 0 0.6rem;
  padding: 0.5rem 0.75rem;
  border-left: 3px solid #16a34a;
  border-radius: 0 10px 10px 0;
  background: #f0fdf4;
  font-style: italic;
  white-space: pre-line;
}

.group-steps {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0 0 0.6rem;
  padding-left: 1.2rem;
}

.group-upload { display: flex; align-items: flex-start; gap: 1rem; }

@media (max-width: 575.98px) {
  .group-hero__tags { flex-direction: row; align-items: center; }
  .group-stat__value { font-size: 1.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  .grp-avatars img { transition: none; }
}

/* Aviso de la fecha desde la que cuentan los puntos de grupo */
.group-cutoff {
  margin: 0 0 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  border: 1px solid #fde68a;
  background: #fffbeb;
  color: #78350f;
  font-size: 0.82rem;
}

.group-cutoff .bi { color: #d97706; margin-right: 0.25rem; }

/* ---- editor de la imagen del grupo (Mi cuenta y página del grupo) ---- */
.grp-shield--xl { width: 96px; height: 96px; }
.grp-shield--xl span { font-size: 2.4rem; }

.group-editor__now {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.group-editor__name {
  display: inline-block;
  margin-bottom: 4px;
  font-family: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
  text-decoration: none;
}

.group-editor__name:hover { color: #2563eb; }

.group-editor__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* el recorte del grupo se ve redondo, igual que en el resto de la web */
.crop-canvas.crop-canvas--circle {
  max-width: 256px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
}
