/* MUTACORE · Ranking global (public/ranking.html). Usa los tokens y piezas de sitio.css. */
.rk-tabs { margin-bottom: 12px; }
.rk-tab { min-height: 44px; }
.rk-tablero { --rk: #ff5ac8; --filo: var(--rk); padding: 18px 18px 22px; margin-bottom: 40px; }

/* ---------- cabecera del tablero ---------- */
.rk-cabeza { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 18px; margin-bottom: 6px; }
.rk-titulo { display: flex; align-items: center; gap: 12px; min-width: 0; }
.rk-titulo h2 { margin: 0; font-size: clamp(1.3rem, 3.2vw, 1.8rem); text-shadow: var(--contorno-texto); }
.rk-titulo p { margin: 2px 0 0; }
.rk-ico .ico { width: 46px; height: 46px; }
.rk-estado { display: flex; flex-wrap: wrap; gap: 8px; }
.rk-estado .chip { font-variant-numeric: tabular-nums; }
.rk-cuenta span { font-family: var(--t-tec); font-size: .82rem; letter-spacing: .02em; }
.rk-act i { animation: rk-pulso 1.6s ease-in-out infinite; }
.rk-mock { text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.rk-mock[hidden], .rk-cuenta[hidden] { display: none !important; } /* .chip pone display y le ganaba al atributo hidden: «Datos de prueba» se veía con datos reales */
@keyframes rk-pulso { 50% { opacity: .35; transform: scale(.7); } }

/* ---------- podio ---------- */
.rk-podio {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr); align-items: end; gap: clamp(8px, 2vw, 22px);
  max-width: 760px; margin: 18px auto 10px; padding: 34px 4px 0; min-height: 120px;
}
.rk-podio:empty { display: none; } /* sin filas (tabla vacía o cargando con error) no deja un hueco de 190 px */
.rk-podio::before {
  content: ""; position: absolute; inset: 0 8% 18%; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse at 50% 65%, color-mix(in srgb, var(--rk) 30%, transparent), transparent 62%);
  filter: blur(6px);
}
.rk-puesto { --m: #ffd24a; position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; min-width: 0; }
.rk-puesto.vacio { visibility: hidden; }
.rk-retrato { position: relative; }
.rk-foto.grande { width: clamp(70px, 13vw, 104px); height: clamp(70px, 13vw, 104px); border-width: 3px; border-color: var(--m); box-shadow: 0 0 0 3px var(--contorno), 0 0 24px color-mix(in srgb, var(--m) 55%, transparent); }
.rk-puesto.p1 .rk-foto.grande { width: clamp(88px, 16vw, 132px); height: clamp(88px, 16vw, 132px); }
.rk-puesto.p1 .rk-foto.grande i { font-size: 2rem; }
.rk-halo { position: absolute; inset: -14px; z-index: -1; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from 0deg, transparent, color-mix(in srgb, var(--m) 70%, transparent), transparent 35%, color-mix(in srgb, var(--m) 50%, transparent), transparent 70%);
  filter: blur(4px); opacity: .8; animation: rk-girar 6s linear infinite; }
.rk-corona { position: absolute; top: -34px; left: 50%; translate: -50% 0; z-index: 2; color: #ffd24a; filter: drop-shadow(0 2px 0 var(--contorno)) drop-shadow(0 0 10px rgba(255, 210, 74, .7)); animation: rk-flotar 2.8s ease-in-out infinite; }
.rk-corona .gl { width: 40px; height: 40px; }
.rk-sello { margin-top: -22px; position: relative; z-index: 1; line-height: 0; min-height: 30px; display: grid; place-items: center; }
.rk-medalla { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--c);
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c) 45%, #fff), color-mix(in srgb, var(--c) 55%, #000));
  border: 2.5px solid var(--contorno); box-shadow: 0 0 14px color-mix(in srgb, var(--c) 60%, transparent); }
