/* =============================================================================
   CARDS - MHB Theme
   Style inspiré de l'ancien thème avec animations et effets
   ============================================================================= */

/* =============================================================================
   BASE CARD
   ============================================================================= */

.mhb-card {
    position: relative;
    background: var(--mhb-bg-dark-alt, #1a1f2e);
    border-radius: var(--mhb-radius-md, 12px);
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
        box-shadow 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.mhb-card:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

/* Grid card */
.grid-card {
    display: flex;
    flex-direction: column;
}

/* Carrousel card */
.carrousel-card {
    cursor: pointer;
}

/* =============================================================================
   CARD IMAGE
   ============================================================================= */

.mhb-card__image {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
}

.mhb-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.mhb-card:hover .mhb-card__image img,
.mhb-card__image[data-hover="zoom"]:hover img {
    transform: scale(1.08);
}

.mhb-card__image--placeholder {
    background: linear-gradient(135deg, #1a1f2e 0%, #2a3040 100%);
}

/* Image overlay */
.mhb-card__overlay {
    position: absolute;
    inset: -1px;
    background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.8) 100%);
    pointer-events: none;
    transition: none;
}

.mhb-card:hover .mhb-card__overlay {
    opacity: 0.9;
}

/* =============================================================================
   CARD CONTENT
   ============================================================================= */

.mhb-card__content {
    padding: 20px;
}

/* Tag / Category */
.mhb-card__tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--mhb-accent, #E95323);
    background: rgba(233, 83, 35, 0.15);
    padding: 4px 10px;
    border-radius: 4px;
    margin-bottom: 8px;
}

/* Title avec ligne et croix (style ancien thème) */
.mhb-card__title-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
}

.mhb-card__title {
    font-family: var(--mhb-font-display, 'Formula Condensed', sans-serif);
    font-size: 22px;
    font-weight: 700;
    line-height: 1.15;
    color: #fff;
    text-transform: uppercase;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mhb-card__title-line {
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.mhb-card:hover .mhb-card__title-line {
    opacity: 1;
    transform: translateX(0);
}

.mhb-card__cross {
    font-size: 18px;
    font-weight: 700;
    color: var(--mhb-accent, #E95323);
}

.mhb-card__line {
    flex: 1;
    height: 2px;
    background: var(--mhb-accent, #E95323);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) 0.1s;
}

.mhb-card:hover .mhb-card__line {
    transform: scaleX(1);
}

/* Link overlay */
.mhb-card__link {
    position: absolute;
    inset: 0;
    z-index: 2;
    text-decoration: none;
}

/* =============================================================================
   MEDIA CARD - Card générique pour news, albums, vidéos, etc.
   Utiliser .mhb-card--media ou les alias: --news, --album, --video
   ============================================================================= */

:is(.mhb-card--media, .mhb-card--news, .mhb-card--album, .mhb-card--video) {
    flex: 0 0 350px;
    min-width: 300px;
    min-height: 430px;
    border-radius: 22px;
    box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.12);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    position: relative;
    transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1),
        box-shadow 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
}

/* Effet de shine au survol */
:is(.mhb-card--media, .mhb-card--news, .mhb-card--album, .mhb-card--video)::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    transform: skewX(-25deg);
    transition: left 0.7s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 10;
    pointer-events: none;
}

:is(.mhb-card--media, .mhb-card--news, .mhb-card--album, .mhb-card--video):hover::before {
    left: 130%;
}

:is(.mhb-card--media, .mhb-card--news, .mhb-card--album, .mhb-card--video):hover {
    box-shadow: 0 8px 24px 0 rgba(0, 0, 0, 0.18);
}

:is(.mhb-card--media, .mhb-card--news, .mhb-card--album, .mhb-card--video) .mhb-card__image {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
}

:is(.mhb-card--media, .mhb-card--news, .mhb-card--album, .mhb-card--video) .mhb-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.25, 0.8, 0.25, 1), filter 0.5s ease;
    background-color: #FFF;
    border-radius: 23px;
}

:is(.mhb-card--media, .mhb-card--news, .mhb-card--album, .mhb-card--video):hover .mhb-card__image img {
    transform: scale(1.08);
    filter: brightness(1.05);
}

:is(.mhb-card--media, .mhb-card--news, .mhb-card--album, .mhb-card--video) .mhb-card__overlay {
    position: absolute;
    inset: -1px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, 0.85) 100%);
    z-index: 3;
    pointer-events: none;
    transition: none;
    transform: translateZ(0);
}

