/* ==========================================
   WARHAMMER AGE OF SIGMAR - PREMIUM STYLING
   ========================================== */

/* Design Tokens & Variables */
:root {
    --bg-dark: hsl(220, 20%, 6%);
    --bg-panel: hsl(220, 15%, 11%);
    --bg-card: hsl(220, 14%, 15%);
    --bg-card-hover: hsl(220, 14%, 19%);
    
    --color-gold: hsl(45, 80%, 55%);
    --color-gold-dark: hsl(45, 75%, 35%);
    --color-gold-light: hsl(45, 95%, 72%);
    --color-gold-glow: hsla(45, 95%, 55%, 0.15);
    
    --color-crimson: hsl(355, 75%, 45%);
    --color-crimson-hover: hsl(355, 85%, 55%);
    --color-crimson-glow: hsla(355, 75%, 45%, 0.25);
    
    --color-green: hsl(145, 65%, 42%);
    --color-green-glow: hsla(145, 65%, 42%, 0.2);
    --color-amber: hsl(35, 90%, 55%);
    
    --color-text: hsl(220, 20%, 94%);
    --color-text-muted: hsl(220, 10%, 68%);
    --color-text-dark: hsl(220, 10%, 45%);
    
    --border-subtle: rgba(255, 255, 255, 0.05);
    --border-gold: rgba(212, 175, 55, 0.2);
    --border-gold-hover: rgba(212, 175, 55, 0.5);
    
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Resets & Global Rules */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--color-text);
    font-family: 'Outfit', sans-serif;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    -webkit-font-smoothing: antialiased;
}

/* Premium Scrollbars (Always styled for premium high visibility) */
.scroller {
    overflow-y: auto;
    scrollbar-width: auto;
}

.scroller::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
.scroller::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}
.scroller::-webkit-scrollbar-thumb {
    background: var(--color-gold-dark);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.scroller::-webkit-scrollbar-thumb:hover {
    background: var(--color-gold);
}

/* CSS Typography */
h1, h2, h3, h4, .brand h1 {
    font-family: 'Cinzel', serif;
    letter-spacing: 0.08em;
    font-weight: 700;
}

h2 {
    font-size: 1.8rem;
    color: var(--color-text);
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    border-bottom: 2px solid var(--color-gold);
    padding-bottom: 6px;
    display: inline-block;
}

p {
    font-size: 0.95rem;
    line-height: 1.5;
}

/* App Container Layout */
.app-container {
    display: grid;
    grid-template-columns: 260px 1fr;
    height: 100vh;
    width: 100vw;
}

/* Sidebar Navigation */
.sidebar {
    background: linear-gradient(180deg, var(--bg-panel) 0%, var(--bg-dark) 100%);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    justify-content: space-between;
}

.brand {
    text-align: center;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 24px;
}

.brand-crest {
    font-size: 2.5rem;
    line-height: 1;
    margin-bottom: 8px;
    filter: drop-shadow(0 0 10px var(--color-gold));
}

.brand h1 {
    font-family: 'Cinzel Decorative', serif;
    font-size: 1.4rem;
    color: var(--color-gold);
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.3);
}

.brand p {
    font-size: 0.75rem;
    color: var(--color-text-dark);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-top: 4px;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.nav-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--color-text-muted);
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: left;
    transition: var(--transition-fast);
}

.nav-btn i {
    width: 18px;
    height: 18px;
    transition: var(--transition-fast);
}

.nav-btn:hover {
    background: rgba(255,255,255,0.02);
    color: var(--color-text);
    border-color: rgba(255,255,255,0.05);
}

.nav-btn.active {
    background: var(--color-gold-glow);
    color: var(--color-gold);
    border-color: var(--border-gold);
    box-shadow: inset 0 0 12px rgba(212, 175, 55, 0.05);
    font-weight: 600;
}

.nav-btn.active i {
    filter: drop-shadow(0 0 5px var(--color-gold));
}

.sidebar-footer {
    padding-top: 16px;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.8rem;
    color: var(--color-text-dark);
    text-align: center;
}

.sidebar-footer .rules-version {
    color: var(--color-gold-dark);
    font-weight: 600;
}

/* Main Content Area */
.main-content {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background: linear-gradient(135deg, var(--bg-dark) 0%, hsl(220, 15%, 8%) 100%);
}

