/* --- CONFIGURATION GLOBALE --- */
body, html {
    height: 100%;
    margin: 0;
    font-family: 'Rajdhani', sans-serif;
    overflow: hidden;
    background: #000;
    user-select: none; /* Empêche la sélection du texte */
}

/* AJOUT INDISPENSABLE POUR LA 3D */
model-viewer {
    width: 100%;
    height: 100%;
    --poster-color: transparent;
    display: block;
}

/* FOND D'ECRAN (Géré par JS pour le flou) */
.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;
}

/* Classe ajoutée par JS quand on est dans le garage */
.background-layer.blurred {
    filter: brightness(0.5) blur(8px);
    transform: scale(1.02);
}

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

/* --- ÉCRAN DE DÉMARRAGE ("Appuyer pour continuer") --- */
@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;
    text-align: center;
    cursor: pointer;
    z-index: 1000;
    background: rgba(0,0,0,0.3); /* Léger filtre sombre */
}

#press-to-continue {
    font-family: 'Berkshire Swash', cursive;
    font-size: 3rem;
    color: #ffd700; /* Gold */
    text-shadow: 2px 2px 10px #000;
    margin-top: 0;
    animation: blink 2s infinite ease-in-out;
}

/* --- PANNEAUX (Menus, Lobby, Garage) --- */
.panel {
    /* Fond rouge semi-transparent ORIGINAL CONSERVÉ */
    background: linear-gradient(to bottom, rgba(179, 0, 0, 0.9) 0%, rgba(96, 0, 0, 0.95) 100%);
    border: 5px solid #ffd700; /* Or */
    outline: 5px solid #006400; /* Vert foncé */
    outline-offset: -10px;
    border-radius: 30px;
    padding: 40px;
    width: 90%;
    max-width: 800px;
    text-align: center;
    color: #fff;
    display: none; /* Caché par défaut */
    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 ET BOUTONS */
.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; }

.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; }
.btn:disabled { filter: grayscale(1); cursor: not-allowed; opacity: 0.6; }

/* UTILS MENU */
.clickable-code {
    cursor: pointer;
    border: 2px dashed #fff;
    padding: 10px 20px;
    display: inline-block;
    margin: 10px;
    font-size: 2rem;
    font-weight: bold;
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
}
.clickable-code:hover { background: rgba(255,255,255,0.1); border-color: #ffd700; color: #ffd700; }
#menu-loader {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.2rem;
    animation: blink 1.5s infinite;
}

/* --- GARAGE (CARROUSEL) --- */
.carousel-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 350px;
    width: 100%;
    margin-bottom: 10px;
    position: relative;
}
.model-stage { width: 80%; height: 100%; position: relative; }

.arrow {
    font-size: 3rem;
    color: #ffd700;
    cursor: pointer;
    padding: 0 20px;
    transition: 0.2s;
    text-shadow: 0 0 10px #000;
    user-select: none;
}
.arrow:hover { transform: scale(1.2); color: #fff; }

.car-simple-title {
    font-family: 'Berkshire Swash';
    font-size: 2.5rem;
    color: #ffd700;
    text-shadow: 2px 2px 0 #000;
    margin-bottom: 20px;
}

/* --- ÉCRAN DE JEU (MAP) --- */
#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 & Timer) */
#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;
}
#timer-display {
    font-family: 'Rajdhani';
    font-size: 3rem;
    color: #00ff00;
    text-shadow: 0 0 10px #006400;
    background: rgba(0,0,0,0.6);
    padding: 5px 25px;
    border-radius: 15px;
    border: 1px solid #006400;
}
.timer-red { color: #ff0000 !important; text-shadow: 0 0 10px #8b0000 !important; border-color: #8b0000 !important; }

/* INDICATEUR DE TOUR */
#turn-indicator {
    position: absolute; top: 15%; left: 50%; transform: translateX(-50%);
    font-family: 'Berkshire Swash'; font-size: 3.5rem;
    color: #fff;
    text-shadow: 0 0 20px #000;
    z-index: 50;
    transition: color 0.3s;
}