:is(.mhb-card--media, .mhb-card--news, .mhb-card--album, .mhb-card--video):hover .mhb-card__overlay {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, 0.85) 100%);
}

:is(.mhb-card--media, .mhb-card--news, .mhb-card--album, .mhb-card--video) .mhb-card__content {
    padding: 24px 22px 28px 22px;
    color: #fff;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    position: relative;
    width: 100%;
    z-index: 5;
}

/* Tag de catégorie */
:is(.mhb-card--media, .mhb-card--news, .mhb-card--album, .mhb-card--video) .mhb-card__tag {
    display: flex;
    background: var(--mhb-accent);
    color: #fff;
    font-family: var(--mhb-font-display);
    font-size: 14px;
    line-height: 1.0;
    font-weight: 500;
    text-transform: uppercase;
    border-radius: 6px;
    padding: 8px 12px 5px;
    margin-bottom: 15px;
    letter-spacing: 1px;
    z-index: 5;
    position: relative;
    align-self: flex-start;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.4s ease, background 0.3s ease;
}

:is(.mhb-card--media, .mhb-card--news, .mhb-card--album, .mhb-card--video):hover .mhb-card__tag {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 4px 12px rgba(233, 83, 35, 0.35);
    background: #ff5f2e;
}

/* Titre */
:is(.mhb-card--media, .mhb-card--news, .mhb-card--album, .mhb-card--video) .mhb-card__title-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

