:root {
    --header-btn-radius: calc(15px * var(--ui-scale));
    --portrait-icon-size-mx: 0.9; /* additional multiplier adjustment on all header icon sizes*/
}
/* START BUTTONS */
.btn {

    /* these values at top are attempt at potentia lfix for square border o nsafari? */
    -webkit-appearance: none;
    border-radius: 0;

    display: inline-block;
    text-align: center;
    padding: calc(5px * var(--ui-scale)) calc(20px * var(--ui-scale));
    border-radius: calc(15px * var(--ui-scale));

    cursor: pointer;

    font-family: var(--font-fam-title);
    background: white;
    color: var(--clr-green1);

    font-weight: bold;
    text-decoration: none;

    /* removed all transition as it causes slow re-scale on resize*/
    /*transition: all 200ms ease-in, color 0s, background 0s;*/
    transition: transform 200ms ease-in, color 0s, background 0s;

    backface-visibility: hidden; /* fixes font not being smooth on scale effect */
    transform: translateZ(0);
}
.btn.no-action {
    cursor: default;
}
.btn:not(.icon):not(.boxed-in) {
    /* uncomment if we want to give a 3d look to buttons */
    /*box-shadow: calc(3px * var(--ui-scale)) calc(3px * var(--ui-scale)) calc(5px * var(--ui-scale)) rgba(0,0,0, 0.5), inset 0 30px 0px rgba(255, 255, 255, 0.2);*/
}
.btn:not(.icon, :last-child) {
    margin-right: calc(5px * var(--ui-scale));
}
.btn-primary {
    color: var(--clr-pri);
    background: var(--clr-sec);
}
.btn-secondary {
    color: var(--clr-pri);
    /*background: var(--clr-green2);*/
    background: var(--clr-green5);
}
.btn-tertiary {
    background: var(--clr-red);
}
.btn-tertiary-forced {
    background: var(--clr-red) !important;
}
.btn.increased-inner-span span {
    font-size: 1.3em;
    line-height: 1;

    vertical-align: middle;
}
p.or-paragraph {
    font-size: 0.8em;
    font-weight: 600;
}
.btn-clean { /*has no BG, i.e. for menus */
    display: block;
    width: max-content;
    color: var(--clr-pri);
    background: none;
}
.btn-simple-boxy {

    background: var(--clr-orange);
    border: calc(1px * var(--ui-scale)) solid;
    font-family: var(--font-fam-title);
    font-size: calc(14px * var(--ui-scale));
    line-height: calc(16px * var(--ui-scale));
    font-weight: 700;
    color: var(--clr-green1);
    padding: calc(10px * var(--ui-scale)) calc(20px * var(--ui-scale));
    margin-bottom: calc(5px * var(--ui-scale));

}
.btn-simple-boxy:hover {
    color: var(--clr-pri);
    border-color: var(--clr-pri);
}
.btn.btn-toggle {
    background: none;
    border: 0;
    padding: 0;
    margin: calc(7px * var(--ui-scale)) 0;
    padding-left: calc(30px * var(--ui-scale));
}
.btn.btn-toggle:after {
    content: '';
    position: absolute;
    top: calc(-2px * var(--ui-scale));
    bottom: 0;
    left: 0px;

    width: calc(20px * var(--ui-scale));
    height: calc(20px * var(--ui-scale));
    border-radius: 50%;

    background: #8eb344;
    border: calc(3px * var(--ui-scale)) solid white;
}
.btn.btn-toggle.off:after {
    background: #fc2020;
}
.btn:not(.active):not(.no-action):hover {
    transform: scale(0.98);
}
.btn.btn-toggle:hover {
    transform: scale(0.98);
    color: var(--clr-sec);
}
.btn.disabled {
    pointer-events: none;
    opacity: 0.8;
}
.btn:not(.is-loading) .fa-spinner {
    display: none;
}
.btn.is-loading .fa-spinner {
    position: absolute;
    right: calc(20px * var(--ui-scale));
    top: 0;
    bottom: 0;
    height: max-content;
    margin: auto 0;
}
/* START boxy header buttons */
.buttons-holder .boxed-in {
    /*border: calc(4px * var(--ui-scale)) solid #ffffff;*/
    color: #ffffff;
    text-align: center;
    border-radius: 0;
    background: none;
    padding: 0 calc(5px * var(--ui-scale)) calc(5px * var(--ui-scale)) calc(5px * var(--ui-scale));
    margin: 0;
    font-size: calc(10px * var(--ui-scale));

    text-transform: uppercase;
    transition: transform 100ms ease-in, color 0s, background 0s;

    z-index: 1; /* so notification icon goes over alpha version*/
}
.buttons-holder .boxed-in[data-action-type="quick_menu_toggle"] {
    margin-left: calc(4px * var(--ui-scale));
}
.boxed-in.border-radius-left {
    border-top-left-radius: var(--header-btn-radius);
    border-bottom-left-radius: var(--header-btn-radius);
}
.boxed-in.border-radius-right {
    border-top-right-radius: var(--header-btn-radius);
    border-bottom-right-radius: var(--header-btn-radius);
}
.boxed-in .icon {
    display: block;
    transition: transform 100ms ease-in-out, color 0s, filter 0s, background 0s;
    margin: 0 auto;
    transform: scale(0.97);
}
.boxed-in.no-left-border {
    border-left: none;
}
.btn.boxed-in:not(.active):hover {
    transform: none;
}
.btn.boxed-in:not(.active):hover .icon{
    transform: scale(1.00);
}
/* END boxy header buttons */

