/* =========================================================================
   GUERRA DE HINCHADAS EN VIVO (03/12/2026)
   Lo arma juegos-temporadas.js › renderGuerraGH (clases gh-). Archivo aparte
   (como diseno10.css) para que tools/tema-claro.py no lo invierta: claro y
   oscuro salen de los tokens de diseno10.css. Se carga después de él.
   ========================================================================= */
.jt-guerra.gh{
  --gh-a: var(--text-1, #f4f5f7);
  --gh-b: var(--accent-red, #ef4444);
  --gh-oro: var(--accent-gold, #f5b301);
  --gh-mio: var(--accent-link, #7c93ff);
  --gh-caja: color-mix(in srgb, var(--text-1, #fff) 3.5%, transparent);
  --gh-linea: var(--border-subtle, rgba(255,255,255,0.08));
  position: relative; overflow: hidden; container-type: inline-size;
  display: flex; flex-direction: column; gap: 0.9rem;
  background:
    radial-gradient(120% 60% at 100% 0%, color-mix(in srgb, var(--gh-b) 13%, transparent), transparent 60%),
    var(--bg-surface, var(--panel));
  border: 1px solid var(--border-strong, var(--border));
  box-shadow: var(--shadow-card, none);
}
.gh .gh-num{ font-variant-numeric: tabular-nums; font-weight: 800; }

/* --- Punto «en vivo» --- */
.gh-punto{ display:inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--gh-b); margin-right: 0.4rem; vertical-align: middle;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--gh-b) 60%, transparent); animation: gh-latido 1.6s infinite; }
@keyframes gh-latido{ 0%{ box-shadow: 0 0 0 0 color-mix(in srgb, var(--gh-b) 55%, transparent); } 70%{ box-shadow: 0 0 0 7px transparent; } 100%{ box-shadow: 0 0 0 0 transparent; } }

/* --- Cabecera --- */
.gh-cab{ display:flex; flex-direction:column; gap: 0.3rem; }
.gh-cab__titulo{ display:flex; align-items:center; justify-content:space-between; gap: 0.5rem; flex-wrap: wrap; }
.gh-cab__titulo .jp-subtitulo{ margin: 0; font-size: 1.35rem; letter-spacing: -0.02em; }
.gh-chip{ display:inline-flex; align-items:center; gap: 0.4rem; padding: 0.28rem 0.65rem; border-radius: 999px; font-size: 0.72rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.05em; border: 1px solid var(--gh-linea); color: var(--text-2, var(--text-muted)); white-space: nowrap; }
.gh-chip--vivo{ color: var(--gh-b); border-color: color-mix(in srgb, var(--gh-b) 45%, transparent); background: color-mix(in srgb, var(--gh-b) 10%, transparent); }
.gh-chip--vivo i{ width: 7px; height: 7px; border-radius: 50%; background: var(--gh-b); animation: gh-latido 1.6s infinite; }
.gh-chip--fin{ color: var(--gh-oro); border-color: color-mix(in srgb, var(--gh-oro) 45%, transparent); background: color-mix(in srgb, var(--gh-oro) 10%, transparent); }
.gh-act{ font-size: 0.75rem; color: var(--text-3, var(--text-muted)); font-variant-numeric: tabular-nums; }
.gh-reglas summary{ cursor: pointer; font-size: 0.8rem; font-weight: 700; color: var(--text-2, var(--text-muted)); list-style: none; display:inline-flex; align-items:center; gap: 0.3rem; }
.gh-reglas summary::-webkit-details-marker{ display:none; }
.gh-reglas summary::after{ content: "▾"; transition: transform .2s; }
.gh-reglas[open] summary::after{ transform: rotate(180deg); }
.gh-reglas p{ margin: 0.4rem 0 0; font-size: 0.82rem; line-height: 1.5; color: var(--text-2, var(--text-muted)); }
.gh-nota{ margin: 0; font-size: 0.78rem; color: var(--text-3, var(--text-muted)); }
.gh-sub{ margin: 0; font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2, var(--text-muted)); display:flex; align-items:center; }

/* --- Escudos --- */
.gh-escudo{ width: 22px; height: 22px; object-fit: contain; flex: 0 0 auto; display:inline-block; }
.gh-escudo--xl{ width: 52px; height: 52px; filter: drop-shadow(0 6px 14px rgba(0,0,0,0.35)); }

/* --- Campeón anterior y de la semana --- */
.gh-anterior, .gh-campeon{ display:flex; align-items:center; gap: 0.7rem; padding: 0.6rem 0.8rem; border-radius: var(--d10-r-ctrl, 10px);
  background: linear-gradient(90deg, color-mix(in srgb, var(--gh-oro) 14%, transparent), transparent 80%); border: 1px solid color-mix(in srgb, var(--gh-oro) 30%, transparent); }
.gh-anterior > span:nth-child(2), .gh-campeon > div{ display:flex; flex-direction:column; flex: 1; min-width: 0; }
.gh-anterior small, .gh-campeon small{ font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gh-oro); }
.gh-anterior strong{ font-size: 0.95rem; }
.gh-anterior > span:last-child, .gh-campeon > span:last-child{ font-size: 1.3rem; }
.gh-campeon strong{ font-size: 1.15rem; }
.gh-campeon{ animation: gh-entra .5s ease both; }

/* --- Duelo destacado --- */
.gh-duelo{ position: relative; display:flex; flex-direction:column; gap: 0.7rem; padding: 0.95rem 0.9rem 0.8rem; border-radius: var(--d10-r-card, 14px);
  background: linear-gradient(160deg, color-mix(in srgb, var(--gh-a) 6%, transparent), color-mix(in srgb, var(--gh-b) 9%, transparent));
  border: 1px solid var(--gh-linea); }
.gh-duelo.is-mio{ border-color: color-mix(in srgb, var(--gh-mio) 50%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--gh-mio) 18%, transparent) inset; }
.gh-duelo__tag{ font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2, var(--text-muted)); }
.gh-duelo__lados{ display:grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items:center; gap: 0.4rem; }
.gh-duelo__lado{ position: relative; display:flex; flex-direction:column; align-items:center; gap: 0.3rem; text-align:center; min-width: 0; padding: 0.3rem; border-radius: var(--d10-r-ctrl, 10px); transition: background .4s; }
.gh-duelo__club{ font-weight: 800; font-size: 0.9rem; line-height: 1.2; max-width: 100%; overflow:hidden; text-overflow: ellipsis; display:-webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.gh-duelo__club small{ color: var(--text-3, var(--text-muted)); font-weight: 700; }
.gh-duelo__xp{ display:flex; align-items:baseline; gap: 0.25rem; }
.gh-duelo__xp .gh-num{ font-size: 1.9rem; line-height: 1; letter-spacing: -0.03em; }
.gh-duelo__xp small{ font-size: 0.7rem; font-weight: 700; color: var(--text-3, var(--text-muted)); }
.gh-duelo__lado.is-a .gh-num{ color: var(--gh-a); }
.gh-duelo__lado.is-b .gh-num{ color: var(--gh-b); }
.gh-lider{ position:absolute; top: -0.55rem; left: 50%; transform: translateX(-50%); font-size: 0.58rem; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.1rem 0.4rem; border-radius: 999px; background: var(--gh-oro); color: #111; white-space: nowrap; z-index: 1; }
.gh-duelo__vs{ font-size: 0.8rem; font-weight: 900; color: var(--text-3, var(--text-muted)); letter-spacing: 0.05em; padding: 0.35rem 0.45rem; border-radius: 999px; border: 1px solid var(--gh-linea); }
.gh-duelo__pie{ margin: 0; font-size: 0.8rem; color: var(--text-2, var(--text-muted)); text-align:center; }
.gh-reloj{ font-variant-numeric: tabular-nums; font-weight: 800; color: var(--text-1, var(--text)); }
.gh-mio{ display:flex; align-items:center; gap: 0.8rem; }
.gh-mio small{ font-size: 0.75rem; font-weight: 800; color: var(--gh-mio); }
.gh-mio p{ margin: 0.15rem 0 0; font-size: 0.92rem; line-height: 1.4; }
.gh-mio__icono{ font-size: 2.2rem; }
.gh-duelo--clas .gh-duelo__pie{ text-align: left; }

/* --- Tira (tira y afloja entre las dos hinchadas) --- */
.gh-tira{ position: relative; height: 6px; border-radius: 999px; overflow: hidden; background: var(--gh-b); }
.gh-tira i{ position:absolute; inset: 0 auto 0 0; background: var(--gh-a); transition: width 1.2s cubic-bezier(.2,.8,.2,1); }
.gh-tira i::after{ content:""; position:absolute; right: -1px; top: 0; bottom: 0; width: 2px; background: var(--bg-surface, #000); }
.gh-tira--grande{ height: 10px; }
.gh-tira--vacia{ background: var(--gh-linea); }

/* --- Rondas --- */
.gh-tabs{ display:grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0.3rem; padding: 0.25rem; border-radius: var(--d10-r-ctrl, 10px); background: var(--gh-caja); border: 1px solid var(--gh-linea); }
.gh-tab{ display:flex; flex-direction:column; align-items:center; gap: 0.05rem; padding: 0.4rem 0.2rem; border: 0; border-radius: 8px; background: transparent; color: var(--text-2, var(--text-muted)); font: inherit; cursor: pointer; transition: background .2s, color .2s; }
.gh-tab strong{ font-size: 0.8rem; }
.gh-tab small{ font-size: 0.66rem; text-transform: capitalize; opacity: 0.8; }
.gh-tab:hover{ color: var(--text-1, var(--text)); background: var(--gh-caja); }
.gh-tab.is-activa{ background: var(--bg-elevated, var(--panel-alt)); color: var(--text-1, var(--text)); box-shadow: 0 1px 3px rgba(0,0,0,0.25); }
.gh-tab.is-hoy small{ color: var(--gh-b); font-weight: 800; opacity: 1; }
.gh-tab.is-jugada strong::after{ content: " ✓"; color: var(--text-3, var(--text-muted)); font-size: 0.7rem; }

.gh-cruces{ display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
.gh-cruces--final{ grid-template-columns: minmax(0, 1fr); max-width: 340px; width: 100%; margin: 0 auto; }
@container (min-width: 760px){ .gh-cruces{ grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@container (max-width: 380px){ .gh-cruces{ grid-template-columns: minmax(0, 1fr); } }
.gh-cruce{ display:flex; flex-direction:column; gap: 0.35rem; padding: 0.55rem 0.6rem 0.5rem; border-radius: var(--d10-r-ctrl, 10px); background: var(--gh-caja); border: 1px solid var(--gh-linea);
  transition: border-color .3s, transform .2s; animation: gh-entra .35s ease both; }
.gh-cruce:hover{ transform: translateY(-1px); border-color: var(--border-strong, var(--border)); }
.gh-cruce--en-juego{ border-color: color-mix(in srgb, var(--gh-b) 40%, transparent); background: linear-gradient(180deg, color-mix(in srgb, var(--gh-b) 7%, transparent), var(--gh-caja)); }
.gh-cruce--falta{ opacity: 0.75; }
.gh-cruce.is-mio{ border-color: color-mix(in srgb, var(--gh-mio) 55%, transparent); }
.gh-cruce__pie{ font-size: 0.7rem; color: var(--text-3, var(--text-muted)); display:flex; align-items:center; }
.gh-cruce--en-juego .gh-cruce__pie{ color: var(--gh-b); font-weight: 700; }

.gh-equipo{ position: relative; display:flex; align-items:center; gap: 0.4rem; min-width: 0; font-size: 0.82rem; padding: 0.1rem 0.15rem; border-radius: 6px; transition: background .4s; }
.gh-equipo__club{ flex: 1; min-width: 0; overflow:hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.gh-equipo__club small{ display:inline-block; min-width: 1.1rem; margin-right: 0.25rem; color: var(--text-3, var(--text-muted)); font-size: 0.7rem; font-weight: 700; }
.gh-equipo .gh-num{ font-size: 0.92rem; }
.gh-equipo.is-lider .gh-equipo__club, .gh-equipo.is-gano .gh-equipo__club{ font-weight: 800; }
.gh-equipo.is-lider .gh-num{ color: var(--gh-oro); }
.gh-equipo.is-gano .gh-num{ color: var(--text-1, var(--text)); }
.gh-equipo.is-afuera{ opacity: 0.45; }
.gh-equipo.is-afuera .gh-equipo__club{ text-decoration: line-through; text-decoration-thickness: 1px; }
.gh-equipo.is-vacio{ color: var(--text-3, var(--text-muted)); font-style: italic; }
.gh-equipo.is-mio .gh-equipo__club{ color: var(--gh-mio); }
.gh-check{ display:inline-grid; place-items:center; width: 16px; height: 16px; border-radius: 50%; background: var(--gh-oro); color: #111; font-size: 0.62rem; font-weight: 900; }

/* --- «+N» flotante y destello cuando una hinchada suma --- */
.gh-mas{ position:absolute; right: 0.2rem; top: -0.3rem; font-size: 0.72rem; font-weight: 900; color: var(--gh-oro); pointer-events: none; animation: gh-mas 2.1s ease-out forwards; z-index: 2; }
.gh-duelo__lado .gh-mas{ right: auto; left: 50%; top: 40%; font-size: 1rem; transform: translateX(-50%); }
@keyframes gh-mas{ 0%{ opacity: 0; transform: translateY(6px) scale(.8); } 15%{ opacity: 1; transform: translateY(0) scale(1.1); } 70%{ opacity: 1; } 100%{ opacity: 0; transform: translateY(-16px); } }
.gh-duelo__lado .gh-mas{ animation-name: gh-mas-c; }
@keyframes gh-mas-c{ 0%{ opacity: 0; transform: translate(-50%, 6px) scale(.8); } 15%{ opacity: 1; transform: translate(-50%, 0) scale(1.15); } 70%{ opacity: 1; } 100%{ opacity: 0; transform: translate(-50%, -22px); } }
.gh-sube{ background: color-mix(in srgb, var(--gh-oro) 13%, transparent); }
@keyframes gh-entra{ from{ opacity: 0; transform: translateY(4px); } to{ opacity: 1; transform: none; } }

/* --- Últimos movimientos --- */
.gh-feed{ display:flex; flex-direction:column; gap: 0.45rem; padding: 0.7rem 0.8rem; border-radius: var(--d10-r-ctrl, 10px); background: var(--gh-caja); border: 1px solid var(--gh-linea); }
.gh-feed ul{ list-style: none; margin: 0; padding: 0; display:flex; flex-direction:column; gap: 0.3rem; }
.gh-feed li{ display:flex; align-items:center; gap: 0.5rem; font-size: 0.82rem; animation: gh-entra .4s ease both; }
.gh-feed li .gh-escudo{ width: 18px; height: 18px; }
.gh-feed li span{ flex: 1; min-width: 0; overflow:hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.gh-feed li b{ color: var(--gh-oro); font-variant-numeric: tabular-nums; }
.gh-feed li small{ color: var(--text-3, var(--text-muted)); font-size: 0.7rem; min-width: 4.2rem; text-align: right; }
.gh-feed__vacio{ margin: 0; font-size: 0.78rem; color: var(--text-3, var(--text-muted)); }

/* --- Clasificación --- */
.gh-clas{ list-style: none; margin: 0; padding: 0; display:flex; flex-direction:column; gap: 0.22rem; }
.gh-fila{ position: relative; display:grid; grid-template-columns: 2rem 22px minmax(0, 1fr) minmax(40px, 22%) auto; align-items:center; gap: 0.5rem;
  padding: 0.42rem 0.55rem; border-radius: 8px; background: var(--gh-caja); font-size: 0.85rem; transition: background .4s; }
.gh-fila__pos{ position: relative; text-align:center; font-weight: 800; color: var(--text-3, var(--text-muted)); font-variant-numeric: tabular-nums; }
.gh-fila.is-clasifica .gh-fila__pos{ color: var(--gh-b); }
.gh-fila.is-podio .gh-fila__pos{ color: #111; border-radius: 999px; padding: 0.05rem 0; }
.gh-fila.is-p1 .gh-fila__pos{ background: var(--gh-oro); }
.gh-fila.is-p2 .gh-fila__pos{ background: #c9ced6; }
.gh-fila.is-p3 .gh-fila__pos{ background: #d08b4e; }
.gh-fila__club{ min-width: 0; overflow:hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.gh-fila__club small{ margin-left: 0.4rem; font-weight: 500; font-size: 0.72rem; color: var(--text-3, var(--text-muted)); }
.gh-fila__barra{ height: 5px; border-radius: 999px; background: var(--gh-linea); overflow: hidden; }
.gh-fila__barra i{ display:block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, color-mix(in srgb, var(--gh-b) 55%, transparent), var(--gh-b)); transition: width 1.2s cubic-bezier(.2,.8,.2,1); }
.gh-fila:not(.is-clasifica) .gh-fila__barra i{ background: var(--text-3, #666); }
.gh-fila__xp{ text-align: right; white-space: nowrap; min-width: 3.6rem; }
.gh-fila.is-mio{ background: color-mix(in srgb, var(--gh-mio) 14%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--gh-mio) 40%, transparent) inset; }
.gh-fila.gh-sube{ background: color-mix(in srgb, var(--gh-oro) 13%, transparent); }
.gh-flecha{ position:absolute; right: -0.35rem; top: -0.2rem; font-style: normal; font-size: 0.5rem; }
.gh-flecha.is-sube{ color: var(--accent-live, #10b981); }
.gh-flecha.is-baja{ color: var(--gh-b); }
.gh-corte{ display:flex; align-items:center; gap: 0.5rem; margin: 0.3rem 0; font-size: 0.66rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gh-b); }
.gh-corte::before, .gh-corte::after{ content:""; flex: 1; border-top: 1px dashed color-mix(in srgb, var(--gh-b) 55%, transparent); }
@container (max-width: 420px){
  .gh-fila{ grid-template-columns: 1.8rem 20px minmax(0, 1fr) auto; }
  .gh-fila__barra{ display:none; }
  .gh-fila__club small{ display:none; }
  .gh-duelo__xp .gh-num{ font-size: 1.5rem; }
  .gh-escudo--xl{ width: 42px; height: 42px; }
}

.jt-guerra.gh .jt-ver-archivo{ margin-top: 0; }

@media (prefers-reduced-motion: reduce){
  .gh-punto, .gh-chip--vivo i{ animation: none; }
  .gh-cruce, .gh-feed li, .gh-campeon{ animation: none; }
  .gh-tira i, .gh-fila__barra i{ transition: none; }
}