/* Top Bar summary of active list */
.top-bar {
    background-color: var(--bg-panel);
    border-bottom: 1px solid var(--border-subtle);
    padding: 12px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.active-army-summary {
    display: flex;
    align-items: center;
    gap: 12px;
}

.active-army-summary span {
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--color-text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.badge.faction-badge {
    color: var(--color-gold);
    border-color: var(--border-gold);
    background-color: var(--color-gold-glow);
}

.points-indicator {
    display: flex;
    align-items: center;
    gap: 16px;
}

.points-label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.points-indicator select {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--color-text);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    font-weight: 500;
}

.points-progress-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

#armyPointsDisplay {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-gold);
}

.points-progress-bar {
    width: 160px;
    height: 6px;
    background-color: var(--bg-dark);
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.02);
}

.points-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--color-gold-dark) 0%, var(--color-gold) 100%);
    border-radius: var(--radius-sm);
    box-shadow: 0 0 8px var(--color-gold-glow);
    transition: var(--transition-smooth);
}

/* Visual pulse states for point bar limit proximity */
.points-fill.warning {
    background: linear-gradient(90deg, var(--color-amber) 0%, hsl(45, 95%, 55%) 100%);
}

.points-fill.success {
    background: linear-gradient(90deg, var(--color-gold) 0%, var(--color-gold-light) 100%);
    animation: goldGlowPulse 2s infinite ease-in-out;
}

.points-fill.overlimit {
    background: linear-gradient(90deg, var(--color-crimson) 0%, var(--color-crimson-hover) 100%);
}

@keyframes goldGlowPulse {
    0% { filter: drop-shadow(0 0 1px var(--color-gold)); }
    50% { filter: drop-shadow(0 0 6px var(--color-gold-light)); }
    100% { filter: drop-shadow(0 0 1px var(--color-gold)); }
}

/* Tab Layout Management */
.tab-panels {
    flex-grow: 1;
    overflow: hidden;
    position: relative;
    min-height: 0;
    height: calc(100vh - 70px);
    display: flex;
    flex-direction: column;
}

.tab-panel {
    display: none;
    flex-direction: column;
    height: 100%;
    padding: 32px;
    animation: fadeIn 0.25s ease-out;
    overflow: hidden;
    min-height: 0;
}

.tab-panel.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Common Section Header Styles */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

/* Form inputs & dropdowns */
input[type="text"], select {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--color-text);
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

input[type="text"]:focus, select:focus {
    outline: none;
    border-color: var(--color-gold-dark);
    box-shadow: 0 0 8px var(--color-gold-glow);
}

/* Buttons Styles */
.btn {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-fast);
    text-transform: uppercase;
    border: 1px solid transparent;
}

.btn i {
    width: 16px;
    height: 16px;
}

.btn-gold {
    background: linear-gradient(135deg, var(--color-gold-dark) 0%, var(--color-gold) 100%);
    color: var(--bg-dark);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.15);
}

.btn-gold:hover {
    background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-light) 100%);
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.3);
    transform: translateY(-1px);
}

.btn-crimson {
    background: linear-gradient(135deg, var(--color-crimson) 0%, var(--color-crimson-hover) 100%);
    color: var(--color-text);
    box-shadow: 0 4px 12px var(--color-crimson-glow);
}

.btn-crimson:hover {
    box-shadow: 0 4px 20px rgba(240, 50, 50, 0.4);
    transform: translateY(-1px);
}

.btn-glow {
    animation: pulseBorder 2s infinite ease-in-out;
}

@keyframes pulseBorder {
    0% { border-color: transparent; }
    50% { border-color: rgba(212,175,55,0.4); }
    100% { border-color: transparent; }
}

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

.btn-outline:hover {
    background-color: var(--color-gold-glow);
    border-color: var(--color-gold);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.btn-icon:hover {
    color: var(--color-text);
    background-color: var(--border-subtle);
}

/* Card layout basics */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: var(--transition-fast);
}

.glass-card {
    background: rgba(30, 34, 42, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-gold);
}

/* Empty State Style */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 48px;
    background: rgba(255,255,255,0.01);
    border: 2px dashed var(--border-subtle);
    border-radius: var(--radius-lg);
    height: 100%;
}

.empty-icon {
    width: 48px;
    height: 48px;
    color: var(--color-text-dark);
    margin-bottom: 16px;
}

.empty-state h3 {
    margin-bottom: 8px;
    color: var(--color-text);
}

.empty-state p {
    color: var(--color-text-muted);
    max-width: 320px;
    margin-bottom: 16px;
    font-size: 0.85rem;
}

/* === TAB 1: ARMIES DASHBOARD === */
.armies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    padding-right: 8px;
    flex-grow: 1;
    min-height: 0;
    height: 0;
    overflow-y: auto;
}

