/**
 * Roster de jugadores (roster.php) y tarjeta de cada jugador (rj_tarjeta en funciones/roster.php, también en la ficha)
 * Tarjeta tipo cromo: la foto (fondo blanco) se funde con «multiply» sobre un degradado naranja con el dorsal detrás.
 * @author Aris Mota <soy@aris.do>
 * @version 2.0
 * @date 2026-10-24
 */

.rj, .rj-card {
    --rj-naranja: #fd3f00;
    --rj-naranja-claro: #ff7a45;
    --rj-negro: #121212;
    --rj-negro-2: #1d1d1b;
    --rj-borde: #e4e4e4;
    --rj-suave: #6f6f6f;
    --rj-fondo: #f4f4f2;
}

.rj { margin: 0 0 60px; color: var(--rj-negro-2); }
.rj a:hover, .rj a:focus { text-decoration: none; }
.rj [hidden] { display: none !important; }

/* ------------------------------------------------------------------ Portada */
.rj-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    min-height: 360px;
    margin: 0 0 18px;
    padding: 48px 44px 40px;
    border-radius: 18px;
    background-color: #000;
    background-size: cover;
    background-position: center 35%;
    color: #fff;
    box-shadow: 0 22px 50px rgba(0, 0, 0, .28);
}
.rj-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    background:
        linear-gradient(100deg, rgba(0, 0, 0, .94) 0%, rgba(0, 0, 0, .78) 48%, rgba(253, 63, 0, .62) 100%),
        linear-gradient(0deg, rgba(0, 0, 0, .6), transparent 50%);
}
.rj-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: repeating-linear-gradient(115deg, transparent 0 26px, rgba(255, 255, 255, .035) 26px 28px);
}
.rj-hero-marca {
    position: absolute;
    right: -24px;
    bottom: -58px;
    z-index: -1;
    font-family: var(--fuente-titulo);
    font-weight: 800;
    font-size: clamp(130px, 24vw, 320px);
    line-height: .8;
    letter-spacing: -.02em;
    color: transparent;
    -webkit-text-stroke: 2px rgba(255, 255, 255, .13);
    pointer-events: none;
    user-select: none;
}
.rj-hero-texto { position: relative; flex: 1; min-width: 0; }
.rj-kicker, .rj-manager-etiqueta {
    display: inline-block;
    padding: 3px 11px;
    border-radius: 3px;
    background: var(--rj-naranja);
    font-family: var(--fuente-widget);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.rj-hero h1 {
    margin: 12px 0 10px;
    font-size: clamp(52px, 8.5vw, 104px);
    line-height: .88;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 0 6px 30px rgba(0, 0, 0, .5);
}
.rj-hero p { max-width: 520px; margin: 0 0 26px; font-size: 16px; line-height: 1.5; color: rgba(255, 255, 255, .78); }

.rj-conteo { display: flex; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.rj-conteo li { padding: 0 22px 0 0; margin: 0 22px 8px 0; border-right: 1px solid rgba(255, 255, 255, .18); }
.rj-conteo li:last-child { border-right: 0; margin-right: 0; }
.rj-conteo a { display: block; color: #fff; transition: color .15s; }
.rj-conteo a:hover, .rj-conteo a:focus { color: var(--rj-naranja-claro); }
.rj-conteo b { display: block; font-family: var(--fuente-titulo); font-weight: 800; font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums; }
.rj-conteo li:first-child b { color: var(--rj-naranja-claro); }
.rj-conteo span { display: block; margin-top: 4px; font-family: var(--fuente-widget); font-weight: 600; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 255, 255, .62); }
.rj-conteo a span { color: inherit; opacity: .75; }

/* Manager */
.rj-manager {
    position: relative;
    flex: none;
    display: flex;
    align-items: flex-end;
    width: 360px;
    min-height: 200px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 16px;
    background: linear-gradient(160deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .02));
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: #fff !important;
    transition: transform .25s, border-color .25s, box-shadow .25s;
}
.rj-manager:hover, .rj-manager:focus { transform: translateY(-4px); border-color: rgba(253, 63, 0, .8); box-shadow: 0 18px 36px rgba(0, 0, 0, .35); }
.rj-manager-foto { flex: none; align-self: stretch; display: flex; align-items: flex-end; width: 160px; }
.rj-manager-foto img { display: block; width: 100%; max-height: 210px; object-fit: contain; object-position: bottom; transition: transform .35s; }
.rj-manager:hover .rj-manager-foto img { transform: scale(1.05); transform-origin: bottom center; }
.rj-manager:not(.rj-manager-recorte) .rj-manager-foto { align-items: center; justify-content: center; padding: 18px; }
.rj-manager:not(.rj-manager-recorte) .rj-manager-foto img { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; object-position: top; border: 3px solid var(--rj-naranja); }
.rj-manager-datos { flex: 1; min-width: 0; align-self: center; padding: 18px 18px 18px 6px; }
.rj-manager strong { display: block; margin-top: 8px; font-family: var(--fuente-titulo); font-weight: 800; font-size: 34px; line-height: .95; text-transform: uppercase; }
.rj-manager-ver { display: inline-block; margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--rj-naranja-claro); }

