/* ============================================================
   REPLAY MATCH — CSS
   Catch-Des (univers-catch.com)
   Version 1.0 — 02/04/2026
   ============================================================ */

/* ============================================================
   PHASE 1 — DES 3D
   ============================================================ */

/* Container perspective pour le dé */
.dice-container {
    display: inline-block;
    width: 60px;
    height: 60px;
    perspective: 400px;
    margin: 0 8px;
}

/* Le cube lui-même */
.dice-cube {
    width: 60px;
    height: 60px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 1s ease-out;
}

/* Face commune */
.dice-face {
    position: absolute;
    width: 60px;
    height: 60px;
    background: linear-gradient(145deg, #FF9540, #FF7200, #E56000);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    box-shadow:
        inset 0 0 12px rgba(0,0,0,0.2),
        inset 0 2px 4px rgba(255,255,255,0.15);
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
    padding: 8px;
    box-sizing: border-box;
}

/* Fond de remplissage derrière chaque face pour combler les gaps entre coins arrondis */
.dice-face::before {
    content: '';
    position: absolute;
    top: -1px; left: -1px; right: -1px; bottom: -1px;
    background: #E56000;
    border-radius: 4px;
    z-index: -1;
}

/* Point sur le dé */
.dice-dot {
    width: 11px;
    height: 11px;
    background: radial-gradient(circle at 35% 35%, #ffffff, #d0d0d0);
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0,0,0,0.5), inset 0 1px 1px rgba(255,255,255,0.8);
    place-self: center;
}

/* Positionnement des 6 faces du cube */
.dice-face-1 { transform: rotateY(0deg)   translateZ(30px); }
.dice-face-2 { transform: rotateY(90deg)  translateZ(30px); }
.dice-face-3 { transform: rotateY(180deg) translateZ(30px); }
.dice-face-4 { transform: rotateY(-90deg) translateZ(30px); }
.dice-face-5 { transform: rotateX(90deg)  translateZ(30px); }
.dice-face-6 { transform: rotateX(-90deg) translateZ(30px); }

/* --- Layout des points par face (grille 3x3) --- */
/* Toutes les faces utilisent la grille 3x3 définie dans .dice-face */
/* Les points sont placés via grid-area: row / col */

/* Face 1 : 1 point centré */
.dice-face-1 .dice-dot { grid-area: 2 / 2; width: 14px; height: 14px; }

/* Face 2 : 2 points en DIAGONALE (haut-droite + bas-gauche) */
.dice-face-2 .dice-dot:nth-child(1) { grid-area: 1 / 3; }
.dice-face-2 .dice-dot:nth-child(2) { grid-area: 3 / 1; }

/* Face 3 : 3 points en DIAGONALE */
.dice-face-3 .dice-dot:nth-child(1) { grid-area: 1 / 3; }
.dice-face-3 .dice-dot:nth-child(2) { grid-area: 2 / 2; }
.dice-face-3 .dice-dot:nth-child(3) { grid-area: 3 / 1; }

/* Face 4 : 4 points aux coins */
.dice-face-4 .dice-dot:nth-child(1) { grid-area: 1 / 1; }
.dice-face-4 .dice-dot:nth-child(2) { grid-area: 1 / 3; }
.dice-face-4 .dice-dot:nth-child(3) { grid-area: 3 / 1; }
.dice-face-4 .dice-dot:nth-child(4) { grid-area: 3 / 3; }

/* Face 5 : 4 coins + centre */
.dice-face-5 .dice-dot:nth-child(1) { grid-area: 1 / 1; }
.dice-face-5 .dice-dot:nth-child(2) { grid-area: 1 / 3; }
.dice-face-5 .dice-dot:nth-child(3) { grid-area: 2 / 2; }
.dice-face-5 .dice-dot:nth-child(4) { grid-area: 3 / 1; }
.dice-face-5 .dice-dot:nth-child(5) { grid-area: 3 / 3; }

/* Face 6 : 2 colonnes x 3 rangées */
.dice-face-6 .dice-dot:nth-child(1) { grid-area: 1 / 1; }
.dice-face-6 .dice-dot:nth-child(2) { grid-area: 1 / 3; }
.dice-face-6 .dice-dot:nth-child(3) { grid-area: 2 / 1; }
.dice-face-6 .dice-dot:nth-child(4) { grid-area: 2 / 3; }
.dice-face-6 .dice-dot:nth-child(5) { grid-area: 3 / 1; }
.dice-face-6 .dice-dot:nth-child(6) { grid-area: 3 / 3; }

/* --- Rotation finale pour afficher la bonne face --- */
.dice-show-1 { transform: rotateY(0deg)    rotateX(0deg); }
.dice-show-2 { transform: rotateY(-90deg)  rotateX(0deg); }
.dice-show-3 { transform: rotateY(180deg)  rotateX(0deg); }
.dice-show-4 { transform: rotateY(90deg)   rotateX(0deg); }
.dice-show-5 { transform: rotateX(-90deg)  rotateY(0deg); }
.dice-show-6 { transform: rotateX(90deg)   rotateY(0deg); }

/* --- Animation de lancer --- */
@keyframes diceRoll3D {
    0%   { transform: rotateX(0deg)   rotateY(0deg)   rotateZ(0deg); }
    20%  { transform: rotateX(200deg) rotateY(150deg)  rotateZ(60deg); }
    40%  { transform: rotateX(400deg) rotateY(300deg)  rotateZ(120deg); }
    60%  { transform: rotateX(550deg) rotateY(420deg)  rotateZ(160deg); }
    80%  { transform: rotateX(650deg) rotateY(500deg)  rotateZ(180deg); }
    100% { /* La rotation finale est définie par la classe dice-show-X */ }
}

.dice-rolling {
    animation: diceRoll3D 1s ease-out forwards;
}

/* Surcharge : la rotation finale après l'animation */
.dice-rolling.dice-show-1 { animation: diceRoll3D-1 1s ease-out forwards; }
.dice-rolling.dice-show-2 { animation: diceRoll3D-2 1s ease-out forwards; }
.dice-rolling.dice-show-3 { animation: diceRoll3D-3 1s ease-out forwards; }
.dice-rolling.dice-show-4 { animation: diceRoll3D-4 1s ease-out forwards; }
.dice-rolling.dice-show-5 { animation: diceRoll3D-5 1s ease-out forwards; }
.dice-rolling.dice-show-6 { animation: diceRoll3D-6 1s ease-out forwards; }

@keyframes diceRoll3D-1 {
    0%   { transform: rotateX(0) rotateY(0) rotateZ(0); }
    30%  { transform: rotateX(240deg) rotateY(180deg) rotateZ(90deg); }
    60%  { transform: rotateX(500deg) rotateY(400deg) rotateZ(150deg); }
    100% { transform: rotateX(720deg) rotateY(720deg) rotateZ(0deg); }
}
@keyframes diceRoll3D-2 {
    0%   { transform: rotateX(0) rotateY(0) rotateZ(0); }
    30%  { transform: rotateX(200deg) rotateY(150deg) rotateZ(70deg); }
    60%  { transform: rotateX(450deg) rotateY(350deg) rotateZ(140deg); }
    100% { transform: rotateX(720deg) rotateY(630deg) rotateZ(0deg); }
}
@keyframes diceRoll3D-3 {
    0%   { transform: rotateX(0) rotateY(0) rotateZ(0); }
    30%  { transform: rotateX(220deg) rotateY(200deg) rotateZ(80deg); }
    60%  { transform: rotateX(480deg) rotateY(420deg) rotateZ(160deg); }
    100% { transform: rotateX(720deg) rotateY(540deg) rotateZ(0deg); }
}
@keyframes diceRoll3D-4 {
    0%   { transform: rotateX(0) rotateY(0) rotateZ(0); }
    30%  { transform: rotateX(180deg) rotateY(160deg) rotateZ(60deg); }
    60%  { transform: rotateX(400deg) rotateY(380deg) rotateZ(130deg); }
    100% { transform: rotateX(720deg) rotateY(450deg) rotateZ(0deg); }
}
@keyframes diceRoll3D-5 {
    0%   { transform: rotateX(0) rotateY(0) rotateZ(0); }
    30%  { transform: rotateX(250deg) rotateY(170deg) rotateZ(90deg); }
    60%  { transform: rotateX(520deg) rotateY(390deg) rotateZ(150deg); }
    100% { transform: rotateX(630deg) rotateY(720deg) rotateZ(0deg); }
}
@keyframes diceRoll3D-6 {
    0%   { transform: rotateX(0) rotateY(0) rotateZ(0); }
    30%  { transform: rotateX(230deg) rotateY(190deg) rotateZ(100deg); }
    60%  { transform: rotateX(490deg) rotateY(410deg) rotateZ(170deg); }
    100% { transform: rotateX(-630deg) rotateY(720deg) rotateZ(0deg); }
}

/* --- Variantes doubles --- */

/* Double 6 : glow rouge pulsant */
.dice-double6 .dice-face {
    background: linear-gradient(145deg, #FF3333, #CC0000);
    border-color: #990000;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.6), inset 0 0 15px rgba(0,0,0,0.2);
}
.dice-double6 .dice-cube {
    animation-name: inherit;
}
@keyframes glowPulse6 {
    0%, 100% { filter: drop-shadow(0 0 10px rgba(255, 0, 0, 0.5)); }
    50%      { filter: drop-shadow(0 0 25px rgba(255, 0, 0, 0.9)); }
}
.dice-double6 {
    animation: glowPulse6 0.8s ease-in-out infinite;
}

/* Double (autre que 6) : glow doré */
.dice-double .dice-face {
    background: linear-gradient(145deg, #FFD700, #DAA520);
    border-color: #B8860B;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5), inset 0 0 15px rgba(0,0,0,0.15);
}
@keyframes glowPulseGold {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.4)); }
    50%      { filter: drop-shadow(0 0 18px rgba(255, 215, 0, 0.8)); }
}
.dice-double {
    animation: glowPulseGold 1s ease-in-out infinite;
}

