/* =========================================
   1. BASES (ANCIEN CSS CONSERVÉ)
   ========================================= */
body, html {
    height: 100%; margin: 0;
    font-family: 'Rajdhani', sans-serif;
    overflow: hidden; background: #000;
    user-select: none; /* Empêche la sélection de texte */
}

/* FOND D'ECRAN */
.background-layer {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: url('rocket-league/image/ecran.jpg') no-repeat center center fixed;
    background-size: cover; z-index: 0;
    transition: filter 0.8s ease, transform 0.8s ease;
}
.background-layer.blurred { filter: brightness(0.5) blur(8px); transform: scale(1.02); }

/* CONTENEUR UI */
.ui-container {
    display: flex; justify-content: center; align-items: center;
    height: 100vh; width: 100%; position: relative; z-index: 10;
}

/* START SCREEN (CLIGNOTEMENT) */
@keyframes blink {
    0%, 100% { opacity: 1; text-shadow: 0 0 20px #ffd700; }
    50% { opacity: 0.5; text-shadow: none; }
}
#screen-start {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    cursor: pointer; z-index: 1000; background: rgba(0,0,0,0.4);
}
#press-to-continue {
    font-family: 'Berkshire Swash', cursive; font-size: 3rem; color: #ffd700;
    text-shadow: 2px 2px 10px #000; animation: blink 2s infinite ease-in-out;
}

/* =========================================
   2. PANNEAUX & MENUS (STYLE ROUGE/OR)
   ========================================= */
.panel {
    /* Ton style signature : Rouge sombre avec bordure Or */
    background: linear-gradient(to bottom, rgba(179, 0, 0, 0.9) 0%, rgba(96, 0, 0, 0.95) 100%);
    border: 5px solid #ffd700; outline: 5px solid #006400; outline-offset: -10px;
    border-radius: 30px; padding: 40px; width: 90%; max-width: 800px;
    text-align: center; color: #fff; display: none; animation: popIn 0.5s ease;
    box-shadow: 0 0 50px rgba(0,0,0,0.8); position: relative; z-index: 20;
}
@keyframes popIn { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }

h2 {
    font-family: 'Berkshire Swash', cursive; font-size: 2.5rem;
    margin-bottom: 20px; color: #ffd700; text-shadow: 2px 2px 0 #000;
}

