@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700&family=EB+Garamond:wght@400;600;700&display=swap');

/* --- MAIN CONTAINER (Aged Parchment) --- */
.meta-report-container {
    font-family: 'EB Garamond', serif;
    /* Warm, radial gradient to look like aged paper with slightly darker edges */
    background: radial-gradient(circle at center, #fdf8e9 0%, #ebd7b2 100%);
    border: 2px solid #b89947;
    border-radius: 4px;
    box-shadow: inset 0 0 40px rgba(138, 103, 51, 0.2), 0 10px 20px rgba(0,0,0,0.4);
    padding: 30px;
    color: #3e2a14; /* Dark ink brown instead of white */
    position: relative;
    text-align: left; 
}

/* --- HEADINGS --- */
.meta-report-container h3 {
    font-family: 'Cinzel', serif;
    color: #5c4018; /* Deep golden-brown */
    text-shadow: 1px 1px 0px rgba(255,255,255,0.6); /* Gives an embossed/letterpress effect */
    letter-spacing: 2px;
    font-size: 1.1rem;
    margin-bottom: 15px;
    margin-top: 0;
    border: none;
    background: transparent;
}

/* --- THE DIVIDER LINE --- */
.meta-report-container .war-room-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #b89947, transparent);
    margin: 20px 0 25px 0;
    opacity: 0.8;
    border: none;
}

/* --- FACTION PILLS (Wooden/Parchment Plaques) --- */
.meta-report-container .faction-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 15px;
}

/* --- FACTION PILLS (Bulletproof Solid Color Method) --- */
.meta-report-container .faction-pill {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    
    /* 1. PURE SOLID COLOR - 100% immune to gradient flashing */
    background: none !important; 
    background-color: #e6d0a1 !important; 
    
    border: 1px solid #c4a962 !important;
    border-bottom: 2px solid #a68a42 !important; 
    border-radius: 3px;
    color: #4a331c !important;
    padding: 10px 18px;
    cursor: pointer;
    
    /* 2. We use an inset white shadow to fake the "gradient shine" */
    box-shadow: inset 0 10px 12px rgba(253, 248, 233, 0.7), 0 3px 5px rgba(0,0,0,0.1) !important;
    
    /* 3. Now everything animates beautifully */
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease, color 0.15s ease; 
    user-select: none;
    line-height: 1; 
}

.meta-report-container .faction-pill:hover {
    background-color: #fdf8e9 !important; 
    border-color: #8c7335 !important;
    color: #2b1d0f !important;
    /* Increase the shine on hover */
    box-shadow: inset 0 10px 12px rgba(255, 255, 255, 0.9), 0 3px 5px rgba(0,0,0,0.1) !important;
}

.meta-report-container .faction-pill.active {
    /* Pressed-in active state */
    background-color: #d6b87c !important;
    
    border: 1px solid #c9a44c !important;
    border-top: 2px solid #8c7335 !important;
    color: #2b1d0f !important;
    
    /* Reverse the shadow to look pushed down */
    box-shadow: inset 0 4px 8px rgba(100, 70, 30, 0.4) !important;
    text-shadow: none !important;
    transform: translateY(1px); 
}

/* --- THE DROPDOWN FIX --- */
.meta-report-container select#meta-mode-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none; 
    width: 100%;
    padding: 12px 35px 12px 15px;
    
    background-color: #fdf8e9;
    /* Dark brown SVG arrow */
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="%233e2a14" viewBox="0 0 16 16"><path d="M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 12px;
    
    color: #3e2a14;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 1px;
    
    border: 1px solid #c4a962;
    border-radius: 3px;
    box-shadow: inset 0 2px 5px rgba(138, 103, 51, 0.1);
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    height: auto; 
}

.meta-report-container select#meta-mode-select:focus {
    border-color: #8c7335;
    box-shadow: 0 0 8px rgba(184, 153, 71, 0.4), inset 0 2px 5px rgba(138, 103, 51, 0.1);
}

