/* ==================== ÉCRAN DE CHARGEMENT ==================== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    animation: fadeIn 0.5s ease-in;
}

.loading-logo {
    width: 150px;
    height: 150px;
    object-fit: contain;
    filter: drop-shadow(0 10px 30px rgba(0,0,0,0.3));
    animation: pulse 2s ease-in-out infinite;
    margin-bottom: 20px;
}

.loading-title {
    color: white;
    font-size: 3em;
    font-family: 'Cinzel', serif;
    margin: 20px 0;
    text-shadow: 0 4px 12px rgba(0,0,0,0.3);
    animation: slideDown 0.8s ease-out;
}

.loading-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 30px auto;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1.5s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.spinner-ring:nth-child(1) {
    animation-delay: -0.45s;
}

.spinner-ring:nth-child(2) {
    animation-delay: -0.3s;
    border-top-color: rgba(255,255,255,0.7);
}

.spinner-ring:nth-child(3) {
    animation-delay: -0.15s;
    border-top-color: rgba(255,255,255,0.4);
}

.loading-text {
    color: white;
    font-size: 1.2em;
    margin-top: 20px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* ==================== MODERNISATION UI GLOBALE ==================== */
button, .btn {
    background: var(--button-bg);
    color: #0a0a0a;
    border: none;
    border-radius: var(--button-radius);
    box-shadow: var(--button-shadow);
    padding: 10px 22px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
    outline: none;
    margin: 4px 0;
    letter-spacing: 0.5px;
    min-width: 120px;
    min-height: 40px;
    display: inline-block;
    text-align: center;
    -ms-user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    position: relative;
}
button:hover, .btn:hover {
    background: var(--button-hover);
    box-shadow: 0 4px 16px rgba(102,126,234,0.18);
    transform: translateY(-2px) scale(1.03);
}
button:focus, .btn:focus {
    outline: var(--focus-outline);
}
input, select, textarea {
    background: var(--input-bg);
    border: 1.5px solid var(--input-border);
    border-radius: var(--input-radius);
    padding: 8px 12px;
    font-size: 1em;
    transition: border 0.2s, box-shadow 0.2s;
    color: #F5F5F5;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--input-focus);
    outline: var(--focus-outline);
}
::-webkit-scrollbar {
    width: 10px;
    background: var(--scrollbar-track);
}
::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 8px;
}
.notification, .overlay, .modal-overlay {
    border-radius: var(--main-radius);
    box-shadow: var(--main-shadow);
}

/* ==================== HIÉRARCHIE DES Z-INDEX ====================
 * Pour éviter la superposition de modaux :
 * - Éléments normaux : z-index 1-999
 * - Modal de conquête (.modal-overlay) : z-index 9000
 * - Modal de notification (.overlay) : z-index 10000-10001 (priorité maximale)
 * - Le système JavaScript vérifie qu'un seul modal soit actif à la fois
 * ================================================================ */

/* ==================== OVERLAY NOTIFICATION ==================== */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.85);
    z-index: 10000;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    overflow-y: auto;
}

.overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}

.notification-modal {
    background: white;
    padding: 0;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow: hidden;
    overflow-y: auto;
    transform: scale(0.7);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    color: #2c3e50;
}

.notification-header {
    background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
    color: white;
    padding: 25px 30px;
    border-radius: 16px 16px 0 0;
    border-bottom: 3px solid #D4AF37;
}

.notification-header h2 {
    margin: 0;
    font-size: 1.5em;
    font-weight: 700;
}

.notification-content {
    padding: 30px;
    font-size: 1.05em;
    line-height: 1.6;
    color: #333;
}

.notification-buttons {
    display: flex;
    gap: 15px;
    padding: 20px 30px 30px;
    justify-content: flex-end;
}

.notification-buttons .btn {
    padding: 12px 30px;
    font-size: 1em;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.notification-buttons .btn-primary {
    background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
    color: white;
}

.notification-buttons .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.4);
}

.notification-buttons .btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.notification-buttons .btn-secondary:hover {
    background: #d0d0d0;
}

.notification-modal, .conquest-modal {
    border-radius: var(--main-radius);
    box-shadow: var(--main-shadow);
}
.army-section, .diplomacy-section {
    background: var(--main-content-bg);
    border-radius: var(--main-content-radius);
    box-shadow: var(--main-content-shadow);
    padding: var(--main-content-padding);
    margin-bottom: var(--main-content-margin);
}
.click-hint {
    font-style: italic;
    opacity: 0.85;
}
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@700&family=Open+Sans:wght@400;600&display=swap');

/* ==================== VARIABLES & RESET ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --kingdom-primary: #FFD700;
    --kingdom-secondary: #4169E1;
    --empire-primary: #800080;
    --empire-secondary: #000000;
    --horde-primary: #DC143C;
    --horde-secondary: #DEB887;
    --republic-primary: #228B22;
    --republic-secondary: #FFFFFF;
    
    /* Couleurs Noir/Doré/Violet */
    --primary-color: #8B5CF6;
    --secondary-color: #7C3AED;
    --accent-gold: #D4AF37;
    --accent-gold-light: #F4D03F;
    --success-color: #10B981;
    --danger-color: #EF4444;
    --warning-color: #F59E0B;
    
    --panel-bg: rgba(20, 20, 20, 0.95);
    --shadow: 0 10px 30px rgba(0,0,0,0.6);
    --shadow-hover: 0 15px 40px rgba(212, 175, 55, 0.3);
    
    /* Boutons */
    --button-bg: linear-gradient(135deg, #D4AF37 0%, #C9A227 100%);
    --button-text: #0a0a0a;
    --button-hover: linear-gradient(135deg, #F4D03F 0%, #D4AF37 100%);
    --button-radius: 10px;
    --button-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
    
    /* Inputs */
    --input-bg: #1a1a1a;
    --input-border: #D4AF37;
    --input-focus: #F4D03F;
    --input-radius: 8px;
    
    /* Focus */
    --focus-outline: 2px solid #D4AF37;
    
    /* Scrollbar */
    --scrollbar-track: #1a1a1a;
    --scrollbar-thumb: #8B5CF6;
    
    /* Modals et overlays */
    --main-radius: 16px;
    --main-shadow: 0 20px 60px rgba(0,0,0,0.5);
    
    /* Main content */
    --main-content-bg: rgba(26, 26, 26, 0.95);
    --main-content-radius: 15px;
    --main-content-shadow: 0 10px 30px rgba(212, 175, 55, 0.15);
    --main-content-padding: 20px;
    --main-content-margin: 20px;
}

body {
    font-family: 'Open Sans', sans-serif;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #0a0a0a 100%);
    color: #F5F5F5;
    overflow-x: hidden;
    min-height: 100vh;
}

h1, h2, h3 {
    font-family: 'Cinzel', serif;
}

/* ==================== LAYOUT PRINCIPAL ==================== */
.game-wrapper {
    max-width: 1600px;
    margin: 0 auto;
    padding: 10px;
}

/* ==================== HEADER ==================== */
header, .game-header {
    /* background: linear-gradient(135deg, 
        rgba(90, 61, 122, 0.95) 0%, 
        rgba(118, 75, 162, 0.97) 35%, 
        rgba(102, 126, 234, 0.95) 70%, 
        rgba(90, 61, 122, 0.95) 100%); */
    background: #0a0a0a;
    padding: 25px 30px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4), 
                0 0 0 1px rgba(244, 197, 66, 0.3) inset,
                0 5px 20px rgba(244, 197, 66, 0.2);
    margin-top: 100px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    z-index: 10;
    border: 2px solid rgba(244, 197, 66, 0.3);
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, 
        #F4C542 0%, 
        #FFD966 25%, 
        #667eea 50%, 
        #FFD966 75%, 
        #F4C542 100%);
    box-shadow: 0 2px 10px rgba(244, 197, 66, 0.5);
}

.empire-info {
    flex: 1;
    min-width: 250px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.empire-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.2));
}

.empire-name {
    color: #FFD700;
    font-size: 2em;
    text-shadow: 2px 2px 8px rgba(244, 197, 66, 0.5);
    margin: 0 0 10px 0;
    font-weight: 800;
}

.prestige-info {
    font-size: 0.95em;
    color: rgba(255,255,255,0.9);
    font-weight: 600;
}

.prestige-info span {
    color: #FFD700;
    font-weight: 700;
}

.faction-display {
    display: flex;
    align-items: center;
    gap: 15px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    padding: 15px 25px;
    border-radius: 12px;
    border: 2px solid var(--primary-color);
}

.faction-icon {
    font-size: 2.5em;
    line-height: 1;
}

.faction-name {
    font-size: 1.2em;
    font-weight: 700;
    color: #FFD700;
}

.btn-change-faction {
    margin-left: 10px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(102,126,234,0.3);
}

.btn-change-faction:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102,126,234,0.4);
    background: linear-gradient(135deg, #5568d3, #6a4091);
}