.army-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 200px;
    border: 1px solid var(--border-subtle);
    background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-panel) 100%);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.army-card:hover {
    border-color: var(--color-gold-dark);
    box-shadow: 0 6px 20px rgba(212,175,55,0.08);
    transform: translateY(-2px);
}

.army-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.army-card h3 {
    font-size: 1.15rem;
    color: var(--color-text);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.army-card .army-faction {
    font-size: 0.8rem;
    color: var(--color-gold);
    font-weight: 600;
    text-transform: uppercase;
}

.army-card-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.army-stat-pill {
    display: flex;
    flex-direction: column;
}

.army-stat-pill span:first-child {
    font-size: 0.75rem;
    color: var(--color-text-dark);
    text-transform: uppercase;
}

.army-stat-pill span:last-child {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 0.95rem;
}

.army-card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid var(--border-subtle);
    padding-top: 12px;
}

/* === TAB 2: REGIMENT BUILDER === */
/* Top bar inline editor for army name */
.army-name-editor-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.army-name-editor-wrapper #topBarArmyName {
    font-size: 1.25rem;
    font-weight: 700;
    font-family: 'Cinzel', serif;
    color: var(--color-text);
    cursor: pointer;
    transition: color 0.2s ease;
}

.army-name-editor-wrapper #topBarArmyName:hover {
    color: var(--color-gold);
}

.army-name-editor-wrapper #topBarArmyNameInput {
    background-color: var(--bg-card);
    border: 1px solid var(--border-gold);
    color: var(--color-text);
    font-size: 1.1rem;
    font-family: 'Cinzel', serif;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    outline: none;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
    width: 260px;
}

.btn-icon-only {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.btn-icon-only:hover {
    color: var(--color-gold);
    background-color: var(--color-gold-glow);
}

.btn-icon-only i, .btn-icon-only svg {
    width: 16px;
    height: 16px;
}

.hidden {
    display: none !important;
}

.builder-workspace {
    display: grid;
    grid-template-columns: 1.2fr 1fr 300px;
    gap: 24px;
    flex-grow: 1;
    min-height: 0;
    height: 0;
    overflow: hidden;
}

.builder-workspace.empty-builder {
    grid-template-columns: 1fr !important;
}

/* === PREMIUM MOBILE-FIRST RESPONSIVE ENGINE === */

@media (max-width: 1200px) {
    .builder-workspace {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
        height: 100%;
        overflow-y: auto;
    }
    
    .validation-sidebar {
        grid-column: span 2;
        display: flex;
        flex-direction: column;
        gap: 16px;
        overflow-y: visible;
        height: auto;
    }
}

@media (max-width: 1024px) {
    /* Main Layout shifts to Bottom Tab Bar navigation */
    .app-container {
        grid-template-columns: 1fr;
        height: 100vh;
        width: 100vw;
        overflow: hidden;
    }
    
    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 64px;
        flex-direction: row;
        border-right: none;
        border-top: 1px solid var(--border-subtle);
        padding: 0 16px;
        justify-content: center;
        background: var(--bg-panel);
        z-index: 999;
    }
    
    .brand, .sidebar-footer {
        display: none !important;
    }
    
    .nav-menu {
        flex-direction: row;
        width: 100%;
        height: 100%;
        justify-content: space-around;
        align-items: center;
        gap: 0;
        flex-grow: 0;
    }
    
    .nav-btn {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 6px 12px;
        font-size: 0.7rem;
        gap: 4px;
        text-align: center;
        border: none;
        background: transparent;
        color: var(--color-text-dark);
        flex-grow: 1;
        height: 100%;
        border-radius: 0;
    }
    
    .nav-btn.active {
        background: transparent;
        box-shadow: none;
        color: var(--color-gold);
    }
    
    .nav-btn i {
        width: 20px;
        height: 20px;
    }
    
    .main-content {
        height: calc(100vh - 64px);
        overflow: hidden;
    }
    
    .tab-panel {
        padding: 16px;
        overflow-y: auto;
    }
    
    .top-bar {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
    
    .armies-grid, .collection-workspace {
        height: auto;
        overflow-y: visible;
    }
}

@media (max-width: 768px) {
    .builder-workspace {
        grid-template-columns: 1fr;
        gap: 24px;
        overflow-y: auto;
        height: 100%;
    }
    
    .validation-sidebar {
        grid-column: span 1;
    }
    
    .regiments-container, .builder-inventory {
        height: auto;
        min-height: 450px;
        max-height: 650px;
        overflow-y: auto;
    }
    
    .section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .army-meta-inputs {
        flex-direction: column;
        gap: 8px;
    }
}

.regiments-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-right: 8px;
    height: 100%;
    min-height: 0;
    overflow-y: auto;
}