/* --- Responsive --- */
@media (max-width: 600px) {
    .dice-container {
        width: 42px;
        height: 42px;
        margin: 0 4px;
    }
    .dice-cube {
        width: 42px;
        height: 42px;
    }
    .dice-face {
        width: 42px;
        height: 42px;
        padding: 4px;
        border-radius: 8px;
    }
    .dice-face-1, .dice-face-2, .dice-face-3,
    .dice-face-4, .dice-face-5, .dice-face-6 {
        transform-origin: center;
    }
    .dice-face-1 { transform: rotateY(0deg)   translateZ(21px); }
    .dice-face-2 { transform: rotateY(90deg)  translateZ(21px); }
    .dice-face-3 { transform: rotateY(180deg) translateZ(21px); }
    .dice-face-4 { transform: rotateY(-90deg) translateZ(21px); }
    .dice-face-5 { transform: rotateX(90deg)  translateZ(21px); }
    .dice-face-6 { transform: rotateX(-90deg) translateZ(21px); }
    .dice-dot {
        width: 8px;
        height: 8px;
    }
    .dice-face-1 .dice-dot { width: 10px; height: 10px; }
}


/* ============================================================
   PHASE 2 — ANIMATIONS & STYLES
   ============================================================ */

/* --- T2.1 : Barres de PV style jeu vidéo --- */

