/* ==========================================================================
   SECTION 1 : VARIABLES GLOBALES & THÈME
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700;900&display=swap');

:root {
    --bg-dark: #0b0c10;
    --panel-bg: rgba(30, 32, 40, 0.65);
    --panel-border: rgba(255, 255, 255, 0.08);
    --accent: #ffa502;
    --accent-pink: #ff6b81;
    --blue: #54a0ff;
    --red: #ff6b6b;
    --green: #2ecc71;
    --text: #f5f5f7;
    --radius: 22px;
    --radius-sm: 16px;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    
    /* Zones sécurisées (Mobile / Notch) */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
}

/* ==========================================================================
   SECTION 2 : RESET & STYLES DE BASE (MOTEUR JEU)
   ========================================================================== */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

body, html { 
    width: 100%; 
    height: 100%; 
    overflow: hidden; 
    position: fixed; /* Fixe le viewport sur Safari mobile */
    background-color: var(--bg-dark); 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, 'Poppins'; 
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-font-smoothing: antialiased;
}

canvas { 
    display: block; 
    position: absolute; 
    top: 0; 
    left: 0; 
    z-index: 1; 
}

#ui-layer { 
    position: absolute; 
    inset: 0; 
    pointer-events: none; 
    display: none; 
    z-index: 10; 
}

/* ==========================================================================
   SECTION 3 : HUD & BARRES DE STATISTIQUES (HAUT-GAUCHE)
   ========================================================================== */
#info-panel { 
    position: absolute; 
    top: calc(15px + var(--safe-top)); 
    left: calc(15px + var(--safe-left)); 
    display: flex; 
    flex-direction: column; 
    gap: 8px; 
    pointer-events: none; 
    z-index: 40;
}

.top-stats { display: flex; align-items: flex-start; gap: 12px; pointer-events: auto; }
.bars-container { display: flex; flex-direction: column; gap: 6px; }

/* Conteneur d'une jauge */
.status-bar { 
    display: flex; 
    align-items: center; 
    background: rgba(20, 23, 30, 0.85); 
    border-radius: 12px; 
    border: 1px solid rgba(255, 255, 255, 0.1); 
    padding: 4px 8px 4px 4px; 
    width: 200px; 
    position: relative; 
    backdrop-filter: blur(10px); 
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); 
}

.status-icon { 
    width: 26px; 
    height: 26px; 
    border-radius: 8px; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    font-size: 1em; 
    color: white; 
    z-index: 2; 
    flex-shrink: 0; 
}