.btn-change-faction:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(102,126,234,0.3);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.empire-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.empire-flag {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid #FFD700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

h1 {
    color: var(--primary-color);
    font-size: 2em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.empire-stats {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.stat-badge {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    padding: 8px 15px;
    border-radius: 20px;
    color: white;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    font-size: 0.9em;
    transition: transform 0.3s;
}

.stat-badge:hover {
    transform: translateY(-2px);
}

/* ==================== RESSOURCES ==================== */
.resources-panel {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 1.2rem;
    margin-bottom: 0;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    z-index: 1000;
    background: linear-gradient(135deg, #1a1d2e 0%, #2d3250 100%);
    box-shadow: 0 4px 20px rgba(0,0,0,0.25), 0 0 0 1px rgba(212, 175, 55, 0.2) inset;
    padding: 8px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    overflow-x: auto;
    overflow-y: hidden;
}

.resources-panel::-webkit-scrollbar {
    display: none;
}

/* Ajout d'un espace sous la barre de ressources pour éviter le chevauchement */
.resources-panel-spacer {
    height: 90px;
    width: 100%;
}


/* Header - ne pas dupliquer les styles, voir la définition principale plus haut */


.resource-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 249, 250, 0.95) 100%);
    padding: 8px 14px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3), 0 0 0 1px rgba(212, 175, 55, 0.3) inset;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-width: 150px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(212, 175, 55, 0.4);
    -ms-user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    text-align: left;
    /* Annuler les styles de bouton par défaut */
    margin: 0;
    font-size: inherit;
    font-weight: inherit;
    letter-spacing: normal;
}

.resource-card.clickable {
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

.resource-card.clickable:focus {
    outline: 2px solid rgba(102,126,234,0.5);
    outline-offset: 2px;
}

.resource-card.clickable:hover {
    box-shadow: 0 8px 24px rgba(212, 175, 55, 0.3), 0 0 0 1px rgba(212, 175, 55, 0.6) inset, 0 0 20px rgba(212, 175, 55, 0.5);
    transform: translateY(-2px) scale(1.02);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(139, 92, 246, 0.1) 100%);
    border: 2px solid rgba(212, 175, 55, 0.8);
}

.resource-card.clickable:active {
    transform: translateY(-2px) scale(0.98);
    transition: all 0.1s ease;
}

.click-hint {
    position: absolute;
    bottom: 5px;
    right: 10px;
    font-size: 0.7em;
    color: rgba(255,255,255,0.6);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.resource-card.clickable:hover .click-hint {
    opacity: 1;
}

.resource-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    opacity: 0.9;
}

.resource-card.gold::before {
    background: linear-gradient(90deg, #ffd700, #ffed4e, #ffa500);
    box-shadow: 0 0 10px rgba(255,215,0,0.5);
}

.resource-card.food::before {
    background: linear-gradient(90deg, #5efc82, #7affa5, #00d4aa);
    box-shadow: 0 0 10px rgba(94,252,130,0.5);
}

.resource-card.science::before {
    background: linear-gradient(90deg, #4facfe, #00f2fe, #43e8ff);
    box-shadow: 0 0 10px rgba(79,172,254,0.5);
}

.resource-card.army::before {
    background: linear-gradient(90deg, #ff6b6b, #ff5252, #ee5a24);
    box-shadow: 0 0 10px rgba(255,107,107,0.5);
}

.resource-card.faction::before {
    background: linear-gradient(90deg, #a18cd1, #fbc2eb, #f093fb);
    box-shadow: 0 0 10px rgba(161,140,209,0.5);
}

.resource-card .resource-icon {
    font-size: 1.8em;
    line-height: 1;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4));
}

.resource-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.resource-name {
    font-size: 0.65em;
    color: #C9A227;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 2px;
    text-shadow: 0 1px 2px rgba(212, 175, 55, 0.3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.resource-amount {
    font-size: 1.2em;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.1;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    white-space: nowrap;
}

.resource-rate {
    font-size: 0.65em;
    color: #2c3e50;
    margin-top: 2px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(255,255,255,0.5);
    white-space: nowrap;
}

.resource-rate.rate-positive {
    color: #5efc82;
    text-shadow: 0 0 8px rgba(94,252,130,0.5);
}

.resource-rate.rate-negative {
    color: #ff6b6b;
    text-shadow: 0 0 8px rgba(255,107,107,0.5);
}

/* ==================== LAYOUT PRINCIPAL ==================== */
.main-content {
    display: grid;
    grid-template-columns: 350px 1fr 300px;
    gap: 15px;
    margin-top: 0;
    padding-top: 10px;
}

@media (max-width: 1400px) {
    .main-content {
        grid-template-columns: 300px 1fr 250px;
    }
}

@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

.left-panel, .center-panel, .right-panel {
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.95) 0%, rgba(20, 20, 20, 0.95) 100%);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(212, 175, 55, 0.15);
    border: 2px solid rgba(212, 175, 55, 0.3);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.panel-header {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(212, 175, 55, 0.5);
}

.panel-header h2 {
    color: #D4AF37;
    font-size: 1.5em;
    text-shadow: 0 2px 8px rgba(212, 175, 55, 0.5);
    margin: 0;
}

.resources-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.resource {
    padding: 15px 20px;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    transition: transform 0.3s;
    position: relative;
    overflow: hidden;
}

.resource:hover {
    transform: translateY(-3px);
}

.resource::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0%, 100% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    50% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.resource.gold {
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
}

.resource.food {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.resource.science {
    background: linear-gradient(135deg, #89f7fe 0%, #66a6ff 100%);
}

.resource-icon {
    font-size: 1.5em;
    margin-right: 8px;
}

.resource-label {
    font-size: 0.85em;
    opacity: 0.9;
    display: block;
    margin-bottom: 5px;
}

.resource-value {
    font-size: 1.8em;
    display: block;
    font-weight: 700;
}

.resource-rate {
    font-size: 0.8em;
    opacity: 0.85;
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.rate-positive {
    color: #00ff00;
}

.rate-negative {
    color: #ff4444;
}

/* ==================== ONGLETS ==================== */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    overflow-x: auto;
    padding-bottom: 5px;
}

.tab-button {
    padding: 12px 20px;
    border: 2px solid rgba(244, 197, 66, 0.3);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, border 0.18s, box-shadow 0.18s, transform 0.18s;
    font-weight: 600;
    font-size: 1em;
    color: #F4D03F;
    outline: none;
    flex-shrink: 0;
}

.tab-button:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    border-color: #F4D03F;
    color: #FFD700;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(244, 197, 66, 0.3);
}

.tab-button.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #FFFFFF;
    border-color: var(--primary-color);
    cursor: default;
}

.tab-button.active:hover {
    transform: none;
    box-shadow: none;
}

.tab-content {
    min-height: 400px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ==================== CONTRÔLES DU JEU ==================== */
.game-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #667eea 100%);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #5a6268 0%, #3d4349 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
}

/* Boutons de sélection de faction */
.btn-select-faction {
    transition: all 0.2s ease !important;
}

.btn-select-faction:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
    filter: brightness(1.1);
}

.btn-select-faction:active {
    transform: scale(0.98) !important;
}

/* ==================== FILTRES BÂTIMENTS ==================== */
.buildings-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 15px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    font-size: 0.85em;
    color: #666;
}

.filter-btn:hover {
    background: #f0f0f0;
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-color: var(--primary-color);
    cursor: default;
}

.filter-btn.active:hover {
    transform: none;
    box-shadow: none;
}

/* ==================== GRILLE BÂTIMENTS ==================== */
.buildings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
}

/* ==================== STATS RAPIDES ==================== */
.quick-stats {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 15px;
    border-radius: 10px;
    margin-top: 15px;
}

.quick-stats h3 {
    color: var(--primary-color);
    font-size: 1.1em;
    margin-bottom: 15px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    font-size: 0.95em;
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-row span:first-child {
    color: #666;
    font-weight: 600;
}

.stat-row span:last-child {
    color: #333;
    font-weight: 700;
}

/* ==================== MESSAGES LOG ==================== */
.log-messages {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.log-entry {
    padding: 10px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 4px solid var(--primary-color);
    border-radius: 5px;
    font-size: 0.85em;
    color: #333;
    line-height: 1.4;
    animation: slideInRight 0.3s;
}

.log-entry.log-info {
    border-left-color: #17a2b8;
}

.log-entry.log-success {
    border-left-color: #28a745;
}

.log-entry.log-warning {
    border-left-color: #ffc107;
}

.log-entry.log-error {
    border-left-color: #dc3545;
}

/* ==================== LAYOUT GRILLE ==================== */
.main-layout {
    display: grid;
    grid-template-columns: 2.5fr 1fr;
    gap: 15px;
}

.left-panel, .right-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.panel {
    background: var(--panel-bg);
    padding: 20px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    animation: fadeInUp 0.5s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.panel-title {
    font-size: 1.5em;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-button, .clear-button {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s;
}

.info-button:hover, .clear-button:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* ==================== CARTE DU MONDE ==================== */
.world-map {
    position: relative;
    background: linear-gradient(135deg, #fdfcfb 0%, #e2d1c3 100%);
    border-radius: 10px;
    padding: 20px;
    min-height: 400px;
}

.territory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.territory {
    background: #e8e8e8;
    padding: 15px;
    border-radius: 12px;
    cursor: default;
    transition: all 0.3s;
    border: 3px solid transparent;
    position: relative;
    overflow: hidden;
    -ms-user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    color: #2c3e50;
}

.territory::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.5), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.territory.available {
    cursor: pointer;
}

.territory.available:hover::before {
    opacity: 1;
}

.territory.available:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.territory.conquered {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-color: #FFD700;
}

.territory.conquered.low-loyalty {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    border-color: #ff1744;
    animation: warning-pulse 2s infinite;
}

@keyframes warning-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(244, 67, 54, 0.7);
    }
    50% {
        box-shadow: 0 0 20px 10px rgba(244, 67, 54, 0);
    }
}

.territory.available {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    border-color: #ff6b6b;
    animation: pulse 2s infinite ease-in-out;
}

.territory.locked {
    background: #d0d0d0;
    cursor: not-allowed;
    opacity: 0.6;
}

@keyframes pulse {
    0%, 100% { 
        transform: scale(1); 
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.7); 
    }
    50% { 
        transform: scale(1.03); 
        box-shadow: 0 0 20px 10px rgba(255, 107, 107, 0); 
    }
}

/* Conquête en cours */
.territory.conquering {
    background: linear-gradient(135deg, #fff3cd 0%, #fff9e6 100%);
    border: 3px solid #ffc107;
    animation: conqueringAttack 0.6s infinite ease-in-out;
    position: relative;
    overflow: visible;
}

.territory.conquering::before {
    content: '⚔️';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3em;
    opacity: 0;
    animation: attackSlash 1.2s infinite ease-out;
    pointer-events: none;
    z-index: 10;
}

.territory.conquering::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border: 2px solid #ff9800;
    border-radius: 12px;
    opacity: 0;
    animation: shockwave 1.2s infinite ease-out;
    pointer-events: none;
}

@keyframes conqueringAttack {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7), 0 8px 20px rgba(255, 152, 0, 0.3);
    }
    25% {
        transform: scale(1.02) rotate(-1deg);
        box-shadow: 0 0 20px 5px rgba(255, 87, 34, 0.6), 0 8px 20px rgba(255, 152, 0, 0.3);
    }
    50% {
        transform: scale(1.05) rotate(1deg);
        box-shadow: 0 0 30px 10px rgba(255, 193, 7, 0.3), 0 8px 20px rgba(255, 152, 0, 0.3);
    }
    75% {
        transform: scale(1.02) rotate(-1deg);
        box-shadow: 0 0 20px 5px rgba(255, 87, 34, 0.6), 0 8px 20px rgba(255, 152, 0, 0.3);
    }
}

