/* =====================================================
   GLP — Group Landing Pages (agent-briefs/15)
   Sistema compartido por las 8 páginas de grupo del nav
   (Competición, Scouting, Partidos, Temporada, Club,
   Plantilla, Funciones IA, Games). Bento asimétrico con
   datos reales, sin inventar nada — ver competicion.html
   como referencia validada por Hugo.
   ===================================================== */

.glp-wrap { max-width: 1320px; margin: 0 auto; padding: 28px 28px 70px; position: relative; }

/* ── Textura de lienzo (grano + tramas cruzadas), brand book 24/25 ── */
.glp-wrap::before {
  content: '';
  position: fixed; inset: 0; z-index: -1;
  background-image:
    radial-gradient(ellipse 1300px 750px at 50% 0%, rgba(230,103,40,.10), transparent 60%),
    repeating-linear-gradient(45deg, rgba(255,255,255,.03) 0px, rgba(255,255,255,.03) 1px, transparent 1px, transparent 3px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,.025) 0px, rgba(255,255,255,.025) 1px, transparent 1px, transparent 3px),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  background-size: auto, 4px 4px, 4px 4px, auto;
  pointer-events: none;
}

/* ── Cabecera: título grande + tira de estatus compacta ── */
.glp-topbar {
  display: flex; align-items: flex-end; justify-content: space-between;
  flex-wrap: wrap; gap: 18px; margin-bottom: 28px; padding: 0 0 22px;
  border-bottom: 2px solid rgba(230,103,40,.25);
  position: relative;
}
.glp-eyebrow {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-body); font-size: 13px; font-weight: 700;
  letter-spacing: 2.6px; text-transform: uppercase; color: var(--orange); margin-bottom: 8px;
}
.glp-eyebrow::before { content: ''; width: 22px; height: 3px; background: var(--orange); border-radius: 2px; }
.glp-title {
  font-family: var(--font-display); font-weight: 900; font-size: clamp(44px, 6.4vw, 78px);
  letter-spacing: -0.01em; line-height: .92; margin: 0; color: var(--txt); text-transform: uppercase;
}
.glp-status {
  display: flex; align-items: center; gap: 22px; background: var(--gs-surface, #1c1c1a);
  border: 1px solid var(--gs-border, rgba(255,255,255,0.07)); border-radius: 12px; padding: 12px 22px;
  flex-wrap: wrap;
}
.glp-status-block { display: flex; flex-direction: column; align-items: center; min-width: 56px; }
.glp-status-num { font-family: var(--font-display); font-weight: 900; font-size: 26px; color: var(--txt); line-height: 1; }
.glp-status-block.alta .glp-status-num { color: var(--green); }
.glp-status-block.descenso .glp-status-num { color: var(--red-loss); }
.glp-status-lbl { font-family: var(--font-body); font-size: 10px; color: var(--txt-muted); text-transform: uppercase; letter-spacing: .6px; margin-top: 2px; }
.glp-status-sep { width: 1px; height: 30px; background: var(--gs-border, rgba(255,255,255,0.07)); }
.glp-status-next { display: flex; flex-direction: column; }
.glp-status-next b { font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--txt); }

/* ── BENTO ── */
.glp-bento { display: grid; grid-template-columns: repeat(6, 1fr); grid-auto-rows: 100px; gap: 14px; }

