/* === REACTION POINTS === */
.reaction-points-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding-top: var(--space-1);
    border-top: 1px solid var(--border);
    margin-top: var(--space-1);
}

.reaction-points-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.reaction-points-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gold);
    min-width: 1.5rem;
    text-align: center;
}

.btn-rp {
    width: 2rem;
    height: 2rem;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    background-color: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 150ms ease-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-rp:hover {
    border-color: var(--gold);
    color: var(--gold);
}

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

/* === REACTIONS SECTION === */
.reactions-section {
    padding: var(--space-3);
    border-bottom: 1px solid var(--border);
    display: block;
    visibility: visible;
    min-height: 80px;
}

.section-header {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gold);
    margin: 0 0 var(--space-2) 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    visibility: visible;
}

.reactions-counter {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.75rem;
    color: var(--text-secondary);
    background-color: var(--bg-elevated);
    padding: var(--space-1) var(--space-2);
    border-radius: 4px;
}

.reactions-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    min-height: 50px;
}

.reaction-item {
    background-color: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: var(--space-2) var(--space-3);
    cursor: pointer;
    transition: all 150ms ease-out;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 50px;
    justify-content: center;
}

.reaction-item:hover {
    border-color: var(--gold);
    background-color: var(--gold-dim);
    transform: translateY(-2px);
}

.reaction-item:active {
    transform: scale(0.95);
}

.reaction-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.reaction-text {
    flex: 1;
    text-align: left;
}

.reaction-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
}

.reaction-name {
    font-weight: 700;
    color: var(--text-primary);
}

.reaction-type-badge {
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 1px var(--space-2);
    border-radius: 3px;
    flex-shrink: 0;
}

.reaction-type-badge.reaction-core {
    background-color: rgba(56, 161, 105, 0.2);
    color: var(--success);
    border: 1px solid rgba(56, 161, 105, 0.3);
}

.reaction-type-badge.reaction-advanced {
    background-color: rgba(168, 85, 247, 0.2);
    color: #a855f7;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.reaction-type-badge.reaction-faction {
    background-color: rgba(234, 179, 8, 0.2);
    color: var(--gold);
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.reaction-once-badge {
    font-size: 0.55rem;
    font-weight: 700;
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 0 4px;
    border-radius: 3px;
    margin-left: var(--space-1);
    vertical-align: middle;
}

/* Allegiance toggle in battle setup */
.allegiance-toggle {
    margin-top: var(--space-2);
    margin-bottom: var(--space-2);
}

.allegiance-buttons {
    display: flex;
    gap: var(--space-2);
}

.allegiance-btn {
    flex: 1;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
}

.allegiance-btn.active[data-allegiance="loyalist"] {
    background: rgba(56, 161, 105, 0.2);
    border-color: var(--success);
    color: var(--success);
}

.allegiance-btn.active[data-allegiance="traitor"] {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--danger);
    color: var(--danger);
}

.allegiance-label {
    font-size: 0.65rem;
    font-style: italic;
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
}

/* Army List Import */
.army-list-import {
    margin-top: var(--space-3);
    margin-bottom: var(--space-2);
}
.army-list-toggle {
    width: 100%;
    text-align: center;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}
.army-list-toggle.army-list-imported {
    background: rgba(56, 161, 105, 0.15);
    border-color: var(--success);
    color: var(--success);
}
.army-list-input-area {
    margin-top: var(--space-2);
}
.army-list-textarea {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    line-height: 1.4;
    min-height: 120px;
    resize: vertical;
    background: var(--bg-card);
    color: var(--text-primary);
}
.army-list-btn-row {
    display: flex;
    gap: var(--space-2);
    margin-top: var(--space-2);
}
.army-list-preview {
    margin-top: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.8rem;
}
.army-list-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: var(--space-2);
    padding-bottom: var(--space-1);
    border-bottom: 1px solid var(--border);
    color: var(--gold);
}
.army-list-preview-header span {
    font-size: 0.7rem;
    color: var(--text-muted);
}
.army-list-preview-rite {
    font-size: 0.7rem;
    font-style: italic;
    color: var(--text-muted);
    margin-bottom: var(--space-1);
}
.army-list-preview-category {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-top: var(--space-2);
    margin-bottom: var(--space-1);
}
.army-list-preview-unit {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
    font-size: 0.75rem;
    color: var(--text-primary);
}
.army-list-preview-pts {
    color: var(--text-muted);
    white-space: nowrap;
    margin-left: var(--space-2);
}