@keyframes attackSlash {
    0% {
        opacity: 0;
        transform: translate(-150%, -150%) scale(0.5) rotate(-45deg);
    }
    30% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
    }
    60% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1) rotate(5deg);
    }
    100% {
        opacity: 0;
        transform: translate(50%, 50%) scale(0.8) rotate(45deg);
    }
}

@keyframes shockwave {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Territoire sans armée */
.territory.no-army {
    opacity: 0.6;
    cursor: not-allowed !important;
    filter: grayscale(0.3);
}

.territory.no-army:hover {
    transform: scale(1.01);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

@keyframes slideDown {
    from {
        transform: translate(-50%, -100%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

@keyframes tabPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 5px 20px rgba(255, 152, 0, 0.6);
    }
}

.conquest-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 10px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.conquest-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #45a049, #66bb6a);
    background-size: 200% 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
    animation: progressShine 1.5s infinite linear;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

@keyframes progressShine {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

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

.mini-btn {
    transition: transform 0.2s, box-shadow 0.2s;
}

.mini-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.territory-icon {
    font-size: 2.5em;
    text-align: center;
    margin-bottom: 8px;
}

.territory-name {
    font-weight: 600;
    text-align: center;
    margin-bottom: 5px;
    font-size: 0.95em;
}

.territory-type {
    text-align: center;
    font-size: 0.75em;
    opacity: 0.8;
    margin-bottom: 8px;
}

.territory-stats {
    font-size: 0.8em;
    opacity: 0.9;
    text-align: center;
}

.territory-loyalty {
    margin-top: 8px;
    background: rgba(0,0,0,0.1);
    border-radius: 10px;
    height: 6px;
    overflow: hidden;
}

.loyalty-bar {
    height: 100%;
    background: linear-gradient(90deg, #dc3545 0%, #ffc107 50%, #28a745 100%);
    transition: width 0.5s;
}

/* ==================== MODAL DE CONQUÊTE ==================== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.85);
    z-index: 9000;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    overflow-y: auto;
}

.modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.conquest-modal {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    overflow-y: auto;
    text-align: center;
    animation: slideUp 0.3s;
    position: relative;
    margin: 20px;
    color: #2c3e50;
}

@media (max-width: 768px) {
    .conquest-modal {
        padding: 25px 20px;
        max-height: 85vh;
    }
}

@media (max-width: 480px) {
    .conquest-modal {
        padding: 20px 15px;
        max-height: 80vh;
        width: 95%;
    }
}

@keyframes slideUp {
    from { 
        transform: translateY(50px); 
        opacity: 0; 
    }
    to { 
        transform: translateY(0); 
        opacity: 1; 
    }
}

.modal-header {
    font-size: 2em;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.modal-description {
    color: #495057;
    margin-bottom: 20px;
}

.conquest-progress {
    margin: 25px 0;
}

.progress-container {
    background: #e0e0e0;
    height: 35px;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.2);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    transition: width 0.2s ease;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: progressShine 1.5s infinite;
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.click-counter {
    font-size: 1.8em;
    font-weight: 700;
    color: var(--primary-color);
    margin: 15px 0;
}

.click-button {
    background: var(--button-bg);
    color: var(--button-text);
    border: none;
    padding: 20px 50px;
    font-size: 1.5em;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.25);
    transition: background 0.18s, box-shadow 0.18s, transform 0.13s;
    margin: 15px 0;
    position: relative;
    overflow: hidden;
}

.click-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.click-button:hover::before {
    width: 300px;
    height: 300px;
}

.click-button:hover {
    background: var(--button-hover);
    transform: scale(1.07);
    box-shadow: 0 18px 48px rgba(102, 126, 234, 0.22);
}

.click-button:active {
    transform: scale(0.98);
}

.cancel-button {
    background: #e0e7ff;
    color: #667eea;
    border: none;
    padding: 10px 25px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}

.cancel-button:hover {
    background: #c3dafe;
    color: #764ba2;
    box-shadow: 0 2px 8px rgba(102,126,234,0.10);
}

/* ==================== FACTIONS ==================== */
.faction-selection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.faction-card {
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    cursor: default;
    transition: all 0.3s;
    border: 3px solid transparent;
    color: white;
    position: relative;
    overflow: hidden;
}

/* .faction-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
} */

/* Retirer les effets hover sur les cartes non-cliquables */
.faction-card.kingdom {
    background: linear-gradient(135deg, var(--kingdom-primary) 0%, var(--kingdom-secondary) 100%);
}

.faction-card.empire {
    background: linear-gradient(135deg, var(--empire-primary) 0%, var(--empire-secondary) 100%);
}

.faction-card.horde {
    background: linear-gradient(135deg, var(--horde-primary) 0%, var(--horde-secondary) 100%);
}

.faction-card.republic {
    background: linear-gradient(135deg, var(--republic-primary) 0%, var(--republic-secondary) 100%);
}

.faction-card.selected {
    border-color: white;
    transform: scale(1.05);
    box-shadow: 0 15px 50px rgba(0,0,0,0.5);
}

.faction-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.faction-name {
    font-size: 1.3em;
    font-weight: 700;
    margin: 10px 0;
    font-family: 'Cinzel', serif;
}

.faction-bonus {
    font-size: 0.9em;
    opacity: 0.95;
    line-height: 1.5;
}

/* ==================== TECHNOLOGIES ==================== */
.tech-tree {
    display: flex;
    flex-direction: column;
    gap: 25px;
    padding: 10px;
}

.tech-category {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.tech-category h3 {
    margin: 0 0 20px 0;
    font-size: 1.4em;
    color: #333;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.tech-category h3::before {
    content: '';
    width: 4px;
    height: 24px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 2px;
}

.tech-card {
    background: white;
    padding: 18px;
    margin: 12px 0;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s;
    display: grid;
    grid-template-columns: 60px 1fr;
    gap: 15px;
    align-items: start;
    position: relative;
    overflow: hidden;
    color: #2c3e50;
}

@media (max-width: 480px) {
    .tech-card {
        grid-template-columns: 50px 1fr;
        padding: 12px;
        gap: 10px;
        margin: 8px 0;
    }
}

.tech-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    transform: scaleY(0);
    transition: transform 0.3s;
}

.tech-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tech-card.unlocked {
    background: linear-gradient(135deg, #d4fc79 0%, #96e6a1 100%);
    border-color: var(--success-color);
    cursor: default;
}

.tech-card.unlocked::before {
    background: var(--success-color);
    transform: scaleY(1);
}

.tech-card.available {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #ffffff 0%, #f0f4ff 100%);
    cursor: default;
}

.tech-card.affordable {
    border-color: var(--success-color);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.2);
    cursor: default;
}

.tech-card.locked {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f5f5f5;
}

.tech-icon {
    font-size: 3em;
    text-align: center;
    line-height: 1;
    grid-row: 1 / 4;
}

.tech-name {
    font-weight: 700;
    font-size: 1.2em;
    margin-bottom: 8px;
    color: #2c3e50;
}

.tech-description {
    font-size: 0.9em;
    color: #666;
    line-height: 1.5;
    margin-bottom: 10px;
}

.tech-requires {
    font-size: 0.85em;
    color: var(--warning-color);
    background: #fff3cd;
    padding: 6px 10px;
    border-radius: 6px;
    margin-bottom: 10px;
    font-weight: 600;
}

.tech-cost {
    display: flex;
    gap: 12px;
    font-size: 0.95em;
    font-weight: 600;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.tech-cost span {
    background: #f8f9fa;
    padding: 6px 12px;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: all 0.2s;
}

.tech-cost span.insufficient {
    color: var(--danger-color);
    border-color: var(--danger-color);
    background: #ffe0e0;
}

.tech-unlocked {
    background: linear-gradient(135deg, var(--success-color) 0%, #20c997 100%);
    color: white;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    font-weight: 700;
    font-size: 1em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tech-branch {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 15px;
    border-radius: 12px;
    border-left: 4px solid;
}

.tech-branch.military {
    border-left-color: var(--danger-color);
}

.tech-branch.economic {
    border-left-color: var(--warning-color);
}

.tech-branch.diplomatic {
    border-left-color: var(--success-color);
}

.tech-item {
    background: white;
    padding: 12px;
    margin: 8px 0;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.3s;
    cursor: pointer;
}

.tech-item:hover {
    border-color: var(--primary-color);
    transform: translateX(5px);
}

.tech-item.unlocked {
    background: linear-gradient(135deg, #d4fc79 0%, #96e6a1 100%);
    border-color: var(--success-color);
}

.tech-item.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.tech-effect {
    font-size: 0.8em;
    color: var(--success-color);
    margin-top: 5px;
}

.tech-button {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.3s;
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tech-button.can-research {
    background: linear-gradient(135deg, var(--primary-color) 0%, #5a6fd8 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    cursor: pointer;
}

.tech-button.can-research:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    filter: brightness(1.1);
}

.tech-button.can-research:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.tech-button:disabled,
.tech-button.cannot-research {
    background: linear-gradient(135deg, #d0d0d0 0%, #b0b0b0 100%);
    color: #888;
    cursor: not-allowed;
    opacity: 0.7;
}

/* ==================== BÂTIMENTS ==================== */
.buildings-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 600px;
    overflow-y: auto;
    padding-right: 10px;
}

.buildings-list::-webkit-scrollbar {
    width: 8px;
}

.buildings-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.buildings-list::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.building-card {
    background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
    padding: 15px;
    border-radius: 12px;
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s;
    position: relative;
    opacity: 0.6;
    border: 2px dashed #ccc;
    color: #2c3e50;
}

/* Bâtiment qu'on peut acheter */
.building-card.affordable {
    opacity: 1;
    border: 2px solid var(--primary-color);
}

/* Bâtiment construit/possédé */
.building-card.owned {
    opacity: 1;
    background: linear-gradient(135deg, #e8f5e9 0%, #f2f5ea 100%);
    border: 2px solid var(--success-color);
    border-left: 5px solid var(--success-color);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.15);
}

@media (max-width: 768px) {
    .building-card {
        padding: 12px;
    }
    
    .building-header {
        flex-direction: row;
        gap: 8px;
    }
    
    .building-name {
        font-size: 1em;
    }
    
    .building-icon {
        font-size: 1.8em;
    }
}

@media (max-width: 480px) {
    .building-card {
        padding: 10px;
    }
    
    .building-name {
        font-size: 0.95em;
    }
    
    .building-icon {
        font-size: 1.5em;
    }
}

.building-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.building-card.owned:hover {
    box-shadow: 0 5px 20px rgba(40, 167, 69, 0.3);
}

.building-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.building-name {
    font-weight: 700;
    font-size: 1.1em;
    color: #333;
}

.building-card.owned .building-name {
    color: var(--success-color);
    font-weight: 800;
}

.building-level {
    background: var(--primary-color);
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.9em;
    font-weight: 600;
}

.building-card.owned .building-level {
    background: var(--success-color);
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

.building-icon {
    font-size: 2em;
    margin-bottom: 8px;
    filter: grayscale(50%) opacity(0.8);
    transition: all 0.3s;
}

.building-card.owned .building-icon {
    filter: grayscale(0%) opacity(1);
    transform: scale(1.1);
}

.building-production {
    display: flex;
    gap: 10px;
    margin: 10px 0;
    font-size: 0.9em;
    flex-wrap: wrap;
}

.production-item {
    background: rgba(102, 126, 234, 0.1);
    padding: 5px 10px;
    border-radius: 8px;
}

.building-cost {
    font-size: 0.9em;
    color: #666;
    margin: 8px 0;
}

.cost-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.insufficient {
    color: var(--danger-color);
    opacity: 0.6;
}

.building-button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1em;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1;
}

.building-button.can-buy {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
    color: white !important;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.6) !important;
    cursor: pointer;
    border: 2px solid #20c997 !important;
    opacity: 1 !important;
    isolation: isolate;
}

.building-button.can-buy:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.8) !important;
    filter: brightness(1.15) !important;
    background: linear-gradient(135deg, #20c997 0%, #28a745 100%) !important;
    opacity: 1 !important;
}

.building-button.can-buy:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.6);
    opacity: 1 !important;
}

.building-button.cannot-buy,
.building-button:disabled {
    background: linear-gradient(135deg, #d0d0d0 0%, #b0b0b0 100%);
    color: #888;
    cursor: not-allowed;
    opacity: 0.7;
}

.buy-button {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--success-color) 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1em;
}

.buy-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

.buy-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* ==================== ACTIONS RAPIDES ==================== */
.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.action-button {
    padding: 15px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    color: white;
    font-size: 0.95em;
}

.action-button.save {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.action-button.load {
    background: linear-gradient(135deg, #89f7fe 0%, #66a6ff 100%);
}

.action-button.reset {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.action-button.prestige {
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
}

.action-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}

/* ==================== JOURNAL ==================== */
.event-log {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 10px;
    transition: opacity 0.2s, transform 0.2s;
}

.event-log::-webkit-scrollbar {
    width: 6px;
}

.event-log::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.event-log::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.log-entry {
    padding: 10px;
    margin: 5px 0;
    background: #f8f9fa;
    border-left: 3px solid var(--primary-color);
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s ease-out;
    border-radius: 5px;
    font-size: 0.9em;
    animation: slideInRight 0.3s;
}

@keyframes slideInRight {
    from {
        transform: translateX(20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ==================== NOTIFICATIONS ==================== */
.notification {
    position: fixed;
    top: 80px;
    right: 20px;
    background: white;
    padding: 20px 25px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    max-width: 400px;
    z-index: 999;
    overflow: hidden;
    transform: translateX(500px);
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.notification.active {
    transform: translateX(0);
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.notification-title {
    font-size: 1.3em;
    font-weight: 700;
    color: var(--primary-color);
}

.notification-close {
    background: none;
    border: none;
    font-size: 2em;
    cursor: pointer;
    color: #999;
    line-height: 1;
    transition: color 0.3s;
}

.notification-close:hover {
    color: var(--danger-color);
}

.notification-body {
    margin-bottom: 15px;
    color: #666;
    line-height: 1.6;
}

.notification-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.notification-btn {
    flex: 1;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 120px;
}

.notification-btn.primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.notification-btn.secondary {
    background: #e0e0e0;
    color: #666;
}

.notification-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* ==================== TUTORIEL ==================== */
.tutorial-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.9);
    z-index: 2000;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.tutorial-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.5s;
}

.tutorial-content {
    background: white;
    padding: 50px;
    border-radius: 20px;
    max-width: 1600px;
    margin: 0 auto;
    overflow: hidden;
    /* Ajout du spacer pour la barre de ressources */
}


@keyframes zoomIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.tutorial-title {
    font-size: 2.5em;
    color: var(--primary-color);
    margin-bottom: 20px;
    font-family: 'Cinzel', serif;
}

.tutorial-text {
    font-size: 1.1em;
    line-height: 2;
    color: #666;
    margin-bottom: 30px;
}

.tutorial-button {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    padding: 20px 50px;
    font-size: 1.3em;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    transition: all 0.3s;
}

.tutorial-button:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.6);
}

/* ==================== RESPONSIVE ==================== */
.building-card, .tech-card, .faction-card, .choice-button, .tab-button {
    -ms-user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

@media (max-width: 1200px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
    
    .tech-tree {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .game-wrapper {
        padding: 5px;
    }
    
    header, .game-header {
        padding: 15px;
        margin-top: 95px;
        flex-direction: column;
        gap: 10px;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .resources-panel {
        gap: 0.7rem;
        padding: 6px 10px;
        justify-content: flex-start;
    }
    
    .resources-panel-spacer {
        height: 85px;
    }
    
    .resource-card {
        min-width: auto;
        width: auto;
        padding: 6px 10px;
        flex-direction: column;
        text-align: center;
        gap: 3px;
        flex-shrink: 0;
    }
    
    .resource-card .resource-icon {
        font-size: 1.5em;
    }
    
    .resource-info {
        width: 100%;
    }
    
    .resource-name {
        font-size: 0.6em;
        letter-spacing: 0.4px;
    }
    
    .resource-amount {
        font-size: 1em;
    }
    
    .resource-rate {
        font-size: 0.6em;
    }
    
    .click-hint {
        display: none;
    }
    
    .resources-bar {
        grid-template-columns: 1fr;
    }
    
    .territory-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .territory {
        padding: 10px;
        min-height: 110px;
        font-size: 0.9em;
    }
    
    .territory h3 {
        font-size: 1em;
        margin: 5px 0;
    }
    
    .territory-resistance,
    .territory-reward,
    .territory-details {
        font-size: 0.8em;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }
    
    .faction-selection {
        grid-template-columns: 1fr;
    }
    
    .left-panel, .center-panel, .right-panel {
        padding: 12px;
        gap: 10px;
    }
    
    .panel-header h2 {
        font-size: 1.3em;
    }
    
    .tab-button {
        font-size: 0.85em;
        padding: 10px 14px;
    }
    
    .building-card, .tech-card {
        font-size: 0.9em;
    }
    
    .building-name,
    .tech-name {
        font-size: 1em;
    }
    
    .building-icon,
    .tech-icon {
        font-size: 1.8em;
    }
    
    .building-cost,
    .tech-cost,
    .building-production,
    .tech-description {
        font-size: 0.85em;
    }
    
    .tech-category h3 {
        font-size: 1.1em;
    }
    
    .tabs {
        flex-wrap: wrap;
        gap: 6px;
        overflow-x: auto;
        -ms-overflow-style: none;
    }
    
    .tabs::-webkit-scrollbar {
        display: none;
    }
    
    .tab-button {
        padding: 10px 12px;
        font-size: 0.85em;
        min-width: auto;
        flex: 1 1 auto;
        white-space: nowrap;
    }
    
    button, .btn {
        min-width: 100px;
        min-height: 44px;
        padding: 12px 16px;
        font-size: 0.95em;
    }
    
    .notification-modal, .conquest-modal {
        width: 95%;
        max-width: 95%;
        margin: 10px;
        padding: 25px 20px;
        font-size: 0.9em;
    }
    
    .modal-header {
        font-size: 1.5em;
    }
    
    .modal-description {
        font-size: 0.9em;
    }
    
    .empire-name {
        font-size: 1.3em;
    }
    
    .prestige-info {
        font-size: 0.85em;
    }
    
    .faction-card {
        padding: 20px;
        font-size: 0.95em;
    }
    
    .faction-icon {
        font-size: 2.5em;
    }
    
    .faction-name {
        font-size: 1.2em;
    }
    
    .faction-bonus {
        font-size: 0.85em;
    }
    
    .buildings-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .building-card, .tech-card {
        padding: 12px;
        font-size: 0.9em;
    }
    
    .building-name,
    .tech-name {
        font-size: 1em;
    }
    
    .building-icon,
    .tech-icon {
        font-size: 1.8em;
    }
    
    .building-cost,
    .tech-cost,
    .building-production,
    .tech-description {
        font-size: 0.85em;
    }
    
    .tech-category h3 {
        font-size: 1.1em;
    }
    
    .tech-category {
        padding: 15px;
    }
    
    .units-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .unit-card {
        padding: 15px;
    }
    
    .army-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .buildings-filters {
        gap: 8px;
        margin-bottom: 12px;
    }
    
    .filter-btn {
        padding: 8px 12px;
        font-size: 0.8em;
        flex: 1 1 auto;
        min-width: 80px;
    }
    
    .btn-festival {
        padding: 12px 16px;
        font-size: 0.95em;
    }
    
    .festival-title {
        font-size: 1em;
    }
    
    .festival-badges {
        gap: 6px;
    }
    
    .badge {
        font-size: 0.75em;
        padding: 5px 10px;
    }
    
    .building-button {
        padding: 10px;
        font-size: 0.95em;
    }
    
    .tech-button {
        padding: 10px;
        font-size: 0.85em;
    }
    
    .buy-button {
        padding: 10px 14px;
        font-size: 0.95em;
    }
    
    .recruit-btn {
        padding: 10px;
        font-size: 0.9em;
    }
    
    .demobilize-btn {
        padding: 8px;
        font-size: 0.8em;
    }
    
    .action-button {
        padding: 12px;
        font-size: 0.9em;
    }
    
    .click-button {
        padding: 18px 40px;
        font-size: 1.3em;
    }
    
    .cancel-button {
        padding: 10px 20px;
        font-size: 0.95em;
    }
    
    .btn-change-faction {
        padding: 8px 15px;
        font-size: 0.85em;
    }
    
    button, .btn {
        font-size: 0.95em;
        padding: 12px 16px;
    }
    
    .btn-primary,
    .btn-secondary,
    .btn-danger {
        font-size: 0.95em;
    }
}

/* ==================== ANIMATIONS SPÉCIALES ==================== */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.territory.available {
    animation: pulse 2s infinite, float 3s infinite ease-in-out;
}

/* Particules de clic */
@keyframes clickParticle {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--x), var(--y)) scale(0);
        opacity: 0;
    }
}

/* Très petits écrans (smartphones) */
@media (max-width: 480px) {
    .game-wrapper {
        padding: 2px;
    }
    
    header, .game-header {
        padding: 8px 10px;
        margin-top: 85px;
    }
    
    .empire-name {
        font-size: 1em;
        margin: 0;
    }
    
    .prestige-info {
        font-size: 0.75em;
    }
    
    .resources-panel {
        gap: 0.4rem;
        padding: 5px 6px;
    }
    
    .resources-panel-spacer {
        height: 75px;
    }
    
    .resource-card {
        padding: 5px 7px;
        gap: 2px;
        min-width: auto;
    }
    
    .resource-card .resource-icon {
        font-size: 1.3em;
    }
    
    .resource-name {
        font-size: 0.55em;
        letter-spacing: 0.2px;
    }
    
    .resource-amount {
        font-size: 0.9em;
    }
    
    .resource-rate {
        font-size: 0.55em;
    }
    
    .territory-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .territory {
        padding: 8px;
        min-height: 95px;
        font-size: 0.8em;
    }
    
    .territory h3 {
        font-size: 0.85em;
        margin: 3px 0;
    }
    
    .territory-resistance, .territory-reward,
    .territory-details {
        font-size: 0.7em;
    }
    
    .left-panel, .center-panel, .right-panel {
        padding: 10px;
        gap: 8px;
    }
    
    .panel-header h2 {
        font-size: 1.1em;
    }
    
    .tabs {
        gap: 4px;
    }
    
    .tab-button {
        padding: 8px 10px;
        font-size: 0.8em;
        border-width: 1px;
    }
    
    button, .btn {
        padding: 10px 14px;
        font-size: 0.85em;
        min-height: 40px;
        min-width: 80px;
    }
    
    .btn-primary,
    .btn-secondary,
    .btn-danger {
        font-size: 0.85em;
        padding: 10px 14px;
    }
    
    .btn-festival {
        padding: 10px 14px;
        font-size: 0.85em;
    }
    
    .festival-title {
        font-size: 0.9em;
    }
    
    .festival-badges {
        gap: 4px;
    }
    
    .badge {
        padding: 4px 8px;
        font-size: 0.65em;
    }
    
    .building-button {
        padding: 8px;
        font-size: 0.85em;
    }
    
    .tech-button {
        padding: 8px;
        font-size: 0.8em;
    }
    
    .buy-button {
        padding: 8px 12px;
        font-size: 0.85em;
    }
    
    .recruit-btn {
        padding: 8px;
        font-size: 0.85em;
    }
    
    .demobilize-btn {
        padding: 6px;
        font-size: 0.75em;
    }
    
    .action-button {
        padding: 10px;
        font-size: 0.85em;
    }
    
    .click-button {
        padding: 15px 35px;
        font-size: 1.2em;
    }
    
    .cancel-button {
        padding: 8px 18px;
        font-size: 0.85em;
    }
    
    .btn-change-faction {
        padding: 6px 12px;
        font-size: 0.8em;
    }
    
    .notification-modal, .conquest-modal {
        padding: 20px 15px;
        font-size: 0.85em;
    }
    
    .modal-header {
        font-size: 1.3em;
    }
    
    .modal-description {
        font-size: 0.85em;
    }
    
    .faction-card {
        padding: 15px;
        font-size: 0.85em;
    }
    
    .faction-icon {
        font-size: 2em;
    }
    
    .faction-name {
        font-size: 1.1em;
    }
    
    .faction-bonus {
        font-size: 0.8em;
    }
    
    .buildings-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .tech-tree {
        gap: 15px;
        padding: 5px;
    }
    
    .tech-category {
        padding: 12px;
        border-radius: 10px;
    }
    
    .tech-category h3 {
        font-size: 1em;
        margin-bottom: 10px;
    }
    
    .units-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .unit-card {
        padding: 12px;
    }
    
    .army-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .buildings-filters {
        gap: 6px;
        margin-bottom: 10px;
    }
    
    .filter-btn {
        padding: 6px 10px;
        font-size: 0.75em;
        flex: 1 1 auto;
        min-width: 70px;
    }
    
    .building-card {
        padding: 10px;
        font-size: 0.85em;
    }
    
    .building-name {
        font-size: 0.95em;
    }
    
    .building-icon {
        font-size: 1.5em;
    }
    
    .building-cost,
    .building-production,
    .building-level {
        font-size: 0.85em;
    }
    
    .building-button {
        font-size: 0.85em;
        padding: 8px;
    }
    
    .tech-button {
        padding: 8px;      
        font-size: 0.8em;
    }
    
    .buy-button {
        padding: 8px 12px;
        font-size: 0.85em;
    }
    
    .recruit-btn {
        padding: 8px;
        font-size: 0.85em;
    }
    
    .demobilize-btn {
        padding: 6px;
        font-size: 0.75em;
    }
    
    .action-button {
        padding: 10px;
        font-size: 0.85em;
    }
    
    .tech-card {
        grid-template-columns: 45px 1fr;
        padding: 10px;
        gap: 8px;
        font-size: 0.85em;
        margin: 6px 0;
    }
    
    .tech-icon {
        font-size: 1.8em;
    }
    
    .tech-name {
        font-size: 1em;
    }
    
    .tech-description,
    .tech-cost {
        font-size: 0.8em;
    }
    
    .tech-category {
        padding: 12px;
    }
    
    .tech-category h3 {
        font-size: 1.1em;
    }
    
    .stat-row {
        font-size: 0.85em;
    }
}

/* Mode sombre (bonus) */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
    }
    
    .panel {
        background: rgba(30, 30, 30, 0.95);
        color: #e0e0e0;
    }
    
    .panel-title {
        color: #89f7fe;
    }
}

/* ==================== STATISTIQUES ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-label {
    font-size: 0.85em;
    opacity: 0.7;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 1.3em;
    font-weight: 600;
    color: #4CAF50;
}

/* ==================== PARAMÈTRES ==================== */
.settings-menu {
    max-width: 500px;
    margin: 0 auto;
}

.setting-item {
    padding: 12px 0;
}

.setting-item label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 1em;
}

.setting-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    cursor: pointer;
}

.setting-item button {
    width: 100%;
}

/* ==================== CHOIX D'ÉVÉNEMENTS ==================== */
.event-choices {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.choice-button {
    padding: 15px;
    background: rgba(76, 175, 80, 0.15);
    border: 2px solid #4CAF50;
    border-radius: 8px;
    color: #1a5d1a;
    font-weight: 600;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.choice-button:hover:not(.disabled) {
    background: rgba(76, 175, 80, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
    border-color: #2d7a2d;
}

.choice-button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #999;
    background: rgba(128, 128, 128, 0.1);
    color: #666;
}

/* ==================== CONTRÔLES DU JEU ==================== */
.game-controls .btn {
    flex: 1;
    min-width: 120px;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .game-controls {
        flex-direction: column;
    }
    
    .game-controls .btn {
        width: 100%;
    }
    
    .choice-button {
        padding: 12px;
        font-size: 0.95em;
    }
    
    .army-section,
    .diplomacy-section {
        padding: 15px;
        font-size: 0.95em;
    }
    
    .army-section h3,
    .diplomacy-section h3 {
        font-size: 1.2em;
    }
    
    .tutorial-tips {
        padding: 15px;
        font-size: 0.95em;
    }
    
    .quick-stats {
        padding: 12px;
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    .choice-button {
        padding: 10px;
        font-size: 0.85em;
    }
    
    .army-section,
    .diplomacy-section {
        padding: 12px;
        font-size: 0.85em;
    }
    
    .army-section h3,
    .diplomacy-section h3 {
        font-size: 1.1em;
    }
    
    .tutorial-tips {
        padding: 12px;
        font-size: 0.85em;
    }
    
    .tutorial-tips h3 {
        font-size: 1.1em;
    }
    
    .quick-stats {
        padding: 10px;
        font-size: 0.85em;
    }
    
    .stat-row {
        font-size: 0.9em;
    }
}

/* ==================== CONTRÔLES DU JEU ==================== */
.game-controls {
    display: flex;
    gap: 10px;
    margin: 15px 0;
    flex-wrap: wrap;
    padding: 0 15px;
}

.game-controls .btn {
    flex: 1;
    min-width: 120px;
    font-size: 0.9em;
    padding: 10px 15px;
}

/* ==================== PLACEHOLDER STATS ==================== */
.placeholder-stats {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 30px;
}

.stat-box {
    background: rgba(255, 255, 255, 0.05);
    padding: 25px;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    min-width: 150px;
}

.stat-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 0.9em;
    opacity: 0.7;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 1.8em;
    font-weight: 700;
    color: #4CAF50;
}

/* ==================== ARMY & DIPLOMACY TABS ==================== */
.army-section,
.diplomacy-section {
    padding: 20px;
}

.army-section h3,
.diplomacy-section h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #FFD700;
}

/* ==================== TUTORIAL ==================== */
.tutorial-tips {
    margin-top: 30px;
    padding: 20px;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 12px;
    border: 2px solid rgba(76, 175, 80, 0.3);
}

.tutorial-tips h3 {
    color: #4CAF50;
    margin-bottom: 15px;
}

.tutorial-tips ul {
    list-style: none;
    padding: 0;
}

.tutorial-tips li {
    padding: 8px 0;
    opacity: 0.9;
}

/* ==================== QUICK STATS ==================== */
.quick-stats {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.quick-stats h3 {
    font-size: 1em;
    margin-bottom: 15px;
    color: #FFD700;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-row span:first-child {
    opacity: 0.7;
}

.stat-row span:last-child {
    font-weight: 600;
    color: #4CAF50;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .game-controls {
        flex-direction: column;
    }
    
    .game-controls .btn {
        width: 100%;
    }
    
    .placeholder-stats {
        flex-direction: column;
    }
    
    .stat-box {
        width: 100%;
    }
}

/* ==================== SYSTÈME D'ARMÉE ==================== */
.army-section {
    padding: 20px;
}

.army-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.units-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.unit-card {
    background: linear-gradient(135deg, #fff, #f8f9fa);
    border: 2px solid #dee2e6;
    border-radius: 12px;
    padding: 15px;
    transition: all 0.3s ease;
    overflow: hidden;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    color: #2c3e50;
}

.unit-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: var(--primary-color);
}

.unit-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.unit-icon {
    font-size: 2.5em;
}

.unit-name {
    font-size: 1.3em;
    font-weight: 700;
    color: var(--primary-color);
}

.unit-description {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.4;
}

.unit-owned {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 12px;
    text-align: center;
    font-size: 1.1em;
}

.unit-owned strong {
    color: var(--primary-color);
    font-size: 1.3em;
}

.unit-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
    font-size: 0.85em;
    width: 100%;
    box-sizing: border-box;
}

.unit-stats > div {
    background: #f8f9fa;
    padding: 6px;
    border-radius: 6px;
    text-align: center;
}

.unit-cost {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    padding: 8px;
    border-radius: 6px;
    text-align: center;
    margin-bottom: 8px;
    font-weight: 600;
}

.unit-upkeep {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    padding: 6px;
    border-radius: 6px;
    text-align: center;
    font-size: 0.85em;
    margin-bottom: 12px;
}

.unit-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 6px;
    width: 100%;
    box-sizing: border-box;
    margin-top: auto;
    padding: 0;
    margin-left: 0;
    margin-right: 0;
}

.recruit-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 8px 4px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    text-align: center;
    margin: 0;
}

.recruit-btn:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    filter: brightness(1.1);
}

.recruit-btn:active {
    filter: brightness(0.9);
}

.demobilize-btn {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: white;
    border: none;
    padding: 8px 4px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.8em;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    text-align: center;
    margin: 0;
}

.demobilize-btn:hover {
    background: linear-gradient(135deg, #f57c00, #ff9800);
    filter: brightness(1.1);
}

.demobilize-btn:active {
    filter: brightness(0.9);
}

/* ==================== VÉTÉRANCE ==================== */
.vet-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 1.2em;
    filter: drop-shadow(0 0 3px rgba(255, 215, 0, 0.8));
    animation: vet-glow 2s ease-in-out infinite;
}

@keyframes vet-glow {
    0%, 100% { filter: drop-shadow(0 0 3px rgba(255, 215, 0, 0.6)); }
    50% { filter: drop-shadow(0 0 8px rgba(255, 215, 0, 1)); }
}

.veterancy-info {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(218, 165, 32, 0.1));
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    padding: 10px;
    margin: 10px 0;
}

.vet-rank {
    font-weight: 600;
    color: #D4AF37;
    margin-bottom: 5px;
    font-size: 0.95em;
}

.vet-progress {
    background: rgba(0, 0, 0, 0.2);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin: 5px 0;
}

.vet-progress-bar {
    background: linear-gradient(90deg, #FFD700, #FFA500);
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.vet-xp {
    font-size: 0.85em;
    color: #D4AF37;
    text-align: center;
}

.vet-max {
    text-align: center;
    font-weight: 700;
    color: #FFD700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    animation: vet-glow 2s ease-in-out infinite;
}

.vet-bonuses {
    font-size: 0.85em;
    color: #4CAF50;
    text-align: center;
    margin-top: 5px;
    font-weight: 600;
}

/* ==================== COMPOSITION D'ARMÉE ==================== */
.composition-bonus {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(124, 58, 237, 0.15));
    border: 2px solid rgba(139, 92, 246, 0.4);
    border-radius: 12px;
    padding: 15px;
    margin: 15px 0;
    text-align: center;
}

.composition-bonus h4 {
    color: #8B5CF6;
    margin: 0 0 8px 0;
    font-size: 1.1em;
}

.bonus-stats {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.bonus-stats span {
    background: rgba(139, 92, 246, 0.2);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    color: #D4AF37;
}

/* ==================== STATISTIQUES MILITAIRES ==================== */
.army-statistics {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 10px;
    padding: 15px;
    margin: 20px 0;
}

.army-statistics h4 {
    color: #D4AF37;
    margin: 0 0 12px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    font-size: 0.95em;
}

.stats-grid div {
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 12px;
    border-radius: 6px;
}

.stats-grid strong {
    color: #4CAF50;
    font-weight: 700;
}

/* Bouton Festival */
.btn-festival {
    width: 100%;
    margin-bottom: 15px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #9c27b0 0%, #e91e63 50%, #ff9800 100%);
    background-size: 200% 100%;
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.4s ease;
    box-shadow: 0 4px 15px rgba(156, 39, 176, 0.3);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.btn-festival::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.btn-festival:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(156, 39, 176, 0.5);
    background-position: 100% 0;
}

.btn-festival:hover::before {
    left: 100%;
}

.btn-festival:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(156, 39, 176, 0.4);
}

.btn-festival:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.festival-title {
    font-size: 1.1em;
    letter-spacing: 0.5px;
}

.festival-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.badge-cost {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.badge-effect {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(76, 175, 80, 0.5);
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
}

.btn-festival:hover .badge {
    transform: scale(1.05);
}

.btn-festival:hover .badge-effect {
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.5);
}

.decimate-btn {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.3);
}

.decimate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(244, 67, 54, 0.5);
}

