:root {
    --bg-dark: #111827;
    --bg-card: #1f2937;
    --accent: #d97706; /* Warmer gold */
    --accent-light: #fbbf24;
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --danger: #dc2626;
    --border: #374151;
}

body {
    margin: 0;
    font-family: 'Quicksand', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
}

/* Header & Global Stats */
.main-header {
    background: #000;
    padding: 1rem 2rem;
    border-bottom: 2px solid var(--accent);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1 { font-family: 'Cinzel', serif; margin: 0; color: var(--accent); font-size: 1.5rem; }

#army-selector {
    background: var(--bg-card);
    color: white;
    border: 1px solid var(--border);
    padding: 0.4rem;
    border-radius: 4px;
    margin-top: 5px;
}

.stats-bar {
    display: flex;
    gap: 2rem;
}

.stat-item {
    text-align: center;
    font-weight: 700;
    font-size: 1.2rem;
}

.stat-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-secondary);
}

/* Layout */
.builder-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Unit Grid (Catalog) */
.unit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.unit-card {
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border);
    overflow: hidden;
    transition: border-color 0.2s;
}

.unit-card:hover { border-color: var(--accent); }

.image-container { height: 120px; position: relative; }
.image-container img { width: 100%; height: 100%; object-fit: cover; }

.points-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0,0,0,0.7);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--accent-light);
}

.unit-card-body { padding: 0.8rem; text-align: center; }
.unit-card-body h3 { margin: 0 0 0.5rem 0; font-size: 0.95rem; height: 2.4rem; overflow: hidden; }

/* Warband Styling */
.warband-container {
    background: var(--bg-card);
    border-left: 4px solid var(--accent);
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
}

.warband-header {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
    margin-bottom: 0.8rem;
}

.unit-stack {
    background: rgba(0,0,0,0.2);
    padding: 0.6rem;
    margin-top: 0.5rem;
    border-radius: 4px;
}

.stack-header { display: flex; justify-content: space-between; font-size: 0.9rem; }

.options-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 5px 0; }

.opt-label { font-size: 0.75rem; color: var(--text-secondary); cursor: pointer; }

/* Buttons */
.btn-add, .btn-mini-add {
    background: var(--accent);
    color: #000;
    font-weight: 700;
    border: none;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
}

.btn-mini-add { margin-top: 4px; padding: 2px; font-size: 0.7rem; background: var(--border); color: white; }

.btn-danger {
    width: 100%;
    background: var(--danger);
    color: white;
    border: none;
    padding: 0.8rem;
    font-weight: 700;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 1rem;
}
