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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

#app {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 30px;
    max-width: 1200px;
    width: 100%;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 3rem;
    color: #333;
    margin-bottom: 10px;
}

header p {
    color: #666;
    font-size: 1.1rem;
}

main {
    display: flex;
    gap: 20px;
}

#main-content {
    flex: 1;
}

#activity-sidebar {
    width: 320px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 12px;
    padding: 24px;
    max-height: 700px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    border: 2px solid rgba(102, 126, 234, 0.3);
}

#activity-sidebar h3 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 1.4rem;
    font-weight: 700;
    border-bottom: 3px solid #667eea;
    padding-bottom: 12px;
    text-align: center;
    letter-spacing: 0.5px;
}

#activity-log {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 8px;
}

#activity-log::-webkit-scrollbar {
    width: 8px;
}

#activity-log::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

#activity-log::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 4px;
}

#activity-log::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.7);
}

.activity-log-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: #7f8c8d;
    height: 100%;
}

.activity-log-empty-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.6;
}

.activity-log-empty-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #34495e;
}

.activity-log-empty-subtitle {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #95a5a6;
}

.activity-event {
    background: white;
    border-left: 4px solid #667eea;
    padding: 14px;
    margin-bottom: 12px;
    border-radius: 8px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12);
    animation: slideIn 0.4s ease-out;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.activity-event:hover {
    transform: translateX(2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.16);
}

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

.activity-event.building {
    border-left-color: #4CAF50;
    background: linear-gradient(135deg, #ffffff 0%, #f1f8f4 100%);
}

.activity-event.birth {
    border-left-color: #FF69B4;
    background: linear-gradient(135deg, #ffffff 0%, #fff0f6 100%);
}

.activity-event.government {
    border-left-color: #FFC107;
    background: linear-gradient(135deg, #ffffff 0%, #fffbf0 100%);
}

.activity-event.tax {
    border-left-color: #2196F3;
    background: linear-gradient(135deg, #ffffff 0%, #f0f7ff 100%);
}

.activity-event.rebellion {
    border-left-color: #f44336;
    background: linear-gradient(135deg, #ffffff 0%, #fff5f5 100%);
}

.activity-event-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-weight: 700;
    color: #2c3e50;
    font-size: 1.05rem;
}

.activity-event-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.activity-event-details {
    font-size: 0.92rem;
    color: #555;
    line-height: 1.5;
    padding-left: 32px;
    margin-bottom: 6px;
}

.activity-event-time {
    font-size: 0.82rem;
    color: #95a5a6;
    margin-top: 6px;
    padding-left: 32px;
    font-weight: 500;
}

#world-container {
    background: #f5f5f5;
    border: 2px solid #ddd;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 500px;
}

#world-canvas {
    border: 1px solid #ccc;
    background: white;
}

#controls {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

button {
    padding: 12px 24px;
    font-size: 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

#start-btn {
    background: #4CAF50;
    color: white;
}

#start-btn:hover:not(:disabled) {
    background: #45a049;
}

#pause-btn {
    background: #ff9800;
    color: white;
}

#pause-btn:hover:not(:disabled) {
    background: #e68900;
}

#reset-btn {
    background: #f44336;
    color: white;
}

#reset-btn:hover {
    background: #da190b;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#speed-control {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 8px;
}

#speed {
    width: 150px;
}

#stats {
    background: #f9f9f9;
    border-radius: 10px;
    padding: 20px;
}

#stats h3 {
    margin-bottom: 15px;
    color: #333;
}

#stats-content p {
    margin: 8px 0;
    color: #666;
    font-size: 1rem;
}

#stats-content span {
    font-weight: bold;
    color: #667eea;
}

@media (max-width: 768px) {
    main {
        flex-direction: column;
    }
    
    #activity-sidebar {
        width: 100%;
        max-height: 300px;
    }
    
    #world-canvas {
        max-width: 100%;
    }
}