.validation-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
    height: 100%;
    min-height: 0;
    overflow-y: auto;
}

.validation-sidebar .card {
    padding: 16px;
}

.validation-sidebar h3 {
    font-size: 0.95rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.validation-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.validation-item {
    display: flex;
    gap: 8px;
    font-size: 0.8rem;
    line-height: 1.3;
    padding: 8px;
    border-radius: var(--radius-sm);
    background-color: rgba(255,255,255,0.01);
    border: 1px solid var(--border-subtle);
}

.validation-item i {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.validation-item.success {
    color: var(--color-green);
    border-color: var(--color-green-glow);
    background-color: var(--color-green-glow);
}

.validation-item.error {
    color: var(--color-crimson);
    border-color: var(--color-crimson-glow);
    background-color: var(--color-crimson-glow);
}

.gold-icon { color: var(--color-gold); }
.amber-icon { color: var(--color-amber); }

.recommendations-card {
    flex-grow: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.recommendation-desc {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-bottom: 12px;
}

.recommendations-list {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.reco-card {
    background-color: rgba(255,255,255,0.02);
    border: 1px solid var(--border-subtle);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition-fast);
}

.reco-card:hover {
    border-color: var(--border-gold-hover);
    background-color: rgba(255,255,255,0.04);
}

.reco-info {
    display: flex;
    flex-direction: column;
}

.reco-name {
    font-size: 0.85rem;
    font-weight: 600;
}

.reco-pts {
    font-size: 0.75rem;
    color: var(--color-gold);
    font-family: 'Cinzel', serif;
    font-weight: 700;
    margin-top: 2px;
}

.reco-add-btn {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--color-text-muted);
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.reco-add-btn:hover {
    color: var(--color-gold);
    border-color: var(--color-gold);
    background-color: var(--color-gold-glow);
}

.reco-add-btn i {
    width: 14px;
    height: 14px;
}

/* Regiment Horizontal Tab Navigation */
.regiments-tabs-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
    scrollbar-width: thin;
}

.regiment-tab-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--color-text-muted);
    cursor: pointer;
    transition: var(--transition-medium);
    min-width: 115px;
    flex-shrink: 0;
}

.regiment-tab-btn:hover {
    background: rgba(212, 175, 55, 0.05);
    border-color: rgba(212, 175, 55, 0.3);
    color: var(--color-text);
}

.regiment-tab-btn.active {
    background: rgba(212, 175, 55, 0.1);
    border-color: var(--color-gold);
    color: var(--color-gold);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.1);
}

.regiment-tab-btn .tab-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.regiment-tab-btn .tab-pts-badge {
    font-size: 0.85rem;
    font-weight: 600;
}

.regiment-tab-btn.add-tab {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    border-style: dashed;
    color: var(--color-gold-dark);
    font-weight: 600;
    font-size: 0.8rem;
    gap: 6px;
    min-width: unset;
}

.regiment-tab-btn.add-tab:hover {
    background: rgba(212, 175, 55, 0.08);
    border-color: var(--color-gold);
    color: var(--color-gold);
}

/* Regiment Card Styles */
.regiment-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.regiment-card:has(.regiment-leader.empty) {
    border-style: dashed;
    background-color: rgba(255,255,255,0.01);
}

.regiment-header {
    background-color: var(--bg-panel);
    border-bottom: 1px solid var(--border-subtle);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.regiment-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.regiment-header-info h3 {
    font-size: 1.05rem;
}

.regiment-pts-counter {
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-gold);
}

/* Regiment Leader Row */
.regiment-leader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px dashed var(--border-subtle);
}

.regiment-leader.empty {
    justify-content: center;
    padding: 32px 20px;
    border-bottom: none;
}

.hero-profile {
    display: flex;
    align-items: center;
    gap: 16px;
}

.hero-avatar {
    width: 40px;
    height: 40px;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-gold);
    color: var(--color-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 0 10px var(--color-gold-glow);
}

.hero-details {
    display: flex;
    flex-direction: column;
}

.hero-name {
    font-size: 1rem;
    font-weight: 600;
}

.hero-options {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 2px;
}

.hero-points {
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-text);
}

/* Regiment Units List */
.regiment-units {
    display: flex;
    flex-direction: column;
}

.regiment-unit-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-subtle);
    background-color: rgba(255,255,255,0.005);
}

.regiment-unit-row:last-child {
    border-bottom: none;
}

.unit-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.unit-avatar {
    width: 30px;
    height: 30px;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-subtle);
    color: var(--color-text-muted);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.unit-details {
    display: flex;
    flex-direction: column;
}

