:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --border: rgba(255, 255, 255, 0.1);
    --text: #f8fafc;
    --text-dim: #94a3b8;
    --accent: #818cf8;
    --green: #22c55e;
    --cyan: #22d3ee;
    --red: #f43f5e;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }

body {
    background-color: var(--bg);
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.15) 0px, transparent 50%);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.container { max-width: 900px; width: 100%; }

.hero-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.8s ease-out;
}

.badge {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background: rgba(34, 197, 94, 0.15);
    color: var(--green);
    border-radius: 9999px;
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(34, 197, 94, 0.3);
    transition: all 0.3s;
}

.badge.active {
    background: rgba(99, 102, 241, 0.2);
    color: var(--accent);
    border-color: rgba(99, 102, 241, 0.4);
    animation: pulse 1.5s infinite;
}

h1 {
    font-size: 2.75rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

p.description {
    font-size: 1rem;
    color: var(--text-dim);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

/* ── Scenario Grid ── */
.scenario-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.scenario-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 1rem 0.5rem;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.2s;
}

.scenario-btn:hover {
    border-color: var(--accent);
    color: white;
    transform: translateY(-2px);
}

.scenario-btn.active {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    color: white;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.scenario-icon { font-size: 1.5rem; }
.scenario-name { font-size: 0.75rem; font-weight: 600; }
.scenario-diff { font-size: 0.65rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; }

/* ── Chaos Controls ── */
.chaos-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.chaos-input {
    flex: 1;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    color: white;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.chaos-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* ── Terminal Log ── */
.terminal-log {
    background: #020617;
    border-radius: 12px;
    padding: 1.25rem;
    height: 320px;
    overflow-y: auto;
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    text-align: left;
    margin-bottom: 1.25rem;
    border: 1px solid var(--border);
    scroll-behavior: smooth;
}

.log-line {
    padding: 0.2rem 0;
    line-height: 1.5;
    color: var(--text-dim);
    animation: logSlide 0.2s ease-out;
}

.log-line.system { color: var(--accent); }
.log-line.user { color: var(--cyan); }
.log-line.alert { color: var(--red); font-weight: 600; }

/* ── Stats Grid ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.stat-box {
    background: rgba(15, 23, 42, 0.4);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-dim);
    margin-bottom: 0.25rem;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: white;
}

/* ── Buttons ── */
.btn {
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    font-size: 0.9rem;
}

.btn-primary { background: var(--primary); color: white; white-space: nowrap; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: white;
}

.actions { text-align: center; }

/* ── Animations ── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes logSlide {
    from { opacity: 0; transform: translateX(-5px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .scenario-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    h1 { font-size: 2rem; }
    .hero-card { padding: 1.5rem; }
}