/* END BUTTONS */

.buttons-holder {
    padding: calc(10px * var(--ui-scale)) 0;
    gap: calc(5px * var(--ui-scale));
    align-items: center;
}
.buttons-holder.boxed-in {
    gap: calc(2px * var(--ui-scale));
}

.btn[data-action-type="pause_game"] {
    min-width: 9ch;
}

.btn.boxed-in span {
    transition: opacity 150ms ease-out;
    opacity: 0;
}
.btn.boxed-in:hover span {
    opacity: 1;
}
/* adjustment of texts to neatly center icons */
.btn[data-action-type="quick_menu_toggle"] span {
    margin-right: calc(3px * var(--ui-scale));
}
.btn[data-type="hands"] span {
    /*margin-right: calc(3px * var(--ui-scale));*/
}
.btn[data-action-type="leave_room"] span {
    margin-right: calc(15px * var(--ui-scale));
}
.btn[data-type="master_toggle"] span {
    margin-right: calc(5px * var(--ui-scale));
}
.btn[data-action-type="fullscreen"] span {
}
.btn[data-type="rebuy_seat_watch_ad"] {
    display: flex;
    gap: 1em;
    align-items: center;
    padding: calc(20px * var(--ui-scale));

    margin: 0 auto;
    width: max-content;
}
.btn[data-type="rebuy_seat_watch_ad"] *:not(.fa-solid) {
    transform: translateZ(0px);
    will-change: transform;
}
.btn .watch-ad-icon-holder {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: calc(10px * var(--ui-scale));
    padding: calc(var(--ui-scale) * 10px) calc(var(--ui-scale) * 15px);

    background: #ffffff;
    border-radius: calc(var(--ui-scale) * 10px);
    border: calc(var(--ui-scale) * 1px) solid var(--clr-black1);
}
.btn .watch-ad-icon-holder .fa-solid {
    color: var(--clr-black1);

    font-size: 1.3em;
}
.btn .watch-ad-icon-holder > span {
    display: block;
    /*background: var(--clr-black1);*/
    color: var(--clr-black1);
    /*padding: calc(3px * var(--ui-scale));*/
    font-size: calc(13px * var(--ui-scale));
    font-weight: 700;
}
.btn .side-text {
    text-align: center;
    max-width: 10ch;
    line-height: 1;
}
.btn .side-text span {
    display: inline-block;
    line-height: 1;
    margin-top: 0.5em;
}

#layoutHeader .url-box {
    background: white;
    color: black;
    padding: calc(var(--canvas-scale) * 10px) calc(var(--canvas-scale) * 20px);
    border-radius: calc(var(--canvas-scale) * 10px);
    text-align: left;
    font-size: 1em;
    line-height: 1.2;
    font-weight: bold;

    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    margin-left: auto;
    width: calc(var(--ui-scale) * 500px);
    max-width: 50vw;
    position: relative;
    left: -2em;
}

