:root {
    --bg-color: #0f172a;
    --text-color: #e2e8f0;
    --primary-color: #3b82f6;
    --secondary-color: #64748b;
    --accent-color: #f59e0b;
    --danger-color: #ef4444;
    --panel-bg: #1e293b;
    --box-bg: #334155;
    --success-color: #10b981;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
}

.game-container {
    max-width: 1200px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

h1 {
    font-weight: 600;
    margin: 0;
    background: linear-gradient(to right, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    background: var(--panel-bg);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
}

.btn:active {
    transform: scale(0.95);
}

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

.primary {
    background-color: var(--primary-color);
    color: white;
}

.secondary {
    background-color: var(--secondary-color);
    color: white;
}

.accent {
    background-color: var(--accent-color);
    color: black;
}

.danger {
    background-color: var(--danger-color);
    color: white;
}

.main-view {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
}

.section {
    background: var(--panel-bg);
    padding: 20px;
    border-radius: 12px;
    min-height: 400px;
}

h2 {
    margin-top: 0;
    border-bottom: 1px solid var(--secondary-color);
    padding-bottom: 10px;
    font-size: 1.2rem;
    color: var(--secondary-color);
}

/* Control Plane */
.component-box {
    background: var(--box-bg);
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
    border: 1px solid #475569;
}

.queue {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 60px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

/* Data Plane */
.cluster-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-content: flex-start;
}

.instance {
    background: #1e1e1e;
    border: 2px solid var(--secondary-color);
    border-radius: 8px;
    width: 200px;
    min-height: 250px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: all 0.3s ease;
}

.instance.active {
    border-color: var(--success-color);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

.instance-header {
    font-size: 0.9rem;
    color: #94a3b8;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
}

.resource-bar {
    height: 6px;
    background: #333;
    border-radius: 3px;
    margin-bottom: 5px;
    overflow: hidden;
}

.resource-fill {
    height: 100%;
    background: var(--success-color);
    width: 0%;
    transition: width 0.5s ease;
}

.task-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 10px;
}

/* Task Entity */
.task {
    background: var(--accent-color);
    color: black;
    padding: 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    text-align: center;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.task.pending {
    background: var(--secondary-color);
    color: white;
    border: 1px dashed white;
}

@keyframes popIn {
    from {
        transform: scale(0);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Logs */
.logs-section {
    background: #000;
    padding: 15px;
    border-radius: 8px;
    height: 150px;
    overflow-y: auto;
    font-family: 'Courier New', Courier, monospace;
    border: 1px solid #333;
}

#event-log {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.9rem;
}

#event-log li {
    margin-bottom: 5px;
    color: #22c55e;
}

#event-log li::before {
    content: "> ";
    color: #666;
}