.replay-hud {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 15px 10px;
    background: rgba(0, 0, 0, 0.85);
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
}

.replay-fighter {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.replay-fighter.right {
    flex-direction: row-reverse;
}

.replay-fighter-photo {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    object-fit: cover;
    object-position: top center;
    border: 3px solid #FF7200;
    box-shadow: 0 0 12px rgba(255, 114, 0, 0.5), 0 0 25px rgba(255, 114, 0, 0.2);
    flex-shrink: 0;
}

/* Image double/finisher dans le replay */
.replay-double-img {
    max-width: 300px;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(255, 114, 0, 0.6), 0 4px 15px rgba(0,0,0,0.5);
    animation: doubleImgAppear 0.6s ease-out;
}

@keyframes doubleImgAppear {
    0%   { transform: scale(0.3) rotate(-5deg); opacity: 0; }
    60%  { transform: scale(1.1) rotate(2deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* Texte du finisher (ex: "TORTUUURE RACKKK !") */
.replay-double-text {
    font-size: 20px;
    font-weight: 900;
    color: #FF4500;
    text-transform: uppercase;
    text-shadow: 0 0 15px rgba(255, 69, 0, 0.7), 0 2px 4px rgba(0,0,0,0.8);
    animation: doubleTextPulse 0.8s ease-out;
    margin-top: 5px;
}

@keyframes doubleTextPulse {
    0%   { transform: scale(0.5); opacity: 0; }
    50%  { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.replay-pv-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.replay-fighter.right .replay-pv-container {
    align-items: flex-end;
}

.replay-fighter-name {
    font-size: 12px;
    font-weight: bold;
    color: #FF7200;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.replay-pv-bar-outer {
    width: 100%;
    height: 18px;
    background: #1a1a1a;
    border-radius: 9px;
    overflow: hidden;
    border: 1px solid #333;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
    position: relative;
}

.replay-pv-bar-inner {
    height: 100%;
    border-radius: 8px;
    transition: width 0.8s ease, background 0.5s ease;
    position: relative;
    overflow: hidden;
}

/* Reflet glossy sur la barre */
.replay-pv-bar-inner::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 50%;
    background: linear-gradient(to bottom, rgba(255,255,255,0.25), rgba(255,255,255,0));
    border-radius: 8px 8px 0 0;
}

/* Couleurs selon niveau PV */
.pv-high   .replay-pv-bar-inner { background: linear-gradient(90deg, #2ECC40, #5FE36A); }
.pv-mid    .replay-pv-bar-inner { background: linear-gradient(90deg, #FF851B, #FFAA33); }
.pv-low    .replay-pv-bar-inner { background: linear-gradient(90deg, #FF4136, #FF6655); }
.pv-critical .replay-pv-bar-inner {
    background: linear-gradient(90deg, #CC0000, #FF0000);
    animation: pvCriticalPulse 0.5s ease-in-out infinite;
}

@keyframes pvCriticalPulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.5; }
}

.replay-pv-text {
    font-size: 11px;
    color: #aaa;
    font-weight: bold;
}

/* Compteur de tour central */
.replay-tour-counter {
    font-size: 22px;
    font-weight: 900;
    color: #FF7200;
    text-shadow: 0 0 10px rgba(255, 114, 0, 0.5);
    min-width: 80px;
    text-align: center;
    flex-shrink: 0;
}


/* --- T2.2 : Overlay intro --- */

.replay-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.replay-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.replay-intro-fighters {
    display: flex;
    align-items: center;
    gap: 40px;
}

.replay-intro-photo {
    width: 180px;
    height: 273px;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(255, 114, 0, 0.4);
}

.replay-intro-photo.left {
    animation: crashInLeft 2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.replay-intro-photo.right {
    animation: crashInRight 2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* Les 2 photos foncent depuis très loin, se percutent au centre, rebondissent */
@keyframes crashInLeft {
    0%   { transform: translateX(-600px) scale(0.4); opacity: 0; }
    30%  { transform: translateX(80px) scale(1.08); opacity: 1; }
    40%  { transform: translateX(50px) scale(1.12); }
    50%  { transform: translateX(-25px) scale(0.95); }
    65%  { transform: translateX(10px) scale(1.03); }
    80%  { transform: translateX(-3px) scale(1); }
    100% { transform: translateX(0) scale(1); opacity: 1; }
}

@keyframes crashInRight {
    0%   { transform: translateX(600px) scale(0.4); opacity: 0; }
    30%  { transform: translateX(-80px) scale(1.08); opacity: 1; }
    40%  { transform: translateX(-50px) scale(1.12); }
    50%  { transform: translateX(25px) scale(0.95); }
    65%  { transform: translateX(-10px) scale(1.03); }
    80%  { transform: translateX(3px) scale(1); }
    100% { transform: translateX(0) scale(1); opacity: 1; }
}

/* VS apparaît avec éclat au moment de l'impact (delay 0.4s = quand les photos se percutent) */
.replay-intro-vs {
    font-size: 80px;
    font-weight: 900;
    background: linear-gradient(180deg, #FF7200, #FF4500, #CC0000);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 0 20px rgba(255, 69, 0, 0.6));
    opacity: 0;
    animation: vsImpact 0.8s ease-out 0.55s forwards, vsPulse 1.5s ease-in-out 1.5s infinite;
}

/* Le VS explose au moment du choc */
@keyframes vsImpact {
    0%   { transform: scale(3); opacity: 0; filter: drop-shadow(0 0 60px rgba(255,255,255,0.9)); }
    40%  { transform: scale(0.9); opacity: 1; }
    60%  { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; filter: drop-shadow(0 0 20px rgba(255, 69, 0, 0.6)); }
}

@keyframes vsPulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.15); }
}

/* Éclair / flash au moment de l'impact */
.replay-intro-flash {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 0; height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.9), rgba(255,200,0,0.4), transparent);
    opacity: 0;
    animation: impactFlash 1s ease-out 0.5s forwards;
    pointer-events: none;
}

@keyframes impactFlash {
    0%   { width: 0; height: 0; opacity: 1; }
    30%  { width: 500px; height: 500px; opacity: 0.8; }
    100% { width: 800px; height: 800px; opacity: 0; }
}

/* Tremblement de tout l'overlay au moment du choc */
.replay-intro-fighters {
    display: flex;
    align-items: center;
    gap: 40px;
    position: relative;
}

.replay-intro-fighters.impact {
    animation: introShake 0.7s ease-out 0.55s;
}

@keyframes introShake {
    0%, 100% { transform: translate(0); }
    10%      { transform: translate(-8px, 4px); }
    20%      { transform: translate(8px, -4px); }
    30%      { transform: translate(-6px, 2px); }
    40%      { transform: translate(6px, -2px); }
    50%      { transform: translate(-4px, 3px); }
    60%      { transform: translate(4px, -1px); }
    70%      { transform: translate(-2px, 1px); }
    80%      { transform: translate(2px, -1px); }
}

.replay-intro-stipu {
    margin-top: 20px;
    font-size: 18px;
    color: #ccc;
    text-transform: uppercase;
    letter-spacing: 3px;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 2s forwards;
}

@keyframes fadeInUp {
    0%   { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

.replay-intro-names {
    display: flex;
    justify-content: center;
    gap: 200px;
    margin-top: 15px;
}

.replay-intro-name {
    font-size: 20px;
    font-weight: 800;
    color: white;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
    opacity: 0;
    animation: fadeInUp 0.6s ease-out 1.5s forwards;
}


/* --- T2.3 : Overlay victoire --- */

/* Container pour les 2 photos victoire (gagnant + perdant) */
.replay-victory-fighters {
    position: relative;
    width: 400px;
    height: 320px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Flash éclair au moment de l'impact victoire (35% de 3.5s = ~1.2s) */
.replay-victory-flash {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 0; height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.95), rgba(255,200,0,0.5), transparent);
    opacity: 0;
    z-index: 3;
    pointer-events: none;
    animation: victoryImpactFlash 0.8s ease-out 1.1s forwards;
}

@keyframes victoryImpactFlash {
    0%   { width: 0; height: 0; opacity: 1; }
    30%  { width: 400px; height: 400px; opacity: 0.9; }
    100% { width: 700px; height: 700px; opacity: 0; }
}

/* Photo du perdant : visible seul au centre, puis éjecté par le gagnant */
.replay-victory-loser {
    width: 180px;
    height: 273px;
    object-fit: contain;
    border-radius: 10px;
    position: absolute;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.4);
    animation: loserEject 3.5s ease-in-out forwards;
    z-index: 1;
}

@keyframes loserEject {
    /* 0-30% : le perdant est seul au centre, bien visible */
    0%   { transform: translateX(0) scale(1) rotate(0deg); opacity: 1; filter: grayscale(0); }
    30%  { transform: translateX(0) scale(1) rotate(0deg); opacity: 1; filter: grayscale(0); }
    /* 35% : impact ! le gagnant le percute */
    35%  { transform: translateX(20px) scale(1.05) rotate(2deg); opacity: 1; filter: grayscale(0); }
    /* 40-60% : éjection vers la gauche avec rotation */
    40%  { transform: translateX(-80px) scale(0.9) rotate(-8deg); opacity: 0.9; filter: grayscale(0.3); }
    50%  { transform: translateX(-250px) scale(0.7) rotate(-20deg); opacity: 0.6; filter: grayscale(0.7); }
    65%  { transform: translateX(-500px) scale(0.4) rotate(-35deg); opacity: 0.2; filter: grayscale(1); }
    /* 70-100% : disparu hors écran */
    75%  { transform: translateX(-700px) scale(0.2) rotate(-45deg); opacity: 0; filter: grayscale(1); }
    100% { transform: translateX(-700px) scale(0.2) rotate(-45deg); opacity: 0; filter: grayscale(1); }
}

/* Photo du gagnant : arrive depuis la droite, percute le perdant, reste au centre */
.replay-victory-photo {
    width: 200px;
    height: 303px;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.5);
    position: relative;
    z-index: 2;
    opacity: 0;
    animation: winnerCrashIn 3.5s ease-out forwards, victoryCelebrate 2s ease-in-out 3.5s infinite;
}

@keyframes winnerCrashIn {
    /* 0-25% : invisible, le perdant est seul */
    0%   { transform: translateX(500px) scale(0.5); opacity: 0; }
    25%  { transform: translateX(500px) scale(0.5); opacity: 0; }
    /* 30-35% : le gagnant fonce depuis la droite */
    30%  { transform: translateX(200px) scale(0.8); opacity: 0.5; }
    /* 35% : IMPACT au centre */
    35%  { transform: translateX(-10px) scale(1.1); opacity: 1; }
    /* 40% : rebond léger */
    40%  { transform: translateX(15px) scale(1.05); opacity: 1; }
    45%  { transform: translateX(-5px) scale(1.02); opacity: 1; }
    /* 50-100% : se stabilise au centre */
    55%  { transform: translateX(0) scale(1); opacity: 1; }
    100% { transform: translateX(0) scale(1); opacity: 1; }
}

/* Flottement de célébration (boucle infinie après la séquence) */
@keyframes victoryCelebrate {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25%      { transform: translateY(-8px) rotate(1deg); }
    50%      { transform: translateY(-4px) rotate(-1deg); }
    75%      { transform: translateY(-10px) rotate(0.5deg); }
}

.replay-victory-text {
    font-size: 48px;
    font-weight: 900;
    color: gold;
    text-transform: uppercase;
    margin-top: 20px;
    letter-spacing: 5px;
    opacity: 0;
    animation: fadeInUp 0.6s ease-out 2.5s forwards, shimmer 2s linear 3s infinite;
    background: linear-gradient(90deg, #FFD700, #FFF8DC, #FFD700, #DAA520, #FFD700);
    background-size: 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.replay-victory-name {
    font-size: 28px;
    font-weight: 800;
    color: white;
    margin-top: 10px;
    text-shadow: 0 2px 15px rgba(255, 114, 0, 0.6);
    opacity: 0;
    animation: fadeInUp 0.6s ease-out 2.8s forwards;
}

.replay-victory-stats {
    margin-top: 25px;
    display: flex;
    gap: 30px;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 1.5s forwards;
}

.replay-victory-stat {
    text-align: center;
    color: #aaa;
    font-size: 13px;
}

.replay-victory-stat-value {
    font-size: 24px;
    font-weight: 800;
    color: #FF7200;
    display: block;
}

.replay-inprogress-text {
    font-size: 32px;
    font-weight: 700;
    color: #FF7200;
    text-transform: uppercase;
    letter-spacing: 3px;
    animation: vsPulse 2s ease-in-out infinite;
}


/* --- T2.4 : Bandeau commentateur --- */

.replay-commentary {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0.7));
    padding: 12px 30px;
    z-index: 10000;
    border-top: 2px solid #FF7200;
    transform: translateY(100%);
    transition: transform 0.4s ease-out;
}

.replay-commentary.visible {
    transform: translateY(0);
}

.replay-commentary-text {
    color: white;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    animation: commentSlideIn 0.4s ease-out;
}

@keyframes commentSlideIn {
    0%   { transform: translateX(-50px); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}


/* --- T2.5 : Effets d'impact --- */

/* Tremblement léger (dégâts -1 à -3) */
@keyframes shakeLight {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-3px); }
    50%      { transform: translateX(3px); }
    75%      { transform: translateX(-2px); }
}

.shake-light {
    animation: shakeLight 0.3s ease-in-out;
}

/* Tremblement fort (dégâts -4 à -7) */
@keyframes shakeHeavy {
    0%, 100% { transform: translateX(0) scale(1); }
    10%      { transform: translateX(-6px) scale(1.02); }
    20%      { transform: translateX(6px) scale(1.02); }
    30%      { transform: translateX(-5px); }
    40%      { transform: translateX(5px); }
    50%      { transform: translateX(-4px); }
    60%      { transform: translateX(4px) scale(1.01); }
    70%      { transform: translateX(-3px); }
    80%      { transform: translateX(2px); }
    90%      { transform: translateX(-1px); }
}

.shake-heavy {
    animation: shakeHeavy 0.5s ease-in-out;
}

/* Flash rouge plein écran (gros dégâts) */
.replay-flash {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 10001;
    pointer-events: none;
    opacity: 0;
}

.replay-flash.flash-red {
    background: rgba(255, 0, 0, 0.3);
    animation: flashFade 0.4s ease-out forwards;
}

.replay-flash.flash-white {
    background: rgba(255, 255, 255, 0.6);
    animation: flashFade 0.3s ease-out forwards;
}

@keyframes flashFade {
    0%   { opacity: 1; }
    100% { opacity: 0; }
}

/* Tour fade-in pour l'historique */
@keyframes tourFadeIn {
    0%   { opacity: 0; transform: translateX(-20px); }
    100% { opacity: 1; transform: translateX(0); }
}

.tour-fadein {
    animation: tourFadeIn 0.4s ease-out;
}

/* Résultat highlight */
@keyframes resultHighlight {
    0%   { background-color: #FF7200; color: white; }
    100% { background-color: lightgrey; color: inherit; }
}

.result-highlight {
    animation: resultHighlight 1.2s ease-out;
}


/* --- T2.6 : Responsive mobile --- */

@media (max-width: 600px) {
    /* HUD barres PV */
    .replay-hud {
        flex-direction: column;
        gap: 8px;
        padding: 10px;
    }
    .replay-fighter {
        width: 100%;
    }
    .replay-fighter.right {
        flex-direction: row;
    }
    .replay-fighter.right .replay-pv-container {
        align-items: flex-start;
    }
    .replay-tour-counter {
        font-size: 18px;
        min-width: auto;
        order: -1;
    }

    /* Overlay intro */
    .replay-intro-fighters {
        gap: 15px;
    }
    .replay-intro-photo {
        width: 100px;
        height: 152px;
    }
    .replay-intro-vs {
        font-size: 40px;
    }
    .replay-intro-stipu {
        font-size: 13px;
        letter-spacing: 1px;
    }
    .replay-intro-names {
        gap: 60px;
    }
    .replay-intro-name {
        font-size: 14px;
    }

    /* Overlay victoire */
    .replay-victory-photo {
        width: 130px;
        height: 197px;
    }
    .replay-victory-text {
        font-size: 28px;
        letter-spacing: 2px;
    }
    .replay-victory-name {
        font-size: 20px;
    }
    .replay-victory-stats {
        gap: 15px;
    }
    .replay-victory-stat-value {
        font-size: 18px;
    }

    /* Bandeau commentateur */
    .replay-commentary {
        padding: 8px 15px;
    }
    .replay-commentary-text {
        font-size: 13px;
    }
}


/* --- Contrôles replay --- */

.replay-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.replay-btn {
    background: #FF7200;
    color: white;
    border: none;
    padding: 8px 18px;
    font-size: 14px;
    cursor: pointer;
    border-radius: 5px;
    font-weight: 600;
    transition: background 0.2s;
}

.replay-btn:hover {
    background: #E06000;
}

.replay-btn.active {
    background: #CC5500;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.replay-btn-speed {
    background: #333;
    color: #ccc;
    border: 1px solid #555;
    padding: 5px 12px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 4px;
}

.replay-btn-speed.active {
    background: #FF7200;
    color: white;
    border-color: #FF7200;
}

.replay-btn-mute {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
}