.glp-cell {
  border-radius: var(--radius-lg, 14px);
  padding: 20px 22px;
  background: var(--gs-surface, #1c1c1a);
  border: 1px solid var(--gs-border, rgba(255,255,255,0.07));
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  opacity: 0;
  transform: scale(0.96);
  animation: glpPop 0.5s cubic-bezier(.23,1,.32,1) forwards;
  transition: transform 0.25s cubic-bezier(.23,1,.32,1), box-shadow 0.25s, border-color 0.25s;
}
@keyframes glpPop { to { opacity: 1; transform: scale(1); } }
.glp-cell:hover { transform: translateY(-4px) scale(1.01); box-shadow: 0 16px 36px rgba(0,0,0,0.5); border-color: rgba(230,103,40,0.35); }

.glp-tag {
  font-family: var(--font-body); font-size: 11px; font-weight: 700;
  letter-spacing: 1.6px; text-transform: uppercase; color: var(--orange); margin-bottom: 12px;
}
.glp-desc { font-family: var(--font-body); font-size: 12.5px; color: var(--txt-sub); line-height: 1.4; margin: -6px 0 12px; }
.glp-cta {
  margin-top: auto; padding-top: 12px; font-family: var(--font-body);
  font-size: 12px; font-weight: 700; color: var(--orange);
  display: flex; align-items: center; gap: 5px;
}
.glp-cta svg { width: 13px; height: 13px; transition: transform 0.2s; }
.glp-cell:hover .glp-cta svg { transform: translateX(3px); }

/* ── Affordance de "esto se puede clicar" — visible siempre, no solo al hover ── */
.glp-corner {
  position: absolute; top: 14px; right: 14px;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(255,255,255,.05); border: 1px solid var(--gs-border, rgba(255,255,255,0.07));
  display: flex; align-items: center; justify-content: center;
  color: var(--txt-muted); transition: background-color .2s, border-color .2s, color .2s, transform .2s;
}
.glp-corner svg { width: 12px; height: 12px; }
.glp-cell:hover .glp-corner { background: var(--orange); border-color: var(--orange); color: #000; transform: scale(1.08); }

/* ── Tamaños de celda (columnas x filas, en unidades de grid) ── */
.glp-sz-3x2 { grid-column: span 3; grid-row: span 2; }
.glp-sz-3x4 { grid-column: span 3; grid-row: span 4; }
.glp-sz-6x2 { grid-column: span 6; grid-row: span 2; }
.glp-sz-6x4 { grid-column: span 6; grid-row: span 4; }
.glp-sz-2x2 { grid-column: span 2; grid-row: span 2; }

/* ── Filas de ranking: barra de zona + escudo/avatar + valor ── */
.glp-row {
  display: grid; grid-template-columns: 3px 18px 24px 1fr 32px; gap: 10px;
  align-items: center; padding: 7px 0 7px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.04); font-size: 13.5px;
}
.glp-row:last-child { border: 0; }
.glp-row .bar { align-self: stretch; border-radius: 2px; background: transparent; }
.glp-row.alta .bar { background: var(--green); }
.glp-row.descenso .bar { background: var(--red-loss); }
.glp-row .pos { font-family: var(--font-display); font-weight: 900; font-size: 14px; color: var(--txt-muted); }
.glp-row .crest-sm { width: 20px; height: 20px; object-fit: contain; border-radius: 50%; }
.glp-row .crest-sm-fb {
  width: 20px; height: 20px; border-radius: 50%; background: rgba(255,255,255,.06);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-size: 8px; color: var(--txt-muted);
}
.glp-row .team { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.glp-row .pts { text-align: right; font-family: var(--font-display); font-weight: 800; color: var(--txt); }
.glp-row.es-vcf { background: linear-gradient(90deg, rgba(230,103,40,0.14), transparent); }
.glp-row.es-vcf .pos, .glp-row.es-vcf .pts { color: var(--orange); }
.glp-row.es-vcf .team { font-weight: 700; }

/* ── Mini gráfico de líneas (sparkline) ── */
.glp-spark { width: 100%; height: 60px; display: block; overflow: visible; margin: 4px 0 10px; }
.glp-spark-line {
  fill: none; stroke: var(--orange); stroke-width: 2.5;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 600; stroke-dashoffset: 600;
  animation: glpDraw 0.8s cubic-bezier(.23,1,.32,1) .15s forwards;
}
@keyframes glpDraw { to { stroke-dashoffset: 0; } }
.glp-spark-dot { fill: var(--orange); }
.glp-bar-caption { font-family: var(--font-body); font-size: 11.5px; color: var(--txt-muted); }

/* ── Mini gráfico de barras horizontales ── */
.glp-hbars { display: flex; flex-direction: column; gap: 8px; }
.glp-hbar-row { display: grid; grid-template-columns: 18px 1fr 34px; gap: 8px; align-items: center; font-size: 12px; }
.glp-hbar-row.wide { grid-template-columns: 90px 1fr 34px; }
.glp-hbar-row .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--txt-sub); }
.glp-hbar-avatar { width: 16px; height: 16px; border-radius: 50%; object-fit: cover; vertical-align: middle; margin-right: 6px; }
.glp-hbar-track { height: 10px; background: rgba(255,255,255,.05); border-radius: 3px; overflow: hidden; }
.glp-hbar-fill { height: 100%; background: rgba(255,255,255,.28); border-radius: 3px; transform: scaleX(0); transform-origin: left; animation: glpGrow .6s cubic-bezier(.23,1,.32,1) forwards; }
.glp-hbar-row.es-vcf .glp-hbar-fill, .glp-hbar-row.accent .glp-hbar-fill, .glp-hbar-fill.accent { background: var(--orange); }
.glp-hbar-row.es-vcf { font-weight: 700; color: var(--orange); }
@keyframes glpGrow { to { transform: scaleX(1); } }