.decimate-btn:active {
    transform: translateY(0);
}

.famine-warning {
    background: linear-gradient(135deg, #ffebee, #ffcdd2);
    border: 2px solid #f44336;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
    animation: pulse-warning 2s infinite;
}

.famine-warning h4 {
    color: #f44336;
    margin: 0 0 10px 0;
    font-size: 1.3em;
}

.famine-warning p {
    margin: 8px 0;
    color: #333;
}

@keyframes pulse-warning {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(244, 67, 54, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(244, 67, 54, 0);
    }
}

.army-management {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    border: 2px solid #ff9800;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.army-management h4 {
    color: #ff9800;
    margin: 0 0 15px 0;
    text-align: center;
}

.army-info {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid var(--success-color);
    color: #2c3e50;
}

.army-info h4 {
    margin: 0 0 15px 0;
    color: var(--success-color);
}

.army-info ul {
    margin: 0;
    padding-left: 20px;
    line-height: 1.8;
    color: #2c3e50;
}

.army-info li {
    margin-bottom: 8px;
    color: #2c3e50;
}

/* ==================== SYSTÈME DE BATAILLE ==================== */
.battle-log {
    background: #1a1a1a;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    max-height: 200px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    line-height: 1.6;
}

.battle-log-entry {
    padding: 6px 10px;
    margin: 4px 0;
    border-radius: 4px;
    border-left: 3px solid #666;
    animation: slideIn 0.3s ease-out;
}

.battle-log-entry.log-success {
    background: rgba(76, 175, 80, 0.2);
    border-left-color: #4CAF50;
    color: #81c784;
}

.battle-log-entry.log-error {
    background: rgba(244, 67, 54, 0.2);
    border-left-color: #f44336;
    color: #e57373;
}

.battle-log-entry.log-warning {
    background: rgba(255, 152, 0, 0.2);
    border-left-color: #FF9800;
    color: #ffb74d;
}

.battle-log-entry.log-info {
    background: rgba(33, 150, 243, 0.2);
    border-left-color: #2196F3;
    color: #64b5f6;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes floatUp {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-100px) scale(1.5);
    }
}