/* Army List in Battle Detail */
.detail-army {
    margin-bottom: var(--space-3);
    padding: var(--space-2) var(--space-3);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.detail-army-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: var(--space-1);
    margin-bottom: var(--space-2);
    padding-bottom: var(--space-1);
    border-bottom: 1px solid var(--border);
    color: var(--gold);
    font-size: 0.85rem;
}
.detail-army-header span {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.detail-army-rite {
    font-size: 0.75rem;
    font-style: italic;
    color: var(--text-muted);
    margin-bottom: var(--space-2);
}
.detail-army-category {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-top: var(--space-2);
    margin-bottom: var(--space-1);
}
.detail-army-unit {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
    font-size: 0.8rem;
    color: var(--text-primary);
}
.detail-army-unit-right {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    white-space: nowrap;
}
.detail-army-pts {
    color: var(--text-muted);
    white-space: nowrap;
    margin-left: var(--space-1);
}
.detail-army-badge {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    letter-spacing: 0.03em;
}
.badge-line {
    background: rgba(56, 161, 105, 0.2);
    color: var(--success);
    border: 1px solid rgba(56, 161, 105, 0.4);
}
.badge-vanguard {
    background: rgba(66, 153, 225, 0.2);
    color: #63b3ed;
    border: 1px solid rgba(66, 153, 225, 0.4);
}

/* VP Attribution Picker Modal */
.vp-attribution-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-3);
}
.vp-attribution-modal {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-4);
    max-width: 400px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    overflow-anchor: none;
}
.vp-attribution-modal h4 {
    margin: 0 0 var(--space-1);
    color: var(--gold);
    font-size: 1rem;
}
.vp-attribution-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0 0 var(--space-3);
}
.vp-attribution-amount {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-3);
    padding: var(--space-2);
    background: var(--bg-card);
    border-radius: var(--radius);
}
.vp-attribution-amount label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}
.vp-attribution-amount-controls {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}
.vp-amt-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--gold);
    min-width: 24px;
    text-align: center;
}
.vp-amt-btn {
    min-width: 32px;
    min-height: 32px;
    font-size: 1rem;
    font-weight: 700;
}
.vp-attribution-units {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    margin-bottom: var(--space-3);
}
.vp-attribution-unit-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-2) var(--space-3);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.8rem;
    text-align: left;
    transition: border-color 0.15s;
}
.vp-attribution-unit-btn:active {
    border-color: var(--gold);
    background: rgba(212, 175, 55, 0.1);
}
.vp-attr-unit-name {
    font-weight: 600;
}
.vp-attr-unit-cat {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.vp-attribution-actions {
    display: flex;
    gap: var(--space-2);
}
.vp-attribution-actions .btn {
    flex: 1;
}

.reaction-item.reaction-used {
    opacity: 0.4;
    pointer-events: none;
}

.reaction-item.reaction-used .reaction-once-badge {
    background: var(--text-muted);
    color: var(--bg-root);
    border-color: var(--text-muted);
}

.reaction-item.reaction-active {
    border-color: var(--accent);
    background: rgba(56, 161, 105, 0.1);
}

.reaction-undo-hint {
    font-size: 0.6rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Mechanicum Programming Interrupt toggle */
.programming-interrupt {
    padding: var(--space-2) var(--space-3);
    margin-bottom: var(--space-2);
    border-radius: 6px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
}

.programming-interrupt.active {
    border-color: var(--accent);
    background: rgba(56, 161, 105, 0.1);
}

.programming-interrupt.used {
    opacity: 0.5;
}

.pi-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
}

.pi-toggle input {
    accent-color: var(--accent);
}

.pi-label {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.pi-hint {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-left: auto;
}

.reaction-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.reactions-empty {
    color: var(--text-muted);
    text-align: center;
    padding: var(--space-3);
    font-size: 0.9rem;
}