.bar-hp { background: #e74c3c; } 
.bar-money { background: #f1c40f; color: #0b0c10; } 
.bar-mats { background: #8d6e63; }

.status-track { 
    flex-grow: 1; 
    height: 12px; 
    background: rgba(0, 0, 0, 0.6); 
    border-radius: 6px; 
    margin: 0 8px; 
    overflow: hidden; 
    position: relative; 
}

/* Remplissage de la jauge animé */
.status-fill { 
    height: 100%; 
    border-radius: 6px; 
    transition: width 0.3s ease-out; 
    display: block !important;
}

.fill-hp { background: linear-gradient(90deg, #c0392b, #e74c3c); } 
.fill-money { background: linear-gradient(90deg, #d4ac0d, #f1c40f); } 
.fill-mats { background: linear-gradient(90deg, #5c2e0b, #8b4513); }

.status-val { 
    font-weight: 800; 
    color: white; 
    font-size: 0.8em; 
    min-width: 40px; 
    text-align: right; 
    font-variant-numeric: tabular-nums; 
}

/* Badge Arme équipée */
.weapon-badge { 
    background: rgba(20, 23, 30, 0.85); 
    border-radius: 10px; 
    padding: 6px 14px; 
    display: inline-flex; 
    align-items: center; 
    gap: 8px; 
    font-weight: 800; 
    color: #7bed9f; 
    font-size: 0.85em; 
    backdrop-filter: blur(10px); 
    border: 1px solid rgba(123, 237, 159, 0.3); 
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); 
    text-transform: uppercase; 
    letter-spacing: 0.5px; 
    align-self: flex-start; 
    pointer-events: auto; 
}

/* ==========================================================================
   SECTION 4 : BOUTON RÉGLAGES, SCORE ET KILL FEED
   ========================================================================== */
/* Bouton Paramètres (En haut à droite) */
#settings-btn-container {
    position: absolute; 
    top: calc(15px + var(--safe-top)); 
    right: calc(15px + var(--safe-right));
    z-index: 60; 
    pointer-events: auto;
}

#settings-btn { 
    background: rgba(30, 32, 40, 0.85); 
    border: 1px solid rgba(255, 255, 255, 0.12); 
    color: var(--text); 
    border-radius: 12px; 
    width: 42px; 
    height: 42px; 
    font-size: 1.4em; 
    cursor: pointer; 
    transition: 0.2s; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

#settings-btn:hover { 
    background: rgba(255, 255, 255, 0.15); 
    transform: scale(1.05); 
    border-color: var(--accent); 
    color: var(--accent); 
}

/* Barre de Score (Haut au centre) */
#team-score-bar { 
    position: absolute; 
    top: calc(15px + var(--safe-top)); 
    left: 35%; 
    transform: translateX(-50%); 
    width: 340px; 
    height: 36px; 
    background: rgba(30, 32, 40, 0.5); 
    backdrop-filter: blur(20px); 
    border-radius: 18px; 
    border: 1px solid var(--panel-border); 
    display: flex; 
    align-items: center; 
    overflow: hidden; 
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25); 
    z-index: 40; 
    pointer-events: auto; 
}

.team-progress { height: 100%; transition: width 0.4s; }
#blue-progress { background: linear-gradient(90deg, #2980b9, #3498db); width: 50%; }
#red-progress { background: linear-gradient(90deg, #e74c3c, #c0392b); width: 50%; }

#timer-badge { 
    position: absolute; 
    left: 50%; 
    transform: translateX(-50%); 
    background: var(--bg-dark); 
    border: 1px solid rgba(255, 255, 255, 0.1); 
    padding: 6px 16px; 
    border-radius: 16px; 
    color: var(--text); 
    font-weight: 600; 
    font-size: 0.9em; 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); 
    z-index: 50; 
}

.score-num { font-weight: 800; font-size: 1.1em; } 
#blue-score-txt { color: var(--blue); } 
#red-score-txt { color: var(--red); } 
#timer-txt { color: var(--accent); font-variant-numeric: tabular-nums; font-weight: 700; }

/* Journal d'éliminations (Kill Feed) */
#kill-feed { 
    position: absolute; 
    top: calc(230px + var(--safe-top)); 
    right: calc(15px + var(--safe-right)); 
    display: flex; 
    flex-direction: column; 
    gap: 8px; 
    align-items: flex-end; 
    z-index: 40; 
    pointer-events: none; 
}

.kill-entry { 
    background: linear-gradient(90deg, rgba(20, 23, 30, 0) 0%, rgba(20, 23, 30, 0.8) 50%, rgba(20, 23, 30, 0.9) 100%); 
    border-right: 3px solid #ffa502; 
    padding: 6px 15px; 
    border-radius: 8px 0 0 8px; 
    color: white; 
    font-size: 0.85em; 
    font-weight: 700; 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    animation: slideInRight 0.3s ease-out; 
    backdrop-filter: blur(5px); 
}

.kill-entry .weapon-icon { font-size: 1.2em; filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5)); }
@keyframes slideInRight { from { transform: translateX(50px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOutRight { to { transform: translateX(50px); opacity: 0; } }

#shop-prompt { 
    position: absolute; 
    top: calc(70px + var(--safe-top)); 
    left: 50%; 
    transform: translateX(-50%); 
    background: rgba(255, 165, 2, 0.15); 
    backdrop-filter: blur(12px); 
    border: 1px solid var(--accent); 
    padding: 8px 16px; 
    border-radius: 20px; 
    color: var(--accent); 
    font-weight: 700; 
    font-size: 0.85em; 
    cursor: pointer; 
    display: none; 
    align-items: center; 
    gap: 8px; 
    z-index: 45; 
    box-shadow: 0 4px 15px rgba(255, 165, 2, 0.25); 
    transition: 0.2s; 
    pointer-events: auto; 
}

/* ==========================================================================
   SECTION 5 : BOUTONS D'ACTION TACTILES & CLAVIER
   ========================================================================== */
#left-actions { position: absolute; bottom: calc(30px + var(--safe-bottom)); left: calc(30px + var(--safe-left)); display: flex; gap: 16px; pointer-events: auto; z-index: 20; }
#bottom-right-actions { position: absolute; bottom: calc(30px + var(--safe-bottom)); right: calc(30px + var(--safe-right)); display: flex; gap: 16px; pointer-events: auto; z-index: 20; }
#right-edge-actions { position: absolute; top: 50%; right: calc(15px + var(--safe-right)); transform: translateY(-50%); display: flex; flex-direction: column; gap: 16px; pointer-events: auto; z-index: 20; }

.btn-action.round { 
    width: 60px; 
    height: 60px; 
    border-radius: 50%; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    gap: 2px; 
    background: rgba(46, 204, 113, 0.15); 
    backdrop-filter: blur(15px); 
    border: 1px solid rgba(46, 204, 113, 0.4); 
    color: var(--text); 
    cursor: pointer; 
    transition: all 0.2s; 
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2); 
}

.btn-action.round:hover { transform: translateY(-4px) scale(1.05); box-shadow: 0 12px 28px rgba(46, 204, 113, 0.3); background: rgba(46, 204, 113, 0.25); }
.btn-action.round:active { transform: translateY(0) scale(0.9); background: rgba(46, 204, 113, 0.3); }
.btn-action.round i { font-size: 1.6em; }
.btn-action i, .btn-action kbd { pointer-events: none; }
.btn-action.round kbd { font-size: 0.6em; background: rgba(0, 0, 0, 0.4); padding: 2px 6px; border-radius: 8px; font-weight: 600; }

/* Couleurs spécifiques des boutons */
.btn-action.round.rotate { border-color: rgba(52, 152, 219, 0.4); background: rgba(52, 152, 219, 0.15); }
.btn-action.round.rotate:hover { box-shadow: 0 12px 28px rgba(52, 152, 219, 0.3); background: rgba(52, 152, 219, 0.25); }
.btn-action.round.btn-zoom { border-color: rgba(155, 89, 182, 0.4); background: rgba(155, 89, 182, 0.15); }
.btn-action.round.btn-zoom:hover { box-shadow: 0 12px 28px rgba(155, 89, 182, 0.3); background: rgba(155, 89, 182, 0.25); }

.btn-action { 
    background: rgba(46, 204, 113, 0.15); 
    backdrop-filter: blur(15px); 
    border: 1px solid rgba(46, 204, 113, 0.4); 
    color: var(--text); 
    padding: 12px 18px; 
    border-radius: var(--radius-sm); 
    font-weight: 600; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    transition: all 0.3s; 
    font-size: 0.95em; 
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2); 
}

