@media only screen and (min-width: 1500px) {
    .settings-holder .list-group.color_select {
        --scale-item-mx: 1.2;
    }
}
@media only screen and (min-width: 1921px) {
    .settings-holder .list-group.color_select {
        --scale-item-mx: 1.4;
    }
}
@media only screen and (min-width: 2100px) {
    .settings-holder .list-group.color_select {
        --scale-item-mx: 1.6;
    }
}
@media only screen and (max-width: 1000px) {
    #layoutFooter .status-line,
    #layoutFooter .actions,
    #layoutFooter .room-actions {
        min-height: calc(70px * var(--ui-scale));
    }
    .actions .btn:not(.raise-amount):not([data-action-type="raise"]) {
        font-size: calc(30px * var(--ui-scale));
    }
    #layoutFooter .checkboxes-holder .checkbox-flex-wrapper {
        --font-size: calc(30px * var(--ui-scale));
        --margin-right: 0;
    }

    .btn[data-action-type="close_raise"] {
        left: calc(5px * var(--ui-scale) - 45px);
    }
    .btn.raise-amount {
        /*margin-left: 40px;*/
    }
    .portrait .chat-content-holder.is-overlayed .chat-header .chat-title {
        font-size: calc(50px * var(--ui-scale));
    }


    .portrait #popupsHolder .popup-holder[data-type="set_username"][data-is-closeable="close_one"] .customization-header .customization-special-offer,
    .portrait #popupsHolder .popup-holder[data-type="start_new_game"] .customization-header .customization-special-offer {
        position: relative;
        transform: none;
        margin-left: auto;
    }
    .portrait #popupsHolder .popup-holder[data-type="start_new_game"] .customization-header .customization-special-offer {
        margin-right: auto;
    }
    .portrait #popupsHolder .popup-holder[data-type="start_new_game"] .customization-header > .profile-avatar:nth-last-child(2) {
        /* ONLY IF it's second to last, which means special offer is still there */
        margin-left: auto;
    }
}
@media only screen and (max-width: 780px) {
    #playTable {
        /* help align table more centrish when 2 lines of action footer are visible */
        bottom: calc(100px * var(--ui-scale));
    }
    .portrait #playTable {
        /* help align table more centrish when 2 lines of action footer are visible */
        bottom: calc(100px * var(--ui-scale));
        /*bottom: calc(0px * var(--ui-scale));*/
    }

    #layoutFooter {
        /*padding: calc(10px * var(--ui-scale));
        background: none;
        bordeR: none;*/
    }
    #layoutFooter .actions {
        flex-wrap: wrap;
        justify-content: space-between;
        max-width: auto;

    }

    #layoutFooter .status-line,
    #layoutFooter .actions,
    #layoutFooter .room-actions {
        /*padding-right: calc(50px); /*  - removed for now, as we're putting chat icon elsewhereextra space for chat icon. Has to be padding, so it's still otherwise properly centered*/
    }
    .actions .btn:not(.icon, :last-child) {
        margin-right: 0;
    }
    #layoutFooter .actions .raise-amount {
        flex-basis: 100%;
        margin-top: calc(0px * var(--ui-scale));
        /*padding-top: calc(15px * var(--ui-scale));*/
        /*padding-bottom: calc(15px * var(--ui-scale));*/

        /*margin-left: 50px;*/
        margin-left: 0px; /* buttons move to above the raise bar*/
    }
    .actions .btn {
        font-size: calc(25px * var(--ui-scale)) !important;
        min-width: 10ch;
        line-height: 1.4;
    }
    .actions .btn:not([data-action-type="call"]) {
        line-height: calc(39px * var(--ui-scale)) !important;
    }
    .btn.raise-amount .btn {
        font-size: calc(25px * var(--ui-scale)) !important;
        flex: 0 0 10ch;
        line-height: 1.4;
    }
    .btn[data-action-type="close_raise"] {
        font-size: calc(70px * var(--ui-scale)) !important;
        top: calc(-90px * var(--ui-scale));
        left: calc(0px * var(--ui-scale));

        padding: calc(5px * var(--ui-scale)) calc(10px * var(--ui-scale)) calc(5px * var(--ui-scale)) calc(5px * var(--ui-scale));
    }
    .actions .btn:not(.raise-amount):not([data-action-type="raise"]) {
        padding: calc(15px * var(--ui-scale)) calc(20px * var(--ui-scale));
    }
    #layoutFooter .checkboxes-holder .checkbox-flex-wrapper {
        --margin-right: 0;
        --font-size: calc(25px * var(--ui-scale));
        min-width: 10ch;
    }
    #layoutFooter .checkboxes-holder .checkbox-flex-wrapper:last-child {
        min-width: 10ch;
    }

    .game-content-holder .expand-chat {
        bottom: 10rem;
    }
    .portrait .chat-content-holder.is-overlayed .chat-header .chat-title {
        font-size: calc(50px * var(--ui-scale));
    }

    /* make raise sldiers a bit bigger on mobile */
    .btn[data-action-type="raise"] {
        top: calc(-90px * var(--ui-scale));
        right: calc(0px * var(--ui-scale));
        font-size: calc(46px * var(--ui-scale));
        padding: calc(16px * var(--ui-scale)) calc(20px * var(--ui-scale));
    }

    .actions .slide-container {
        padding-right: 0;
    }

    .actions .slide-container .slider-value {
        font: calc(30px * var(--ui-scale))/calc(30px * var(--ui-scale)) var(--font-fam-btn)
    }
    .actions .slide-container .slider {
        margin-right: 0px;
    }
    /* hide raise verbiage on smalelr screen*/
    .actions .slide-container .slider-value .setting-name {
        display: none;
    }
    .slider {
        height: calc(10px * var(--ui-scale));
        /*
        border-radius: calc(10px * var(--ui-scale));
        margin-bottom: calc(15px * var(--ui-scale));*/
    }
    .slider::-webkit-slider-thumb {
        width: calc(50px * var(--ui-scale));
        height: calc(50px * var(--ui-scale));
        border-radius: calc(25px * var(--ui-scale));
        transform: translateX(calc(var(--slider-thumb-offset-x) * 100%));
    }
    .slider::-moz-range-thumb {
        width: calc(50px * var(--ui-scale));
        height: calc(50px * var(--ui-scale));
        border-radius: calc(25px * var(--ui-scale));
        transform: translateX(calc(var(--slider-thumb-offset-x) * 100%));
    }
    .slider.vertical {
        width: calc(10px * var(--ui-scale));
        height: 100%;
    }
    .slider.vertical::-webkit-slider-thumb {
        width: calc(13px * var(--ui-scale));
        height: calc(var(--vertical-slider-width) * 1.1);
        border-radius: calc(25px * var(--ui-scale));
        border: 1px solid #ffffff;
        filter: drop-shadow(0 0 3px #ffd700a6);
        /* we can still use xoffset, but apply it veritcally */
        /*transform: translateY(calc(var(--slider-thumb-offset-x) * 100%));*/
        transform: none !important;
    }
    .slider.vertical::-moz-range-thumb {
        width: 110%;
        height: calc(13px * var(--ui-scale));
        border-radius: calc(25px * var(--ui-scale));
        border: 1px solid #ffffff;
        filter: drop-shadow(0 0 3px #ffd700a6);
        /* we can still use xoffset, but apply it veritcally */
        /*transform: translateY(calc(var(--slider-thumb-offset-x) * 100%));*/
        transform: none !important;
    }
    .slider.rotate-vertical::-webkit-slider-thumb {
        height: 110%;
        width: calc(18px * var(--ui-scale));
        border-radius: calc(25px * var(--ui-scale));
        border: 1px solid #ffffff;
        filter: drop-shadow(0 0 3px #ffd700a6);
        /* we can still use xoffset, but apply it veritcally */
        /*transform: translateY(calc(var(--slider-thumb-offset-x) * 100%));*/
        margin-top: 0;
        transform: translateY(calc(var(--vertical-slider-width) * -0.05)) !important;
    }
    .slider.rotate-vertical::-moz-range-thumb {
        height: 110%;
        width: calc(13px * var(--ui-scale));
        border-radius: calc(25px * var(--ui-scale));
        border: 1px solid #ffffff;
        filter: drop-shadow(0 0 3px #ffd700a6);
        /* we can still use xoffset, but apply it veritcally */
        /*transform: translateY(calc(var(--slider-thumb-offset-x) * 100%));*/
        transform: none !important;
    }

    /* START settings popup */
    #dynamic_dom .popup-holder.settings-popup .tabs-holder {
        flex-direction: column;
    }
    #dynamic_dom .popup-holder.settings-popup .tabs-holder .popup-sidebar {
        flex: 0 1 auto;
        box-shadow: 0 1px 1px rgba(0,0,0,0.5);
    }
    #dynamic_dom .popup-holder.settings-popup .tabs-holder .popup-sidebar .popup-navigation {
        display: flex;
        flex-wrap: wrap;
    }
    #dynamic_dom .popup-holder.settings-popup .tabs-holder .tabs-content-holder {
        /* weird flex vertical prevention of overflow*/
        min-height: 0;
    }

    .settings-holder .list-group.color_select {
        /*justify-content: space-around;*/
    }
    /* END settings popup */

}

