body { background-color: #2b2b2b; color: #ffffff; font-family: 'Exo 2', sans-serif; margin: 0; display: flex; height: 100vh; overflow: hidden; position: relative; }

h1, h2, h3, .upgrade-name, #map-title { font-family: 'Russo One', sans-serif; font-weight: normal; letter-spacing: 0.5px; }

#main-flag {
    position: absolute; top: 15px; left: 15px; z-index: 1000;
    width: 120px; height: 80px; border-radius: 6px; 
    background: linear-gradient(to bottom, #ffffff 33.3%, #0039a6 33.3%, #0039a6 66.6%, #d52b1e 66.6%); 
    box-shadow: 0 6px 15px rgba(0,0,0,0.6); border: 2px solid #111;
    transition: background 0.6s ease;
}

#main-flag-symbol {
    display: none; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    color: #ffd700; font-size: 45px; line-height: 1; user-select: none; font-family: sans-serif;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
}


#music-player {
    position: absolute; top: 15px; right: 15px; z-index: 1000;
    background: #1e1e1e; border: 1px solid #444; border-radius: 4px;
    padding: 4px 10px; display: flex; align-items: center; gap: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}
#music-title { font-size: 0.75em; color: #bbb; max-width: 130px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: 'Exo 2', sans-serif; }
.music-controls { display: flex; gap: 4px; }
.music-controls button { background: #333; color: #fff; border: 1px solid #555; cursor: pointer; padding: 2px 6px; border-radius: 3px; font-size: 0.7em; font-family: 'Exo 2', sans-serif;}
.music-controls button:hover { background: #444; border-color: #777; }


#btn-settings {
    position: fixed; bottom: 15px; left: 15px; z-index: 1001;
    background: #333; border: 2px solid #555;
    width: 50px; height: 50px; border-radius: 50%; cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.6); transition: transform 0.2s, background 0.2s;
    display: flex; align-items: center; justify-content: center;
}
#btn-settings:hover { transform: rotate(45deg); background: #444; }

#settings-menu {
    position: fixed; bottom: 75px; left: 15px; z-index: 1000;
    background: #1a1a1a; border: 2px solid #555; border-radius: 8px;
    padding: 15px; display: none; flex-direction: column; gap: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.9); width: 180px;
}

.dev-btn { 
    background-color: #d32f2f; color: white; border: none; font-weight: bold; 
    padding: 8px 12px; cursor: pointer; border-radius: 4px; font-family: 'Exo 2', sans-serif; 
    width: 100%; box-sizing: border-box; transition: background 0.2s;
}
.dev-btn:hover { background-color: #b71c1c; }

#credits-panel {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: #1a1a1a; border: 2px solid #ff5252; padding: 25px; border-radius: 8px;
    z-index: 2000; width: 350px; text-align: center; box-shadow: 0px 10px 40px rgba(0,0,0,0.9);
}
#credits-panel h2 { color: #ff5252; margin-top: 0; margin-bottom: 15px; }
#credits-content { color: #ddd; font-size: 0.95em; line-height: 1.6; text-align: left; background: #252525; padding: 15px; border-radius: 4px; }