/* Option pour masquer les touches clavier */
.hide-hints kbd { display: none !important; }

/* ==========================================================================
   SECTION 6 : INVENTAIRE VISUEL (HOTBAR)
   ========================================================================== */
#hotbar { 
    position: absolute; 
    bottom: calc(30px + var(--safe-bottom)); 
    left: 40%; 
    transform: translateX(-50%); 
    display: flex; 
    gap: 12px; 
    pointer-events: auto; 
    z-index: 25; 
}

.hotbar-slot { 
    width: 65px; 
    height: 65px; 
    background: rgba(30, 32, 40, 0.7); 
    backdrop-filter: blur(20px); 
    border: 1px solid rgba(255, 255, 255, 0.12); 
    border-radius: 18px; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    position: relative; 
    cursor: pointer; 
    transition: 0.2s; 
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3); 
}

.hotbar-slot.active { 
    border-color: #ffa502; 
    background: rgba(255, 165, 2, 0.2); 
    box-shadow: 0 0 20px rgba(255, 165, 2, 0.35); 
    transform: scale(1.06); 
}

.slot-key { position: absolute; top: 4px; left: 6px; font-size: 0.65em; font-weight: 800; color: rgba(255, 255, 255, 0.6); background: rgba(0, 0, 0, 0.5); padding: 1px 5px; border-radius: 4px; font-family: monospace; }
.slot-icon { font-size: 1.5em; margin-top: 2px; }
.slot-label { font-size: 0.6em; font-weight: 700; color: rgba(255, 255, 255, 0.85); text-transform: uppercase; max-width: 58px; overflow: hidden; }