.unit-name {
    font-size: 0.9rem;
    font-weight: 500;
}

.unit-meta {
    font-size: 0.75rem;
    color: var(--color-text-dark);
    margin-top: 1px;
}

.unit-points {
    display: flex;
    align-items: center;
    gap: 16px;
}

.unit-pts-display {
    font-family: 'Cinzel', serif;
    font-weight: 600;
    font-size: 0.9rem;
}

.btn-reinforced {
    background-color: var(--bg-dark);
    border: 1px solid var(--border-subtle);
    color: var(--color-text-dark);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-reinforced.active {
    background-color: var(--color-gold-glow);
    border-color: var(--color-gold-dark);
    color: var(--color-gold);
}

/* Regiment Add Unit Row */
.add-unit-placeholder {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 20px;
    background-color: rgba(255,255,255,0.01);
}

/* === TAB 3: COLLECTION MANAGER === */
.factions-accordions {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-right: 8px;
}

.accordion-item {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.accordion-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background-color: var(--bg-card);
    border: none;
    color: var(--color-text);
    cursor: pointer;
    text-align: left;
    transition: var(--transition-fast);
}

.accordion-header:hover {
    background-color: var(--bg-card-hover);
}

.accordion-title-container {
    display: flex;
    align-items: center;
    gap: 16px;
}

.accordion-title-container h3 {
    font-size: 1.1rem;
}

.accordion-badge {
    background-color: var(--bg-dark);
    border: 1px solid var(--border-subtle);
    color: var(--color-text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.accordion-header i {
    transition: var(--transition-smooth);
}

.accordion-item.open .accordion-header i {
    transform: rotate(180deg);
}

.accordion-content {
    display: none;
    padding: 20px;
    background-color: var(--bg-panel);
    border-top: 1px solid var(--border-subtle);
}

.accordion-item.open .accordion-content {
    display: block;
}

/* Model inventory lists */
.models-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.model-inventory-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition-fast);
}

.model-inventory-card:hover {
    border-color: var(--border-gold);
}

.model-inventory-card.owned {
    border-color: var(--color-gold-dark);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.03);
}

.model-info-block {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    margin-right: 12px;
    min-width: 0;
}

.model-info-block span:first-child {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
    line-height: 1.25;
}

.model-info-block span:last-child {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 2px;
}

.inventory-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.checkbox-container {
    display: block;
    position: relative;
    padding-left: 26px;
    margin-bottom: 0;
    cursor: pointer;
    font-size: 0.85rem;
    user-select: none;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 18px;
    width: 18px;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.checkbox-container:hover input ~ .checkmark {
    border-color: var(--color-gold);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--color-gold);
    border-color: var(--color-gold);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 6px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid var(--bg-dark);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.qty-counter {
    display: none;
    align-items: center;
    gap: 8px;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 2px 6px;
}

.model-inventory-card.owned .qty-counter {
    display: flex;
}

.qty-btn {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-size: 1rem;
    cursor: pointer;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.qty-display {
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 16px;
    text-align: center;
}

/* === TAB 4: RULES UPDATER === */
.updater-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    flex-grow: 1;
}

.drop-zone-card {
    border: 2px dashed var(--border-gold);
    background-color: rgba(212, 175, 55, 0.01);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.drop-zone-card:hover {
    background-color: var(--color-gold-glow);
    border-color: var(--color-gold);
}

.drop-icon {
    width: 64px;
    height: 64px;
    color: var(--color-gold-dark);
    margin-bottom: 16px;
    transition: var(--transition-smooth);
}

.drop-zone-card:hover .drop-icon {
    transform: translateY(-4px);
    color: var(--color-gold);
}

.drop-zone-card h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.drop-zone-card p {
    color: var(--color-text-muted);
    margin-bottom: 16px;
}

.file-limits {
    font-size: 0.75rem;
    color: var(--color-text-dark);
    text-transform: uppercase;
}

/* Diff Viewer Styling */
.diff-viewer-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 420px;
    overflow: hidden;
}

.diff-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 12px;
}

.diff-actions {
    display: flex;
    gap: 12px;
}

.diff-stats {
    display: flex;
    gap: 16px;
    font-size: 0.85rem;
    font-weight: 600;
}

.stat-added { color: var(--color-green); }
.stat-modified { color: var(--color-amber); }
.stat-deleted { color: var(--color-crimson); }

.diff-scroller {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 8px;
}