:is(.mhb-card--media, .mhb-card--news, .mhb-card--album, .mhb-card--video) .mhb-card__title {
    font-family: var(--mhb-font-display);
    font-weight: 500;
    font-size: 22px;
    line-height: 24px;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

:is(.mhb-card--media, .mhb-card--news, .mhb-card--album, .mhb-card--video):hover .mhb-card__title {
    transform: translateX(3px);
}

/* Ligne et croix animées - Visible par défaut, croix se déplace au survol */
:is(.mhb-card--media, .mhb-card--news, .mhb-card--album, .mhb-card--video) .mhb-card__title-line {
    display: flex;
    align-items: center;
    margin-top: 8px;
    position: relative;
    width: 100%;
    height: 18px;
    /* Override des styles de base - visible par défaut */
    opacity: 1;
    transform: none;
}

:is(.mhb-card--media, .mhb-card--news, .mhb-card--album, .mhb-card--video) .mhb-card__cross {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
    transition: left 0.5s cubic-bezier(0.25, 0.8, 0.25, 1),
        filter 0.3s ease;
    position: relative;
    left: 0;
    top: 1px;
    z-index: 4;
    line-height: 1;
}

:is(.mhb-card--media, .mhb-card--news, .mhb-card--album, .mhb-card--video) .mhb-card__cross::before {
    content: '+';
    font-size: 43px;
    font-weight: 400;
    color: var(--mhb-accent);
    display: block;
    line-height: 1;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
        text-shadow 0.4s ease;
}

:is(.mhb-card--media, .mhb-card--news, .mhb-card--album, .mhb-card--video):hover .mhb-card__cross::before {
    transform: rotate(90deg);
    text-shadow: 0 0 15px rgba(233, 83, 35, 0.6);
}

:is(.mhb-card--media, .mhb-card--news, .mhb-card--album, .mhb-card--video):hover .mhb-card__cross {
    left: calc(100% - 10px);
}

:is(.mhb-card--media, .mhb-card--news, .mhb-card--album, .mhb-card--video) .mhb-card__line {
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 2px;
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    z-index: 3;
    transition: background 0.4s ease,
        height 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
        box-shadow 0.4s ease;
}

:is(.mhb-card--media, .mhb-card--news, .mhb-card--album, .mhb-card--video):hover .mhb-card__line {
    background: rgba(255, 255, 255, 0.9);
    height: 2px;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* Link overlay - card entièrement cliquable */
:is(.mhb-card--media, .mhb-card--news, .mhb-card--album, .mhb-card--video) .mhb-card__link {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: block;
    text-decoration: none;
}

/* =============================================================================
   PLAYER CARD - Trading card bleu avec motif pattern
   ============================================================================= */

/* Carte extérieure : fond bleu + motif, padding visible */
.mhb-card--player {
    flex: 0 0 320px;
    min-width: 280px;
    background-color: #003DA5;
    background-image: url('../../images/motif-bg.png');
    background-size: 300px;
    background-repeat: repeat;
    background-blend-mode: multiply;
    border-radius: 20px;
    padding: 14px;
}

.mhb-card--player.is-static {
    cursor: default;
}

/* Désactiver le zoom image au hover (le scale card suffit) */
.mhb-card--player:hover .mhb-card__image img {
    transform: none;
}

/* Bloc intérieur : bordure bleue, overflow hidden, contient tout */
.mhb-card--player .mhb-card__inner {
    position: relative;
    border: 1px solid rgba(80, 160, 255, 0.4);
    border-radius: 12px;
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
}

/* Image sur fond bleu transparent (pas de gradient blanc) */
.mhb-card--player .mhb-card__image {
    aspect-ratio: 310/420;
    background: transparent;
    border-radius: 0;
    overflow: hidden;
}

.mhb-card--player .mhb-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

/* Overlay gradient bleu foncé en bas pour lisibilité du texte */
.mhb-card--player .mhb-card__overlay {
    background: linear-gradient(to top, rgba(0, 15, 50, 0.95) 0%, rgba(0, 30, 80, 0.5) 35%, transparent 65%);
}

/* Content - fond transparent, pas de bordure */
.mhb-card--player .mhb-card__content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 3;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border: none;
    border-radius: 0;
    background: transparent;
}

/* Badges container - pleine largeur pour positionnement */
.mhb-card--player .mhb-card__badges {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 0;
    z-index: 5;
}

/* Poste - badge coin haut gauche */
.mhb-card--player .mhb-card__poste {
    position: absolute;
    min-width: 53px;
    height: 28px;
    top: 0;
    left: 0;
    padding: 0 10px;
    border-top-left-radius: 11px;
    border-bottom-right-radius: 14px;
    background: rgba(0, 10, 35, 0.85);
    font-family: var(--mhb-font-display, 'Formula Condensed', Arial, sans-serif);
    font-weight: 700;
    font-size: 15px;
    line-height: 32px;
    text-align: center;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--mhb-accent, #E95323);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.1s;
}

/* Numéro - effet outline stroke, positionné en haut à droite */
.mhb-card--player .mhb-card__numero {
    position: absolute;
    top: 15px;
    right: 15px;
    font-family: var(--mhb-font-display, 'Formula Condensed', sans-serif);
    font-size: 72px;
    line-height: 72px;
    font-weight: 900;
    letter-spacing: 2px;
    color: transparent;
    -webkit-text-stroke: 2px rgba(255, 255, 255, 0.5);
    text-shadow: none;
    opacity: 0.7;
    transition: opacity 0.4s ease;
}

.mhb-card--player:hover .mhb-card__numero {
    opacity: 1;
    -webkit-text-stroke-color: rgba(255, 255, 255, 0.7);
}

/* Player info */
.mhb-card__info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mhb-card__name {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.mhb-card__prenom {
    font-size: 24px;
    line-height: 26px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mhb-card__nom {
    font-family: var(--mhb-font-display, 'Formula Condensed', sans-serif);
    font-size: 44px;
    line-height: 44px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* CTA - Tag à gauche */
.mhb-card--player .mhb-card__cta {
    position: relative;
    z-index: 5;
    text-align: left;
    margin-top: 2px;
}

/* Tag style */
.mhb-card--player .mhb-card__tag {
    display: inline-block;
    position: relative;
    z-index: 4;
    background: var(--mhb-accent, #E95323);
    color: #fff;
    font-family: var(--mhb-font-display, 'Formula Condensed', Arial, sans-serif);
    font-size: 14px;
    line-height: 1.0;
    font-weight: 500;
    text-transform: uppercase;
    border-radius: 6px;
    padding: 8px 12px 5px;
    letter-spacing: 1px;
    text-decoration: none;
    align-self: flex-start;
    pointer-events: auto;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.mhb-card--player:hover .mhb-card__tag {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(233, 83, 35, 0.4);
}

/* =============================================================================
   MATCH CARD (style identique à l'ancien thème)
   ============================================================================= */

.mhb-card--match {
    flex: 0 0 320px;
    min-width: 320px;
    height: 440px;
    padding-top: 10px;
    position: relative;
    border-radius: 0;
    overflow: visible;
    background: transparent;
    -webkit-font-smoothing: auto;
    -moz-osx-font-smoothing: auto;
    text-rendering: optimizeLegibility;
}

.mhb-card--match-empty .mhb-card__inner {
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0, 16, 37, 0.32), rgba(0, 122, 193, 0.12));
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: none;
}

.mhb-card--match-empty__text {
    max-width: 220px;
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    font-family: var(--mhb-font-display);
    font-size: 26px;
    line-height: 1.05;
    letter-spacing: 0.04em;
    text-align: center;
    text-transform: uppercase;
}

/* Status badge - en haut à droite */
.mhb-card--match .mhb-card__status {
    position: absolute;
    top: 0;
    right: 10px;
    padding: 8px 12px 5px;
    border-radius: 5px;
    font-family: var(--mhb-font-display);
    font-size: 14px;
    line-height: 1.2;
    text-transform: uppercase;
    text-align: center;
    letter-spacing: 1px;
    background: #2d2d2d;
    color: #fff;
    z-index: 2;
}

.mhb-card--match.status-finished .mhb-card__status {
    background: #6c6c6c;
}

.mhb-card--match.status-live .mhb-card__status {
    background: #e53935;
    animation: pulse 1.5s infinite;
}

.mhb-card--match.status-upcoming .mhb-card__status {
    background: #1e88e5;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* Inner card */
.mhb-card__inner {
    position: relative;
    width: 100%;
    height: calc(100% - 10px);
    background-size: cover;
    background-position: center;
    border-radius: 18px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
    color: #fff;
    padding: 18px 16px 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Match header */
.mhb-card--match .mhb-card__header {
    display: flex;
    flex-direction: row;
    align-items: center;
    margin-bottom: 16px;
    border-bottom: 1px solid #8d8d8d;
    padding-bottom: 4px;
}

.mhb-card__competition-logo {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.mhb-card__competition-logo img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.mhb-card__competition-info {
    width: calc(100% - 48px);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
}

.mhb-card__competition-name {
    font-family: var(--mhb-font-display);
    font-weight: 400;
    font-size: 17px;
    line-height: 1.2;
    letter-spacing: 1px;
    color: #595959;
    /* Uppercase géré en PHP pour préserver les accents */
}

.mhb-card--match .mhb-card__date {
    font-family: var(--mhb-font-display);
    font-weight: 400;
    font-size: 17px;
    line-height: 1.2;
    letter-spacing: 1px;
    color: #595959;
}

/* Teams container */
.mhb-card__teams-container {
    min-height: 276px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    flex: 1;
}

/* Teams logos */
.mhb-card--match .mhb-card__teams {
    position: relative;
    width: 100%;
    height: 100px;
    margin-top: 15px;
}

.mhb-card--match .mhb-card__team {
    width: auto;
    height: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: absolute;
}

.mhb-card--match .mhb-card__team.home {
    left: 18%;
    z-index: 3;
}

.mhb-card--match .mhb-card__team.visitor {
    right: 18%;
    z-index: 2;
}

.mhb-card--match .mhb-card__team-logo {
    height: 90px;
    width: auto;
    object-fit: contain;
    transition: none;
}

.mhb-card--match .mhb-card__team.mhb .mhb-card__team-logo {
    height: 100px;
    margin-top: -10px;
}

/* Stadium badge */
.mhb-card__stadium {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 15px;
}

.mhb-card__stadium-name {
    padding: 3px 10px 2px;
    border-radius: 5px;
    font-family: var(--mhb-font-display);
    font-weight: 700;
    font-size: 14px;
    line-height: 1.1;
    text-transform: uppercase;
    text-align: center;
    letter-spacing: 1px;
    background: #2d2d2d;
    color: #fff;
}

.mhb-card--match.status-finished .mhb-card__stadium-name {
    background: #6c6c6c;
}

.mhb-card--match.status-live .mhb-card__stadium-name,
.mhb-card--match.status-upcoming .mhb-card__stadium-name {
    background: var(--mhb-accent);
}

/* Team names */
.mhb-card--match .mhb-card__names {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 15px;
    width: 100%;
}

.mhb-card--match .mhb-card__team-name {
    font-family: var(--mhb-font-display);
    font-size: 30px;
    line-height: 1.0;
    letter-spacing: 1px;
    font-weight: bold;
    color: #595959;
    text-transform: uppercase;
}

.mhb-card--match .mhb-card__team-name.mhb {
    color: var(--mhb-accent);
}

/* Variante explicitement demandée pour le calendrier D2 Féminine. */
.mhb-card--match-feminine .mhb-card__inner {
    background-color: rgba(198, 45, 112, 0.42);
    background-blend-mode: multiply;
}

.mhb-card--match-feminine .mhb-card__competition-name,
.mhb-card--match-feminine .mhb-card__date,
.mhb-card--match-feminine .mhb-card__team-name,
.mhb-card--match-feminine .mhb-card__team-name.mhb {
    color: #fff;
}

.mhb-card--match-feminine .mhb-card__date {
    font-weight: 400;
}

.mhb-card--match-feminine .mhb-card__score {
    color: #fff;
}

.mhb-card--match-feminine .mhb-card__score-value {
    color: #fff;
}

.mhb-card--match-feminine .mhb-card__score-value.mhb {
    color: var(--mhb-accent);
}

.mhb-card--match-feminine .mhb-card__countdown,
.mhb-card--match-feminine .mhb-card__countdown .countdown-label,
.mhb-card--match-feminine .mhb-card__countdown .countdown-timer {
    color: #fff;
}

/* Score */
.mhb-card--match .mhb-card__score {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--mhb-font-display);
    font-size: 30px;
    line-height: 1.2;
    letter-spacing: 1px;
    font-weight: bold;
    margin-top: 5px;
    margin-bottom: 10px;
    color: #595959;
    width: 100%;
}

.mhb-card__score-value {
    font-family: var(--mhb-font-display);
    font-size: 30px;
    font-weight: bold;
    color: #595959;
}

.mhb-card__score-value.mhb {
    color: var(--mhb-accent) !important;
}

.mhb-card__score-separator {
    font-size: 30px;
    color: #595959;
    margin: 0 8px;
}

/* Score Live */
.mhb-card__score--live .mhb-card__score-value {
    color: var(--mhb-text-white);
}

.mhb-card__score--live .mhb-card__score-separator {
    color: rgba(255, 255, 255, 0.5);
}

.mhb-card__score--live.score-updated .mhb-card__score-value {
    animation: mhbCardScoreFlash 0.6s ease;
}

@keyframes mhbCardScoreFlash {
    0%, 100% { transform: scale(1); }
    50% { color: var(--mhb-secondary); transform: scale(1.15); }
}

/* Countdown */
.mhb-card__countdown {
    text-align: center;
    margin: 5px 0 10px;
    width: 100%;
}

.countdown-label {
    font-size: 12px;
    line-height: 1.1;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.countdown-timer {
    font-size: 16px;
    font-weight: bold;
    color: #666;
    background: transparent;
    display: inline-block;
}

.countdown-timer .separator {
    color: var(--mhb-accent);
    font-weight: normal;
    display: inline-block;
    margin: 0 1px;
}

.mhb-card__empty-space {
    height: 40px;
}

/* Actions */
.mhb-card__actions {
    margin-top: 5px;
    padding-top: 10px;
    height: 41px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: row;
    gap: 20px;
    align-items: center;
    justify-content: center;
}

/* Match card button style */
.mhb-card__btn {
    background: var(--mhb-secondary);
    color: #fff;
    font-family: var(--mhb-font-display);
    font-size: 15px;
    line-height: 1.1;
    font-weight: 300;
    letter-spacing: 1px;
    padding: 7px 15px 5px 30px;
    border-radius: 8px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    outline: none;
    transition: background 0.3s, transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    position: relative;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
}

.mhb-card__btn::before {
    content: '';
    display: inline-block;
    background: url('../../images/arrow-right.svg') no-repeat center/contain;
    width: 35px;
    height: 28px;
    position: absolute;
    left: -20px;
    top: 50%;
    transform: translateY(-50%) translateX(0);
    transition: transform 0.3s cubic-bezier(.77, 0, .18, 1);
}

.mhb-card__btn:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    color: #fff;
}

.mhb-card__btn:hover::before {
    transform: translateY(-50%) translateX(10px);
}

.mhb-card__btn--tickets {
    background: var(--mhb-secondary);
    padding-right: 35px;
}

.mhb-card__btn--tickets::after {
    content: '';
    display: inline-block;
    background: url('../../images/ticket-icon.svg') no-repeat center/contain;
    width: 16px;
    height: 16px;
    position: absolute;
    right: 10px;
    top: 48%;
    transform: translateY(-50%);
}

.mhb-card__btn--tickets:hover {
    background: #004080;
}

.mhb-card__btn--more,
.mhb-card__btn--summary {
    background: var(--mhb-secondary);
}

.mhb-card__btn--more:hover,
.mhb-card__btn--summary:hover {
    background: #004080;
}

.mhb-card__btn--live {
    background: #ff0000;
}

.mhb-card__btn--live:hover {
    background: #cc0000;
}

.mhb-card__btn--transparent {
    background: rgba(255, 255, 255, 0.2);
    color: var(--mhb-secondary);
    border: 1px solid var(--mhb-secondary);
}

.mhb-card__btn--no-icon {
    padding: 0 15px;
}

.mhb-card__btn--no-icon::before {
    display: none;
}

/* Compétitions à fond sombre : texte blanc et assombrissement homogène. */
.mhb-card--match.cdf .mhb-card__competition-name,
.mhb-card--match.cdf .mhb-card__date,
.mhb-card--match.tdc .mhb-card__competition-name,
.mhb-card--match.tdc .mhb-card__date,
.mhb-card--match.ehfel .mhb-card__competition-name,
.mhb-card--match.ehfel .mhb-card__date,
.mhb-card--match.ehfcl .mhb-card__competition-name,
.mhb-card--match.ehfcl .mhb-card__date {
    color: #fff;
}

.mhb-card--match.cdf .mhb-card__team-name,
.mhb-card--match.tdc .mhb-card__team-name,
.mhb-card--match.ehfel .mhb-card__team-name {
    color: #fff;
}

.mhb-card--match.ehfcl .mhb-card__team-name {
    color: #fff;
}

.mhb-card--match.cdf .mhb-card__score-value,
.mhb-card--match.tdc .mhb-card__score-value,
.mhb-card--match.ehfel .mhb-card__score-value {
    color: #fff;
}

.mhb-card--match.ehfcl .mhb-card__score-value {
    color: #fff;
}

.mhb-card--match.cdf .mhb-card__countdown,
.mhb-card--match.cdf .mhb-card__countdown .countdown-label,
.mhb-card--match.cdf .mhb-card__countdown .countdown-timer,
.mhb-card--match.tdc .mhb-card__countdown,
.mhb-card--match.tdc .mhb-card__countdown .countdown-label,
.mhb-card--match.tdc .mhb-card__countdown .countdown-timer,
.mhb-card--match.ehfel .mhb-card__countdown,
.mhb-card--match.ehfel .mhb-card__countdown .countdown-label,
.mhb-card--match.ehfel .mhb-card__countdown .countdown-timer,
.mhb-card--match.ehfcl .mhb-card__countdown,
.mhb-card--match.ehfcl .mhb-card__countdown .countdown-label,
.mhb-card--match.ehfcl .mhb-card__countdown .countdown-timer {
    color: #fff;
}

.mhb-card--match.tdc .mhb-card__inner,
.mhb-card--match.ehfel .mhb-card__inner,
.mhb-card--match.ehfcl .mhb-card__inner {
    background-color: rgba(0, 0, 0, 0.24);
    background-blend-mode: multiply;
}

/* =============================================================================
   MEDIA CARD - Éléments spécifiques optionnels
   ============================================================================= */

/* Compteur de photos dans le tag (albums) */
.mhb-card__tag .mhb-card__count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: auto 0 auto 8px;
    opacity: 0.8;
}

.mhb-card__tag .mhb-card__count .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* Bouton play (vidéos) */
:is(.mhb-card--media, .mhb-card--video) .mhb-card__play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background: rgba(233, 83, 35, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, background 0.3s ease;
    z-index: 6;
}

:is(.mhb-card--media, .mhb-card--video):hover .mhb-card__play {
    transform: translate(-50%, -50%) scale(1.15);
    background: var(--mhb-accent, #E95323);
}

:is(.mhb-card--media, .mhb-card--video) .mhb-card__play svg {
    width: 28px;
    height: 28px;
    fill: #fff;
    margin-left: 5px;
}

/* Durée vidéo */
:is(.mhb-card--media, .mhb-card--video) .mhb-card__duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    z-index: 6;
}

/* =============================================================================
   LEGEND CARD (nouveau style inspiré du legacy)
   ============================================================================= */

/* Style identique au player card mais en noir/doré */
.mhb-legend-card {
    position: relative;
    flex: 0 0 320px;
    min-width: 280px;
    background-size: cover;
    background-position: center;
    background-color: #0a0a0a;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
                box-shadow 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.mhb-legend-card--carousel {
    flex: 0 0 320px;
    min-width: 280px;
    max-width: 400px;
}

.mhb-legend-card:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

/* Image avec coins arrondis en haut */
.mhb-legend-card__image {
    position: relative;
    aspect-ratio: 310/420;
    background: linear-gradient(to bottom, #1a1a1a 0%, #1a1a1a 30%, rgba(187, 152, 96, 0.2) 100%);
    border-radius: 20px 20px 0 0;
    overflow: hidden;
}

.mhb-legend-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.mhb-legend-card:hover .mhb-legend-card__image img {
    transform: scale(1.05);
}

/* Overlay gradient noir/doré */
.mhb-legend-card__overlay {
    position: absolute;
    inset: -1px;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.25) 50%, rgba(0,0,0,0) 100%);
    z-index: 3;
    pointer-events: none;
    transition: none;
    transform: translateZ(0);
}

/* Content avec bordure dorée et coins arrondis en bas */
.mhb-legend-card__content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    border-radius: 0 0 20px 20px;
    background: transparent;
    color: #fff;
    z-index: 5;
}

/* Badge poste - coin haut droite de la card */
.mhb-legend-card__poste {
    position: absolute;
    top: 0;
    left: 0;
    width: 53px;
    height: 28px;
    border-top-left-radius: 18px;
    border-bottom-right-radius: 18px;
    background: #000;
    font-family: var(--mhb-font-display, 'Formula Condensed', Arial, sans-serif);
    font-weight: 700;
    font-size: 17px;
    line-height: 33px;
    text-align: center;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #BB9860;
    z-index: 6;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.1s;
}

/* Info joueur */
.mhb-legend-card__info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Prénom */
.mhb-legend-card__prenom {
    font-family: var(--mhb-font-display, 'Formula Condensed', Arial, sans-serif);
    font-size: 30px;
    line-height: 30px;
    font-weight: 400;
    color: #fff;
    text-transform: uppercase;
}

/* Nom (plus gros) */
.mhb-legend-card__nom {
    font-family: var(--mhb-font-display, 'Formula Condensed', sans-serif);
    font-size: 48px;
    line-height: 48px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Bouton "Découvrir le joueur" - tag style player */
.mhb-legend-card__btn {
    display: inline-block;
    background: #BB9860;
    color: #000;
    font-family: var(--mhb-font-display, 'Formula Condensed', Arial, sans-serif);
    font-size: 14px;
    line-height: 1.0;
    font-weight: 500;
    text-transform: uppercase;
    border-radius: 6px;
    padding: 8px 12px 5px;
    letter-spacing: 1px;
    text-decoration: none;
    align-self: flex-start;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
                box-shadow 0.4s ease,
                background 0.3s ease;
}

.mhb-legend-card:hover .mhb-legend-card__btn {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(187, 152, 96, 0.3);
    background: #c9a96e;
}

/* Responsive */
@media (max-width: 1024px) {
    .mhb-legend-card,
    .mhb-legend-card--carousel {
        flex: 0 0 280px;
        min-width: 250px;
    }

    .mhb-legend-card__prenom {
        font-size: 24px;
        line-height: 24px;
    }

    .mhb-legend-card__nom {
        font-size: 38px;
        line-height: 38px;
    }
}

@media (max-width: 768px) {
    .mhb-legend-card__poste {
        font-size: 14px;
        padding: 2px 8px 0;
    }

    .mhb-legend-card__prenom {
        font-size: 22px;
        line-height: 22px;
    }

    .mhb-legend-card__nom {
        font-size: 32px;
        line-height: 32px;
    }

    .mhb-legend-card__content {
        padding: 15px;
    }

    .mhb-legend-card__btn {
        font-size: 12px;
        padding: 6px 10px 4px;
    }
}

/* =============================================================================
   NO RESULTS
   ============================================================================= */

.mhb-no-results {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 16px;
    grid-column: 1 / -1;
}

/* =============================================================================
   CASCADE ANIMATION - Cards apparaissant une après l'autre
   ============================================================================= */

/* État initial - cards invisibles (seront animées par JS) */
/* Le JS ajoute .js-enabled sur html, sinon les cards sont visibles par défaut */
.js-enabled .mhb-carousel__track .mhb-card,
.js-enabled .mhb-carousel__track .mhb-legend-card {
    opacity: 0;
}

/* Fallback: si JS désactivé, cards visibles */
.mhb-carousel__track .mhb-card,
.mhb-carousel__track .mhb-legend-card,
.mhb-listing__grid .mhb-card,
.mhb-listing__grid .mhb-legend-card {
    opacity: 1;
}

.mhb-carousel__track .mhb-card,
.mhb-carousel__track .mhb-legend-card {
    -webkit-font-smoothing: auto;
    -moz-osx-font-smoothing: auto;
    text-rendering: optimizeLegibility;
}

/* Animation d'apparition - fade in simple */
.mhb-card.is-visible,
.mhb-legend-card.is-visible {
    animation: cardFadeIn 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

@keyframes cardFadeIn {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

/* Délais en cascade */
.mhb-card.is-visible:nth-child(1) {
    animation-delay: 0s;
}

.mhb-card.is-visible:nth-child(2) {
    animation-delay: 0.06s;
}

.mhb-card.is-visible:nth-child(3) {
    animation-delay: 0.12s;
}

.mhb-card.is-visible:nth-child(4) {
    animation-delay: 0.18s;
}

.mhb-card.is-visible:nth-child(5) {
    animation-delay: 0.24s;
}

.mhb-card.is-visible:nth-child(6) {
    animation-delay: 0.30s;
}

.mhb-card.is-visible:nth-child(7) {
    animation-delay: 0.36s;
}

.mhb-card.is-visible:nth-child(8) {
    animation-delay: 0.42s;
}

.mhb-card.is-visible:nth-child(9) {
    animation-delay: 0.48s;
}

.mhb-card.is-visible:nth-child(10) {
    animation-delay: 0.54s;
}

.mhb-card.is-visible:nth-child(11) {
    animation-delay: 0.60s;
}

.mhb-card.is-visible:nth-child(12) {
    animation-delay: 0.66s;
}

/* Alternative GSAP - pour contrôle via ScrollTrigger */
.mhb-card[data-cascade] {
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.mhb-card[data-cascade].animated {
    opacity: 1;
}

/* =============================================================================
   RESPONSIVE
   ============================================================================= */

@media (max-width: 1024px) {
    :is(.mhb-card--media, .mhb-card--news, .mhb-card--album, .mhb-card--video) {
        flex: 0 0 300px;
        min-width: 260px;
        min-height: 400px;
    }

    .mhb-card--player {
        flex: 0 0 280px;
        min-width: 250px;
    }

    .mhb-card--player .mhb-card__numero {
        font-size: 58px;
        line-height: 58px;
    }

    .mhb-card__prenom {
        font-size: 22px;
        line-height: 24px;
    }

    .mhb-card__nom {
        font-size: 36px;
        line-height: 36px;
    }

    .mhb-card--match {
        flex: 0 0 320px;
        min-width: 300px;
    }

    .mhb-card--legend {
        flex: 0 0 260px;
        min-width: 230px;
    }
}

@media (max-width: 900px) {
    .mhb-card--match {
        flex: 0 0 300px;
        min-width: 280px;
    }
}

/* Les overlays doivent rester instantanés pendant les animations de cards/images. */
.mhb-card__overlay,
.mhb-card:hover .mhb-card__overlay,
.mhb-legend-card__overlay,
.mhb-legend-card:hover .mhb-legend-card__overlay {
    transition: none !important;
}

@media (max-width: 768px) {
    .mhb-card--player {
        padding: 10px;
    }

    .mhb-card--player .mhb-card__inner {
        border-radius: 10px;
    }

    .mhb-card--player .mhb-card__numero {
        font-size: 48px;
        line-height: 48px;
        top: 12px;
        right: 12px;
    }

    .mhb-card--player .mhb-card__poste {
        font-size: 13px;
        padding: 0 8px;
        min-width: 45px;
        height: 24px;
        line-height: 28px;
        border-top-left-radius: 9px;
    }

    .mhb-card__prenom {
        font-size: 20px;
        line-height: 22px;
    }

    .mhb-card__nom {
        font-size: 30px;
        line-height: 30px;
    }

    .mhb-card--player .mhb-card__content {
        padding: 15px;
    }

    .mhb-card--player .mhb-card__tag {
        font-size: 12px;
        padding: 6px 10px 4px;
    }
}

@media (max-width: 350px) {
    .mhb-carousel__track>.mhb-card {
        flex: 0 0 300px;
        min-width: 280px;
    }
}
