/*
 * Tarjeta de los vídeos de partido: lo común a todos los tipos (includes/tarjetas_partido/tarjeta_partido.php).
 * Cada tipo tiene su hoja en esta carpeta; solo se carga la del tipo elegido en Común › Diseño.
 *
 * La tarjeta va dentro del enlace de la plantilla de vídeo, así que los efectos «al pasar el ratón» miran el enlace
 * (:hover > .tpar): siguen aunque el ratón esté sobre los iconos de la plantilla (entradilla, visto). Los tamaños van en
 * cqi (centésimas del ancho de la tarjeta), para que se vea igual en un carrusel que en una rejilla. Ojo: en la propia
 * .tpar, cqi se mediría contra el contenedor de fuera.
 */

.tpar {
    --tpar-fondo: var(--color-primary, #141428);
    --tpar-acento: var(--color-secondary, #3df59e);
    --tpar-acento-texto: var(--color-secondary-text, #111111);
    --tpar-directo: var(--color-live, #ff2d55);
    --tpar-curva: cubic-bezier(.2, .8, .2, 1);
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    isolation: isolate;
    container-type: inline-size;
    border-radius: var(--radius-card, 20px);
    background: var(--tpar-fondo);
    color: #fff;
    line-height: normal;
    text-align: left;
    text-decoration: none;
}

.tpar svg {
    flex: none;
    width: 1.25em;
    height: 1.25em;
}

.tpar-cabecera {
    position: absolute;
    top: 3.8cqi;
    left: 4.2cqi;
    right: 4.2cqi;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2cqi;
}

.tpar-cabecera--centro {
    justify-content: center;
}

.tpar-chip {
    min-width: 0;
    max-width: 64cqi;
    padding: .5em 1.05em;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 999px;
    background: rgba(0, 0, 0, .42);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: clamp(9px, 2.6cqi, 12px);
    font-weight: 700;
    letter-spacing: .08em;
    line-height: 1.2;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.tpar-chip--suave {
    flex: none;
    background: rgba(255, 255, 255, .12);
}

.tpar-estado {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: .55em;
    padding: .5em .95em;
    border-radius: 999px;
    background: rgba(255, 255, 255, .16);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: clamp(8px, 2.4cqi, 11px);
    font-weight: 800;
    letter-spacing: .1em;
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
}

.tpar-estado--directo {
    background: var(--tpar-directo);
    color: var(--color-live-text, #fff);
}

.tpar-estado--directo i {
    width: .6em;
    height: .6em;
    border-radius: 50%;
    background: currentColor;
    animation: tpar-latido 1.2s ease-in-out infinite;
}

.tpar-estado--previa {
    background: var(--tpar-acento);
    color: var(--tpar-acento-texto);
}

@keyframes tpar-latido {
    50% { opacity: .25; transform: scale(.7); }
}

.tpar-nombre {
    max-width: 100%;
    overflow: hidden;
    font-size: clamp(9px, 2.8cqi, 13px);
    font-weight: 700;
    letter-spacing: .03em;
    line-height: 1.15;
    text-align: center;
    text-overflow: ellipsis;
    text-shadow: 0 1px 6px rgba(0, 0, 0, .7);
    text-transform: uppercase;
    white-space: nowrap;
}

.tpar-nombre--dos {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    white-space: normal;
}

/* Escudo: los de iSquad son cuadrados con fondo blanco; sin escudo (o si no carga), las iniciales en su color */
.tpar-escudo {
    --tam: 17cqi;
    position: relative;
    display: grid;
    flex: none;
    place-items: center;
    width: var(--tam);
    height: var(--tam);
    overflow: hidden;
    border-radius: 24%;
    background: #fff;
    box-shadow: 0 .8cqi 2.4cqi rgba(0, 0, 0, .35);
}

/* Con !important: las hojas de las tarjetas de vídeo (card_match_video.css, efectos de Común › Diseño...) dan tamaño,
   esquinas y zoom a todas las imágenes de la tarjeta */
.tpar .tpar-escudo img {
    position: static !important;
    display: block !important;
    width: 86% !important;
    height: 86% !important;
    max-width: none !important;
    margin: 0 !important;
    aspect-ratio: auto !important;
    object-fit: contain !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    opacity: 1 !important;
    filter: none !important;
    transform: none !important;
    transition: none !important;
}

.tpar-escudo b {
    display: none;
    font-size: calc(var(--tam) * .36);
    font-weight: 800;
    letter-spacing: .02em;
    line-height: 1;
}

.tpar-escudo--sin {
    background: linear-gradient(145deg, color-mix(in srgb, var(--c) 72%, #fff), var(--c) 55%, color-mix(in srgb, var(--c) 70%, #000));
    color: var(--t);
}

.tpar .tpar-escudo--sin img {
    display: none !important;
}

.tpar-escudo--sin b {
    display: block;
}

.tpar-marcador {
    display: inline-flex;
    align-items: center;
    gap: .22em;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.tpar-marcador b {
    font-weight: inherit;
}

.tpar-marcador i {
    font-style: normal;
}

/* «Ver partido»: entra desde abajo al pasar el ratón. Cada tipo puede moverlo con --cta-oculto / --cta-visible */
.tpar-cta {
    position: absolute;
    left: 50%;
    bottom: 4cqi;
    z-index: 8;
    display: inline-flex;
    align-items: center;
    gap: .5em;
    padding: .6em 1.15em .6em .95em;
    border-radius: var(--radius-btn, 999px);
    background: var(--tpar-acento);
    box-shadow: 0 .8cqi 3cqi color-mix(in srgb, var(--tpar-acento) 45%, transparent);
    color: var(--tpar-acento-texto);
    font-size: clamp(10px, 2.9cqi, 14px);
    font-weight: 800;
    letter-spacing: .06em;
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: var(--cta-oculto, translate(-50%, 170%));
    transition: transform .45s var(--tpar-curva), opacity .3s;
}

:hover > .tpar .tpar-cta,
:focus-visible > .tpar .tpar-cta {
    opacity: 1;
    transform: var(--cta-visible, translate(-50%, 0));
}

/* «Visto» (tpar_visto()): va en la fila de abajo de cada tipo y toma su letra; solo pone el color de acento y la marca.
   Las veces y la última vez, en su title */
.tpar-visto {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: .3em;
    margin-left: .7em;
    color: var(--tpar-acento);
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.tpar-visto svg {
    width: 1.1em;
    height: 1.1em;
}

/* En las filas que ya separan sus piezas (flex con hueco) sobra el margen */
.tpar-tv__pie .tpar-visto,
.tpar-vhs__osd .tpar-visto,
.tpar-vs__pie .tpar-visto,
.tpar-lin__centro .tpar-visto,
.tpar-flu__centro .tpar-visto,
.tpar-mos__insignia .tpar-visto {
    margin-left: 0;
}

/* Barra de lo que lleva visto (tpar_progreso()): en el borde de abajo; la esquina redondeada la recorta la tarjeta */
.tpar-progreso {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 7;
    height: max(4px, 1.4cqi);
    background: rgba(255, 255, 255, .22);
    pointer-events: none;
}

.tpar-progreso::after {
    content: "";
    display: block;
    width: var(--progreso, 0%);
    height: 100%;
    background: var(--tpar-acento);
}

/* Las capas decorativas de las plantillas (el velo de la imagen del enlace, el tinte de .cardVideo al pasar el ratón)
   quedan por encima de la tarjeta: que no se queden el ratón ni los clics (el botón «Ver resultado», por ejemplo) */
:has(> .tpar)::before,
.cardVideo:has(.tpar)::before {
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    .tpar,
    .tpar * {
        animation: none !important;
        transition-duration: .01ms !important;
    }
}