.meta-report-container select#meta-mode-select option {
    background-color: #fdf8e9;
    color: #3e2a14;
    padding: 10px;
}

/* --- CANVAS AREA --- */
.meta-report-container .analytics-canvas {
    background: rgba(255, 255, 255, 0.3); /* Slightly lighter parchment inset */
    border: 1px solid #d4c093;
    border-radius: 4px;
    box-shadow: inset 0 0 20px rgba(138, 103, 51, 0.1);
    margin-top: 10px;
}

/* --- THE RESULTS CARDS --- */
.meta-report-container .stat-card {
    background: rgba(253, 248, 233, 0.8);
    border: 1px solid #c4a962;
    border-radius: 4px;
    padding: 25px;
    width: 250px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    position: relative;
    text-align: center;
}

/* --- BIG NUMBERS (Deep Ink Colors instead of Neon) --- */
.meta-report-container .stat-card .big-number {
    font-family: 'Cinzel', serif;
    font-size: 3.5rem;
    font-weight: 700;
    margin: 15px 0;
    /* Letterpress effect instead of glowing */
    text-shadow: 1px 1px 0px rgba(255,255,255,0.8);
}

.meta-report-container .stat-card .wins-text { 
    color: #1e5631; /* Deep Forest Green Ink */
} 

.meta-report-container .stat-card .losses-text { 
    color: #8b0000; /* Deep Blood Red Ink */
}

/* --- SUB-STATS BORDER (Ornate divider) --- */
.meta-report-container .stat-card .sub-stats {
    border-top: 1px solid transparent;
    border-image: linear-gradient(to right, transparent, rgba(184, 153, 71, 0.5), transparent) 1;
    padding-top: 15px;
    margin-top: 15px;
    font-size: 1.1rem;
    font-family: 'EB Garamond', serif;
    font-weight: 600;
    color: #3e2a14;
    display: flex;
    justify-content: space-between;
}

/* --- PARCHMENT TEXT INPUTS --- */
.meta-report-container .parchment-input {
    background: rgba(253, 248, 233, 0.5);
    border: 1px solid #c4a962;
    border-radius: 3px;
    padding: 10px 15px;
    color: #3e2a14;
    font-family: 'EB Garamond', serif;
    font-size: 1.05rem;
    width: 100%;
    max-width: 250px;
    outline: none;
    transition: all 0.2s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.meta-report-container .parchment-input:focus {
    border-color: #8c7335;
    box-shadow: inset 0 2px 5px rgba(138, 103, 51, 0.1), 0 0 8px rgba(184, 153, 71, 0.4);
    background: #fdf8e9;
}

.meta-report-container .parchment-input::placeholder {
    color: #a68a42;
    font-style: italic;
    opacity: 0.8;
}

/* --- LIVE AUTOCOMPLETE DROPDOWN --- */
.meta-report-container .autocomplete-wrapper {
    position: relative;
    width: 100%;
    max-width: 250px;
}

.meta-report-container .autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fdf8e9;
    border: 1px solid #c4a962;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 8px 15px rgba(0,0,0,0.3);
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
    display: none; /* Hidden by default */
}

.meta-report-container .autocomplete-item {
    padding: 10px 15px;
    cursor: pointer;
    color: #3e2a14;
    font-family: 'EB Garamond', serif;
    font-size: 1.05rem;
    border-bottom: 1px dashed rgba(196, 169, 98, 0.4);
    transition: background 0.1s ease;
}

.meta-report-container .autocomplete-item:last-child {
    border-bottom: none;
}

.meta-report-container .autocomplete-item:hover {
    background: #ebd7b2;
    color: #1a1107;
    font-weight: bold;
}

/* --- COLLAPSIBLE SECTIONS --- */
.meta-report-container h3.section-header {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    user-select: none;
    transition: color 0.2s ease;
}

.meta-report-container h3.section-header:hover {
    color: #8c7335;
}

.meta-report-container .fold-arrow {
    font-size: 0.65em;
    margin-left: 10px;
    color: #c4a962;
    transition: transform 0.2s ease;
}