.portrait #layoutHeader .url-box {
    margin-left: 1em;
    left: 0;
}

/* special notice */
#layoutHeader .special-notice {
    position: absolute;

    display: flex;
    justify-content: center;
    align-items: center;

    box-sizing: border-box;
    width: max-content;
    height: calc(51px * var(--ui-scale));
    border: calc(var(--ui-scale) * 1px) solid grey;
    border-radius: calc(var(--ui-scale) * 10px);
    background: #ffffff;

    color: #000000;

    left: calc(80px * var(--ui-scale));
    top: calc(var(--ui-scale) * 17px);
    gap: calc(var(--ui-scale) * 10px);
    padding: 0 calc(var(--ui-scale) * 5px);
    text-align: center;
    cursor: pointer;

    transition: transform 100ms ease-in, color 0s, background 0s;
}
#layoutHeader .special-notice i {
    font-size: 1.4em;
}
.portrait #layoutHeader .special-notice {
    height: calc(70px * var(--ui-scale) * var(--portrait-icon-size-mx));
    left: calc(125px * var(--ui-scale) * var(--portrait-icon-size-mx));
    font-size: 1.2em;
    top: calc(var(--ui-scale) * 30px);
}
/* END special notice */

#layoutHeader .side-controls {
    position: absolute;
    right: calc(var(--ui-scale) * 14px);
    top: calc(var(--ui-scale) * 82px);

    /* new solution, to display them in the very top row*/
    display: flex;
    gap: calc(var(--ui-scale) * 5px);
    top: calc(var(--ui-scale) * 14px);
}
#layoutHeader .side-controls .btn {
    position: relative;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0;
    box-sizing: border-box;

    width: calc(58px * var(--ui-scale));
    height: calc(58px * var(--ui-scale));

    /*background: rgba(0,0,0,0.5);
    border: calc(var(--ui-scale) * 1px) solid grey;*/
    border-radius: calc(var(--ui-scale) * 10px);

    /*margin-bottom: calc(var(--ui-scale) * 10px);*/
    min-width: unset;
    z-index: 1;
    margin-right: 0;

    /* new CSS */
    color: #000000;
    text-align: center;
    background: #ffffff;
    font-size: calc(8px * var(--ui-scale));

    text-transform: uppercase;
    transform: scale(0.97);
    transition: transform 100ms ease-in, color 0s, background 0s;
}
#layoutHeader .side-controls .btn[data-action-type="add_chips_popup"] {
    background: url('../images_nonopt/icons/pp_add_chips_icon.png');
    background-size: 100% 100%;
}
#layoutHeader .side-controls .btn[data-action-type="set_away_on"] {
    background: url('../images/icons/pp_away_icon.png');
    background-size: 100% 100%;
}
#layoutHeader .side-controls .btn[data-action-type="set_away_off"] {
    background: url('../images/icons/pp_join_icon.png');
    background-size: 100% 100%;
}
#layoutHeader .side-controls .btn[data-action-type="pause_game"] {
    background: url('../images/icons/pp_pause_icon.png');
    background-size: 100% 100%;
}
#layoutHeader .side-controls .btn[data-action-type="unpause_game"] {
    background: url('../images/icons/pp_play_icon.png');
    background-size: 100% 100%;
}
#layoutHeader .side-controls .btn[data-action-type="stop_game"] {
    background: url('../images/icons/pp_stop_icon.png');
    background-size: 100% 100%;
}
#layoutHeader .side-controls .btn[data-action-type="new_game_ask"] {
    background: url('../images/icons/pp_new_icon.png');
    background-size: 100% 100%;
}
#layoutHeader .side-controls .btn[data-action-type="start_new_game"] {
    background: url('../images/icons/pp_new_icon.png');
    background-size: 100% 100%;
}
#layoutHeader .side-controls .btn[data-type="exit_lobby_popup"] {
    background: url('../images_nonopt/icons/pp_exit_icon.png');
    background-size: 100% 100%;
}
#layoutHeader .side-controls .btn[data-action-type="fullscreen_toggle"] {
    background: url('../images/misc/new_icons_smaller2.png');
    background-size: auto 100%;
    background-position-x: -500%;
    width: calc(64px * var(--ui-scale));
    height: calc(64px * var(--ui-scale));
    margin-top: calc(-3px * var(--ui-scale));
}
#layoutHeader .side-controls .btn[data-action-type="fullscreen_toggle"].exit-fullscreen {
    background: url('../images/misc/new_icons_smaller2.png');
    background-size: auto 100%;
    background-position-x: -600%;
}
#layoutHeader .side-controls .btn.pp-home {
    background: url('../images/icons/pp_home_icon.png');
    background-size: 100% 100%;
}
#layoutHeader .side-controls .btn > div {
    font-size: calc(35px * var(--ui-scale));

    width: max-content;
    height: max-content;
}

