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

body {
    background: #1a1a1a;
    color: #e0e0e0;
    font-family: 'Courier New', monospace;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* === BARRE CONTROLES SIMULATION === */
.sim-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 20px;
    background: #252525;
    border-bottom: 1px solid #333;
    position: sticky;
    top: 0;
    z-index: 50;
}

.btn-hamburger {
    padding: 8px 12px;
    font-size: 1.2rem;
}

.app-title {
    display: block;
    font-size: 1.1rem;
    color: #8ab4f8;
    letter-spacing: 2px;
    margin-right: 10px;
}

.sim-controls .control-group {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.sim-controls label {
    margin: 0;
}

.sim-controls .step-display {
    margin-left: auto;
    font-size: 0.9rem;
    color: #888;
}

.sim-controls .step-display span {
    color: #e0e0e0;
    font-weight: bold;
}

/* === LAYOUT PRINCIPAL === */
.app-layout {
    display: flex;
    flex: 1;
    min-height: 0;
}

/* === TIROIR PARAMETRES === */
.sidebar {
    width: 280px;
    background: #222;
    border-right: 1px solid #333;
    display: flex;
    flex-direction: column;
    transition: width 0.2s, padding 0.2s;
    overflow: hidden;
    min-height: 0;
    height: 100%;
}

.sidebar.collapsed {
    width: 0;
    border-right: none;
}

.sidebar.collapsed .sidebar-content {
    display: none;
}

.sidebar-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.sidebar-section h3 {
    font-size: 0.8rem;
    color: #8ab4f8;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    padding-bottom: 5px;
    border-bottom: 1px solid #333;
}

.sidebar-section .control-group {
    margin-bottom: 10px;
}

/* === ZONE CONTENU === */
.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 15px;
    gap: 15px;
}

.content-row {
    display: flex;
    gap: 15px;
}

.content-row.main-row {
    min-height: 500px;
}

/* === GRAPHE POPULATION === */
.graph-container {
    flex: 1;
    background: #2a2a2a;
    border: 1px solid #333;
    min-height: 150px;
    position: relative;
}

.graph-container canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* === LOG EVENEMENTS === */
.event-log {
    width: 280px;
    background: #2a2a2a;
    border: 1px solid #333;
    display: flex;
    flex-direction: column;
    min-height: 150px;
}

.event-log-header {
    padding: 8px 10px;
    border-bottom: 1px solid #333;
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.event-log-entries {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    font-size: 0.8rem;
}

.event-log-entry {
    padding: 4px 0;
    border-bottom: 1px solid #333;
    color: #aaa;
}

.event-log-footer {
    padding: 8px 10px;
    border-top: 1px solid #333;
    font-size: 0.75rem;
}

.event-log-footer label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

/* === PANEL STATS === */
.stats-panel {
    background: #2a2a2a;
    border: 1px solid #333;
}

.stats-tabs {
    display: flex;
    border-bottom: 1px solid #333;
}

.stats-tab {
    padding: 8px 20px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #888;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.stats-tab:hover {
    color: #e0e0e0;
}

.stats-tab.active {
    color: #8ab4f8;
    border-bottom-color: #8ab4f8;
}

.stats-content {
    padding: 15px;
    min-height: 100px;
}

.stats-header {
    margin-bottom: 10px;
    font-size: 0.85rem;
}

.stats-summary {
    margin-bottom: 12px;
    padding: 8px;
    background: #333;
    border-radius: 4px;
    font-size: 0.85rem;
}

.stats-subtitle {
    font-size: 0.75rem;
    color: #8ab4f8;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.stats-biomes {
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    font-size: 0.8rem;
    border-bottom: 1px solid #333;
}

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


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

.control-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.input-with-btn {
    display: flex;
    gap: 4px;
}

.input-with-btn input {
    flex: 1;
}

.btn-refresh {
    padding: 4px 8px;
    font-size: 1rem;
    min-width: auto;
}

label {
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

input[type="text"],
input[type="number"] {
    background: #2a2a2a;
    border: 1px solid #444;
    color: #e0e0e0;
    padding: 8px 12px;
    font-family: inherit;
    font-size: 0.9rem;
    width: 120px;
}

input:focus {
    outline: none;
    border-color: #8ab4f8;
}

button {
    background: #3a3a3a;
    border: 1px solid #555;
    color: #e0e0e0;
    padding: 10px 20px;
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

button:hover {
    background: #4a4a4a;
    border-color: #8ab4f8;
}

.map-wrapper {
    display: flex;
    gap: 15px;
    flex: 1;
    min-height: 0;
}

.canvas-container {
    border: 1px solid #333;
    background: #000;
    overflow: hidden;
    flex: 1;
    position: relative;
    cursor: crosshair;
}

.cell-info {
    width: 280px;
    background: #2a2a2a;
    border: 1px solid #333;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
}

/* Sections dans panel détail */
.detail-section {
    border-bottom: 1px solid #333;
    padding-bottom: 12px;
}

.detail-section:last-child {
    border-bottom: none;
}

.detail-section h4 {
    font-size: 0.75rem;
    color: #8ab4f8;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.creature-info {
    display: none;
}

.creature-info.has-creature {
    display: block;
}

.btn-follow {
    margin-top: 10px;
    width: 100%;
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* Section case - layout horizontal */
.cell-section {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.cell-preview {
    flex-shrink: 0;
}

.cell-color {
    width: 64px;
    height: 64px;
    background: #444;
    border: 1px solid #555;
    image-rendering: pixelated;
    position: static;
}

.cell-biome {
    font-weight: bold;
    color: #8ab4f8;
    margin-bottom: 6px;
}

.cell-data {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cell-data div {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.85rem;
}

.cell-data .label {
    color: #888;
    flex: 1;
}

.cell-data span:not(.label) {
    color: #e0e0e0;
    text-align: right;
    white-space: pre;
}

canvas {
    display: block;
    image-rendering: pixelated;
    position: absolute;
    top: 0;
    left: 0;
}

#minimap {
    position: absolute;
    top: auto;
    left: auto;
    bottom: 10px;
    right: 10px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(0, 0, 0, 0.3);
    image-rendering: pixelated;
    display: none;
    z-index: 10;
    opacity: 0.7;
    transition: opacity 0.2s;
}

#minimap:hover {
    opacity: 0.9;
}

.info {
    margin-top: 15px;
    font-size: 0.8rem;
    color: #666;
}

.generating {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 30px 50px;
    border: 1px solid #444;
    z-index: 100;
    display: none;
}

.generating.active {
    display: block;
}

.zoom-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 0.85rem;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 20;
}

.zoom-hint.visible {
    opacity: 1;
}