.diff-item {
    background-color: rgba(255,255,255,0.01);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.diff-item-meta {
    display: flex;
    flex-direction: column;
}

.diff-item-meta span:first-child {
    font-weight: 600;
}

.diff-item-meta span:last-child {
    color: var(--color-text-dark);
    font-size: 0.75rem;
    margin-top: 2px;
}

.diff-item-values {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Cinzel', serif;
    font-weight: 700;
}

.diff-val-old {
    color: var(--color-text-dark);
    text-decoration: line-through;
}

.diff-val-new {
    color: var(--color-gold);
}

.diff-item.added { border-left: 3px solid var(--color-green); }
.diff-item.modified { border-left: 3px solid var(--color-amber); }
.diff-item.deleted { border-left: 3px solid var(--color-crimson); }

/* === DIALOG MODALS === */
dialog {
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-lg);
    background-color: var(--bg-panel);
    color: var(--color-text);
    margin: auto;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
}

dialog::backdrop {
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-content {
    padding: 32px;
}

dialog h2 {
    font-size: 1.4rem;
    margin-bottom: 24px;
    border-bottom: none;
    padding-bottom: 0;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.form-group label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    margin-top: 32px;
}

/* Selection Drawer Panel (Modals) */
#selectionDrawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    height: 100vh;
    max-height: 100vh;
    width: 420px;
    max-width: 90vw;
    background: var(--bg-panel);
    border-left: 1px solid var(--border-gold-dim);
    border-top: none;
    border-bottom: none;
    border-right: none;
    z-index: 1000;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    animation: slideInLeft 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#selectionDrawer[open] {
    display: flex;
    flex-direction: column;
}

@keyframes slideInLeft {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.drawer-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 24px;
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.drawer-header h2 {
    font-size: 1.25rem;
    border-bottom: none;
}

.drawer-filters {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 16px;
}

.search-box {
    position: relative;
    width: 100%;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--color-text-dark);
}

.search-box input {
    width: 100%;
    padding-left: 36px;
}

.drawer-scroller {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 4px;
}

/* Selection list card */
.selection-list-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.selection-list-card:hover {
    border-color: var(--border-gold-hover);
    background-color: var(--bg-card-hover);
}

.sel-info {
    display: flex;
    flex-direction: column;
}

.sel-name {
    font-size: 0.9rem;
    font-weight: 600;
}

.sel-meta {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 2px;
}

.sel-pts {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--color-gold);
}

.hidden {
    display: none !important;
}

/* Welcome Homepage Dashboard */
.welcome-home-card {
    grid-column: 1 / -1;
    padding: 40px;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: linear-gradient(135deg, rgba(30, 34, 42, 0.7) 0%, rgba(10, 12, 16, 0.7) 100%);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-gold);
    max-width: 800px;
    margin: 20px auto;
}

.collection-workspace {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-height: 0;
    height: 0;
    overflow-y: auto;
    padding-right: 8px;
}

.collection-subcategory {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.subcategory-title {
    font-size: 0.95rem;
    color: var(--color-gold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
    padding-bottom: 6px;
    margin-bottom: 12px;
    margin-top: 12px;
}

.subcategory-title i {
    width: 16px;
    height: 16px;
}

.welcome-crest {
    font-size: 3rem;
    margin-bottom: 16px;
    filter: drop-shadow(0 0 12px var(--color-gold));
}

.welcome-home-card h2 {
    font-family: 'Cinzel Decorative', serif;
    font-size: 1.8rem;
    color: var(--color-gold);
    margin-bottom: 16px;
    border-bottom: none;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.welcome-intro {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text-muted);
    max-width: 650px;
    margin-bottom: 32px;
}

.guide-steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    width: 100%;
    margin-bottom: 32px;
}

.guide-step {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    transition: var(--transition-fast);
}

.guide-step:hover {
    border-color: var(--border-gold-hover);
    transform: translateY(-2px);
}

.step-badge {
    background-color: var(--color-gold-dark);
    color: var(--bg-dark);
    font-family: 'Cinzel', serif;
    font-weight: 900;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    margin-bottom: 12px;
    border: 1px solid var(--color-gold);
}

.guide-step h4 {
    font-size: 0.95rem;
    color: var(--color-text);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.guide-step p {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    line-height: 1.4;
}

.welcome-actions {
    display: flex;
    gap: 20px;
}

/* Category Filter Pills (Inside Faction Accordions) */
.category-pills-container {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 12px;
}

.pill-btn {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    color: var(--color-text-muted);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-fast);
}

.pill-btn i {
    width: 14px;
    height: 14px;
}

.pill-btn:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--color-text);
    border-color: rgba(255, 255, 255, 0.15);
}

.pill-btn.active {
    background-color: var(--color-gold-glow);
    border-color: var(--color-gold);
    color: var(--color-gold);
}