/* ------------------------------------------------------------------ Barra de filtros (fija bajo el menú al bajar) */
.rj-barra {
    position: sticky;
    top: var(--rj-top, 50px);
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    margin: 0 0 26px;
    padding: 10px 12px;
    border: 1px solid var(--rj-borde);
    border-radius: 14px;
    background: rgba(255, 255, 255, .92);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .06);
}
.rj-pestanas { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.rj-pestanas::-webkit-scrollbar { display: none; }
.rj-pestanas a {
    flex: none;
    padding: 8px 14px;
    border-radius: 9px;
    font-weight: 600;
    font-size: 14px;
    color: var(--rj-negro-2);
    white-space: nowrap;
    transition: background .15s, color .15s;
}
.rj-pestanas a small { margin-left: 3px; font-size: 12px; font-weight: 600; color: var(--rj-suave); }
.rj-pestanas a:hover, .rj-pestanas a:focus { background: var(--rj-fondo); color: var(--rj-negro-2); }
.rj-pestanas a.activo { background: var(--rj-negro); color: #fff; }
.rj-pestanas a.activo small { color: var(--rj-naranja-claro); }

.rj-herramientas { display: flex; gap: 8px; margin-left: auto; }
.rj-buscar { position: relative; margin: 0; font-weight: 400; }
.rj-buscar i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--rj-suave); font-size: 13px; }
.rj-buscar input, .rj-orden select {
    height: 38px;
    border: 1px solid var(--rj-borde);
    border-radius: 9px;
    background: #fff;
    font-size: 14px;
    color: var(--rj-negro-2);
}
.rj-buscar input { width: 220px; padding: 0 12px 0 34px; transition: border-color .15s, box-shadow .15s; }
.rj-buscar input:focus, .rj-orden select:focus { outline: 0; border-color: var(--rj-naranja); box-shadow: 0 0 0 3px rgba(253, 63, 0, .15); }
.rj-orden { margin: 0; font-weight: 400; }
.rj-orden select { padding: 0 10px; }

/* ------------------------------------------------------------------ Grupos y rejilla */
.rj-grupo { margin: 0 0 44px; }
.rj-grupo-titulo {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 18px;
    font-family: var(--fuente-titulo);
    font-weight: 800;
    font-size: 38px;
    line-height: 1;
    text-transform: uppercase;
    color: var(--rj-negro-2);
}
.rj-grupo-titulo span { padding: 3px 10px; border-radius: 6px; background: var(--rj-naranja); color: #fff; font-family: var(--fuente-texto); font-size: 15px; font-weight: 700; }
.rj-grupo-titulo::after { content: ""; flex: 1; height: 2px; background: linear-gradient(90deg, var(--rj-borde), transparent); }
.rj-rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(208px, 1fr)); gap: 22px 18px; }
.rj-vacio { padding: 40px 0; text-align: center; font-size: 16px; color: var(--rj-suave); }