/* INPUTS */
.input-std {
    background: #4a0000; border: 2px solid #ffd700; color: #ffd700; padding: 10px;
    font-size: 1.5rem; text-align: center; border-radius: 10px; width: 60%;
    font-family: 'Rajdhani', sans-serif; font-weight: bold;
}
.input-std::placeholder { color: #884444; }

/* BOUTONS (Classiques) */
.btn {
    padding: 10px 30px; border-radius: 10px; font-family: 'Berkshire Swash', cursive;
    font-size: 1.3rem; cursor: pointer; margin: 10px; transition: 0.1s;
    border: 2px solid #fff; text-transform: uppercase;
}
.btn:active { transform: scale(0.95); }
.btn-green { background: #006400; color: white; text-shadow: 1px 1px 0 #000; }
.btn-gold { background: #daa520; color: black; font-weight: bold; }

/* GARAGE */
.carousel-container { display: flex; align-items: center; justify-content: center; height: 350px; width: 100%; position: relative; }
.arrow { font-size: 3rem; color: #ffd700; cursor: pointer; padding: 0 20px; text-shadow: 0 0 10px #000; transition: 0.2s; }
.arrow:hover { transform: scale(1.2); color: #fff; }

/* =========================================
   3. JEU (MAP & HUD)
   ========================================= */
#screen-map {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: url('rocket-league/image/map.jpg') center/cover; display: none;
}

/* INFO BAR (Score) */
#game-info {
    position: absolute; top: 2%; left: 0; width: 100%; display: flex;
    justify-content: space-between; align-items: center; z-index: 50; padding: 0 50px; box-sizing: border-box;
}
.score-side { font-family: 'Berkshire Swash'; font-size: 4rem; color: #ffd700; text-shadow: 2px 2px 5px #000; }
#turn-indicator {
    position: absolute; top: 10%; left: 50%; transform: translateX(-50%);
    font-family: 'Berkshire Swash'; font-size: 3rem; color: #fff; text-shadow: 0 0 20px #000;
    z-index: 50; white-space: nowrap;
}

/* ZONES BOUCLIERS (CAGES 3D - Ancien style conservé) */
.shield-zone {
    position: absolute; top: 25%; height: 45%; width: 8%; z-index: 1;
    border-radius: 10px; border: 3px solid currentColor;
    background: linear-gradient(to bottom, rgba(255,255,255,0.1), rgba(0,0,0,0));
    box-shadow: 0 0 30px currentColor, inset 0 0 15px currentColor;
}
.shield-blue { left: 1%; color: #00eaff; transform: perspective(600px) rotateY(15deg); }
.shield-orange { right: 1%; color: #ff6600; transform: perspective(600px) rotateY(-15deg); }

/* HUD JOUEURS */
.hud-player {
    position: absolute; bottom: 30%; width: 20%;
    text-align: center; z-index: 20;
    color: white; font-weight: bold; text-shadow: 1px 1px 2px #000;
    font-size: 1.2rem; background: rgba(0,0,0,0.6); padding: 10px; border-radius: 15px;
}
/* BARRE DE VIE */
.hp-container {
    width: 100%; height: 20px; background: #222; border: 2px solid #fff;
    border-radius: 8px; overflow: hidden; position: relative; margin-top: 5px;
}
.hp-fill {
    height: 100%; width: 100%;
    background: linear-gradient(90deg, #00ff00, #ffff00); transition: width 0.5s;
}

/* --- NOUVEAUTÉ : BARRE D'ÉNERGIE (STYLE ELECTRIQUE) --- */
.energy-container {
    width: 100%; height: 15px;
    background: #111; border: 2px solid #00aaff; border-radius: 8px;
    overflow: hidden; position: relative; margin-top: 5px;
    box-shadow: 0 0 10px rgba(0, 170, 255, 0.4); /* Glow bleu */
}
.energy-fill {
    height: 100%; width: 100%;
    background: linear-gradient(90deg, #0044cc, #00ccff); /* Bleu électrique */
    transition: width 0.5s ease-out;
}
.energy-text {
    position: absolute; top: 0; left: 0; width: 100%; line-height: 15px;
    font-size: 0.8rem; color: #fff; font-weight: 800; z-index: 2;
}

/* --- NOUVEAUTÉ : POSITIONS DES VOITURES --- */
/* On ajoute des transitions pour que le mouvement (Avancer/Reculer) soit fluide */
.game-car {
    position: absolute; bottom: 8%; width: 22%; height: 20%; z-index: 5;
    transition: left 0.5s ease-in-out, right 0.5s ease-in-out; /* Animation du mouvement */
}
/* Positions par défaut (Défense) */
.p1-pos { left: 10%; }
.p2-pos { right: 10%; }

/* --- NOUVEAUTÉ : BOUTONS DE CONTRÔLE (MOUVEMENT/TIR) --- */
#controls-p1 {
    position: absolute; bottom: 140px; /* Juste au dessus du deck */
    left: 50%; transform: translateX(-50%);
    display: flex; gap: 15px; z-index: 100;
}
.btn-ctrl {
    background: rgba(0,0,0,0.8); border: 2px solid #fff; color: #fff;
    font-family: 'Rajdhani'; font-weight: bold; font-size: 1rem;
    padding: 8px 15px; cursor: pointer; border-radius: 5px;
    transition: 0.2s; box-shadow: 0 0 10px #000;
}
.btn-ctrl:hover { background: #fff; color: #000; box-shadow: 0 0 15px #fff; }
.btn-shoot { border-color: #ff4444; color: #ff4444; }
.btn-shoot:hover { background: #ff4444; color: white; box-shadow: 0 0 15px #ff0000; }

/* DECK DE POUVOIRS */
.power-bar {
    position: absolute; bottom: 2%; display: flex; gap: 15px; z-index: 100;
    padding: 15px; background: rgba(0,0,0,0.8); border-radius: 20px; border: 2px solid #ffd700;
}
.slot {
    width: 60px; height: 60px; border-radius: 50%; border: 3px solid #888;
    background: #333; cursor: pointer; position: relative;
    display: flex; justify-content: center; align-items: center; font-size: 2rem;
    transition: 0.2s; box-shadow: 0 0 10px #000;
}
.slot:hover { border-color: #fff; transform: translateY(-8px); box-shadow: 0 0 20px #ffd700; }

/* --- NOUVEAUTÉ : BADGES DE COÛT SUR LES CARTES --- */
.badge-cost {
    position: absolute; top: -5px; right: -5px;
    width: 22px; height: 22px; background: #00aaff;
    border: 2px solid #fff; border-radius: 50%;
    color: white; font-weight: bold; font-size: 0.9rem; font-family: 'Rajdhani';
    display: flex; justify-content: center; align-items: center;
    box-shadow: 0 0 5px #000; z-index: 10;
}

/* OVERLAY VICTOIRE */
#win-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9); z-index: 999;
    display: none; flex-direction: column; justify-content: center; align-items: center;
    backdrop-filter: blur(5px);
}
#win-msg {
    color: gold; font-family: 'Berkshire Swash'; font-size: 5rem;
    margin-bottom: 30px; text-shadow: 0 0 20px #ffd700;
}