#layoutHeader .side-controls .btn > div {
    display: block;
    transition: transform 100ms ease-in-out, color 0s, filter 0s, background 0s;
    margin: 0 auto;
}
#layoutHeader .side-controls .btn:not(.active):hover {
    transform: scale(1.00);
    color: #272727;
}
#layoutHeader .side-controls .btn:not(.active):hover > div{
}
#layoutHeader .side-controls .btn span {
    /*transition: opacity 150ms ease-out;*/
    opacity: 1;
    line-height: 1;
    margin-top: 0.3em;
}
#layoutHeader .side-controls .btn:hover span {
    /*opacity: 0;*/
}

#layoutHeader .side-controls .admin-controls {
    display: flex;
    width: max-content;
    gap: calc(var(--ui-scale) * 5px);
}
/* portrait adjustments below */
.portrait #layoutHeader .buttons-holder {
    padding-top: calc(20px * var(--ui-scale));
}
.portrait #layoutHeader .buttons-holder .icon {
    width: calc(90px * var(--ui-scale) * var(--portrait-icon-size-mx));
    height: calc(90px * var(--ui-scale) * var(--portrait-icon-size-mx));
}

.portrait #layoutHeader .buttons-holder .share-game-btn .icon {
    pointer-events: none;
    width: calc(0.875 * 90px * var(--ui-scale) * var(--portrait-icon-size-mx)) !important; /*icon is not centered, so we cut a bit of it's right side off for better alignment, 0.875% of width)*/
}
.portrait .buttons-holder .boxed-in[data-action-type="quick_menu_toggle"] {
    margin-left: calc(20px * var(--ui-scale));
}
.portrait  #game_content[data-quick-popup-open="quick_menu"] .buttons-holder .boxed-in[data-action-type="quick_menu_toggle"] {
    z-index: 10000; /* 1 higher than quick menu*/
}
.portrait #layoutHeader .side-controls {
    gap: calc(var(--ui-scale) * 15px);
    top: calc(var(--ui-scale) * 24px);
    right: calc(var(--ui-scale) * 24px);
}
.portrait #layoutHeader .side-controls .btn {
    width: calc(81px * var(--ui-scale) * var(--portrait-icon-size-mx));
    height: calc(81px * var(--ui-scale) * var(--portrait-icon-size-mx));
    font-size: calc(1.55 * 8px * 0.9 * var(--ui-scale) * var(--portrait-icon-size-mx));
    border: calc(var(--ui-scale) * 1.55 * 1px * 0.9 * var(--portrait-icon-size-mx)) solid grey;
    border-radius: calc(var(--ui-scale) * 1.55 * 10px * 0.9 * var(--portrait-icon-size-mx));
}
.portrait #layoutHeader .side-controls .btn > div {
    font-size: calc(1.55 * 35px * var(--ui-scale) * 0.9 * var(--portrait-icon-size-mx));
}

.portrait #layoutHeader .side-controls .btn[data-action-type="fullscreen_toggle"] {
    border: none !important;
    width: calc(90px * var(--ui-scale) * var(--portrait-icon-size-mx));
    height: calc(90px * var(--ui-scale) * var(--portrait-icon-size-mx));
    margin-top: calc(-4px * var(--ui-scale));
}
.portrait .hamburger .notification-icon {
    font-size: calc(20px * var(--ui-scale) * var(--portrait-icon-size-mx));
    right: calc(var(--ui-scale) * -20px * var(--portrait-icon-size-mx));
    width: calc(var(--ui-scale) * 40px * var(--portrait-icon-size-mx));
    height: calc(var(--ui-scale) * 40px * var(--portrait-icon-size-mx));
    border-radius: calc(var(--ui-scale) * 20px * var(--portrait-icon-size-mx));
    line-height: calc(var(--ui-scale) * 37px * var(--portrait-icon-size-mx));
    font-weight: bold;
    font-family: var(--font-fam-reg);
}
.portrait #layoutHeader .side-controls .admin-controls {
    gap: calc(var(--ui-scale) * 13px * var(--portrait-icon-size-mx));
}