/* ==========================================================================
   SECTION 7 : MENUS & ÉCRANS OVERLAY
   ========================================================================== */
.overlay { 
    position: absolute; 
    inset: 0; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    z-index: 100; 
    background: rgba(10, 12, 16, 0.85); 
    backdrop-filter: blur(15px); 
    color: var(--text); 
    padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left); 
}

.menu-box { 
    background: rgba(25, 28, 35, 0.8); 
    backdrop-filter: blur(40px); 
    padding: 35px; 
    border-radius: 28px; 
    text-align: center; 
    width: 90%; 
    max-width: 440px; 
    border: 1px solid rgba(255, 255, 255, 0.1); 
    border-top: 1px solid rgba(255, 255, 255, 0.2); 
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6); 
    position: relative; 
    
    /* 🟢 Active le scroll vertical sur PC & Mobile */
    max-height: 88vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.input-group { margin-bottom: 18px; text-align: left; }
.input-group label { display: block; font-size: 0.85em; color: rgba(255, 255, 255, 0.7); margin-bottom: 8px; margin-left: 4px; font-weight: 500; text-transform: uppercase; letter-spacing: 1px;}
input, select { width: 100%; padding: 15px 18px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, 0.1); background: rgba(0, 0, 0, 0.3); color: white; font-size: 16px; outline: none; }
input:focus, select:focus { border-color: rgba(255, 165, 2, 0.6); background: rgba(0, 0, 0, 0.5); box-shadow: 0 0 0 4px rgba(255, 165, 2, 0.15); }

button.btn-menu { 
    width: 100%; 
    padding: 16px; 
    margin-top: 25px; 
    background: var(--text); 
    color: var(--bg-dark); 
    font-weight: 800; 
    font-size: 1.1em; 
    border: none; 
    border-radius: var(--radius-sm); 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 8px; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
}

/* Onglets du menu in-game */
.close-btn { position: absolute; top: 16px; right: 16px; background: rgba(255, 255, 255, 0.1); width: 32px; height: 32px; border-radius: 50%; border: none; color: var(--text); cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 10; }
.tabs-header { display: flex; gap: 8px; margin-bottom: 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); padding-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
.tabs-header::-webkit-scrollbar { display: none; }
.tab-btn { background: transparent; border: none; color: rgba(255, 255, 255, 0.5); font-size: 0.9em; font-weight: 600; cursor: pointer; padding: 10px 14px; border-radius: 12px; display: flex; align-items: center; gap: 6px; }
.tab-btn.active { color: var(--accent); background: rgba(255, 165, 2, 0.15); }
.tab-content { display: none; animation: fadeIn 0.3s; }
.tab-content.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.shop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.shop-grid button { background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.1); padding: 12px; color: var(--text); border-radius: 12px; font-weight: 700; cursor: pointer; }
.menu-section { background: rgba(0, 0, 0, 0.2); border-radius: 18px; padding: 16px; margin-bottom: 12px; border: 1px solid rgba(255, 255, 255, 0.05); text-align: left;}
.menu-section h3 { font-size: 0.95em; color: rgba(255, 255, 255, 0.6); margin-bottom: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); padding-bottom: 8px;}

/* Joysticks tactiles */
.joystick-base { position: absolute; width: 130px; height: 130px; background: rgba(255, 255, 255, 0.08); backdrop-filter: blur(5px); border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.15); display: none; z-index: 50; transform: translate(-50%, -50%); }
.joystick-knob { position: absolute; top: 50%; left: 50%; width: 50px; height: 50px; background: rgba(255, 255, 255, 0.8); border-radius: 50%; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); margin-left: -25px; margin-top: -25px; pointer-events: none; }
#joy-right .joystick-knob { background: rgba(255, 71, 87, 0.8); }

