/* Ensure the overlay covers the full screen */
.custom-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Better for scrolling content */
    z-index: 1050;
    overflow-y: auto; /* Allow the overlay to scroll the modal */
    padding: 10px;
}

.stats-modal-large {
    width: 95%;
    max-width: 1200px;
    background: #ffffff;
    border-radius: 12px;
    padding: 20px 25px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    margin: auto; /* Centers modal in the scrollable overlay */
    
    /* Desktop Logic: Keep it on one screen for screenshots */
    display: flex;
    flex-direction: column;
}

/* SCREENSHOT OPTIMIZATION (Desktop)
   Only force the "No Scroll" behavior on screens wide enough 
   to show the 3-column layout (MD breakpoint and up).
*/
@media (min-width: 768px) {
    .stats-modal-large {
        max-height: 98vh;
        overflow: hidden; 
    }
    
    #statsContent {
        flex: 1;
        overflow-y: visible; 
    }
}

/* MOBILE OPTIMIZATION 
   Allow the modal to grow naturally and scroll via the overlay.
*/
@media (max-width: 767px) {
    .stats-modal-large {
        max-height: none; 
        overflow: visible;
        padding: 15px; /* Tighter padding for small screens */
    }

    /* Adjust header for mobile so brand doesn't overlap title */
    .stats-modal-large .d-flex.justify-content-between {
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    .stats-modal-large .text-end {
        text-align: left !important;
        margin-top: 5px;
    }
}

.brand-signature {
    font-weight: bold;
    color: #a0a0a0;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.stats-modal-large h3 { font-size: 1.4rem; }
.stats-modal-large hr { margin: 10px 0; }
.stats-modal-large .card { margin-bottom: 0 !important; }

@media print {
    .badges-close-button { display: none; }
}
