/* === Toolbar overflow hotfix - no rebuild version === */

.gameHeader {
    box-sizing: border-box !important;
    gap: 8px !important;
    overflow-x: clip !important;
}

#navigation {
    min-width: 0 !important;
    flex: 1 1 auto !important;
}

#navigation button {
    flex: 1 1 110px !important;
    min-width: 90px !important;
    max-width: 175px !important;
}

#manipulation {
    margin-right: 10px !important;
    min-width: 0 !important;
    flex: 0 1 auto !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 2px !important;
    overflow: hidden !important;
}

#manipulation #account_open {
    max-width: 260px !important;
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    flex: 1 1 auto !important;
}

#manipulation button,
#manipulation #account_open:after {
    flex: 0 0 auto !important;
}

@media (max-width: 1500px) {
    .gameHeader {
        flex-wrap: wrap !important;
        height: auto !important;
        min-height: 96px !important;
        align-content: flex-start !important;
    }

    #navigation {
        justify-content: center !important;
    }

    #manipulation {
        width: 100% !important;
        justify-content: center !important;
        margin-right: 0 !important;
    }

    #manipulation #account_open {
        max-width: 320px !important;
        flex: 0 1 auto !important;
    }
}

@media (max-width: 900px) {
    #navigation button {
        flex: 1 1 80px !important;
        min-width: 70px !important;
        max-width: 120px !important;
    }

    #manipulation #account_open {
        max-width: 220px !important;
    }
}

/* === Language selector overlap fix ===
   Make language selector participate in the header flex layout instead of floating over logout.
*/

.gameHeader .lang {
    position: relative !important;
    right: auto !important;
    top: auto !important;
    flex: 0 0 auto !important;
    align-self: center !important;
    margin-left: 8px !important;
    max-height: 34px !important;
    overflow: visible !important;
    z-index: 10004 !important;
}

.gameHeader .lang span {
    white-space: nowrap !important;
}

.gameHeader .lang_selector {
    white-space: nowrap !important;
}

/* Keep the icon row and language selector together on narrower/zoomed layouts */
@media (max-width: 1500px) {
    #manipulation {
        width: auto !important;
        max-width: calc(100% - 90px) !important;
    }

    .gameHeader .lang {
        margin-left: 10px !important;
    }
}

@media (max-width: 700px) {
    #manipulation {
        max-width: calc(100% - 70px) !important;
    }

    #manipulation #account_open {
        max-width: 170px !important;
    }
}