#portrait-warning { display: none; position: absolute; top: calc(80px + var(--safe-top)); left: 50%; transform: translateX(-50%); background: rgba(231, 76, 60, 0.9); backdrop-filter: blur(12px); border: 1px solid rgba(255, 255, 255, 0.2); padding: 10px 24px; border-radius: 30px; color: white; font-weight: bold; z-index: 500; align-items: center; gap: 10px; pointer-events: none; white-space: nowrap; animation: pulseWarning 2s infinite; }
@keyframes pulseWarning { 0%, 100% { transform: translateX(-50%) scale(1); } 50% { transform: translateX(-50%) scale(1.05); } }
@media screen and (orientation: portrait) { #portrait-warning { display: flex; } }

/* 🟢 STYLE AMÉLIORÉ DES BOUTONS DE CONTROL RADIO */
.btn-radio-control {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-radio-control:hover {
    background: rgba(255, 165, 2, 0.2);
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 16px rgba(255, 165, 2, 0.3);
}

.btn-radio-control:active {
    transform: translateY(0) scale(0.95);
}

/* Style spécifique pour le bouton Loop quand il est activé */
.btn-radio-control.active-loop {
    background: rgba(46, 204, 113, 0.25);
    border-color: var(--green);
    color: var(--green);
    box-shadow: 0 0 12px rgba(46, 204, 113, 0.4);
}

/* 🟢 SCROLLBAR MODERNE POUR PC (Firefox) */
.menu-box {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 165, 2, 0.4) rgba(0, 0, 0, 0.2);
}

/* 🟢 SCROLLBAR MODERNE POUR PC (Chrome, Edge, Safari, Opera) */
.menu-box::-webkit-scrollbar {
    width: 6px;
}

.menu-box::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    margin: 10px 0;
}

.menu-box::-webkit-scrollbar-thumb {
    background: rgba(255, 165, 2, 0.35); /* Couleur dorée d'accent */
    border-radius: 8px;
    transition: background 0.2s ease;
}

.menu-box::-webkit-scrollbar-thumb:hover {
    background: var(--accent); /* Devient plus éclatant au survol */
}

/* ==========================================================================
   SECTION 8 : RESPONSIVE DESIGN & MOBILE (MAX-WIDTH: 850PX)
   ========================================================================== */
@media screen and (max-width: 850px) {
    /* 1. Cache les lettres de rappel de touche sur smartphone */
    kbd { display: none !important; }

    /* 2. Réduction intelligente de la taille du HUD */
    #info-panel { transform: scale(0.8); transform-origin: top left; }
    #team-score-bar { transform: translateX(-50%) scale(0.85); transform-origin: top center; top: calc(5px + var(--safe-top)); }
    #settings-btn-container { transform: scale(0.85); transform-origin: top right; top: calc(5px + var(--safe-top)); right: calc(5px + var(--safe-right)); }
    #kill-feed { transform: scale(0.8); transform-origin: top right; top: calc(200px + var(--safe-top)); right: calc(5px + var(--safe-right)); }

    /* 3. Ajustement des boutons tactiles */
    .btn-action.round { width: 44px; height: 44px; }
    .btn-action.round i { font-size: 1.3em; }

    #left-actions { left: calc(15px + var(--safe-left)); bottom: calc(20px + var(--safe-bottom)); }
    #bottom-right-actions { gap: 10px; right: calc(15px + var(--safe-right)); bottom: calc(20px + var(--safe-bottom)); }
    #right-edge-actions { gap: 10px; right: calc(10px + var(--safe-right)); }

    /* 4. Réduction de la Hotbar */
    #hotbar { bottom: calc(15px + var(--safe-bottom)); gap: 8px; }
    .hotbar-slot { width: 50px; height: 50px; border-radius: 12px; }
    .slot-icon { font-size: 1.2em; }
    .slot-label { font-size: 0.55em; }

    /* 5. Adaptation des fenêtres de dialogue */
    .menu-box { padding: 25px 20px; width: 94%; max-width: 360px; border-radius: 24px; }
    #in-game-menu .menu-box { max-height: 85vh; overflow-y: auto; }
}