.rk-medalla .gl { width: 22px; height: 22px; color: #fff; filter: drop-shadow(0 1.5px 0 rgba(0, 0, 0, .55)); }
.rk-puesto .rk-nombre { align-items: center; max-width: 100%; }
.rk-puesto .rk-nombre b { font-size: clamp(.92rem, 2vw, 1.12rem); }
.rk-puesto .rk-valor { font-size: .95rem; }
.rk-pedestal {
  position: relative; width: 100%; margin-top: 8px; display: grid; place-items: start center; padding-top: 10px;
  height: 70px; border-radius: 10px 10px 0 0; border: 2.5px solid var(--contorno); border-bottom: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .28), rgba(255, 255, 255, 0) 14%),
    linear-gradient(90deg, rgba(0, 0, 0, .25), transparent 18%, transparent 82%, rgba(0, 0, 0, .25)),
    linear-gradient(180deg, color-mix(in srgb, var(--m) 88%, #fff), color-mix(in srgb, var(--m) 60%, #1a1030) 45%, color-mix(in srgb, var(--m) 25%, #0a122a));
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, .25), 0 0 26px color-mix(in srgb, var(--m) 35%, transparent);
}
.rk-pedestal span { font: 700 clamp(1.8rem, 5vw, 2.6rem)/1 var(--t-titulo); color: #fff; text-shadow: var(--contorno-texto); }
.rk-puesto.p1 .rk-pedestal { height: 112px; }
.rk-puesto.p2 .rk-pedestal { height: 84px; }
.rk-puesto.p3 .rk-pedestal { height: 62px; }
/* entrada: los pedestales suben, después aparecen los jugadores (3 → 2 → 1). */
.rk-podio.animar .rk-pedestal { transform-origin: bottom; animation: rk-subir .6s var(--rebote) both; }
.rk-podio.animar .rk-puesto > :not(.rk-pedestal) { animation: rk-caer .55s var(--rebote) both; }
.rk-podio.animar .p3 .rk-pedestal { animation-delay: .05s; }
.rk-podio.animar .p2 .rk-pedestal { animation-delay: .15s; }
.rk-podio.animar .p1 .rk-pedestal { animation-delay: .25s; }
.rk-podio.animar .p3 > :not(.rk-pedestal) { animation-delay: .45s; }
.rk-podio.animar .p2 > :not(.rk-pedestal) { animation-delay: .6s; }
.rk-podio.animar .p1 > :not(.rk-pedestal) { animation-delay: .8s; }
@keyframes rk-subir { from { transform: scaleY(0); } }
@keyframes rk-caer { from { opacity: 0; transform: translateY(-24px) scale(.8); } }
@keyframes rk-girar { to { transform: rotate(360deg); } }
@keyframes rk-flotar { 50% { transform: translateY(-5px) rotate(-4deg); } }
.rk-esqueleto { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr); align-items: end; gap: inherit; }
.rk-esq { display: block; border-radius: 10px 10px 0 0; background: linear-gradient(90deg, #13244e, #1d3570, #13244e) 0 0 / 200% 100%; animation: rk-brillo 1.3s linear infinite; }
.rk-esq.p1 { height: 200px; } .rk-esq.p2 { height: 170px; } .rk-esq.p3 { height: 150px; }
@keyframes rk-brillo { to { background-position: -200% 0; } }

/* ---------- herramientas ---------- */
.rk-herramientas { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 18px 0 10px; }
.rk-buscar { flex: 1 1 260px; max-width: 420px; min-height: 44px; }

/* ---------- lista ---------- */
.rk-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rk-fila {
  display: grid; grid-template-columns: 44px 44px minmax(0, 1fr) auto auto; align-items: center; gap: 12px;
  min-height: 58px; padding: 6px 14px 6px 8px; border-radius: 9px;
  background: linear-gradient(180deg, #13254f, var(--placa)); border: 1px solid var(--borde);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), inset 0 -2px 0 rgba(0, 0, 0, .25);
  animation: rk-fila .4s var(--suave-ease) both; animation-delay: calc(var(--i, 0) * 18ms);
}
.rk-fila:hover { border-color: color-mix(in srgb, var(--rk) 60%, transparent); }
.rk-fila.top { border-color: color-mix(in srgb, var(--c, #ffd24a) 40%, transparent); }
.rk-fila.t1 { background: linear-gradient(90deg, rgba(255, 210, 74, .16), transparent 60%), linear-gradient(180deg, #13254f, var(--placa)); }
.rk-fila.t2 { background: linear-gradient(90deg, rgba(207, 219, 232, .12), transparent 60%), linear-gradient(180deg, #13254f, var(--placa)); }
.rk-fila.t3 { background: linear-gradient(90deg, rgba(224, 137, 74, .14), transparent 60%), linear-gradient(180deg, #13254f, var(--placa)); }
@keyframes rk-fila { from { opacity: 0; transform: translateY(6px); } }
.rk-esq-fila { background: linear-gradient(90deg, #13244e, #1d3570, #13244e) 0 0 / 200% 100%; animation: rk-brillo 1.3s linear infinite; border-color: transparent; }
.rk-pos { justify-self: center; font-size: 1rem; color: var(--suave); }
.rk-fila.top .rk-pos { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: #fff; background: color-mix(in srgb, var(--c) 70%, #000); border: 2px solid var(--contorno); box-shadow: 0 0 10px color-mix(in srgb, var(--c) 50%, transparent); text-shadow: 0 1px 0 var(--contorno); }
.rk-foto {
  position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; overflow: hidden; flex: none;
  background: radial-gradient(circle at 35% 30%, #2c4c92, #101e46); border: 2px solid rgba(110, 180, 255, .45);
}
.rk-foto i { font: 700 1rem var(--t-titulo); font-style: normal; color: var(--suave); }
.rk-foto img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s; }
.rk-foto img[src] { opacity: 1; }
.rk-nombre { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.rk-nombre b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--t-titulo); font-weight: 600; font-size: 1.02rem; color: #fff; }
.rk-nombre small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--tenue); font-size: .78rem; }
.rk-rango { display: flex; align-items: center; gap: 6px; }
.rk-rango-txt { font-size: .82rem; color: var(--suave); white-space: nowrap; }
.rk-valor { justify-self: end; white-space: nowrap; color: var(--suave); font-size: .85rem; }
.rk-valor b { color: #fff; font-size: 1.05rem; margin-inline-end: 2px; }
.rk-puesto .rk-valor b { color: var(--m); text-shadow: 0 1px 0 var(--contorno); }
.rk-fila:not(:has(.rk-rango)) { grid-template-columns: 44px 44px minmax(0, 1fr) auto; }
/* placa temporal del rango (solo si /js/emblemas-rango.js no cargó) */
.rk-placa { display: inline-grid; place-items: center; width: var(--tam); height: var(--tam); color: var(--c); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--c) 60%, transparent)); }
.rk-placa .gl { width: 100%; height: 100%; }

/* ---------- vacío / error ---------- */
.rk-vacio { display: grid; justify-items: center; gap: 10px; padding: 34px 16px; text-align: center; color: var(--suave); }
.rk-vacio .ico { width: 64px; height: 64px; }
.rk-vacio h3 { margin: 0; }
.rk-vacio.chico { padding: 18px; }

/* ---------- celular ---------- */
@media (max-width: 640px) {
  .rk-tablero { padding: 14px 10px 18px; }
  .rk-titulo .rk-ico { display: none; }
  .rk-podio { padding-top: 38px; gap: 6px; }
  .rk-pedestal { height: 54px; }
  .rk-puesto.p1 .rk-pedestal { height: 84px; } .rk-puesto.p2 .rk-pedestal { height: 64px; } .rk-puesto.p3 .rk-pedestal { height: 48px; }
  .rk-puesto .rk-nombre small { display: none; }
  .rk-puesto .rk-valor { font-size: .78rem; }
  .rk-fila { grid-template-columns: 34px 40px minmax(0, 1fr) auto auto; gap: 8px; padding: 6px 10px 6px 4px; }
  .rk-fila:not(:has(.rk-rango)) { grid-template-columns: 34px 40px minmax(0, 1fr) auto; }
  .rk-foto { width: 40px; height: 40px; }
  .rk-rango-txt { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .rk-halo, .rk-corona, .rk-act i, .rk-esq, .rk-esq-fila { animation: none; }
  .rk-fila { animation: none; }
}

/* ---------- Streamers (Duelo en Vivo) ---------- */
.rk-subtabs { margin: -4px 0 12px; padding-inline-start: 14px; border-inline-start: 3px solid #25f4ee; }
.rk-subtabs[hidden] { display: none; }
.rk-subtabs .rk-tab { min-height: 40px; font-size: .92rem; }
.rk-tk-in { color: #25f4ee; font-weight: 600; text-shadow: 1px 0 0 rgba(254, 44, 85, .55); }
.rk-sep { color: var(--tenue); }
.rk-vivo {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 5px; margin-top: 3px; padding: 1px 8px 1px 6px;
  border-radius: 999px; background: #e0182d; color: #fff; font: 700 .68rem/1.5 var(--t-texto); letter-spacing: .08em; text-transform: uppercase;
  box-shadow: 0 0 0 2px var(--contorno), 0 0 12px rgba(255, 40, 60, .6);
}
.rk-vivo::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: rk-pulso 1.1s ease-in-out infinite; }
.rk-puesto .rk-vivo { align-self: center; }
.rk-puesto .rk-nombre b { white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 640px) { .rk-fila .rk-sep, .rk-fila .rk-tk-in { display: block; font-size: .8rem; } .rk-fila .rk-sep { display: none; } }
@media (prefers-reduced-motion: reduce) { .rk-vivo::before { animation: none; } }
.rk-vivo { white-space: nowrap; }
.rk-puesto .rk-valor { white-space: normal; line-height: 1.15; }
@media (max-width: 640px) {
  .rk-puesto .rk-valor b { display: block; font-size: .95rem; }
  .rk-fila .rk-valor { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; font-size: .72rem; }
  .rk-fila .rk-valor b { font-size: .95rem; margin: 0; }
  .rk-fila .rk-vivo { font-size: .6rem; padding: 0 6px 0 5px; }
  .rk-fila { grid-template-columns: 30px 38px minmax(0, 1fr) auto; }
  .rk-fila .rk-foto { width: 38px; height: 38px; }
}

/* El contenido lo arma JS después de que cabecera.js pinta el pie: sin alto mínimo el pie saltaba (CLS 0,3–0,5). */
#principal { min-height: 100vh; }

/* Mientras llega la tabla (aria-busy), la lista guarda su lugar: el panel no empuja la página al llenarse (CLS ~0,2). */
#rk-panel[aria-busy="true"] .rk-lista { min-height: 60vh; }
#rk-panel[aria-busy="true"] .rk-podio:empty { display: grid; min-height: 250px; } /* el podio llega con los datos: su lugar queda guardado */
