/* Phone layout for the CMS. Loaded last so it wins over maintebb2.css / web.teb998.css,
   which set fixed desktop widths (wrapper 1000px, columns 692px / 330px). */

@media (max-width: 820px) {

    html,
    body {
        overflow-x: hidden;
    }

    img {
        max-width: 100%;
    }

    .wrapper {
        width: auto !important;
        max-width: 100%;
        padding: 0 12px;
        box-sizing: border-box;
    }

    /* two-column pages become one column */
    .page-container .teb-page-content .left-side,
    .page-container .teb-page-content .right-side,
    .page-container[data-page="profile"] .teb-page-content .right-side,
    .page-container[data-page="games_ranking"] .left-side,
    .page-container[data-page="games_ranking"] .right-side,
    .page-container[data-page="profile"] .left-side {
        width: auto !important;
        float: none !important;
        clear: both !important;
        position: static !important;
    }
}

@media (max-width: 820px) {

    /* nav: the menu list has an inline 200px left padding meant for the desktop logo */
    .navigation-container .navigation-menu {
        padding-left: 0 !important;
        justify-content: space-between;
    }

    .navigation-container .navigation-menu .navigation-item.navigation-right-side-item {
        margin-right: 0;
    }

    /* header: no big waving avatar (it covered the button); a wide "Entrar" button instead */
    .header-container .header-content .avatar {
        display: none !important;
    }

    .header-container {
        position: relative;
    }

    .header-container .header-content {
        position: static !important;
    }

    .header-container .header-content .account-container {
        position: absolute !important;
        top: auto !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 26px !important;
        z-index: 2;
        width: auto !important;
        margin: 0 !important;
        padding: 0 16px;
        transform: none !important;
        text-align: center;
    }

    .header-container .header-content .account-container .account-buttons {
        display: flex;
        justify-content: center;
    }

    .header-container .header-content .account-container .account-buttons .rounded-button {
        width: 100%;
        max-width: 320px;
        padding: 14px 0;
        font-size: 16px;
        text-align: center;
    }

    /* greeting + users online bar */
    .bottom {
        height: auto !important;
        padding: 10px 0;
    }

    .bottom .attention {
        flex-wrap: wrap;
        gap: 6px 10px;
    }

    .bottom .attention p {
        width: calc(100% - 50px) !important;
        margin-left: 6px !important;
    }

    /* anything that still has a desktop width */
    input,
    textarea,
    select {
        max-width: 100%;
        box-sizing: border-box;
    }

    .friends-container {
        width: auto !important;
        max-width: 100%;
    }
}

/* "Entrar" button in the header: web.responsive.css turns every element in .account-buttons into a full-width block
   (max-width 450px), which put the arrow icon on its own line and pushed the text out of the 47px button.
   Keep icon and text on one centred row instead. */
@media (max-width: 820px) {
    .header-container .header-content .account-container .account-buttons .rounded-button {
        display: flex !important;
        align-items: center;
        justify-content: center;
        gap: 8px;
        height: auto;
        min-height: 47px;
        padding: 12px 0;
        line-height: 1;
    }

    .header-container .header-content .account-container .account-buttons .rounded-button i {
        display: inline-block !important;
        width: auto !important;
    }
}