/* ZONES BOUCLIERS (CAGES) */
.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;
    transition: opacity 0.5s ease-out;
}
.shield-blue { left: 1%; color: #00eaff; transform: perspective(600px) rotateY(15deg); }
.shield-orange { right: 1%; color: #ff6600; transform: perspective(600px) rotateY(-15deg); }

/* BARRES DE VIE DES CAGES */
.cage-hp-bar {
    position: absolute; top: -30px; left: 50%; transform: translateX(-50%);
    width: 120%; height: 10px; background: #333; border: 1px solid #fff;
}
.cage-fill { height: 100%; width: 100%; transition: width 0.5s; }

/* VOITURES 3D */
.game-car {
    position: absolute; bottom: 8%; width: 22%; height: 20%; z-index: 5;
}
.p1-pos { left: 12%; }
.p2-pos { right: 12%; }

/* 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;
}
.hp-container {
    width: 100%; height: 20px;
    background: #222; border: 2px solid #fff; border-radius: 8px;
    overflow: hidden; position: relative; margin-top: 5px;
    transition: opacity 0.3s;
}
.hp-fill {
    height: 100%; width: 100%;
    background: linear-gradient(90deg, #00ff00, #ffff00);
    transition: width 0.5s;
}
.hp-text {
    position: absolute; top: 0; left: 0; width: 100%;
    line-height: 20px; font-size: 0.9rem; color: #000; font-weight: 800;
}

/* BARRES DE POUVOIRS (DECKS) */
.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;
    transition: opacity 0.3s, transform 0.3s;
}
.disabled-bar {
    opacity: 0.5; pointer-events: none; filter: grayscale(1);
}

/* Slots de pouvoirs */
.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;
}

/* Tooltips (Info-bulles) */
.tooltip {
    position: absolute; bottom: 130%; left: 50%; transform: translateX(-50%);
    width: 180px; background: rgba(0,0,0,0.95);
    border: 1px solid #ffd700; color: #fff;
    padding: 10px; font-size: 0.9rem; border-radius: 8px;
    display: none; pointer-events: none; text-align: center;
    z-index: 200;
}
.slot:hover .tooltip { display: block; }

/* STYLE COOLDOWN (Grisé + Compteur) */
.slot.on-cooldown {
    filter: grayscale(100%);
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #444 !important;
    pointer-events: none;
}

/* MODIFICATION: J'ai renommé .cooldown-text en .status-text pour matcher le JS */
.status-text {
    position: absolute;
    top: 50%; left: 50%; transform: translate(-50%, -50%);
    font-size: 1.8rem; font-weight: 800;
    color: #ff0000;
    text-shadow: 2px 2px 0 #000, -1px -1px 0 #fff;
    z-index: 10;
}

/* AJOUT: Style pour les attaques bloquées par la défense */
.slot.blocked {
    opacity: 0.6;
    cursor: not-allowed;
    position: relative;
}
.slot.blocked::after {
    content: "✕";
    position: absolute;
    color: #ff0000;
    font-size: 3rem;
    font-weight: bold;
    text-shadow: 0 0 5px #000;
}

/* MESSAGES FLOTTANTS */
.float-msg {
    position: fixed; top: 40%; left: 50%; transform: translate(-50%, -50%);
    font-size: 4rem; font-family: 'Berkshire Swash';
    color: gold; text-shadow: 0 0 15px #000;
    animation: floatUp 2s forwards;
    z-index: 999;
    white-space: nowrap;
}
@keyframes floatUp {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    10% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
    100% { opacity: 0; transform: translate(-50%, -200px) scale(1); }
}

/* ÉCRAN VICTOIRE */
#win-overlay {
    backdrop-filter: blur(5px);
}
#win-msg { text-align: center; line-height: 1.1; margin-bottom: 30px; }