/* Conteneur de la carte avec l'image fixe */
#map-wrapper {
    position: relative;
    width: 280px;
    height: 280px;
    margin: 0 auto;
    border-radius: 16px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    background: url('asset/map.png') no-repeat center / cover;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

/* Base d'un point joueur */
.map-dot {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    transform: translate(-50%, -50%); /* Pour centrer le point sur sa position exacte */
    transition: left 0.1s linear, top 0.1s linear; /* Déplacement fluide */
}

/* Style pour SOI-MÊME */
.map-dot.me {
    background-color: #f1c40f;
    border: 2px solid #ffffff;
    width: 12px;
    height: 12px;
    z-index: 10;
    box-shadow: 0 0 10px #f1c40f;
}

/* Style pour l'Équipe BLEUE */
.map-dot.blue {
    background-color: #54a0ff;
    border: 1px solid #ffffff;
    z-index: 5;
}

/* Style pour l'Équipe ROUGE */
.map-dot.red {
    background-color: #ff6b6b;
    border: 1px solid #ffffff;
    z-index: 5;
}

/* ==========================================================================
   ADAPTATION DU MENU DE DÉPLOIEMENT (PORTRAIT & PAYSAGE)
   ========================================================================== */

/* Titre du déploiement */
.deploy-title {
    color: var(--accent);
    margin-bottom: 25px;
    font-size: 1.5em;
    text-transform: uppercase;
}

/* Disposition par défaut (Portrait / Ordinateur vertical) */
.form-grid-layout {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.form-col {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.btn-deploy {
    margin-top: 20px;
}

/* 🟢 MODE PAYSAGE SUR MOBILE (LANDSCAPE) */
@media screen and (orientation: landscape) and (max-height: 600px) {
    .menu-box.deploy-modal-box {
        max-width: 660px;
        width: 95%;
        padding: 18px 26px;
        max-height: 94vh;
        overflow-y: auto;
    }

    .deploy-title {
        font-size: 1.15em;
        margin-bottom: 12px;
    }

    .form-grid-layout {
        flex-direction: row;
        gap: 20px;
    }

    .form-col {
        flex: 1;
    }

    .input-group {
        margin-bottom: 10px;
    }

    .input-group label {
        font-size: 0.75em;
        margin-bottom: 4px;
    }

    input, select {
        padding: 8px 12px;
        font-size: 14px;
        border-radius: 10px;
    }

    .btn-deploy {
        margin-top: 10px;
        padding: 10px 14px;
        font-size: 0.95em;
    }
}

/* Étiquette du nom sur la minimap */
.map-label {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 8px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    text-shadow: 0 1px 3px rgba(0,0,0,0.9);
    pointer-events: none;
}

/* Marqueur de mort / tombe sur la carte */
.map-death-marker {
    position: absolute;
    font-size: 14px;
    transform: translate(-50%, -50%);
    filter: drop-shadow(0 0 3px #000);
    z-index: 4;
    animation: popDeath 0.3s ease-out;
}

@keyframes popDeath {
    from { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* Carte / ligne d'un joueur dans les stats d'équipe */
.team-member-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.8em;
}

.team-member-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.team-member-stats {
    display: flex;
    gap: 12px;
    color: #a4b0be;
    font-size: 0.9em;
}

.team-member-stats span {
    display: flex;
    align-items: center;
    gap: 3px;
}

/* ==========================================================================
   DISPOSITION OPTIMISÉE DE L'ONGLET CARTE (CARTE GAUCHE / STATS DROITE)
   ========================================================================== */

/* Élargit un peu le menu quand l'onglet carte est ouvert sur PC / Tablette / Paysage */
#in-game-menu .menu-box {
    max-width: 620px; /* Plus large pour accueillir la carte et les stats côte à côte */
}

/* Grille 2 colonnes pour la partie haute */
.map-top-layout {
    display: grid;
    grid-template-columns: 240px 1fr; /* 240px pour la carte, le reste pour les stats */
    gap: 14px;
    margin-bottom: 12px;
    align-items: start;
}

/* Ajustement de la taille de la carte pour le format compact */
.map-section-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px !important;
}

.map-section-card #map-wrapper {
    width: 220px;
    height: 220px;
    margin: 0 auto;
}

/* Section Stats à droite */
.stats-section-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 12px !important;
}