#debug-panel { 
    position: fixed; top: 105px; left: 15px; background: #1a1a1a; border: 2px solid #9c27b0; 
    padding: 15px; border-radius: 8px; z-index: 1000; display: none; width: 250px; 
    box-shadow: 0px 5px 15px rgba(0,0,0,0.9); 
}
#debug-panel h3 { margin-top: 0; color: #9c27b0; font-size: 1.1em; margin-bottom: 15px; border-bottom: 1px solid #444; padding-bottom: 5px; }
.debug-action { background: #333; color: white; border: 1px solid #555; padding: 8px; cursor: pointer; border-radius: 4px; width: 100%; margin-bottom: 10px; font-weight: bold; font-family: 'Exo 2', sans-serif; box-sizing: border-box; }
.debug-action:hover { background: #555; }
.debug-action.cheat { color: #ffd700; border-color: #ffd700; }

#editor-panel { position: fixed; top: 105px; left: 15px; background: #111; border: 2px solid #4CAF50; padding: 15px; border-radius: 8px; z-index: 1000; display: none; width: 300px; box-shadow: 0px 5px 15px rgba(0,0,0,0.9); }
#editor-panel h3 { margin-top: 0; color: #4CAF50; font-size: 1.1em; margin-bottom: 10px; }
#editor-output { width: 100%; height: 80px; background: #222; color: #0f0; border: 1px solid #555; padding: 5px; font-family: monospace; resize: none; margin-bottom: 10px; box-sizing: border-box; }
.editor-action { background: #333; color: white; border: 1px solid #666; padding: 5px 10px; cursor: pointer; border-radius: 4px; font-weight: bold; font-family: 'Exo 2', sans-serif;}
.editor-action:hover { background: #555; }
#zoom-container { margin-bottom: 10px; background: #222; padding: 10px; border-radius: 4px; border: 1px solid #444; margin-top: 10px; }
#zoom-slider, #debug-speed { width: 100%; cursor: pointer; }

#game-area { flex: 2; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 6vh; position: relative; padding-bottom: 20px; overflow-y: auto; }

#news-ticker {
    background: rgba(0, 0, 0, 0.4); border: 1px solid #444; border-radius: 4px;
    width: 85%; max-width: 750px; padding: 8px 15px; margin-bottom: 2vh;
    text-align: center; font-size: 0.9em; color: #ddd; font-style: italic;
    min-height: 22px; box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    transition: opacity 0.5s;
}

#score-container { font-size: 3em; font-weight: bold; font-variant-numeric: tabular-nums; font-family: 'Russo One', sans-serif;}
#score { color: #ffd700; text-shadow: 0px 2px 4px rgba(0,0,0,0.5);}
#cps-container { font-size: 1.4em; color: #ffffff; margin-bottom: 10px; font-weight: bold; font-variant-numeric: tabular-nums; text-shadow: 0px 1px 2px rgba(0,0,0,0.5);}

#bonus-container { 
    font-size: 1.1em; background: transparent; border: 1px solid transparent; 
    border-radius: 6px; padding: 6px 12px; font-variant-numeric: tabular-nums; 
    cursor: help; user-select: none; margin-bottom: 5px; 
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8); transition: background 0.2s, border 0.2s;
}
#bonus-container:hover { border-color: #555; background: rgba(255, 255, 255, 0.05); }

#guerre-container { color: #ff5252; font-weight: bold; font-size: 0.9em; min-height: 20px; text-align: center; margin-top: 5px; }

#potato { font-size: 80px; cursor: pointer; user-select: none; transition: transform 0.05s; filter: drop-shadow(0px 10px 10px rgba(0,0,0,0.5)); margin-bottom: 5px; z-index: 10; position: relative; }
#potato:active { transform: scale(0.9); }

#map-container { 
    width: 85%; max-width: 650px; 
    margin: 10px auto auto auto; 
    border: 2px solid #333; border-radius: 8px; background-color: #000; 
    box-shadow: 0px 10px 30px rgba(0,0,0,0.8); display: flex; flex-direction: column; 
}
#map-title { background-color: #1a1a1a; padding: 7px 0; text-align: center; font-size: 1em; color: #aaa; text-transform: uppercase; border-bottom: 1px solid #333; z-index: 2; transition: color 0.5s;}
#map-viewport { position: relative; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; cursor: grab; }
#map-viewport:active { cursor: grabbing; }
#map-content { position: absolute; top: 0; left: 0; width: 100%; height: 100%; transform-origin: 0 0; }
#map-image { display: block; width: 100%; height: auto; pointer-events: none; }
#map-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }

.map-region { transition: opacity 0.5s ease-out, fill 0.5s; stroke: #111; stroke-width: 1; stroke-linejoin: round; opacity: 0.8; cursor: pointer; pointer-events: auto; }
.map-region:hover { stroke: #fff; stroke-width: 2; } 
.edit-mode .map-region { cursor: crosshair; } 

#editor-polygon { fill: rgba(76, 175, 80, 0.4); stroke: #4CAF50; stroke-width: 2; pointer-events: none; }
#editor-handles circle:hover { fill: #ffeb3b; stroke: #ff9800; cursor: move; }

/* BOUTIQUE ET ACCORDÉONS */
#shop-area { flex: 1; background-color: #1a1a1a; border-left: 4px solid #e53935; padding: 20px; overflow-y: auto; height: 100vh; box-sizing: border-box; }

.shop-category {
    background-color: #252525; border-radius: 8px; margin-bottom: 15px; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.3); border: 1px solid #444;
}
.shop-category summary {
    padding: 15px; cursor: pointer; font-family: 'Russo One', sans-serif; font-size: 1.1em; color: #ddd; 
    user-select: none; border-bottom: 1px solid transparent; list-style: none; display: flex; 
    justify-content: space-between; align-items: center; transition: background-color 0.2s; border-radius: 8px;
}
.shop-category summary::-webkit-details-marker { display: none; }
.shop-category summary::after { content: '▼'; font-size: 0.8em; transition: transform 0.3s; }
.shop-category[open] summary::after { transform: rotate(180deg); }
.shop-category[open] summary { border-bottom: 1px solid #444; background-color: rgba(0,0,0,0.2); border-radius: 8px 8px 0 0; }
.category-content { padding: 15px; display: flex; flex-direction: column; gap: 10px; }

/* Code couleur des catégories */
#cat-ideologie { border-color: #ff5252; }
#cat-ideologie summary { color: #ff5252; text-shadow: 1px 1px 2px #000; }

#cat-clic { border-color: #ffd700; } 
#cat-clic summary { color: #ffd700; text-shadow: 1px 1px 2px #000; }

#cat-boutique { border-color: #ff5252; } 
#cat-boutique summary { color: #ff5252; text-shadow: 1px 1px 2px #000; }

#cat-expansion { border-color: #ffd700; } 
#cat-expansion summary { color: #ffd700; text-shadow: 1px 1px 2px #000; }

#cat-acquis { border-color: #ff5252; } 
#cat-acquis summary { color: #ff5252; text-shadow: 1px 1px 2px #000; }

.upgrade-btn { position: relative; background-color: #333; border: 1px solid #555; color: white; padding: 10px; margin-bottom: 0; width: 100%; text-align: left; cursor: pointer; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; font-family: 'Exo 2', sans-serif; box-sizing: border-box;}
.upgrade-btn:hover { background-color: #444; }
.upgrade-btn:disabled { background-color: #222; color: #666; cursor: not-allowed; border-color: #333; }
.upgrade-info { display: flex; flex-direction: column; pointer-events: none; width: 100%; }
.upgrade-name { font-weight: bold; font-size: 1.1em; color: #eee; display: flex; align-items: center;}
.upgrade-desc { font-size: 0.8em; color: #888; margin-top: 3px; }
.upgrade-cost { color: #ff5252; font-weight: bold; margin-top: 5px; font-family: 'Russo One', sans-serif; display: flex; align-items: center;}
.upgrade-count { font-size: 1.5em; color: #ffd700; font-weight: bold; background: #444; padding: 5px 15px; border-radius: 5px; pointer-events: none; font-family: 'Russo One', sans-serif;}

.special-upgrade { border: 1px solid #ffd700; background-color: #4a3f00; }
.party-upgrade { border: 1px solid #ff5252; background-color: #421010; }
.party-upgrade:hover { background-color: #5c1616; }
.click-upgrade { border: 1px solid #ffd700; background-color: #4a3f00; }
.click-upgrade:hover { background-color: #5e5000; }

/* CENSURE SOVIÉTIQUE */
.upgrade-btn.censored {
    background-color: #111 !important;
    border: 1px solid #000 !important;
    cursor: not-allowed !important;
    background-image: repeating-linear-gradient(45deg, #1a1a1a 0, #1a1a1a 10px, #111 10px, #111 20px) !important;
}
.upgrade-btn.censored .upgrade-info, 
.upgrade-btn.censored .upgrade-count {
    visibility: hidden; 
}
.upgrade-btn.censored::after {
    content: '████ CLASSIFIÉ ████';
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    color: #ff5252; font-family: 'Russo One', sans-serif; font-size: 1.1em;
    letter-spacing: 2px; text-shadow: 1px 1px 2px #000; visibility: visible;
}

#acquis-container { display: flex; flex-direction: column; gap: 5px; }
.acquis-item {
    background-color: transparent; border: none; border-bottom: 1px dashed #555;
    padding: 6px 8px; color: #ddd; font-size: 0.9em; font-family: 'Exo 2', sans-serif;
    margin: 0; text-align: left; cursor: help; transition: background 0.2s;
}
.acquis-item:hover { background-color: rgba(255,255,255,0.05); }

/* TOOLTIP */
#global-tooltip {
    position: fixed; background-color: #1a1a1a; color: #fff; text-align: left; border: 2px solid #e53935;
    padding: 12px; border-radius: 8px; z-index: 9999; min-width: 250px; pointer-events: auto; 
    display: none; box-shadow: -5px 5px 20px rgba(0,0,0,0.9); font-size: 0.95em; line-height: 1.5;
}
.tooltip-upgrade-btn { margin-top: 10px; width: 100%; cursor: pointer; background: #4CAF50; border: none; color: white; padding: 8px; border-radius: 4px; font-weight: bold; font-family: 'Exo 2', sans-serif; letter-spacing: 0.5px;}
.tooltip-upgrade-btn:hover { background: #45a049; }
.tooltip-upgrade-btn:disabled { background: #555; color: #888; cursor: not-allowed; }

.flag-icon { display:inline-flex; align-items:center; justify-content:center; width:22px; height:15px; border:1px solid #777; border-radius:2px; vertical-align:middle; margin-right:6px; box-shadow: 0 1px 2px rgba(0,0,0,0.5); overflow:hidden;}
.flag-bielorussie { background: linear-gradient(to bottom, #d52b1e 66%, #009739 66%); }
.flag-ukraine { background: linear-gradient(to bottom, #0057b7 50%, #ffd700 50%); }
.flag-baltes { background: linear-gradient(to bottom, #0072ce 33%, #000 33%, #000 66%, #fff 66%); }

/* --- RÉGLAGE DE LA GRILLE DU PARTI ET CLIC --- */
#ideologie-upgrades-container,
#click-upgrades-container {
    display: flex;
    flex-direction: row !important; /* Force l'affichage de gauche à droite */
    flex-wrap: wrap;
    gap: 10px;
}

#ideologie-upgrades-container .upgrade-btn,
#click-upgrades-container .upgrade-btn {
    width: 130px; 
    height: 110px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 8px;
    box-sizing: border-box;
}

#ideologie-upgrades-container .upgrade-info,
#click-upgrades-container .upgrade-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

#ideologie-upgrades-container .upgrade-name,
#click-upgrades-container .upgrade-name,
#ideologie-upgrades-container .upgrade-cost,
#click-upgrades-container .upgrade-cost {
    display: flex;
    justify-content: center !important; 
    align-items: center;
    width: 100%;
    text-align: center;
}

/* On masque la longue description dans le bouton pour que ça rentre dans le carré */
#click-upgrades-container .upgrade-desc {
    display: none;
}

.upgrade-icon {
    width: 30px;         
    height: auto;        
    margin-right: 10px;  
    vertical-align: middle;
}


.upgrade-name {
    display: flex;
    align-items: center; 
}

.victoire-pulsation {
    animation: pulse-red 3s infinite alternate;
}


#ideologie-upgrades-container .upgrade-info {
    align-items: center; 
    width: 100%;
}

#ideologie-upgrades-container .upgrade-cost {
    justify-content: center; 
    width: 100%;
}

#clic-upgrades-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
}

/* pno de save */
#save-menu {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: #1a1a1a; border: 2px solid #d32f2f; padding: 25px; border-radius: 8px;
    z-index: 2000; width: 350px; text-align: left; box-shadow: 0px 10px 40px rgba(0,0,0,0.9);
}
#save-menu h2 { color: #d32f2f; margin-top: 0; margin-bottom: 15px; text-align: center; }

/* --- EMPLACEMENT PUBLICITAIRE (SKYSCRAPER) --- */
#left-ad-container {
    position: fixed;
    top: 110px; /* S'aligne juste sous ton drapeau (15px + 80px + 15px de marge) */
    bottom: 80px; /* S'arrête juste au-dessus du bouton de paramètres */
    left: 15px;
    width: 120px; /* Exactement la même largeur que ton drapeau principal */
    z-index: 10; /* Important : plus bas que 1000 pour que le menu Éditeur/Debug passe par-dessus */
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

@media (max-width: 1000px) {
    body { 
        flex-direction: column; 
        height: auto;           
        overflow-y: auto;       
        overflow-x: hidden;     
    }
    
    #game-area { 
        width: 100%; 
        flex: none;
        padding-top: 120px;     
        overflow-y: visible;    
    }
    
    #shop-area { 
        width: 100%; 
        flex: none;
        height: auto; 
        border-left: none; 
        border-top: 4px solid #e53935; 
        overflow-y: visible;    
    }

#left-ad-container {
        position: relative; 
        top: 0;
        left: 0;
        width: 100%;       
        height: auto;      
        margin: 20px 0;    
        display: flex;     
        order: 1;          
    }
}

    #map-container {
        width: 95%; 
        margin-bottom: 40px;
    }