.conquest-modal {
    max-width: 700px;
}

.modal-description {
    font-size: 0.95em;
    max-height: 300px;
    overflow-y: auto;
}

/* ==================== ONGLET FACTION ==================== */
.faction-overview {
    padding: 20px;
}

.current-faction {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.faction-header-large {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.faction-icon-large {
    font-size: 5em;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.current-faction h2 {
    margin: 0;
    font-size: 2em;
    color: #2c3e50;
}

.current-faction p {
    margin: 5px 0 0 0;
    color: #666;
    font-size: 1.1em;
}

.faction-bonus-display {
    background: white;
    border-left: 4px solid var(--primary-color);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.faction-bonus-display h4 {
    margin: 0 0 10px 0;
    color: var(--primary-color);
}

.faction-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.faction-stats-display .stat-box {
    background: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.faction-stats-display .stat-icon {
    font-size: 2em;
    margin-bottom: 5px;
}

.faction-stats-display .stat-label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.faction-stats-display .stat-value {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--primary-color);
}

.faction-card-small {
    background: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.faction-card-small:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.faction-card-small .faction-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.faction-card-small .faction-name {
    font-weight: 700;
    font-size: 1.1em;
    margin-bottom: 8px;
    color: #2c3e50;
}

.faction-card-small .faction-bonus-small {
    font-size: 0.85em;
    color: #666;
    font-style: italic;
}

.faction-card-small.current-faction {
    border: 3px solid var(--success-color);
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
}

.current-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--success-color);
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 700;
}

#allFactionsDisplay {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

/* ==================== STYLES POUR LES BOUTONS DE FACTION ==================== */
.btn-select-faction {
    transition: all 0.2s ease !important;
    cursor: pointer !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 12px !important;
    font-weight: 700 !important;
    font-size: 1em !important;
    color: white !important;
    width: 100% !important;
    margin-top: 15px !important;
}

.btn-select-faction:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
    filter: brightness(1.1) !important;
}

.faction-card {
    background: rgba(255,255,255,0.95);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 2px solid transparent;
    transition: all 0.3s ease;
    color: #2c3e50;
}

/* ==================== TOASTS SYSTEM ==================== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    pointer-events: all;
    background: white;
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    max-width: 400px;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    color: #2c3e50;
}

.toast.toast-show {
    opacity: 1;
    transform: translateX(0);
}

.toast.toast-hide {
    opacity: 0;
    transform: translateX(400px);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.toast-icon {
    font-size: 1.2em;
    flex-shrink: 0;
}

.toast-message {
    font-size: 0.9em;
    color: #333;
    flex: 1;
}

.toast-close {
    background: none;
    border: none;
    font-size: 1.5em;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.toast-close:hover {
    background: rgba(0,0,0,0.05);
    color: #333;
}

/* Toast types */
.toast-success {
    border-left: 4px solid #22c55e;
}

.toast-success .toast-icon {
    color: #22c55e;
}

.toast-error {
    border-left: 4px solid #ef4444;
}

.toast-error .toast-icon {
    color: #ef4444;
}

.toast-warning {
    border-left: 4px solid #f59e0b;
}

.toast-warning .toast-icon {
    color: #f59e0b;
}

.toast-info {
    border-left: 4px solid #3b82f6;
}

.toast-info .toast-icon {
    color: #3b82f6;
}

/* ==================== INDICATEURS DE TENDANCE ==================== */
.rate-positive {
    color: #22c55e !important;
    font-weight: 500;
}

.rate-negative {
    color: #ef4444 !important;
    font-weight: 500;
}

.rate-neutral {
    color: #6b7280 !important;
}

.upkeep-indicator {
    color: #f59e0b;
    font-size: 0.85em;
    font-weight: 500;
}

/* ==================== BADGES DE LOYAUTÉ ==================== */
.loyalty-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
    margin-top: 8px;
}

.loyalty-high {
    background: #d1fae5;
    color: #065f46;
}

.loyalty-medium {
    background: #fef3c7;
    color: #92400e;
}

.loyalty-critical {
    background: #fee2e2;
    color: #991b1b;
}

.prod-penalty {
    color: #ef4444;
    font-size: 0.85em;
    font-style: italic;
}

/* ==================== BOUTON ACTIONS RAPIDES MOBILE ==================== */
.quick-actions-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 9999;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-actions-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

.quick-actions-btn.active {
    transform: rotate(45deg);
}

.quick-actions-menu {
    position: fixed;
    bottom: 90px;
    right: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    padding: 8px;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    gap: 4px;
    opacity: 0;
    transform: scale(0.8) translateY(20px);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.quick-actions-menu.show {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: all;
}

.qa-btn {
    background: #f3f4f6;
    border: none;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    text-align: left;
    transition: all 0.2s;
    white-space: nowrap;
}

.qa-btn:hover {
    background: #e5e7eb;
    transform: translateX(-4px);
}

/* ==================== BADGES D'ONGLETS ==================== */
.tab-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    font-size: 0.7em;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.tab-badge-info {
    background: #3b82f6;
}

.tab-badge-alert {
    background: #ef4444;
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

/* ==================== INDICATEUR DE SAUVEGARDE ==================== */
.save-indicator {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #22c55e;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    font-weight: 600;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s;
}

.save-indicator.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ==================== RESPONSIVE TOASTS ET UX ==================== */
@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .toast {
        min-width: auto;
        max-width: 100%;
    }
    
    .quick-actions-btn {
        bottom: 16px;
        right: 16px;
        width: 52px;
        height: 52px;
        font-size: 1.3em;
    }
    
    .quick-actions-menu {
        right: 16px;
        bottom: 80px;
    }
}

@media (max-width: 480px) {
    .toast {
        padding: 10px 12px;
        font-size: 0.9em;
    }
    
    .toast-icon {
        font-size: 1em;
    }
}

.factions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

/* ==================== ANIMATIONS DE CLIC ==================== */
@keyframes clickFloat {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    50% {
        opacity: 1;
        transform: translateY(-30px) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translateY(-60px) scale(0.8);
    }
}


/* ==================== UPGRADES DE CLICS ==================== */
.upgrades-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.upgrades-info h3 {
    margin: 0 0 10px 0;
    font-size: 2em;
    font-weight: bold;
}

.upgrades-info p {
    margin: 10px 0;
    font-size: 1.1em;
    opacity: 0.95;
}

.current-click-power {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.current-click-power > div {
    background: rgba(255, 255, 255, 0.2);
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 1.15em;
    font-weight: bold;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.current-click-power span {
    color: #ffd700;
    font-size: 1.3em;
}

.upgrade-section {
    margin-bottom: 40px;
}

.upgrade-section h3 {
    font-size: 1.8em;
    color: #D4AF37;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--primary-color);
    text-shadow: 0 2px 4px rgba(212, 175, 55, 0.3);
}

.upgrades-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.upgrade-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    color: #2c3e50;
}

.upgrade-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.upgrade-card:hover::before {
    transform: scaleX(1);
}

.upgrade-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
    border-color: var(--primary-color);
}

.upgrade-card.unlocked {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-color: #22c55e;
}

.upgrade-card.unlocked::before {
    background: linear-gradient(90deg, #22c55e 0%, #10b981 100%);
    transform: scaleX(1);
}

.upgrade-card.locked {
    opacity: 0.6;
    filter: grayscale(40%);
}

.upgrade-icon {
    font-size: 3.5em;
    text-align: center;
    margin-bottom: 15px;
}

.upgrade-name {
    font-size: 1.4em;
    font-weight: bold;
    color: #2c3e50;
    text-align: center;
    margin-bottom: 10px;
}

.upgrade-description {
    color: #666;
    text-align: center;
    margin-bottom: 15px;
    font-size: 1.05em;
    line-height: 1.5;
}

.upgrade-cost {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
    margin-bottom: 15px;
    font-size: 1.1em;
    color: #495057;
}

.upgrade-status {
    background: linear-gradient(135deg, #22c55e 0%, #10b981 100%);
    color: white;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
    font-size: 1.1em;
}

.upgrade-card button {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upgrade-card button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.upgrade-card button:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .upgrades-grid {
        grid-template-columns: 1fr;
    }
    
    .current-click-power {
        flex-direction: column;
        gap: 10px;
    }
}

/* ==================== MODAL MANAGER GLOBAL ==================== */
.global-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.global-modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2em;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #f0f0f0;
    color: #333;
    transform: rotate(90deg);
}

.modal-body {
    margin: 20px 0;
    line-height: 1.6;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.modal-buttons button {
    min-width: 100px;
}

/* ==================== BOUTONS MULTI-ACHAT +1/+5/+10 ==================== */
.building-buttons-group,
.recruit-buttons-group,
.demob-buttons-group {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 10px;
}

.multi-buy-btn {
    min-width: 0;
    width: 100%;
    padding: 10px 8px;
    font-size: 0.95em;
    font-weight: 700;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    -webkit-transition: all 0.2s ease;
    -o-transition: all 0.2s ease;
    transition: all 0.2s ease;
    text-transform: none;
    letter-spacing: 0;
}

/* Empêcher les styles hérités (ex: width:100% des anciens boutons) d'élargir les cards */
.building-buttons-group .building-button {
    width: auto !important;
}

.building-card,
.unit-card {
    min-width: 0;
}

/* Utilitaires pour remplacer les styles inline dans index.html */
.btn-spaced-top {
    margin-top: 20px;
}

.divider-soft {
    margin: 30px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.placeholder-note {
    text-align: center;
    opacity: 0.7;
    margin: 40px 0;
}

.conquest-modal--wide {
    max-width: 800px;
}

.multi-buy-btn.can-buy {
    background: -webkit-gradient(linear, left top, right bottom, from(#28a745), to(#20c997));
    background: -webkit-linear-gradient(top left, #28a745, #20c997);
    background: -o-linear-gradient(top left, #28a745, #20c997);
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    -webkit-box-shadow: 0 3px 10px rgba(40, 167, 69, 0.4);
    box-shadow: 0 3px 10px rgba(40, 167, 69, 0.4);
}

.multi-buy-btn.can-buy:hover {
    -webkit-transform: translateY(-2px);
    -ms-transform: translateY(-2px);
    transform: translateY(-2px);
    -webkit-box-shadow: 0 5px 15px rgba(40, 167, 69, 0.6);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.6);
    -webkit-filter: brightness(1.1);
    filter: brightness(1.1);
}

.multi-buy-btn.can-buy:active {
    -webkit-transform: translateY(0);
    -ms-transform: translateY(0);
    transform: translateY(0);
}

.multi-buy-btn.cannot-buy,
.multi-buy-btn:disabled {
    background: -webkit-gradient(linear, left top, right bottom, from(#555), to(#444));
    background: -webkit-linear-gradient(top left, #555, #444);
    background: -o-linear-gradient(top left, #555, #444);
    background: linear-gradient(135deg, #555 0%, #444 100%);
    color: #999;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Boutons de démobilisation */
.demobilize-btn.multi-buy-btn {
    background: -webkit-gradient(linear, left top, right bottom, from(#dc3545), to(#c82333));
    background: -webkit-linear-gradient(top left, #dc3545, #c82333);
    background: -o-linear-gradient(top left, #dc3545, #c82333);
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    -webkit-box-shadow: 0 3px 10px rgba(220, 53, 69, 0.4);
    box-shadow: 0 3px 10px rgba(220, 53, 69, 0.4);
}

.demobilize-btn.multi-buy-btn:hover {
    -webkit-transform: translateY(-2px);
    -ms-transform: translateY(-2px);
    transform: translateY(-2px);
    -webkit-box-shadow: 0 5px 15px rgba(220, 53, 69, 0.6);
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.6);
}

/* ==================== QUEUE DE RECRUTEMENT COMPACTE ==================== */
.recruitment-queue-compact {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 12px;
    margin: 15px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.recruitment-queue-compact h4 {
    margin: 0 0 10px 0;
    color: #FFD700;
    font-size: 0.95em;
}

.queue-count {
    color: rgba(255, 255, 255, 0.6);
    font-weight: 400;
    font-size: 0.85em;
}

.no-queue {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
    padding: 10px;
    margin: 0;
}

.queue-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 6px;
}

.queue-item:last-child {
    margin-bottom: 0;
}

.queue-info {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: justify;
    -ms-flex-pack: justify;
    justify-content: space-between;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    margin-bottom: 5px;
    font-size: 0.9em;
}

.queue-time {
    color: #FFD700;
    font-weight: 600;
}

.queue-progress {
    height: 4px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 2px;
    overflow: hidden;
}

.queue-progress-bar {
    height: 100%;
    background: -webkit-gradient(linear, left top, right top, from(#28a745), to(#20c997));
    background: -webkit-linear-gradient(left, #28a745, #20c997);
    background: -o-linear-gradient(left, #28a745, #20c997);
    background: linear-gradient(90deg, #28a745, #20c997);
    border-radius: 2px;
    -webkit-transition: width 0.3s ease;
    -o-transition: width 0.3s ease;
    transition: width 0.3s ease;
}

/* ==================== COMPATIBILITÉ NAVIGATEURS - POLYFILLS CSS ==================== */
/* Flexbox pour anciens navigateurs */
.units-grid,
.buildings-grid,
.army-stats,
.stats-grid {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-flex-wrap: wrap;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
}

/* Box-sizing universel */
*, *::before, *::after {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

/* Transitions avec préfixes */
.unit-card,
.building-card,
.territory-cell {
    -webkit-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
}

/* Transform avec préfixes */
.unit-card:hover,
.building-card:hover {
    -webkit-transform: translateY(-3px);
    -ms-transform: translateY(-3px);
    transform: translateY(-3px);
}

/* Animation avec préfixes */
@-webkit-keyframes fadeInUp {
    from {
        opacity: 0;
        -webkit-transform: translateY(20px);
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        -webkit-transform: translateY(0);
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        -webkit-transform: translateY(20px);
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        -webkit-transform: translateY(0);
        transform: translateY(0);
    }
}

/* User-select avec préfixes */
.btn, button, .resource-card {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Appearance avec préfixes */
input, select, textarea {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Placeholder avec préfixes */
::-webkit-input-placeholder {
    color: rgba(255, 255, 255, 0.5);
}
::-moz-placeholder {
    color: rgba(255, 255, 255, 0.5);
}
:-ms-input-placeholder {
    color: rgba(255, 255, 255, 0.5);
}
::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Responsive boutons multi-achat */
@media (max-width: 768px) {
    .building-buttons-group,
    .recruit-buttons-group,
    .demob-buttons-group {
        gap: 4px;
    }
    
    .multi-buy-btn {
        padding: 8px 6px;
        font-size: 0.85em;
        min-width: 38px;
    }
}

@media (max-width: 480px) {
    .multi-buy-btn {
        padding: 6px 4px;
        font-size: 0.8em;
        min-width: 32px;
    }
}