@media only screen and (max-width: 620px) {
    .btn[data-action-type="close_raise"] {
        font-size: calc(70px * var(--ui-scale)) !important;
    }
    .portrait .chat-content-holder.is-overlayed .chat-header .chat-title {
        font-size: calc(50px * var(--ui-scale));
    }
    .portrait .chat-content-holder.is-overlayed .chat-header .chat-title.small-text {
        /*font-size: calc(40px * var(--ui-scale));*/
    }
}
@media only screen and (max-width: 550px) {
    .settings-holder .list-group.color_select .btn {
        margin: 0 auto; /* need this so the grid elements center within the grid width */
    }
}
@media only screen and (max-width: 500px) {
    .actions .btn:not(.raise-amount):not([data-action-type="raise"]) {
        font-size: calc(30px * var(--ui-scale));
    }
    .actions .btn, .room-actions .btn {
        /*padding: calc(15px * var(--ui-scale)) calc(5px * var(--ui-scale));*/
    }
    .btn[data-action-type="close_raise"] {
        padding: calc(5px * var(--ui-scale)) calc(5px * var(--ui-scale));
    }
    .btn.raise-amount .slide-container {
        /* on portrait margin on all sides for smaller screen,
        to make the slider bar a bit narrower, so that it doesn't cause "go back" issues on mobile swipe*/
        margin: 1em 0.5em;
    }
    .room-actions .btn[data-action-type="attempt_join_waitlist"],
    .room-actions .btn[data-action-type="leave_waitlist"],
    .room-actions .btn[data-action-type="view_waitlist"] {
        font-size: calc(20px * var(--ui-scale));
    }
    #popupsHolder .popup-holder[data-type="game_end"] .popup-content .press-anywhere-to-continue {
        right: calc(250px * var(--ui-scale));
        left: calc(20px * var(--ui-scale));
    }
    .portrait #popupsHolder .popup-holder[data-type="game_end"] .popup-content .press-anywhere-to-continue span {
        display: none;
    }
    #popupsHolder .popup-holder[data-type="game_end"] .popup-content .show-hand-to-continue {
        font-size: calc(24px * var(--ui-scale));
    }

    /* some adjustments for mobile to raise the top header buttons a bit & make a bit more space */
    .portrait #layoutHeader .side-controls {
        gap: calc(var(--ui-scale) * 10px);
        top: calc(var(--ui-scale) * 10px);
        right: calc(var(--ui-scale) * 10px);
    }
    .portrait #layoutHeader .buttons-holder {
        padding-top: calc(10px * var(--ui-scale));
        /* Reducing top padding, have to account for it in bottom, to not move all the content up.
        Another 10px we have to account for are the reduced icons by 10px.
         */
        padding-bottom: calc(30px * var(--ui-scale));
    }
    .portrait .buttons-holder .boxed-in[data-action-type="quick_menu_toggle"] {
        margin-left: calc(10px * var(--ui-scale));
    }

    .portrait #layoutHeader .side-controls .btn {
        width: calc(72px * var(--ui-scale) * var(--portrait-icon-size-mx));
        height: calc(72px * var(--ui-scale) * var(--portrait-icon-size-mx));
        font-size: calc(1.55 * 8px * 0.8 * var(--ui-scale) * var(--portrait-icon-size-mx));
        border: calc(var(--ui-scale) * 1.55 * 1px * 0.8 * var(--portrait-icon-size-mx)) solid grey;
        border-radius: calc(var(--ui-scale) * 1.55 * 10px * 0.8 * var(--portrait-icon-size-mx));
    }

    .portrait #layoutHeader .buttons-holder .icon {
        width: calc(80px * var(--ui-scale) * var(--portrait-icon-size-mx));
        height: calc(80px * var(--ui-scale) * var(--portrait-icon-size-mx));
    }
    .portrait .icon.hamburger {
        font-size: calc(80px * var(--ui-scale) * var(--portrait-icon-size-mx));
    }
}
@media only screen and (max-width: 480px) {
    .btn.raise-amount .slide-container {
        margin: 1em 1.2em;
    }

    [data-scale-table-size="1.3"].portrait.raise-bar-open .game-content-holder .expand-chat {
        /*bottom: 15rem;*/
        /* have to account for raise bar vertical */
        bottom: calc(18rem + calc(420px * var(--ui-scale)));
    }

    /* START settings popup */
    #dynamic_dom .popup-holder.settings-popup .tabs-holder .scroll-holder {
        margin-left: calc(10px * var(--ui-scale));
        margin-top: calc(10px * var(--ui-scale));
        padding-right: calc(20px * var(--ui-scale));
    }
    .portrait [data-tooltip-content="lobby_theme"]:hover .tooltip-content,
    .portrait [data-tooltip-content="lobby_theme"].show-data-tooltip .tooltip-content{
        left: auto;
        transform: unset;
    }
    /* END settings popup */
}
@media only screen and (max-width: 450px) {
    .btn.raise-amount .slide-container {
        margin: 1em 1.5em;
    }

    #dynamic_dom .popup-holder.settings-popup .tabs-holder .popup-sidebar {
        z-index: unset;
    }
    #dynamic_dom .popup-holder.settings-popup .tabs-holder .tabs-content-holder {
        position: static;
    }
    #dynamic_dom .popup-holder.settings-popup .tabs-holder .tab-data .tab-data-footer {
        box-shadow: 0 -1px 1px rgba(0,0,0,0.5);
    }
    #dynamic_dom .popup-holder.settings-popup .tabs-holder .tab-data .tab-data-footer .btn {
        font-size: calc(15px * var(--ui-scale));
    }

    .portrait .settings-holder .list-group.color_select {
        --scale-item-mx: 0.727;
    }
}
@media only screen and (max-width: 400px) {
    #layoutFooter {
        /*padding: calc(10px * var(--ui-scale)) calc(5px * var(--ui-scale));*/
        padding: calc(10px * var(--ui-scale)) calc(10px * var(--ui-scale));
    }
    .raise-bar-open #layoutFooter {
        padding: calc(10px * var(--ui-scale)) calc(10px * var(--ui-scale));
    }
    #layoutFooter .actions {
        display: flex;
        gap: calc(20px * var(--ui-scale));
    }
    .btn.raise-amount {
        gap: calc(20px * var(--ui-scale));
    }
    #layoutFooter .actions .btn {
        flex: 1;
        line-height: 1.55 !important;
    }
    .actions .btn:not(.raise-amount):not([data-action-type="raise"]) {
        font-size: calc(22px * var(--ui-scale));
    }
    .actions .btn, .room-actions .btn {
        padding: calc(15px * var(--ui-scale)) calc(5px * var(--ui-scale));
        /*padding: 0;*/
    }
    .btn.raise-amount.for-portrait .raise-options {
        bottom: calc(100% + calc(13px * var(--ui-scale))); /* this will put it at the top of the footer*/
    }
    .btn[data-action-type="raise"] {
        line-height: 1 !important;
    }
    .btn[data-action-type="close_raise"] {
        padding: calc(5px * var(--ui-scale)) calc(5px * var(--ui-scale));
        line-height: 1 !important;
    }

    #layoutFooter .checkboxes-holder .checkbox-flex-wrapper {
        min-width: unset !important;
        --side-padding: 0 !important;
    }

    /*
    .portrait #playTable .player .player-icons {
        left: calc(6px * var(--player-ui-scale));
        font-size: 1.8em;
    }
    .portrait #playTable .player[data-seat-location-id="0"] .player-icons {
        left: calc(-8px * var(--player-ui-scale));
    }
    .portrait #playTable .player .best-hand {
        left: calc(99px * var(--player-ui-scale));
        transform: translateX(calc(-0.0 * var(--player1-hand-cards-scale) * var(--card-width-default) - 50%));
    }*/

    /* START settings popup */
    .settings-holder .input-group-wrapper .setting-numeric input {
        font-size: calc(16px * var(--ui-scale));
    }
    .popup-holder .settings-holder .input-group-wrapper .input-group .remove-input-group {
        flex: 0 0 calc(40px * var(--ui-scale));
        height: calc(40px * var(--ui-scale));
    }
    .popup-holder .settings-holder .input-group-wrapper .input-group:last-child .input-wrapper.duration::after {
        font-size: calc(16px * var(--ui-scale));
        width: calc(11ch - 1px);
    }
    /* END settings popup */

    .portrait #popupsHolder .popup-holder[data-type="set_username"] .customization-header .customization-special-offer {
        position: relative;
        transform: none;
        margin-left: auto;
    }
}

