.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) {
    /* The overlay is a fixed, full-screen flex box that centers its child and
       does not scroll by default, so a report taller than the phone screen was
       cut off with no way to reach the rest. Let it scroll, starting from the
       top; the modal's margin:auto still centers a report that fits. The
       spacer keeps a gap below the report at the end of the scroll (bottom
       padding is not part of a flex container's scrollable area). */
    #statsModal {
        overflow-y: auto;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding-top: 12px;
    }

    #statsModal::after {
        content: "";
        flex: 0 0 12px;
    }

    .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; }
}