/* ------------------------------------------------------------------ Tarjeta (cromo) */
.rj-card {
    --rx: 0deg;
    --ry: 0deg;
    --mx: 50%;
    --my: 30%;
    position: relative;
    container-type: inline-size;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: 16px;
    background:
        linear-gradient(var(--rj-negro), var(--rj-negro)) padding-box,
        linear-gradient(140deg, var(--rj-naranja) 0%, #2b2b2b 32%, #2b2b2b 68%, var(--rj-naranja) 100%) border-box;
    color: #fff;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .14);
    transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
    transition: transform .35s cubic-bezier(.2, .8, .2, 1), box-shadow .35s;
    animation: rj-entrar .6s cubic-bezier(.2, .8, .2, 1) both;
    animation-delay: calc(var(--i, 0) * 45ms);
}
/* Brillo que sigue al cursor */
.rj-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 4;
    background:
        radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, .38), transparent 45%),
        linear-gradient(115deg, transparent 38%, rgba(255, 150, 90, .18) 50%, transparent 62%);
    mix-blend-mode: overlay;
    opacity: 0;
    transition: opacity .3s;
    pointer-events: none;
}
.rj-card:hover, .rj-card:focus-within { box-shadow: 0 26px 44px rgba(0, 0, 0, .26), 0 0 0 1px rgba(253, 63, 0, .4); }
.rj-card:hover::before, .rj-card:focus-within::before { opacity: 1; }
.rj-card.rj-inclinada { transition: transform .08s linear, box-shadow .35s; }

.rj-card-foto {
    position: relative;
    isolation: isolate;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: radial-gradient(120% 90% at 50% 18%, #fff 0%, #ffe6da 46%, #ffbe9f 100%);
}
.rj-card-dorsal {
    position: absolute;
    top: 190px;
    top: calc(125cqw - 64px);
    right: 10px;
    z-index: 3;
    font-family: var(--fuente-titulo);
    font-weight: 800;
    font-size: 80px;
    line-height: 1;
    letter-spacing: -.01em;
    color: rgba(253, 63, 0, .12);
    -webkit-text-stroke: 2px var(--rj-naranja);
    text-shadow: 0 6px 24px rgba(0, 0, 0, .35);
    pointer-events: none;
    transition: transform .5s cubic-bezier(.2, .8, .2, 1), color .3s;
}
/* La foto cubre todo el ancho, anclada arriba (gorra y cara); lo que sobra del pecho queda en el degradado */
.rj-card-foto img {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: 50% 8%;
    transform-origin: 50% 30%;
    mix-blend-mode: multiply;
    transition: transform .5s cubic-bezier(.2, .8, .2, 1);
}
/* Sin foto: la figura con el uniforme (PNG transparente), recortada como las fotos */
.rj-card-sinfoto .rj-card-foto img { object-position: 50% 4%; mix-blend-mode: normal; }
.rj-card:hover .rj-card-foto img { transform: scale(1.06); }
.rj-card:hover .rj-card-dorsal { transform: translateY(-4px); color: rgba(253, 63, 0, .22); }
/* La foto se funde con el negro de la tarjeta: sin cortes sobre el cuerpo */
.rj-card-foto::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    z-index: 2;
    height: 34%;
    background: linear-gradient(180deg, rgba(18, 18, 18, 0) 0%, rgba(18, 18, 18, .55) 55%, var(--rj-negro) 100%);
}
.rj-card-lider {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 3;
    padding: 3px 8px;
    border-radius: 20px;
    background: rgba(18, 18, 18, .88);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .02em;
}
.rj-card-lider .fa { color: #ffb020; }

.rj-card-cuerpo { flex: 1; display: flex; flex-direction: column; padding: 4px 14px 14px; }
.rj-card-nombre { display: block; margin: 0 0 6px; padding: 0; border: 0; color: #fff; font-family: var(--fuente-titulo); font-weight: 800; font-size: 25px; line-height: .98; text-transform: uppercase; letter-spacing: .01em; }
.rj-card-nombre small { display: block; margin-bottom: 1px; font-family: var(--fuente-widget); font-weight: 600; font-size: 14px; letter-spacing: .08em; color: rgba(255, 255, 255, .62); }
.rj-card-nombre a { color: #fff; }
/* Toda la tarjeta lleva al perfil */
.rj-card-nombre a::after { content: ""; position: absolute; inset: 0; z-index: 5; }
.rj-card-nombre a:focus { outline: 0; }
.rj-card:focus-within { outline: 2px solid var(--rj-naranja); outline-offset: 3px; }
.rj-card-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 0 0 4px; font-size: 12px; color: rgba(255, 255, 255, .72); }
.rj-card-meta b { color: var(--rj-naranja-claro); }
.rj-card-origen { margin: 0; font-size: 11.5px; line-height: 1.5; color: rgba(255, 255, 255, .55); }
.rj-card-origen span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rj-card-origen .fa { width: 12px; color: rgba(253, 63, 0, .85); }
.rj-card-linea { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: auto; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .1); }
.rj-card-origen + .rj-card-linea, .rj-card-meta + .rj-card-linea { margin-top: 12px; }
.rj-card-linea span { text-align: center; }
.rj-card-linea span + span { border-left: 1px solid rgba(255, 255, 255, .1); }
.rj-card-linea b { display: block; font-size: 18px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.rj-card-linea small { display: block; margin-top: 2px; font-size: 10px; font-weight: 600; letter-spacing: .12em; color: rgba(255, 255, 255, .5); }
/* Números de una temporada anterior: cinta con la temporada y cifras en gris */
.rj-card-cinta {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: -2px 0 6px;
    font-family: var(--fuente-widget);
    font-weight: 700;
    font-size: 11px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--rj-naranja-claro);
}
.rj-card-cinta::after { content: ""; flex: 1; height: 1px; background: rgba(253, 63, 0, .35); }
.rj-card-linea .rj-card-cinta + span { border-left: 0; }
.rj-card-anterior b { color: rgba(255, 255, 255, .62); }
/* Sin historial en la LIDOM */
.rj-card-nuevo { grid-column: 1 / -1; margin: 0; padding: 2px 0; text-align: center; }
.rj-card-nuevo b { font-size: 13px; font-weight: 700; color: #fff; }
.rj-card-nuevo .fa { color: var(--rj-naranja-claro); }
.rj-card-nuevo small { display: block; margin-top: 2px; font-size: 11.5px; letter-spacing: 0; color: rgba(255, 255, 255, .55); }

@keyframes rj-entrar {
    from { opacity: 0; transform: perspective(900px) translateY(26px) rotateX(8deg); }
    to { opacity: 1; transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)); }
}