/* Regiment Builder Active State */
.regiment-card {
    border: 1px solid var(--border-gold-dim);
    transition: var(--transition-medium);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.01);
}

.regiment-card:hover {
    border-color: rgba(212, 175, 55, 0.4);
    transform: translateY(-2px);
}

.regiment-card.active {
    border-color: var(--color-gold) !important;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.25) !important;
    background: rgba(18, 18, 24, 0.7) !important;
}

/* Builder Inventory Sidebar styles */
.builder-inventory {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    padding: 20px;
    gap: 16px;
    background: rgba(18, 18, 24, 0.4);
}

.builder-inventory-header {
    border-bottom: 1px solid var(--border-gold-dim);
    padding-bottom: 12px;
}

.builder-inventory-header h3 {
    font-family: 'Cinzel Decorative', serif;
    font-size: 1.1rem;
    color: var(--color-gold);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.builder-inventory-header p {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.inventory-scroller {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-right: 4px;
}

.inventory-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.inventory-section-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-gold);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 4px;
    margin-bottom: 4px;
}

.inventory-item-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    transition: var(--transition-fast);
}

.inventory-item-card.clickable {
    cursor: pointer;
}

.inventory-item-card.clickable:hover {
    background: rgba(212, 175, 55, 0.05);
    border-color: var(--color-gold);
}

.inventory-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-grow: 1;
    margin-right: 12px;
    min-width: 0;
}

.inventory-item-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text);
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
    line-height: 1.25;
}

.inventory-item-qty {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.inventory-item-pts {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-gold);
}

.inventory-item-card.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: rgba(0, 0, 0, 0.2);
}

.inventory-item-card.disabled:hover {
    border-color: rgba(255, 255, 255, 0.05);
}


/* ==========================================================================
   GAME TRACKER STYLES
   ========================================================================== */

/* Round pills */
.round-pills {
    display: flex;
    gap: 8px;
}
.round-pill-btn {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    color: var(--color-text-muted);
    font-size: 0.95rem;
    font-weight: 700;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}
.round-pill-btn:hover {
    background: rgba(212, 175, 55, 0.08);
    border-color: var(--color-gold);
    color: var(--color-gold);
}
.round-pill-btn.active {
    background: var(--color-gold);
    border-color: var(--color-gold);
    color: #000;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
}

/* Turn pills */
.turn-pill-btn {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition-fast);
}
.turn-pill-btn:hover {
    color: var(--color-text);
}
.turn-pill-btn.active[data-player="p1"] {
    background: var(--color-gold);
    color: #000;
}
.turn-pill-btn.active[data-player="p2"] {
    background: var(--color-crimson);
    color: #fff;
}

/* Phase pills */
.phase-pills-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.phase-pill {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    color: var(--color-text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition-fast);
}
.phase-pill:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--color-text);
}
.phase-pill.active {
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--color-gold);
    color: var(--color-gold);
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.1);
}

/* Adjust buttons */
.btn-icon-only.btn-outline {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    color: var(--color-text-muted);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}
.btn-icon-only.btn-outline:hover {
    border-color: var(--color-gold);
    color: var(--color-gold);
    background: rgba(212, 175, 55, 0.05);
}

/* Tactic dropdown and inputs */
.player-name-input:focus {
    outline: none;
    border-bottom-color: var(--color-gold);
}
.tactic-dropdown:focus {
    outline: none;
    border-color: var(--color-gold);
}

/* Tactic reference cards and completed states */
.tactic-reference-card {
    transition: var(--transition-medium);
}
.tactic-reference-card.used-by-p1 {
    border-color: rgba(212, 175, 55, 0.4) !important;
    background: rgba(212, 175, 55, 0.03) !important;
}
.tactic-reference-card.used-by-p2 {
    border-color: rgba(220, 53, 69, 0.4) !important;
    background: rgba(220, 53, 69, 0.03) !important;
}
.tactic-reference-card.used-by-both {
    border-color: rgba(255, 255, 255, 0.2) !important;
    background: rgba(255, 255, 255, 0.02) !important;
    opacity: 0.6;
}

@media (max-width: 900px) {
    .tracker-columns {
        grid-template-columns: 1fr !important;
    }
}

