/* ────────────────────────────────────────────
   Demo Flow — Three-Pillar MadLibs Layout
   Pillar headers, element cards, role badges,
   summary tables
   ──────────────────────────────────────────── */

/* ── Pillar Header ── */
.demo-pillar-header {
    margin: 2rem 0 1rem;
    padding: 1rem 1.25rem;
    border-left: 5px solid var(--accent-primary, #c8a96e);
    background: linear-gradient(135deg, rgba(200 169 110 / 0.1), rgba(200 169 110 / 0.03));
    border-radius: 0 12px 12px 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}

.demo-pillar-icon {
    font-size: 2rem;
    line-height: 1;
}

.demo-pillar-info {
    flex: 1;
    min-width: 200px;
}

.demo-pillar-name {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--accent-primary, #c8a96e);
}

.demo-pillar-desc {
    font-size: 0.85rem;
    color: var(--text-secondary, #a0a0b0);
    margin-top: 0.15rem;
}

.demo-pillar-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

/* ── Badges ── */
.demo-badge {
    display: inline-block;
    font-size: 0.68rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.demo-badge-engine { background: rgba(138 180 248 / 0.2); color: #8ab4f8; }
.demo-badge-agent  { background: rgba(200 169 110 / 0.2); color: #c8a96e; }
.demo-badge-player { background: rgba(129 201 149 / 0.2); color: #81c995; }
.demo-badge-state  { background: rgba(186 135 211 / 0.2); color: #ba87d3; }
.demo-badge-total  { background: rgba(255 255 255 / 0.08); color: var(--text-primary, #e0e0e0); }

/* ── Element Card ── */
.demo-element-card {
    margin: 0.4rem 0;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    border: 1px solid rgba(255 255 255 / 0.08);
    background: var(--surface-tertiary, rgba(255 255 255 / 0.02));
    font-size: 0.8rem;
    transition: border-color 0.2s;
}

.demo-element-card:hover {
    border-color: rgba(255 255 255 / 0.15);
}

/* Role-based left border accent */
.demo-element-engine { border-left: 3px solid #8ab4f8; }
.demo-element-agent  { border-left: 3px solid #c8a96e; }
.demo-element-player { border-left: 3px solid #81c995; }
.demo-element-state  { border-left: 3px solid #ba87d3; }

.demo-element-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    flex-wrap: wrap;
}

.demo-element-role-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.demo-role-engine { background: rgba(138 180 248 / 0.2); color: #8ab4f8; }
.demo-role-agent  { background: rgba(200 169 110 / 0.2); color: #c8a96e; }
.demo-role-player { background: rgba(129 201 149 / 0.2); color: #81c995; }
.demo-role-state  { background: rgba(186 135 211 / 0.2); color: #ba87d3; }

.demo-element-type {
    font-size: 0.72rem;
    color: var(--text-secondary, #a0a0b0);
    font-family: 'Consolas', 'Fira Code', monospace;
}

.demo-element-id {
    font-size: 0.65rem;
    color: rgba(255 255 255 / 0.3);
    margin-left: auto;
    font-family: 'Consolas', 'Fira Code', monospace;
}

.demo-element-label {
    font-weight: 700;
    color: var(--text-primary, #e0e0e0);
    margin-bottom: 0.25rem;
}

.demo-element-condition {
    font-size: 0.75rem;
    color: var(--text-secondary, #a0a0b0);
    font-style: italic;
    margin-bottom: 0.2rem;
}

.demo-element-engine-call {
    font-family: 'Consolas', 'Fira Code', monospace;
    font-size: 0.72rem;
    color: #8ab4f8;
    background: rgba(138 180 248 / 0.08);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    margin: 0.2rem 0;
}

.demo-element-result {
    font-family: 'Consolas', 'Fira Code', monospace;
    font-size: 0.75rem;
    color: var(--text-primary, #e0e0e0);
    background: rgba(255 255 255 / 0.04);
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    margin: 0.2rem 0;
}

.demo-result-pair strong {
    color: var(--accent-secondary, #8ab4f8);
}

.demo-element-modifiers {
    font-size: 0.72rem;
    color: var(--text-secondary, #a0a0b0);
}

/* Agent narrative blank — the "MadLibs" slot */
.demo-element-agent-blank {
    margin-top: 0.3rem;
    padding: 0.35rem 0.6rem;
    border: 1px dashed rgba(200 169 110 / 0.4);
    border-radius: 6px;
    background: rgba(200 169 110 / 0.05);
    color: #c8a96e;
    font-style: italic;
    font-size: 0.78rem;
}

/* Player input blank */
.demo-element-player-blank {
    margin-top: 0.3rem;
    padding: 0.35rem 0.6rem;
    border: 1px dashed rgba(129 201 149 / 0.4);
    border-radius: 6px;
    background: rgba(129 201 149 / 0.05);
    color: #81c995;
    font-style: italic;
    font-size: 0.78rem;
}

.demo-element-state {
    font-size: 0.72rem;
    color: #ba87d3;
    font-family: 'Consolas', 'Fira Code', monospace;
    margin-top: 0.2rem;
}

.demo-element-rules {
    font-size: 0.72rem;
    color: var(--text-secondary, #a0a0b0);
    background: rgba(255 255 255 / 0.03);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    margin-top: 0.2rem;
}

.demo-element-npc {
    font-size: 0.72rem;
    color: #e8b84d;
    font-family: 'Consolas', 'Fira Code', monospace;
    margin-top: 0.2rem;
}

/* ── Pillar Summary ── */
.demo-pillar-summary {
    margin: 1.5rem 0;
    padding: 1rem;
    border: 1px solid var(--accent-primary, #c8a96e);
    border-radius: 10px;
    background: var(--surface-secondary, rgba(255 255 255 / 0.04));
}

/* ── Master Summary ── */
.demo-master-summary {
    margin: 2rem 0 1rem;
    padding: 1.25rem;
    border: 2px solid var(--accent-primary, #c8a96e);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(200 169 110 / 0.08), rgba(200 169 110 / 0.02));
}

.demo-summary-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--accent-primary, #c8a96e);
}

.demo-summary-subtitle {
    font-size: 0.82rem;
    color: var(--text-secondary, #a0a0b0);
    margin-bottom: 0.75rem;
}

.demo-summary-counts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.demo-summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.demo-summary-table th,
.demo-summary-table td {
    text-align: left;
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid rgba(255 255 255 / 0.08);
}

.demo-summary-table th {
    color: var(--accent-secondary, #8ab4f8);
    font-weight: 700;
}

.demo-summary-table td:first-child {
    white-space: nowrap;
    font-weight: 600;
    color: var(--accent-primary, #c8a96e);
}