/* ------------------------------------------------------------------ Pie */
.rj-pie { padding-top: 20px; border-top: 1px solid var(--rj-borde); }
.rj-pie p { margin: 0 0 18px; font-size: 12.5px; color: var(--rj-suave); }
.rj-enlaces { display: flex; flex-wrap: wrap; gap: 10px; }
.rj-enlaces a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 18px;
    border-radius: 10px;
    background: var(--rj-negro);
    font-weight: 600;
    font-size: 14px;
    color: #fff;
    transition: background .15s, transform .15s;
}
.rj-enlaces a .fa { color: var(--rj-naranja-claro); }
.rj-enlaces a:hover, .rj-enlaces a:focus { background: var(--rj-naranja); color: #fff; transform: translateY(-2px); }
.rj-enlaces a:hover .fa { color: #fff; }

/* ------------------------------------------------------------------ Móvil */
@media (max-width: 991px) {
    .rj-hero { flex-direction: column; align-items: stretch; padding: 36px 28px 28px; }
    .rj-manager { width: 100%; max-width: 420px; }
}
@media (max-width: 600px) {
    .rj-hero { min-height: 0; padding: 28px 18px 20px; border-radius: 14px; }
    .rj-hero p { font-size: 14px; margin-bottom: 18px; }
    .rj-conteo li { padding-right: 14px; margin-right: 14px; }
    .rj-conteo b { font-size: 30px; }
    .rj-conteo span { font-size: 11px; }
    .rj-manager { min-height: 150px; }
    .rj-manager-foto { width: 120px; }
    .rj-manager-foto img { max-height: 160px; }
    .rj-manager strong { font-size: 26px; }
    .rj-barra { padding: 8px; border-radius: 12px; }
    .rj-herramientas { width: 100%; }
    .rj-buscar { flex: 1; }
    .rj-buscar input { width: 100%; }
    .rj-grupo-titulo { font-size: 30px; }
    .rj-rejilla { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .rj-card { border-radius: 12px; }
    .rj-card-dorsal { font-size: 56px; top: calc(125cqw - 46px); right: 6px; }
    .rj-card-cuerpo { padding: 2px 10px 10px; }
    .rj-card-nombre { font-size: 20px; }
    .rj-card-nombre small { font-size: 12px; }
    .rj-card-origen { display: none; }
    .rj-card-linea b { font-size: 15px; }
    .rj-card-linea small { font-size: 9px; letter-spacing: .06em; }
    .rj-card-lider { font-size: 10px; }
    .rj-card-cinta { font-size: 10px; letter-spacing: .08em; }
}

@media (prefers-reduced-motion: reduce) {
    .rj-card, .rj-card-foto img, .rj-card-dorsal, .rj-manager, .rj-enlaces a { animation: none; transition: none; }
    .rj-card { transform: none; }
}
