/* --- Mise en page globale --- */
body {
    background-color: #1a1a1a;
    color: #ffffff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    overflow: hidden;
}

/* --- Écran de connexion --- */
#formulaire-authentification {
    background: #2d2d2d;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    text-align: center;
    border: 2px solid #ed1c24;
}

#formulaire-authentification h1 {
    color: #ed1c24;
    margin-bottom: 20px;
}

input {
    padding: 10px;
    border-radius: 5px;
    border: none;
    width: 200px;
    margin-bottom: 15px;
}

button {
    padding: 10px 20px;
    background: #ed1c24;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}

button:hover {
    background: #bf171d;
}

/* --- Zone de jeu et Canvas --- */
#formulaire-jeu {
    position: relative;
    display: none;
}

#conteneur-canvas {
    position: relative;
    border: 5px solid #444;
    background-color: #000;
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
}

canvas {
    display: block;
    image-rendering: pixelated;
    background: url('https://www.fightersgeneration.com/nx5/stage/sf2/ryu-stage-sf2ce.gif') no-repeat center center;
    background-size: cover;
}

/* --- LAYER HADOKEN (animation vectorielle) --- */
#layer-hadoken {
    position: absolute;
    top: 0;
    left: 0;
    width: 800px;
    height: 400px;
    z-index: 5;
    pointer-events: none;
    overflow: hidden;
}

.hadoken-svg {
    animation: pulsationHadoken 0.25s infinite alternate;
}

@keyframes pulsationHadoken {
    from {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.95;
    }
    to {
        transform: translate(-50%, -50%) scale(1.08);
        opacity: 1;
    }
}

/* --- Interface des points de vie (HUD) --- */
.interface-vie {
    position: absolute;
    top: 20px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 40px;
    box-sizing: border-box;
    pointer-events: none;
    z-index: 10;
}

.cadre-vie {
    width: 250px;
    text-align: left;
}

.cadre-vie.adversaire {
    text-align: right;
}

.nom-joueur {
    font-size: 1.2em;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 5px;
    text-shadow: 2px 2px #000;
}

.barre-fond {
    width: 100%;
    height: 25px;
    background: rgba(255, 0, 0, 0.3);
    border: 2px solid #fff;
    border-radius: 5px;
    overflow: hidden;
}

.barre-vie-actuelle {
    height: 100%;
    width: 100%;
    background: linear-gradient(to bottom, #00ff00, #008000);
    transition: width 0.3s ease-out;
}

/* --- Timer et Statut --- */
/* --- Timer et Statut Central --- */
#bloc-temps-statut {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: absolute;
    left: 50%;
    top: 5px; /* Garde le timer en haut */
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 20;
}

#timer-combat {
    font-size: 50px;
    color: #FFD700;
    font-family: 'Arial Black', sans-serif;
    line-height: 1;
    text-shadow: 3px 3px 0 #000;
}

#statut-jeu {
    position: absolute;
    top: 200px; /* Milieu vertical du canvas (400px / 2) */
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 80px;
    color: #FFCC00;
    text-shadow: 0 0 20px #FF0000;
    display: none;
    z-index: 30;
    white-space: nowrap;
}

/* --- Écran de Fin de Combat (NOUVELLES FONCTIONNALITÉS) --- */
#annonce-fin-partie {
    display: none;
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.85);
    padding: 30px;
    border-radius: 20px;
    border: 3px solid #FFD700;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
    min-width: 300px;
}

.texte-vainqueur {
    color: #FFD700;
    font-size: 45px;
    font-family: 'Arial Black', sans-serif;
    text-shadow: 2px 2px #000;
    margin: 0;
    text-transform: uppercase;
}

.texte-perdant {
    color: #FF4500;
    font-size: 25px;
    font-family: 'Arial Black', sans-serif;
    text-shadow: 1px 1px #000;
    margin-top: 5px;
    display: block;
}

/* --- Bouton Rejouer --- */
.bouton-rejouer {
    margin-top: 25px;
    padding: 15px 30px;
    background: #FFD700;
    color: #000;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    text-transform: uppercase;
    transition: transform 0.2s, background 0.2s;
}

.bouton-rejouer:hover {
    background: #ffffff;
    transform: scale(1.1);
}

/* --- Animations existantes --- */
#message-fin-combat {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    color: #ff0000;
    font-family: 'Arial Black', sans-serif;
    font-size: 90px;
    text-shadow: 5px 5px 0px #000, 0 0 30px rgba(255, 255, 255, 0.5);
    z-index: 9998;
    pointer-events: none;
    text-align: center;
    visibility: hidden;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#message-fin-combat.visible {
    transform: translate(-50%, -50%) scale(1);
    visibility: visible;
}

.effet-zoom-ko {
    animation: zoomRapide 0.5s ease-out forwards;
}

@keyframes zoomRapide {
    0% { transform: scale(0); opacity: 0; }
    70% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

#selecteur-personnage {
    display: none; /* Caché au départ */
    background: #2d2d2d;
    padding: 30px;
    border-radius: 10px;
    border: 2px solid #FFD700;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
}

#selecteur-personnage h2 {
    color: #FFD700;
    font-family: 'Arial Black', sans-serif;
    margin-bottom: 20px;
}

.conteneur-choix {
    display: flex;
    gap: 40px;
    justify-content: center;
}

.carte-perso {
    cursor: pointer;
    border: 4px solid transparent;
    padding: 20px; /* Un peu plus de padding pour respirer */
    transition: all 0.2s;
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    text-align: center;
    width: 180px; /* Largeur fixe pour que les cartes soient identiques */
}

.carte-perso:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-5px);
}
/* --- LE ZOOM SE PASSE ICI --- */
.aperçu-sprite {
    width: 140px;  /* On double la largeur (était 64px) */
    height: 140px; /* On double la hauteur (était 64px) */
    margin: 0 auto 15px;
    background-size: cover;

    /* Très important pour garder les pixels nets lors du zoom */
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* Positionnement pour montrer juste la première frame Idle */
.aperçu-sprite.rouge {
    background-image: url('illustrations/Idle.png');
    background-position: 0 0;
}

.aperçu-sprite.bleu {
    background-image: url('illustrations/Idle1.png');
    background-position: 0 0;
}

.carte-perso p {
    margin: 0;
    font-weight: bold;
    font-size: 1.1em;
}

#attente-adversaire {
    margin-top: 20px;
    font-style: italic;
    color: #aaa;
    display: none;
}

/* Styles pour l'écran de fin */
.victoire-container {
    text-align: center;
    background: rgba(0, 0, 0, 0.85);
    padding: 30px;
    border-radius: 20px;
    border: 2px solid #333;
    display: none; /* Caché par défaut */
}

.victoire-animee {
    animation: neonPulse 1.5s infinite ease-in-out;
}

@keyframes neonPulse {
    0% { filter: drop-shadow(0 0 5px #FFD700) brightness(1); }
    50% { filter: drop-shadow(0 0 20px #FFD700) brightness(1.5); }
    100% { filter: drop-shadow(0 0 5px #FFD700) brightness(1); }
}

#bouton-rejouer {
    margin-top: 20px;
    padding: 12px 40px;
    cursor: pointer;
    background: #FFD700;
    color: #111;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    transition: all 0.3s;
}

#bouton-rejouer:hover {
    background-color: #FFF;
    transform: scale(1.1);
}
