body {
    margin: 0;
    padding: 20px;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background: #f0f0f0;
    color: #333;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.title {
    position: fixed;
    top: 12px;
    right: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #90a4ae;
    letter-spacing: 0.3px;
    z-index: 5;
}

.canvas-area {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

#restartButton {
    padding: 5px 10px;
    font-size: 12px;
    background: #eceff1;
    color: #546e7a;
    border: 1px solid #cfd8dc;
    border-radius: 3px;
    cursor: pointer;
    margin-top: 2px;
    white-space: nowrap;
    transition: background 0.15s;
}

#restartButton:hover {
    background: #cfd8dc;
}

.sim-area {
    display: contents;
}

.creature-list {
    position: fixed;
    left: 16px;
    top: 16px;
    width: 230px;
    max-height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    z-index: 10;
}

.creature-list-header {
    padding: 8px 16px;
    background: #eceff1;
    font-weight: 600;
    font-size: 14px;
    color: #455a64;
    flex-shrink: 0;
}

.creature-list-scroll {
    flex: 1;
    overflow-y: auto;
}

.creature-table {
    width: 100%;
    border-collapse: collapse;
    font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
    font-size: 11px;
    line-height: 1.4;
}

.creature-table thead th {
    position: sticky;
    top: 0;
    padding: 6px 4px;
    background: #f5f7f8;
    font-weight: 600;
    color: #607d8b;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    border-bottom: 1px solid #cfd8dc;
}

.creature-table th.col-id,
.creature-table td.col-id {
    text-align: right;
    padding-right: 6px;
    color: #90a4ae;
    width: 28px;
}

.creature-table th.col-species,
.creature-table td.col-species {
    width: 36px;
    text-align: center;
}

.creature-table td {
    padding: 4px 4px;
    border-bottom: 1px solid #f5f5f5;
    vertical-align: middle;
}

.creature-table tbody tr:hover {
    background: #fafafa;
}

.creature-dot {
    display: inline-block;
    border-radius: 50%;
    vertical-align: middle;
}

.creature-dot.child {
    width: 7px;
    height: 7px;
}

.creature-dot.adult {
    width: 13px;
    height: 13px;
}

.vis-dim {
    color: #bbb;
}

#simulationCanvas {
    background: #fafafa;
    border: 2px solid #333;
    display: block;
    margin-bottom: 16px;
    max-width: 100%;
}

.stats {
    padding: 14px 20px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px 24px;
    min-width: 320px;
}

.stats > div {
    font-size: 14px;
}

.stats b {
    color: #555;
    font-weight: 600;
}

.log-panel {
    margin-top: 16px;
    width: 640px;
    max-width: 100%;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.log-header {
    padding: 8px 16px;
    background: #eceff1;
    font-weight: 600;
    font-size: 14px;
    color: #455a64;
}

#log-list {
    padding: 8px 12px;
    font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
    font-size: 12px;
    max-height: 260px;
    overflow-y: auto;
    line-height: 1.45;
}

.log-entry { padding: 1px 0; }
.log-time { color: #9e9e9e; margin-right: 8px; }
.log-birth { color: #2e7d32; }
.log-death { color: #c62828; }
.log-eat_food { color: #1565c0; }
.log-eat_prey { color: #ad1457; font-weight: 600; }
.log-repro_fail { color: #f57c00; }
.log-carn_full { color: #6a1b9a; }
.log-stat {
    color: #00695c;
    font-weight: 600;
    background: #e0f2f1;
    padding: 4px 8px;
    margin: 3px -8px;
    border-radius: 3px;
}