/* ── Pills de forma / resultado ── */
.glp-form { display: flex; gap: 7px; margin-bottom: 12px; flex-wrap: wrap; }
.glp-form-pill {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 14px; font-weight: 800; color: #000;
}
.glp-form-pill.v { background: var(--green); }
.glp-form-pill.e { background: var(--amber); }
.glp-form-pill.d { background: var(--red-loss); }

/* ── Lista de partidos ── */
.glp-match { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
.glp-match:last-child { border: 0; }
.glp-match-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.glp-match-dot.v { background: var(--green); }
.glp-match-dot.e { background: var(--amber); }
.glp-match-dot.d { background: var(--red-loss); }
.glp-match-info { flex: 1; min-width: 0; }
.glp-match-rival { font-family: var(--font-display); font-weight: 700; font-size: 14.5px; color: var(--txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.glp-match-date { font-family: var(--font-body); font-size: 11px; color: var(--txt-muted); }
.glp-match-score { font-family: var(--font-display); font-weight: 900; font-size: 17px; color: var(--txt); flex-shrink: 0; }

/* ── Lista de personas (jugador/entrenador/árbitro) con avatar ── */
.glp-person { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
.glp-person:last-child { border: 0; }
.glp-person .rank { font-family: var(--font-display); font-weight: 900; font-size: 15px; color: var(--txt-muted); width: 16px; text-align: center; flex-shrink: 0; }
.glp-person .avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: rgba(255,255,255,.06); }
.glp-person .avatar-fb {
  width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.06);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  font-family: var(--font-display); font-weight: 800; font-size: 10px; color: var(--txt-muted);
}
.glp-person .info { flex: 1; min-width: 0; }
.glp-person .name { font-family: var(--font-display); font-weight: 700; font-size: 14px; color: var(--txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.glp-person .meta { font-family: var(--font-body); font-size: 11px; color: var(--txt-muted); }
.glp-person .val { font-family: var(--font-display); font-weight: 900; font-size: 16px; color: var(--orange); flex-shrink: 0; }

/* ── Estadística grande + etiqueta ── */
.glp-stat-num { font-family: var(--font-display); font-weight: 900; font-size: 40px; color: var(--orange); line-height: 1; margin: 4px 0 2px; }
.glp-stat-num.small { font-size: 26px; }
.glp-stat-label { font-family: var(--font-body); font-size: 13px; color: var(--txt-sub); }

/* ── Pareja de escudos (previa, post-partido, h2h) ── */
.glp-vs-row { display: flex; align-items: center; gap: 12px; margin: 6px 0 10px; }
.glp-vs-crest { width: 40px; height: 40px; object-fit: contain; }
.glp-vs-crest-fb {
  width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.06);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-size: 12px; color: var(--txt-muted);
}
.glp-vs-mid { font-family: var(--font-display); font-weight: 900; font-size: 13px; color: var(--txt-muted); }

/* ── Tarjeta con imagen fija (para funciones sin datos que previsualizar:
   juegos, herramientas de IA) — la imagen ES el preview, no una tabla ── */
.glp-cell--image { padding: 0; }
.glp-cell--image .glp-img-cover {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.4s cubic-bezier(.23,1,.32,1);
}
.glp-cell--image:hover .glp-img-cover { transform: scale(1.04); }
.glp-cell--image .glp-img-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,.88) 100%);
}
.glp-cell--image .glp-cta {
  position: relative; z-index: 1; padding: 16px 20px; margin-top: auto;
}
.glp-cell--image .glp-corner { z-index: 2; }

/* ── Composición: mini chat (Agente) ── */
.glp-chat-mock { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 12px; }
.glp-chat-bubble {
  font-family: var(--font-body); font-size: 12.5px; line-height: 1.4;
  padding: 9px 12px; border-radius: 12px; max-width: 88%;
}
.glp-chat-bubble.user {
  align-self: flex-end; background: rgba(255,255,255,.07); color: var(--txt-sub);
  border-bottom-right-radius: 3px;
}
.glp-chat-bubble.bot {
  align-self: flex-start; background: rgba(230,103,40,.14); color: var(--txt);
  border: 1px solid rgba(230,103,40,.25); border-bottom-left-radius: 3px;
}