/* side button for PP home & changelogs */
.game-content-holder .left-side-buttons {
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(-1px * var(--ui-scale)); /*there's a bit of unnecessary opacity on the right*/
    margin: auto 0;
    height: max-content;
    z-index: 5;
}
.portrait .game-content-holder .left-side-buttons {
    /* position it similar as the chat icon */
    position: absolute;
    bottom: 10rem;
    margin: 0;
    top: auto;
    left: calc(-1px * var(--ui-scale));
}
#game_content .game-content-holder .left-side-buttons > div {
    transform: scale(0.97);
    transition: transform  100ms ease-in, color 0s, background 0s;
    transform-origin: 0 center;
    border-top-right-radius: calc(12px * var(--ui-scale));
    border-bottom-right-radius: calc(12px * var(--ui-scale));
}
#game_content .game-content-holder .left-side-buttons > div:not(.pp-discord) {
    background: var(--clr-black1);
}
.is-dark-lobby-background #game_content .game-content-holder .left-side-buttons > div:not(.pp-discord) {
    /*background: var(--clr-green3);*/
    background: #ffffff;
    color: #000000;
}
.portrait #game_content .game-content-holder .left-side-buttons > div {
    transform: scale(0.97);
}
#game_content .game-content-holder  .left-side-buttons > div:hover {
    transform: scale(1);
}
.game-content-holder .left-side-buttons .changelog-button {
    padding: calc(10px * var(--ui-scale)) calc(5px * var(--ui-scale));
    background: black;
    box-sizing: border-box;

    color: white;
    border-top-right-radius: calc(12px * var(--ui-scale));
    border-bottom-right-radius: calc(12px * var(--ui-scale));
    font-size: calc(9px * var(--ui-scale));
    margin-top: calc(5px * var(--ui-scale));
    margin-bottom: calc(5px * var(--ui-scale));

    text-align: center;
    cursor: pointer;
    font-weight: 600;

    width: calc(75px * var(--ui-scale));
}
.portrait .game-content-holder .left-side-buttons .changelog-button {
    padding: calc(17px * var(--ui-scale)) calc(5px * var(--ui-scale));
    width: calc(105px * var(--ui-scale));
    font-size: calc(13px * var(--ui-scale));
    margin-top: calc(10px * var(--ui-scale));
    margin-bottom: calc(10px * var(--ui-scale));
}
.game-content-holder .btn.pp-discord,
.game-content-holder .btn.pp-home {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0;
    box-sizing: border-box;
    width: calc(75px * var(--ui-scale));
    height: calc(36px * var(--ui-scale));
    border-radius: 0;

    min-width: unset;
    z-index: 1;
    text-transform: uppercase;
}
.game-content-holder .btn.pp-discord {
    background: url('../images_nonopt/icons/pp_discord_sidebar.png');
    background-size: 100% 100%;
}
.game-content-holder .btn.pp-home {
    /*background: url('../images_nonopt/icons/pp_icon_sidebar.png');
    background-size: 100% 100%;*/
}
.game-content-holder .btn.pp-home a {
    display: flex;
    justify-content: center;
    align-items: center;
}
.game-content-holder .btn.pp-home a:after {
    content: '';
    display: inline-block;
    background: url('../favicon-32x32.png?v=2');
    background-size: 100% 100%;
    width: calc(20px * var(--ui-scale));
    height: calc(20px * var(--ui-scale));
}
.portrait .game-content-holder .btn.pp-discord {
    display: none;
    width: calc(105px * var(--ui-scale));
    height: calc(50.5px * var(--ui-scale));
}
.portrait .game-content-holder .btn.pp-home {
    width: calc(105px * var(--ui-scale));
    height: calc(50.5px * var(--ui-scale));
}
.portrait .game-content-holder .btn.pp-home a:after {
    width: calc(28px * var(--ui-scale));
    height: calc(28px * var(--ui-scale));
}