/* styles.css - Carte Interactive Sea of Thieves v2.1 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
    color: #fff;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== HEADER ===== */
.header {
    background: rgba(0, 0, 0, 0.9);
    padding: 1rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 200;
}

.header h1 {
    color: #ffd700;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
}

.header p {
    color: #cccccc;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.stats-bar {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.stat-item {
    background: linear-gradient(145deg, rgba(255, 215, 0, 0.15), rgba(255, 215, 0, 0.05));
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    border: 1px solid rgba(255, 215, 0, 0.4);
    transition: all 0.3s ease;
    cursor: default;
    backdrop-filter: blur(5px);
}

.stat-item:hover {
    background: linear-gradient(145deg, rgba(255, 215, 0, 0.25), rgba(255, 215, 0, 0.1));
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

/* ===== CONTENEUR CARTE ===== */
.map-container {
    position: relative;
    max-width: 1400px;
    margin: 2rem auto;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.map-wrapper {
    position: relative;
    width: 100%;
    height: 70vh;
    min-height: 500px;
    overflow: hidden;
    cursor: grab;
    background: radial-gradient(circle at center, #1a4b5c, #0f2027);
}

.map-wrapper:active {
    cursor: grabbing;
}

.map {
    position: absolute;
    width: 1200px;
    height: 900px;
    background-image: url('map_sot.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 3px solid rgba(255, 215, 0, 0.6);
    transform-origin: 0 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== GRILLE (cachée par défaut) ===== */
.grid-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0; /* Cachée par défaut */
    transition: opacity 0.3s ease;
}

.grid-line {
    position: absolute;
    background: rgba(0, 0, 0, 0.7); /* Lignes noires semi-transparentes */
}

.grid-line.vertical {
    width: 1px;
    height: 100%;
}

.grid-line.horizontal {
    width: 100%;
    height: 1px;
}

.grid-line.major {
    background: rgba(0, 0, 0, 0.9); /* Lignes principales plus sombres */
    width: 2px;
}

.grid-line.major.horizontal {
    height: 2px;
    width: 100%;
}

.grid-label {
    position: absolute;
    color: #000;
    font-size: 13px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.3);
}

/* ===== MARQUEURS JOUEURS AVEC EMOJIS ===== */
.player-marker {
    position: absolute;
    width: 30px;
    height: 30px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 50;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    border: 2px solid transparent;
}

.player-marker:hover {
    transform: translate(-50%, -50%) scale(1.3);
    z-index: 60;
}

.player-marker.normal {
    color: #4CAF50;
    border-color: #4CAF50;
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.5);
}

.player-marker.emissary {
    color: #FF4500;
    border-color: #FFD700;
    box-shadow: 0 0 20px rgba(255, 69, 0, 0.7);
    animation: emissary-pulse 2s infinite;
}

.player-marker.alliance {
    color: #9932CC;
    border-color: #DDA0DD;
    box-shadow: 0 0 15px rgba(153, 50, 204, 0.5);
}

/* ===== GESTION JOUEURS MULTIPLES SUR MÊME CASE ===== */
.player-stack {
    position: absolute;
    transform: translate(-50%, -50%);
}

.player-stack .player-marker {
    position: relative;
    transform: none;
    margin-bottom: 2px;
    z-index: 50;
}

.player-stack .player-marker:last-child {
    margin-bottom: 0;
}

.player-count-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    z-index: 100;
}

/* ===== MARQUEURS ÉVÉNEMENTS AVEC EMOJIS ===== */
.event-marker {
    position: absolute;
    cursor: pointer;
    transition: all 0.4s ease;
    z-index: 40;
    transform: translate(-50%, -50%);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(3px);
}

.event-marker:hover {
    transform: translate(-50%, -50%) scale(1.2);
    z-index: 45;
}

/* ===== MARQUEURS COMBAT AVEC EMOJIS ===== */
.combat-marker {
    position: absolute;
    width: 35px;
    height: 35px;
    z-index: 55;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: rgba(255, 0, 0, 0.2);
    backdrop-filter: blur(3px);
    cursor: pointer;
    transition: all 0.4s ease;
}

.combat-marker:hover {
    transform: translate(-50%, -50%) scale(1.2);
}

/* ===== ANIMATION POUR COMBAT ===== */
@keyframes combat-pulse {
    0%, 100% { 
        text-shadow: 0 0 15px #FF0000;
        filter: drop-shadow(0 0 10px #FF0000);
    }
    50% { 
        text-shadow: 0 0 25px #FFD700;
        filter: drop-shadow(0 0 15px #FFD700);
    }
} 28px;
    background: linear-gradient(45deg, #DC143C, #FF1493);
    border-radius: 4px;
    border: 3px solid #FF69B4;
    transform: translate(-50%, -50%) rotate(45deg);
    box-shadow: 0 0 25px rgba(220, 20, 60, 0.8);
    z-index: 45;
}

.event-megalodon:hover {
    transform: translate(-50%, -50%) rotate(45deg) scale(1.3);
    z-index: 50;
}

.event-ghost_fleet {
    width: 25px;
    height: 25px;
    background: linear-gradient(145deg, #2F4F4F, #708090);
    border: 3px solid #00CED1;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    box-shadow: 0 0 20px rgba(0, 206, 209, 0.7);
}

.event-fort_damned {
    width: 40px;
    height: 40px;
    background: linear-gradient(145deg, #8B0000, #DC143C);
    border: 3px solid #FFD700;
    border-radius: 8px;
    box-shadow: 0 0 35px rgba(220, 20, 60, 0.9);
    animation: fort-glow 2s infinite alternate;
}

/* ===== MARQUEURS COMBAT ===== */
.combat-marker {
    position: absolute;
    width: 40px;
    height: 40px;
    background: radial-gradient(circle, #FF0000, #FF6600);
    border: 4px solid #FFD700;
    border-radius: 50%;
    animation: combat-flash 1s infinite;
    z-index: 55;
    box-shadow: 0 0 40px rgba(255, 0, 0, 0.9);
    transform: translate(-50%, -50%);
}

.combat-marker::before {
    content: '⚔️';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    animation: combat-spin 2s linear infinite;
}

/* ===== TOOLTIP ===== */
.tooltip {
    position: absolute;
    background: linear-gradient(145deg, rgba(0, 0, 0, 0.95), rgba(20, 20, 20, 0.95));
    color: #fff;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    border: 2px solid #ffd700;
    z-index: 1000;
    pointer-events: none;
    max-width: 350px; /* Augmenté pour les tooltips multiples */
    line-height: 1.5;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
}

.tooltip::before {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #ffd700;
}

/* ===== CONTRÔLES GRILLE EN DIRECT ===== */
.grid-controls {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(145deg, rgba(0, 0, 0, 0.9), rgba(40, 40, 40, 0.9));
    color: #ffd700;
    padding: 15px 20px;
    border-radius: 10px;
    border: 2px solid rgba(255, 215, 0, 0.6);
    z-index: 100;
    backdrop-filter: blur(10px);
    display: none;
    min-width: 320px;
}

.grid-controls.active {
    display: block;
}

.grid-controls h4 {
    margin: 0 0 10px 0;
    text-align: center;
    font-size: 14px;
}

.grid-control-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 12px;
}

.grid-control-row label {
    min-width: 80px;
    font-weight: bold;
}

.grid-control-row input[type="range"] {
    flex: 1;
    height: 4px;
    background: rgba(255, 215, 0, 0.3);
    border-radius: 2px;
    outline: none;
}

.grid-control-row input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 12px;
    height: 12px;
    background: #ffd700;
    border-radius: 50%;
    cursor: pointer;
}

.grid-control-row input[type="number"] {
    width: 60px;
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 215, 0, 0.5);
    border-radius: 4px;
    color: #ffd700;
    font-size: 11px;
}

.grid-control-buttons {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    justify-content: center;
}

.grid-control-btn {
    background: linear-gradient(145deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.1));
    color: #ffd700;
    border: 1px solid rgba(255, 215, 0, 0.6);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.grid-control-btn:hover {
    background: linear-gradient(145deg, rgba(255, 215, 0, 0.3), rgba(255, 215, 0, 0.2));
    transform: translateY(-1px);
}
.controls {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 100;
}

.control-btn {
    background: linear-gradient(145deg, rgba(0, 0, 0, 0.8), rgba(40, 40, 40, 0.8));
    color: #ffd700;
    border: 2px solid rgba(255, 215, 0, 0.6);
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
    font-weight: bold;
    backdrop-filter: blur(5px);
}

.control-btn:hover {
    background: linear-gradient(145deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.1));
    border-color: #ffd700;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

/* ===== LÉGENDE ===== */
.legend {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background: linear-gradient(145deg, rgba(0, 0, 0, 0.9), rgba(20, 20, 20, 0.9));
    padding: 20px;
    border-radius: 12px;
    border: 2px solid rgba(255, 215, 0, 0.6);
    z-index: 100;
    backdrop-filter: blur(10px);
    max-width: 250px;
}

.legend h4 {
    color: #ffd700;
    margin-bottom: 15px;
    text-align: center;
    font-size: 14px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-size: 12px;
}

.legend-marker {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    border-radius: 50%;
    border: 2px solid #fff;
    flex-shrink: 0;
}

.legend-marker.storm {
    background: #4B0082;
    border-radius: 50%;
    width: 20px;
    height: 20px;
}

.legend-marker.megalodon {
    background: #DC143C;
    transform: rotate(45deg);
    border-radius: 3px;
}

.legend-marker.combat {
    background: #FF0000;
    width: 20px;
    height: 20px;
    animation: combat-flash 2s infinite;
}

/* ===== AUTO-REFRESH ===== */
.auto-refresh {
    position: absolute;
    top: 15px;
    left: 15px;
    background: linear-gradient(145deg, rgba(0, 0, 0, 0.8), rgba(40, 40, 40, 0.8));
    color: #ffd700;
    padding: 10px 14px;
    border-radius: 8px;
    border: 2px solid rgba(255, 215, 0, 0.6);
    font-size: 12px;
    font-weight: bold;
    z-index: 100;
    backdrop-filter: blur(5px);
}

.auto-refresh.updating {
    border-color: #00FF00;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.5);
}

.auto-refresh.stale {
    border-color: #FF8C00;
    color: #FF8C00;
    box-shadow: 0 0 15px rgba(255, 140, 0, 0.5);
}

/* ===== LOADING ===== */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 215, 0, 0.3);
    border-top: 4px solid #ffd700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ===== ANIMATIONS ===== */
@keyframes emissary-pulse {
    0%, 100% { 
        opacity: 1; 
        box-shadow: 0 0 25px rgba(255, 69, 0, 0.9);
    }
    50% { 
        opacity: 0.8; 
        box-shadow: 0 0 35px rgba(255, 69, 0, 1);
    }
}

@keyframes storm-pulse {
    0%, 100% { 
        box-shadow: 0 0 30px rgba(138, 43, 226, 0.8);
        transform: translate(-50%, -50%) scale(1);
    }
    50% { 
        box-shadow: 0 0 40px rgba(138, 43, 226, 1);
        transform: translate(-50%, -50%) scale(1.05);
    }
}

@keyframes combat-flash {
    0%, 100% { background: radial-gradient(circle, #FF0000, #FF6600); }
    50% { background: radial-gradient(circle, #FF6600, #FFD700); }
}

@keyframes combat-spin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes fort-glow {
    from { box-shadow: 0 0 35px rgba(220, 20, 60, 0.9); }
    to { box-shadow: 0 0 50px rgba(255, 215, 0, 0.9); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.4rem;
    }
    
    .stats-bar {
        gap: 1rem;
    }
    
    .stat-item {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .map-container {
        margin: 1rem;
        border-radius: 10px;
    }
    
    .map-wrapper {
        height: 60vh;
        min-height: 400px;
    }
    
    .legend, .controls {
        position: static;
        margin: 1rem;
    }
    
    .legend {
        max-width: none;
    }
    
    .controls {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 0.8rem;
    }
    
    .stats-bar {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    .player-marker {
        width: 18px;
        height: 18px;
    }
    
    .tooltip {
        font-size: 11px;
        padding: 8px 12px;
        max-width: 200px;
    }
}

/* ===== EASTER EGGS ===== */
.shrouded-ghost {
    animation: shrouded-ghost-rare 3s infinite;
}

@keyframes shrouded-ghost-rare {
    0%, 90%, 100% { opacity: 1; }
    95% { opacity: 0.3; }
}

.kraken-encounter {
    animation: kraken-tentacles 4s infinite;
}

@keyframes kraken-tentacles {
    0%, 100% { transform: translate(-50%, -50%) scale(1) rotate(0deg); }
    25% { transform: translate(-50%, -50%) scale(1.1) rotate(5deg); }
    75% { transform: translate(-50%, -50%) scale(0.9) rotate(-5deg); }
}