* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6c5ce7;
    --primary-dark: #5b4bc4;
    --secondary: #a8e6cf;
    --danger: #ff7675;
    --warning: #fdcb6e;
    --success: #00b894;
    --dark: #2d3436;
    --light: #f5f6fa;
    --gray: #dfe6e9;
    --text: #2d3436;
    --bg-gray: #eef2f3;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-gray);
    min-height: 100vh;
    color: var(--text);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.nav-brand h1 {
    font-size: 1.5rem;
    color: var(--primary);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: var(--primary);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Main content */
main {
    min-height: calc(100vh - 140px);
    padding: 2rem 0;
}

/* Cards */
.card {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.card-header {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--gray);
}

.card-header h2, .card-header h3 {
    color: var(--primary);
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

input, select, textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--gray);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
    background: white;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
}

button, .btn {
    background: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

button:hover, .btn:hover {
    background: var(--primary-dark);
}

.btn-danger {
    background: var(--danger);
}

.btn-danger:hover {
    background: #e74c3c;
}

.btn-success {
    background: var(--success);
}

.btn-success:hover {
    background: #00947a;
}

/* Grid layouts */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

/* Building cards */
.building-card {
    background: white;
    border-radius: 10px;
    padding: 1rem;
    border-left: 4px solid var(--primary);
    margin-bottom: 1rem;
}

.building-card h4 {
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.building-stats {
    margin: 1rem 0;
    padding: 0.75rem;
    background: var(--light);
    border-radius: 8px;
}

.slot-progress {
    margin: 0.5rem 0;
}

/* Defense slots */
.defense-slot {
    background: var(--light);
    border: 2px dashed var(--gray);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    transition: all 0.3s;
}

.defense-slot:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.defense-slot.filled {
    background: linear-gradient(135deg, #e8f8f5, #d5f5e3);
    border-color: var(--success);
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray);
}

th {
    background: var(--primary);
    color: white;
    font-weight: 600;
}

tr:hover {
    background: var(--light);
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    animation: slideIn 0.3s ease-out;
}

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

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Stats */
.stat-card {
    text-align: center;
    padding: 1.5rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
}

.stat-label {
    color: var(--text);
    margin-top: 0.5rem;
}

/* Condition badges */
.condition-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    margin: 0.25rem 0;
}

.condition-badge.affinity {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.condition-badge.role {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.condition-badge.faction {
    background: linear-gradient(135deg, #2d3436, #636e72);
    color: white;
}

/* Trap badge */
.badge-trap {
    background: var(--warning);
    color: var(--dark);
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Stats overview */
.stats-overview .card {
    transition: transform 0.3s;
}

.stats-overview .card:hover {
    transform: translateY(-5px);
}

/* Stats cards gradient backgrounds */
.stats-grid .stat-card:first-child {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.stats-grid .stat-card:first-child .stat-number {
    color: white;
}

.stats-grid .stat-card:nth-child(2) {
    background: linear-gradient(135deg, #00b894, #55efc4);
    color: white;
}

.stats-grid .stat-card:nth-child(2) .stat-number {
    color: white;
}

.stats-grid .stat-card:nth-child(3) {
    background: linear-gradient(135deg, #fdcb6e, #f39c12);
    color: white;
}

.stats-grid .stat-card:nth-child(3) .stat-number {
    color: white;
}

.stats-grid .stat-card:last-child {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.stats-grid .stat-card:last-child .stat-number {
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }
    
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 0 15px;
    }
    
    th, td {
        padding: 0.5rem;
        font-size: 0.875rem;
    }
}

/* Footer */
footer {
    background: white;
    text-align: center;
    padding: 1rem 0;
    margin-top: 2rem;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

/* Tooltips */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]:before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 5px;
    font-size: 0.75rem;
    white-space: nowrap;
    display: none;
    z-index: 1000;
}

[data-tooltip]:hover:before {
    display: block;
}

/* Page spécifique share.php */
.share-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 2rem 0;
    text-align: center;
}

.view-mode {
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(10px);
    text-align: center;
    padding: 0.75rem;
    font-size: 0.875rem;
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
}

.share-container {
    background: var(--bg-gray);
}