:root {
    --bg: #0b0d12;
    --surface: #141821;
    --surface-raised: #1b202b;
    --border: #262c3a;
    --border-hover: #3a4357;
    --text: #e6e9ef;
    --text-muted: #8b93a7;
    --accent: #7c8cff;
    --success: #34d399;
    --danger: #f87171;
    --radius: 12px;
    color-scheme: dark;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px 16px;
    background:
        radial-gradient(circle at 20% 0%, rgba(124, 140, 255, 0.12), transparent 45%),
        radial-gradient(circle at 100% 100%, rgba(248, 113, 113, 0.08), transparent 40%),
        var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    line-height: 1.5;
}

.card {
    width: 100%;
    max-width: 520px;
    padding: 28px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 650;
    letter-spacing: -0.02em;
}

h2 {
    margin: 0 0 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 999px;
    border: 1px solid currentColor;
}

.badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.badge-on {
    color: var(--danger);
}

.badge-off {
    color: var(--text-muted);
}

.stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 28px;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.stat-scenario {
    color: var(--accent);
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 1rem;
}

.group + .group {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.actions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.actions form {
    margin: 0;
}

.btn {
    width: 100%;
    padding: 11px 14px;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.btn:hover {
    border-color: var(--border-hover);
    background: #222837;
}

.btn:active {
    transform: translateY(1px);
}

.btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.btn-success {
    color: var(--success);
    border-color: rgba(52, 211, 153, 0.35);
    background: rgba(52, 211, 153, 0.08);
}

.btn-success:hover {
    border-color: var(--success);
    background: rgba(52, 211, 153, 0.16);
}

.btn-danger {
    color: var(--danger);
    border-color: rgba(248, 113, 113, 0.35);
    background: rgba(248, 113, 113, 0.08);
}

.btn-danger:hover {
    border-color: var(--danger);
    background: rgba(248, 113, 113, 0.16);
}

@media (max-width: 420px) {
    .card {
        padding: 20px;
    }

    .stats {
        grid-template-columns: 1fr;
    }
}