.team-stats-scroll {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
    scrollbar-width: thin;
}

/* Tchat en dessous */
.team-chat-section {
    padding: 12px !important;
    margin-bottom: 0 !important;
}

.team-chat-box {
    height: 80px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.8em;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
    scrollbar-width: thin;
}

/* Adaptation automatique sur petits écrans verticaux (Mobile Portrait) */
@media screen and (max-width: 540px) {
    .map-top-layout {
        grid-template-columns: 1; /* Repasse en 1 colonne sur petit écran */
    }

    .map-section-card #map-wrapper {
        width: 240px;
        height: 240px;
    }
}


/* ==========================================================================
   ENCART PROMOTIONNEL DU MOMENT (MENU DE DÉPLOIEMENT)
   ========================================================================== */

/* Élargissement de la boîte de dialogue de départ pour accueillir l'encart */
.menu-box.deploy-modal-box {
    max-width: 820px;
    width: 95%;
    padding: 30px;
}

/* Grille principale : Formulaire à gauche (flex 1.5) + Pub à droite (flex 1) */
.deploy-main-layout {
    display: flex;
    gap: 24px;
    align-items: stretch;
    text-align: left;
}

.deploy-form-section {
    flex: 1.6;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Style de la carte promotionnelle */
.deploy-promo-card {
    flex: 1;
    background: linear-gradient(145deg, rgba(255, 165, 2, 0.08) 0%, rgba(46, 204, 113, 0.05) 100%);
    border: 1px solid rgba(255, 165, 2, 0.35);
    border-radius: 18px;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.promo-badge {
    position: absolute;
    top: -10px;
    background: linear-gradient(90deg, #ffa502, #ff4757);
    color: #fff;
    font-size: 0.65em;
    font-weight: 900;
    padding: 3px 10px;
    border-radius: 12px;
    letter-spacing: 1px;
    box-shadow: 0 4px 10px rgba(255, 71, 87, 0.4);
}

.promo-icon {
    font-size: 2.4em;
    margin: 8px 0 4px 0;
    filter: drop-shadow(0 0 10px rgba(255, 165, 2, 0.4));
}

.deploy-promo-card h4 {
    color: #ffffff;
    font-size: 1.05em;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.deploy-promo-card p {
    color: #a4b0be;
    font-size: 0.8em;
    line-height: 1.4;
    margin-bottom: 12px;
    flex-grow: 1;
}

.promo-price {
    font-size: 1.3em;
    font-weight: 900;
    color: #2ecc71;
    margin-bottom: 12px;
}

.btn-promo-shop {
    background: rgba(255, 165, 2, 0.2);
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.8em;
    font-weight: 800;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    width: 100%;
    justify-content: center;
}

.btn-promo-shop:hover {
    background: var(--accent);
    color: #0b0c10;
    transform: scale(1.03);
    box-shadow: 0 4px 15px rgba(255, 165, 2, 0.4);
}

/* ==========================================================================
   RESPONSIVE (PORTRAIT & PETITS ÉCRANS)
   ========================================================================== */
@media screen and (max-width: 768px) {
    .deploy-main-layout {
        flex-direction: column;
    }
    
    .menu-box.deploy-modal-box {
        max-width: 440px;
    }

    .deploy-promo-card {
        margin-top: 10px;
    }
}

/* ==========================================
   🟢 HUD MINIMAP (EN HAUT À DROITE)
   ========================================== */
#top-right-ui {
    font-family: 'Segoe UI', Roboto, Helvetica, sans-serif;
}

#hud-players-container {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Les petits points spécifiques à la minimap du HUD (Ils sont générés en JS) */
#hud-players-container div {
    /* L'animation fait "clignoter" légèrement les points sur le radar */
    animation: radarPulse 2s infinite alternate;
}

@keyframes radarPulse {
    0% { opacity: 0.8; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
}