/* ── Composición: formatos de exportación (Post Kit) ── */
.glp-format-mock { display: flex; align-items: flex-end; gap: 18px; margin: 10px 0 14px; }
.glp-format-item { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.glp-format-chip {
  border-radius: 6px; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-size: 11px; color: rgba(255,255,255,.9);
}
.glp-format-item .dim { font-family: var(--font-body); font-weight: 500; font-size: 10.5px; color: var(--txt-muted); }

/* ── Composición: barra de búsqueda (Buscador Histórico) ── */
.glp-search-mock {
  display: flex; align-items: center; gap: 10px; margin: 8px 0 12px;
  background: rgba(255,255,255,.04); border: 1px solid var(--gs-border, rgba(255,255,255,.08));
  border-radius: 10px; padding: 12px 16px;
}
.glp-search-mock svg { width: 16px; height: 16px; color: var(--txt-muted); flex-shrink: 0; }
.glp-search-mock span { font-family: var(--font-body); font-size: 13.5px; color: var(--txt-muted); }
.glp-search-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.glp-search-chip {
  font-family: var(--font-body); font-size: 11px; font-weight: 600; color: var(--txt-sub);
  background: rgba(255,255,255,.05); border: 1px solid var(--gs-border, rgba(255,255,255,.08));
  border-radius: 20px; padding: 5px 12px;
}

/* ── Composición: diagrama de flujo (Cedidos) ── */
.glp-flow { display: flex; align-items: center; gap: 12px; margin: 10px 0 14px; }
.glp-flow-node {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  width: 64px;
}
.glp-flow-crest { width: 34px; height: 34px; object-fit: contain; }
.glp-flow-node span { font-family: var(--font-body); font-size: 10px; color: var(--txt-muted); text-align: center; }
.glp-flow-arrow { color: var(--orange); flex: 1; display: flex; align-items: center; justify-content: center; }
.glp-flow-arrow svg { width: 22px; height: 14px; }

/* ── Composición: termómetro de sentimiento (Termómetro Afición) ── */
.glp-thermo-row { display: flex; align-items: center; gap: 18px; margin: 6px 0 12px; }
.glp-thermo { position: relative; width: 22px; height: 84px; border-radius: 11px; background: rgba(255,255,255,.06); overflow: hidden; flex-shrink: 0; }
.glp-thermo-fill { position: absolute; bottom: 0; left: 0; right: 0; border-radius: 11px; transform: scaleY(0); transform-origin: bottom; animation: glpThermoFill .7s cubic-bezier(.23,1,.32,1) .15s forwards; }
.glp-thermo-fill.subiendo { background: linear-gradient(180deg, var(--green), rgba(34,197,94,.5)); }
.glp-thermo-fill.bajando { background: linear-gradient(180deg, var(--red-loss), rgba(239,68,68,.5)); }
.glp-thermo-fill.estable { background: linear-gradient(180deg, var(--amber), rgba(245,158,11,.5)); }
@keyframes glpThermoFill { to { transform: scaleY(1); } }
.glp-thermo-info { flex: 1; min-width: 0; }
.glp-thermo-score { font-family: var(--font-display); font-weight: 900; font-size: 30px; line-height: 1; }
.glp-thermo-score.subiendo { color: var(--green); }
.glp-thermo-score.bajando { color: var(--red-loss); }
.glp-thermo-score.estable { color: var(--amber); }
.glp-thermo-trend { font-family: var(--font-body); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--txt-muted); margin-top: 2px; }

/* ── Escudo como marca de agua discreta (cards de club/economía sin sujeto propio) ── */
.glp-crest-watermark { position: absolute; right: -14px; bottom: -14px; width: 108px; height: 108px; opacity: .07; object-fit: contain; pointer-events: none; }

.glp-empty { font-family: var(--font-body); font-size: 13px; color: var(--txt-muted); }

.glp-ref-badge {
  display: flex; align-items: center; gap: 7px; margin: 0 0 12px;
  padding: 6px 10px; background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.25); border-radius: 6px;
  font-family: var(--font-body); font-size: 11.5px; font-weight: 600; color: var(--amber);
}
.glp-ref-badge svg { width: 13px; height: 13px; flex-shrink: 0; }

@media (max-width: 860px) {
  .glp-bento { grid-template-columns: repeat(2, 1fr); grid-auto-rows: auto; }
  .glp-sz-3x2, .glp-sz-3x4, .glp-sz-6x2, .glp-sz-6x4, .glp-sz-2x2 { grid-column: span 2 !important; grid-row: auto !important; }
  .glp-status { flex-wrap: wrap; }
}