@media only screen and (max-width: 380px) { /* most biger screens are down to 372 */
    #layoutFooter .actions {
        gap: calc(10px * var(--ui-scale));
    }
    .btn.raise-amount {
        gap: calc(10px * var(--ui-scale));
    }

    .game-content-holder .expand-chat {
        bottom: 14rem;
    }
    /*.portrait .game-content-holder .left-side-buttons {
        bottom: 14rem;
    }*/
    .portrait:not([data-scale-table-size="1.3"]) .game-content-holder .left-side-buttons {
        bottom: 5rem;
        top: 0;
        margin: auto 0;
    }


    .portrait #game_content[data-room-status="waiting_players"][data-playing-players="1"] #layoutContent #playTable .invite-link-widget {
        font-size: 0.9em;
    }
    .portrait[data-scale-table-size="1.3"] #game_content[data-room-status="waiting_players"][data-playing-players="1"] #layoutContent .invite-link-widget {
        top: calc(var(--canvas-scale) * 550px);
        font-size: 0.9em;
    }
}
@media only screen and (max-width: 350px) {
    .raise-bar-open .game-content-holder .expand-chat {
        bottom: 25rem;
    }
    .portrait .checkbox-with-label {
        font-size: 1.3em;
    }

    .settings-holder .list-group.color_select {
        --scale-item-mx: 0.545;
    }
}
@media only screen and (max-width: 240px) {
    .raise-bar-open .game-content-holder .expand-chat {
        bottom: 31rem;
    }
}