/* Classic Gamers Portal – responsive overrides
   This file is intended to be loaded AFTER the WebSite X5 stylesheets. */

html {
    width: 100%;
    min-height: 100%;
    box-sizing: border-box;
}

*,
*::before,
*::after {
    box-sizing: inherit;
}

body {
    width: 100%;
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
}

/* Keep the existing portal background, but scale it proportionally. */
body,
#imPageExtContainer,
#imPageIntContainer,
#imPage {
    background-position: center top !important;
    background-repeat: no-repeat !important;
    background-size: 100% auto !important;
    background-attachment: scroll !important;
}

/* Make the main WebSite X5 wrappers fluid on all screen sizes. */
#imPageExtContainer,
#imPageIntContainer,
#imPage,
#imHeader,
#imContent,
#imFooter {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 1920px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

#imPage,
#imContent {
    height: auto !important;
    min-height: 0;
}

#imContent img {
    display: inline-block;
    max-width: 100%;
    height: auto !important;
}

/* Tablet and phone: flow the existing content cells vertically/in rows,
   instead of keeping desktop coordinates. */
@media screen and (max-width: 900px) {
    #imSideBar {
        display: none !important;
    }

    #imContent {
        display: flex !important;
        flex-flow: row wrap !important;
        align-items: flex-start !important;
        justify-content: center !important;
        gap: clamp(14px, 2.5vw, 24px) !important;
        padding: clamp(12px, 3vw, 28px) !important;
        height: auto !important;
        min-height: 0 !important;
    }

    #imPageRow_1,
    #imPageRow_2 {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    #imCell_1,
    #imCell_2,
    #imCell_3,
    #imCell_4,
    #imCell_5 {
        position: relative !important;
        inset: auto !important;
        float: none !important;
        transform: none !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 auto !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }

    #imCell_1,
    #imCell_2 {
        flex: 0 0 100% !important;
        width: 100% !important;
        max-width: 860px !important;
    }

    #imCell_3,
    #imCell_4,
    #imCell_5 {
        flex: 1 1 220px !important;
        width: auto !important;
        max-width: 300px !important;
    }

    #imCell_1 img,
    #imCell_3 img,
    #imCell_4 img,
    #imCell_5 img {
        max-width: 100% !important;
        height: auto !important;
    }

    #imTextObject_02,
    #imTextObject_03,
    #imTextObject_04,
    #imTextObject_05,
    #imTextObject_02 .text-inner,
    #imTextObject_03 .text-inner,
    #imTextObject_04 .text-inner,
    #imTextObject_05 .text-inner {
        width: 100% !important;
        max-width: 100% !important;
    }

    .fs20lh1-5 {
        font-size: clamp(1.15rem, 3.5vw, 1.4rem) !important;
        line-height: 1.45 !important;
    }

    .fs14lh1-5 {
        font-size: clamp(0.95rem, 2.8vw, 1.05rem) !important;
        line-height: 1.5 !important;
    }
}

/* Narrow phones: stack the three large portal buttons one per row. */
@media screen and (max-width: 560px) {
    #imContent {
        gap: 18px !important;
        padding: 12px 14px 26px !important;
    }

    #imCell_1,
    #imCell_2 {
        flex-basis: 100% !important;
    }

    #imCell_3,
    #imCell_4,
    #imCell_5 {
        flex: 0 1 100% !important;
        width: 100% !important;
        max-width: 320px !important;
    }

    #imCell_1 img {
        width: 100% !important;
        max-width: 646px !important;
    }

    #imTextObject_02 .text-inner {
        padding-left: 4px;
        padding-right: 4px;
    }
}