/* Custom Active State Colors for Game Tracker Phase Pills */
.phase-pill.active[data-phase="start"] {
    background: #000000 !important;
    border-color: #333333 !important;
    color: #ffffff !important;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.7) !important;
}
.phase-pill.active[data-phase="hero"] {
    background: #ffd700 !important;
    border-color: #f5c518 !important;
    color: #000000 !important;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.4) !important;
}
.phase-pill.active[data-phase="movement"] {
    background: #6c757d !important;
    border-color: #808080 !important;
    color: #ffffff !important;
    box-shadow: 0 0 10px rgba(108, 117, 125, 0.4) !important;
}
.phase-pill.active[data-phase="shooting"] {
    background: #28a745 !important;
    border-color: #4caf50 !important;
    color: #ffffff !important;
    box-shadow: 0 0 10px rgba(40, 167, 69, 0.4) !important;
}
.phase-pill.active[data-phase="charge"] {
    background: #fd7e14 !important;
    border-color: #ff9800 !important;
    color: #ffffff !important;
    box-shadow: 0 0 10px rgba(253, 126, 20, 0.4) !important;
}
.phase-pill.active[data-phase="combat"] {
    background: #dc3545 !important;
    border-color: #f44336 !important;
    color: #ffffff !important;
    box-shadow: 0 0 10px rgba(220, 53, 69, 0.4) !important;
}
.phase-pill.active[data-phase="end"] {
    background: #6f42c1 !important;
    border-color: #9c27b0 !important;
    color: #ffffff !important;
    box-shadow: 0 0 10px rgba(111, 66, 193, 0.4) !important;
}

/* Sidebar Toggle and Collapsible Sidebar Styles */
.sidebar {
    position: relative;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease;
}
.app-container {
    transition: grid-template-columns 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-sidebar-toggle {
    position: absolute;
    top: 24px;
    right: -12px;
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    color: var(--color-gold);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.btn-sidebar-toggle:hover {
    background: var(--color-gold);
    color: var(--bg-dark);
    box-shadow: 0 0 8px var(--color-gold);
}
.btn-sidebar-toggle i {
    width: 14px;
    height: 14px;
}

/* Collapsed state adjustments */
.app-container.collapsed {
    grid-template-columns: 72px 1fr !important;
}
.app-container.collapsed .sidebar {
    padding: 24px 8px !important;
    align-items: center;
}
.app-container.collapsed .brand-title,
.app-container.collapsed .brand-subtitle,
.app-container.collapsed .sidebar-footer {
    display: none !important;
}
.app-container.collapsed .brand {
    margin-bottom: 24px !important;
    padding-bottom: 12px !important;
    border-bottom: none !important;
    width: 100% !important;
}
.app-container.collapsed .brand-crest {
    font-size: 1.8rem !important;
    margin-bottom: 0 !important;
}
.app-container.collapsed .btn-sidebar-toggle {
    right: 24px !important;
    top: 72px !important;
}
.app-container.collapsed .nav-btn span {
    display: none !important;
}
.app-container.collapsed .nav-btn {
    justify-content: center !important;
    padding: 12px !important;
    width: 48px !important;
    height: 48px !important;
    border-radius: 12px !important;
    margin: 4px auto !important;
}
.app-container.collapsed .nav-btn i {
    margin: 0 !important;
    width: 20px !important;
    height: 20px !important;
}

/* --- AoS 4th Ed. Battle Setup & Deployment Modal CSS --- */
.setup-tab-btn {
    border-bottom: 3px solid transparent !important;
    transition: all 0.3s ease;
}
.setup-tab-btn:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.03) !important;
}
.setup-tab-btn.active {
    color: var(--color-gold) !important;
    border-bottom-color: var(--color-gold) !important;
    background: rgba(212, 175, 55, 0.05) !important;
}

.setup-step-card {
    transition: all 0.2s ease;
}
.setup-step-card:hover {
    transform: translateX(4px);
    background: rgba(255, 255, 255, 0.04) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Underdog Pulse Animation */
@keyframes underdog-pulse {
    0% {
        box-shadow: 0 0 4px rgba(212, 175, 55, 0.4);
        opacity: 0.8;
    }
    50% {
        box-shadow: 0 0 12px rgba(212, 175, 55, 0.9);
        opacity: 1;
    }
    100% {
        box-shadow: 0 0 4px rgba(212, 175, 55, 0.4);
        opacity: 0.8;
    }
}
.underdog-active-pulse {
    animation: underdog-pulse 2s infinite ease-in-out;
}

#doubleTurnWarning {
    animation: pulse-warning-border 1.5s infinite alternate;
}
@keyframes pulse-warning-border {
    from {
        border-color: rgba(255, 193, 7, 0.3);
        box-shadow: 0 0 4px rgba(255, 193, 7, 0.1);
    }
    to {
        border-color: rgba(255, 193, 7, 0.7);
        box-shadow: 0 0 10px rgba(255, 193, 7, 0.25);
    }
}


