/* ---------- chat window (ui/js/chat.js): messenger in the lobby (item-source="chat") and the chat in a game ---------- */
.chat-container {
    display: none;
    opacity: 0;
    position: fixed;
    left: 0px;
    top: 0px;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 10100000;
    background-color: rgba(4, 9, 20, 0.62);
}

.chat-container:not([item-source="chat"]) {
    background-color: rgba(3, 8, 16, 0.4);
}

.chat-container[item-closing] {
    -webkit-animation: cv-fade-out 0.18s ease forwards;
    animation: cv-fade-out 0.18s ease forwards;
}

.cv-app {
    position: absolute;
    left: 0px;
    right: 0px;
    bottom: 0px;
    height: 100%;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-flex-direction: column;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
    background-color: #0f1931;
    background-image: linear-gradient(180deg, #18264a 0%, #0f1931 55%, #0b1428 100%);
    color: #eef3fb;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -webkit-animation: cv-up 0.32s cubic-bezier(0.2, 0.9, 0.25, 1);
    animation: cv-up 0.32s cubic-bezier(0.2, 0.9, 0.25, 1);
}

.cv-app::before {
    content: '';
    position: absolute;
    left: 0px;
    right: 0px;
    top: 0px;
    height: 1px;
    z-index: 3;
    background: linear-gradient(90deg, transparent, rgba(240, 197, 85, 0.65), transparent);
    pointer-events: none;
}

.chat-container[item-closing] .cv-app {
    -webkit-animation: cv-out 0.18s ease forwards;
    animation: cv-out 0.18s ease forwards;
}

/* in a game: a sheet from the bottom, the table stays visible above it */
.chat-container:not([item-source="chat"]) .cv-app {
    height: 74%;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    -webkit-border-radius: 26px 26px 0 0;
    border-radius: 26px 26px 0 0;
    -webkit-box-shadow: 0 -18px 50px rgba(0, 0, 0, 0.5);
    box-shadow: 0 -18px 50px rgba(0, 0, 0, 0.5);
}

.cv-grab {
    display: none;
}

.chat-container:not([item-source="chat"]) .cv-grab {
    display: block;
    -webkit-flex: none;
    flex: none;
    width: 40px;
    height: 4px;
    margin: 8px auto 0;
    background-color: rgba(255, 255, 255, 0.22);
    -webkit-border-radius: 4px;
    border-radius: 4px;
}

@media only screen and (min-width: 600px) {
    .chat-container[item-source="chat"] .cv-app {
        left: 50%;
        right: auto;
        width: 440px;
        margin-left: -220px;
        height: 640px;
        max-height: calc(100% - 48px);
        bottom: 24px;
        bottom: max(24px, calc(50% - 320px));
        border: 1px solid rgba(255, 255, 255, 0.1);
        -webkit-border-radius: 24px;
        border-radius: 24px;
        -webkit-box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
        box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
        -webkit-animation-name: cv-pop;
        animation-name: cv-pop;
    }

    /* in a game on a big screen the chat floats next to the table and the game stays playable */
    .chat-container:not([item-source="chat"]) {
        background: none;
        pointer-events: none;
    }

    .chat-container:not([item-source="chat"]) .cv-app {
        pointer-events: auto;
        left: auto;
        right: 72px;
        width: 380px;
        height: 520px;
        max-height: calc(100% - 32px);
        bottom: 16px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        -webkit-border-radius: 24px;
        border-radius: 24px;
        -webkit-box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
        box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
        -webkit-animation-name: cv-pop;
        animation-name: cv-pop;
    }

    .chat-container:not([item-source="chat"]) .cv-grab {
        display: none;
    }
}

svg.cv-i {
    display: block;
    -webkit-flex: none;
    flex: none;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---------- header ---------- */
.cv-head {
    -webkit-flex: none;
    flex: none;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    height: 62px;
    padding: 0 12px 0 14px;
    box-sizing: border-box;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-container:not([item-source="chat"]) .cv-head {
    height: 52px;
}

.cv-ava,
.cv-av {
    position: relative;
    -webkit-flex: none;
    flex: none;
    background-color: #22345c;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%237f93b8'%3E%3Ccircle cx='12' cy='9' r='4'/%3E%3Cpath d='M4.5 20c.8-4 3.9-6 7.5-6s6.7 2 7.5 6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 62% 62%;
    -webkit-border-radius: 50%;
    border-radius: 50%;
}

.cv-ava > span,
.cv-av > span {
    position: absolute;
    left: 0px;
    top: 0px;
    right: 0px;
    bottom: 0px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    -webkit-border-radius: 50%;
    border-radius: 50%;
}

.cv-ava {
    width: 40px;
    height: 40px;
    -webkit-box-shadow: 0 0 0 2px rgba(240, 197, 85, 0.85);
    box-shadow: 0 0 0 2px rgba(240, 197, 85, 0.85);
}

.chat-container:not([item-source="chat"]) .cv-head .cv-ava {
    width: 34px;
    height: 34px;
}

.cv-ava > i {
    display: none;
    position: absolute;
    right: -1px;
    bottom: -1px;
    z-index: 1;
    width: 12px;
    height: 12px;
    -webkit-border-radius: 50%;
    border-radius: 50%;
    -webkit-box-shadow: 0 0 0 2.5px #16233f;
    box-shadow: 0 0 0 2.5px #16233f;
}

.cv-ava[item-online="online"] > i {
    display: block;
    background-color: #2ee07a;
}

.cv-ava[item-online="playing"] > i {
    display: block;
    background-color: #f0c555;
}

.cv-who {
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    flex: 1;
    min-width: 0;
    margin-left: 11px;
}

.cv-who b {
    display: block;
    font-size: 15.5px;
    font-weight: bold;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cv-who span {
    display: block;
    margin-top: 2px;
    font-size: 11.5px;
    color: #93a4bf;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cv-who span:empty {
    display: none;
}

.cv-ava[item-online="online"] + .cv-who span {
    color: #7fe6a6;
}

.cv-ava[item-online="playing"] + .cv-who span {
    color: #ffe29a;
}

.cv-hb {
    -webkit-flex: none;
    flex: none;
    display: -webkit-inline-box;
    display: -webkit-inline-flex;
    display: inline-flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    height: 34px;
    min-width: 34px;
    margin: 0 0 0 8px;
    padding: 0;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background-color: rgba(255, 255, 255, 0.07);
    color: #dfe7f5;
    font: inherit;
    cursor: pointer;
    outline: none;
    -webkit-appearance: none;
    -webkit-border-radius: 17px;
    border-radius: 17px;
    -webkit-transition: background-color 0.15s ease, border-color 0.15s ease, -webkit-transform 0.15s ease;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.cv-hb:hover {
    background-color: rgba(255, 255, 255, 0.13);
}

.cv-hb:active {
    -webkit-transform: scale(0.94);
    transform: scale(0.94);
}

.cv-hb svg.cv-i {
    width: 16px;
    height: 16px;
    -webkit-transition: -webkit-transform 0.2s ease;
    transition: transform 0.2s ease;
}

.cv-x:hover svg.cv-i {
    -webkit-transform: rotate(90deg);
    transform: rotate(90deg);
}

.cv-play {
    padding: 0 12px 0 10px;
    font-size: 12.5px;
    font-weight: bold;
    color: #b9f7d3;
    background-color: rgba(31, 191, 95, 0.16);
    border-color: rgba(31, 191, 95, 0.45);
}

.cv-play:hover {
    background-color: rgba(31, 191, 95, 0.28);
}

.cv-play svg.cv-i {
    width: 13px;
    height: 13px;
    fill: currentColor;
}

.cv-play span {
    margin-left: 6px;
}

.cv-sound svg.cv-i-mute,
.cv-sound[item-off] svg.cv-i-sound {
    display: none;
}

.cv-sound[item-off] svg.cv-i-mute {
    display: block;
}

.cv-sound[item-off] {
    color: #7d8ca6;
}

/* ---------- messages ---------- */
.cv-main {
    position: relative;
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    flex: 1;
    min-height: 0;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-flex-direction: column;
    flex-direction: column;
}

.cv-body {
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

.cv-body::-webkit-scrollbar {
    width: 4px;
    background: transparent;
}

.cv-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.16);
    -webkit-border-radius: 2px;
    border-radius: 2px;
}

.cv-list {
    min-height: 100%;
    box-sizing: border-box;
    padding: 10px 12px 12px;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-box-pack: end;
    -webkit-justify-content: flex-end;
    justify-content: flex-end;
}

.cv-day {
    -webkit-align-self: center;
    align-self: center;
    margin: 14px 0 8px;
    padding: 4px 11px;
    background-color: rgba(255, 255, 255, 0.06);
    color: #93a4bf;
    font-size: 11px;
    -webkit-border-radius: 999px;
    border-radius: 999px;
}

.cv-row {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: end;
    -webkit-align-items: flex-end;
    align-items: flex-end;
    margin-top: 2px;
}

.cv-row.g-first {
    margin-top: 10px;
}

.cv-row.cv-me {
    -webkit-box-orient: horizontal;
    -webkit-box-direction: reverse;
    -webkit-flex-direction: row-reverse;
    flex-direction: row-reverse;
}

.cv-av {
    width: 26px;
    height: 26px;
    margin-right: 7px;
    visibility: hidden;
    -webkit-box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.14);
    box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.14);
}

.cv-row.g-last .cv-av {
    visibility: visible;
}

.cv-col {
    max-width: 78%;
    min-width: 0;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-box-align: start;
    -webkit-align-items: flex-start;
    align-items: flex-start;
}

.cv-me .cv-col {
    -webkit-box-align: end;
    -webkit-align-items: flex-end;
    align-items: flex-end;
}

.cv-bub {
    position: relative;
    max-width: 100%;
    box-sizing: border-box;
    padding: 9px 13px;
    font-size: 14.5px;
    line-height: 1.42;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    -webkit-border-radius: 18px;
    border-radius: 18px;
}

.cv-it .cv-bub {
    background-color: rgba(255, 255, 255, 0.075);
    border: 1px solid rgba(255, 255, 255, 0.07);
    color: #e9eff9;
    -webkit-transform-origin: left bottom;
    transform-origin: left bottom;
}

.cv-me .cv-bub {
    background-color: #2f5ce0;
    background-image: linear-gradient(135deg, #3567ea 0%, #2443c2 100%);
    color: #ffffff;
    -webkit-box-shadow: 0 4px 14px rgba(36, 67, 194, 0.3);
    box-shadow: 0 4px 14px rgba(36, 67, 194, 0.3);
    -webkit-transform-origin: right bottom;
    transform-origin: right bottom;
}

.cv-it.g-mid .cv-bub,
.cv-it.g-last .cv-bub {
    border-top-left-radius: 6px;
}

.cv-it.g-first .cv-bub,
.cv-it.g-mid .cv-bub {
    border-bottom-left-radius: 6px;
}

.cv-me.g-mid .cv-bub,
.cv-me.g-last .cv-bub {
    border-top-right-radius: 6px;
}

.cv-me.g-first .cv-bub,
.cv-me.g-mid .cv-bub {
    border-bottom-right-radius: 6px;
}

.cv-row.g-solo .cv-bub {
    border-radius: 18px;
}

.cv-it.g-solo .cv-bub {
    border-bottom-left-radius: 6px;
}

.cv-me.g-solo .cv-bub {
    border-bottom-right-radius: 6px;
}

.cv-row.cv-in .cv-bub {
    -webkit-animation: cv-in 0.26s cubic-bezier(0.2, 0.9, 0.25, 1.12);
    animation: cv-in 0.26s cubic-bezier(0.2, 0.9, 0.25, 1.12);
}

.cv-row.cv-sending .cv-bub {
    opacity: 0.7;
}

/* rows are updated in place: sending -> sent and regrouping change softly */
.cv-me .cv-bub {
    -webkit-transition: opacity 0.2s ease, border-radius 0.2s ease;
    transition: opacity 0.2s ease, border-radius 0.2s ease;
}

.cv-bub img {
    display: block;
    width: 56px;
    height: 56px;
    margin-top: 8px;
}

.cv-meta {
    margin-top: 4px;
    padding: 0 4px;
    font-size: 10.5px;
    color: rgba(201, 214, 234, 0.55);
    white-space: nowrap;
}

.cv-st {
    margin-left: 6px;
    color: rgba(201, 214, 234, 0.75);
    /* a fast send never shows it */
    -webkit-animation: cv-fade-in 0.2s ease 0.6s both;
    animation: cv-fade-in 0.2s ease 0.6s both;
}

.cv-st:first-child {
    margin-left: 0px;
}

/* box gift */
.cv-bub.cv-gift {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    padding: 10px 14px 10px 10px;
    overflow: hidden;
    color: #ffffff;
    background-color: rgba(240, 197, 85, 0.12);
    background-image: linear-gradient(135deg, rgba(240, 197, 85, 0.24) 0%, rgba(240, 197, 85, 0.06) 100%);
    border: 1px solid rgba(240, 197, 85, 0.45);
    -webkit-box-shadow: 0 6px 18px rgba(240, 197, 85, 0.12);
    box-shadow: 0 6px 18px rgba(240, 197, 85, 0.12);
    -webkit-border-radius: 18px;
    border-radius: 18px;
}

.cv-bub.cv-gift::after {
    content: '';
    position: absolute;
    top: 0px;
    bottom: 0px;
    left: -60%;
    width: 40%;
    opacity: 0;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    -webkit-transform: skewX(-18deg);
    transform: skewX(-18deg);
    pointer-events: none;
}

.cv-box {
    display: block;
    -webkit-flex: none;
    flex: none;
    width: 40px;
    height: 40px;
    margin-right: 11px;
}

.cv-gift-t {
    min-width: 0;
}

.cv-gift-t b {
    display: block;
    font-size: 14px;
    font-weight: bold;
}

.cv-gift-t small {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    color: #ffe29a;
}

.cv-row.cv-in .cv-bub.cv-gift {
    -webkit-animation: cv-gift 0.6s cubic-bezier(0.2, 0.9, 0.25, 1.25);
    animation: cv-gift 0.6s cubic-bezier(0.2, 0.9, 0.25, 1.25);
}

.cv-row.cv-in .cv-bub.cv-gift::after {
    -webkit-animation: cv-shine 1.1s 0.35s ease-out;
    animation: cv-shine 1.1s 0.35s ease-out;
}

.cv-row.cv-in .cv-box {
    -webkit-animation: cv-wiggle 0.9s 0.25s ease-in-out;
    animation: cv-wiggle 0.9s 0.25s ease-in-out;
}

/* empty chat and first load */
.cv-empty {
    margin: auto;
    padding: 30px 20px;
    text-align: center;
    color: #93a4bf;
    font-size: 13px;
    line-height: 1.5;
    -webkit-animation: cv-fade-in 0.3s ease;
    animation: cv-fade-in 0.3s ease;
}

.cv-empty .cv-ava {
    width: 74px;
    height: 74px;
    margin: 0 auto 12px;
    -webkit-box-shadow: 0 0 0 3px rgba(240, 197, 85, 0.6);
    box-shadow: 0 0 0 3px rgba(240, 197, 85, 0.6);
}

.cv-empty b {
    display: block;
    margin-bottom: 4px;
    font-size: 16px;
    color: #ffffff;
}

.cv-loading {
    margin: auto;
    padding: 30px 0;
}

.cv-loading i {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin: 0 3px;
    background-color: rgba(255, 255, 255, 0.4);
    -webkit-border-radius: 50%;
    border-radius: 50%;
    -webkit-animation: cv-dot 1s ease-in-out infinite;
    animation: cv-dot 1s ease-in-out infinite;
}

.cv-loading i:nth-child(2) {
    -webkit-animation-delay: 0.15s;
    animation-delay: 0.15s;
}

.cv-loading i:nth-child(3) {
    -webkit-animation-delay: 0.3s;
    animation-delay: 0.3s;
}

/* scrolled up: a round "down" button, the count of new messages on it */
.cv-down {
    position: absolute;
    left: 50%;
    bottom: 12px;
    z-index: 4;
    display: none;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin: 0 0 0 -21px;
    padding: 0;
    border: 1px solid rgba(240, 197, 85, 0.5);
    font: inherit;
    color: #ffe29a;
    background-color: rgba(22, 36, 63, 0.94);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    cursor: pointer;
    outline: none;
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-border-radius: 50%;
    border-radius: 50%;
    -webkit-box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
    -webkit-transition: -webkit-transform 0.12s ease, background-color 0.15s;
    transition: transform 0.12s ease, background-color 0.15s;
}

.cv-down[item-show] {
    display: -webkit-inline-box;
    display: -webkit-inline-flex;
    display: inline-flex;
    -webkit-animation: cv-pop-small 0.25s cubic-bezier(0.2, 0.9, 0.25, 1.2);
    animation: cv-pop-small 0.25s cubic-bezier(0.2, 0.9, 0.25, 1.2);
}

.cv-down:hover {
    background-color: rgba(30, 48, 82, 0.98);
}

.cv-down:active {
    -webkit-transform: scale(0.92);
    transform: scale(0.92);
}

.cv-down svg.cv-i {
    width: 20px;
    height: 20px;
    margin: 0;
    stroke-width: 2.4;
}

.cv-down span {
    position: absolute;
    top: -6px;
    right: -5px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    box-sizing: border-box;
    font-size: 11px;
    font-weight: bold;
    line-height: 19px;
    text-align: center;
    color: #1b1403;
    background-image: linear-gradient(135deg, #ffe29a, #f0c555);
    -webkit-border-radius: 10px;
    border-radius: 10px;
    -webkit-box-shadow: 0 0 0 2px #0f1931;
    box-shadow: 0 0 0 2px #0f1931;
}

.cv-down span:empty {
    display: none;
}

/* quick phrases */
.cv-quick {
    -webkit-flex: none;
    flex: none;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px 12px 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.cv-quick[item-hidden] {
    display: none;
}

.cv-quick::-webkit-scrollbar {
    display: none;
}

.cv-quick button {
    -webkit-flex: none;
    flex: none;
    height: 32px;
    margin: 0 7px 0 0;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background-color: rgba(255, 255, 255, 0.06);
    color: #dfe7f5;
    font: inherit;
    font-size: 12.5px;
    white-space: nowrap;
    cursor: pointer;
    outline: none;
    -webkit-appearance: none;
    -webkit-border-radius: 16px;
    border-radius: 16px;
    -webkit-transition: background-color 0.12s ease, border-color 0.12s ease, -webkit-transform 0.12s ease;
    transition: background-color 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
}

.cv-quick button:hover {
    background-color: rgba(255, 255, 255, 0.11);
    border-color: rgba(240, 197, 85, 0.45);
}

.cv-quick button:active {
    -webkit-transform: scale(0.95);
    transform: scale(0.95);
}

/* ---------- input bar ---------- */
.cv-bar {
    -webkit-flex: none;
    flex: none;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    margin: 0;
    padding: 10px 12px 12px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}

.chat-container[item-keyboard] .cv-bar {
    padding-bottom: 12px;
}

.cv-ib {
    position: relative;
    -webkit-flex: none;
    flex: none;
    display: -webkit-inline-box;
    display: -webkit-inline-flex;
    display: inline-flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin: 0;
    padding: 0;
    border: 0;
    cursor: pointer;
    outline: none;
    -webkit-appearance: none;
    -webkit-border-radius: 50%;
    border-radius: 50%;
    -webkit-transition: background-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease, -webkit-transform 0.15s ease;
    transition: background-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.cv-ib:active {
    -webkit-transform: scale(0.92);
    transform: scale(0.92);
}

.cv-gift-btn {
    background-color: rgba(240, 197, 85, 0.12);
    color: #ffe29a;
    -webkit-box-shadow: inset 0 0 0 1px rgba(240, 197, 85, 0.35);
    box-shadow: inset 0 0 0 1px rgba(240, 197, 85, 0.35);
}

.cv-gift-btn:hover {
    background-color: rgba(240, 197, 85, 0.22);
}

.cv-send {
    background-color: #2f5ce0;
    background-image: linear-gradient(135deg, #3567ea, #2443c2);
    color: #ffffff;
    -webkit-box-shadow: 0 6px 16px rgba(36, 67, 194, 0.4);
    box-shadow: 0 6px 16px rgba(36, 67, 194, 0.4);
}

.cv-send[item-empty] {
    background-color: rgba(255, 255, 255, 0.07);
    background-image: none;
    color: rgba(255, 255, 255, 0.3);
    -webkit-box-shadow: none;
    box-shadow: none;
    cursor: default;
}

.cv-send svg.cv-i {
    stroke-width: 2.2;
}

.cv-send[item-sending] svg.cv-i {
    opacity: 0;
}

.cv-send[item-sending]::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    box-sizing: border-box;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: #ffffff;
    -webkit-border-radius: 50%;
    border-radius: 50%;
    -webkit-animation: cv-spin 0.8s linear infinite;
    animation: cv-spin 0.8s linear infinite;
}

.cv-field {
    position: relative;
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    flex: 1;
    min-width: 0;
    margin: 0 8px;
}

.cv-field input {
    display: block;
    width: 100%;
    height: 42px;
    margin: 0;
    padding: 0 16px;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background-color: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    font: inherit;
    font-size: 16px;
    outline: none;
    -webkit-appearance: none;
    -webkit-border-radius: 21px;
    border-radius: 21px;
    -webkit-transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.cv-field input::-webkit-input-placeholder {
    color: rgba(201, 214, 234, 0.45);
}

.cv-field input::placeholder {
    color: rgba(201, 214, 234, 0.45);
}

.cv-field input:focus {
    border-color: rgba(240, 197, 85, 0.65);
    background-color: rgba(255, 255, 255, 0.09);
    -webkit-box-shadow: 0 0 0 3px rgba(240, 197, 85, 0.12);
    box-shadow: 0 0 0 3px rgba(240, 197, 85, 0.12);
}

.cv-field[item-count] input {
    padding-right: 66px;
}

.cv-cnt {
    display: none;
    position: absolute;
    right: 14px;
    top: 50%;
    margin-top: -8px;
    line-height: 16px;
    font-size: 11px;
    color: #93a4bf;
    pointer-events: none;
}

.cv-field[item-count] .cv-cnt {
    display: block;
}

.cv-field[item-count="max"] .cv-cnt {
    color: #ff98a3;
}

/* gift confirm title (users.js gift_box) */
.cv-gift-emb {
    display: inline-block;
    width: 56px;
    height: 56px;
    vertical-align: middle;
    -webkit-animation: cv-wiggle 1s 0.2s ease-in-out;
    animation: cv-wiggle 1s 0.2s ease-in-out;
}

.cv-gift-emb .cv-box {
    width: 100%;
    height: 100%;
    margin: 0;
}

/* ---------- message menu, reactions, reply ---------- */
.cv-body,
.cv-head,
.cv-quick,
.cv-reply {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.cv-bw {
    position: relative;
    max-width: 100%;
    -webkit-transition: -webkit-transform 0.16s ease;
    transition: transform 0.16s ease;
}

.cv-it .cv-bw {
    -webkit-transform-origin: left center;
    transform-origin: left center;
}

.cv-me .cv-bw {
    -webkit-transform-origin: right center;
    transform-origin: right center;
}

.cv-row.cv-picked .cv-bw {
    -webkit-transform: scale(1.03);
    transform: scale(1.03);
}

.cv-row.cv-picked .cv-bub {
    -webkit-box-shadow: 0 0 0 2px rgba(240, 197, 85, 0.55), 0 8px 22px rgba(0, 0, 0, 0.35);
    box-shadow: 0 0 0 2px rgba(240, 197, 85, 0.55), 0 8px 22px rgba(0, 0, 0, 0.35);
}

.cv-row.cv-flash .cv-bub {
    -webkit-animation: cv-flash 1.1s ease-out;
    animation: cv-flash 1.1s ease-out;
}

.cv-row.cv-has-r .cv-bw {
    margin-bottom: 13px;
}

.cv-react {
    position: absolute;
    right: 10px;
    bottom: -14px;
    z-index: 1;
    min-width: 28px;
    height: 24px;
    padding: 0 5px;
    box-sizing: border-box;
    border: 2px solid #0f1931;
    background-color: #22324f;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
    font-size: 13px;
    line-height: 20px;
    text-align: center;
    -webkit-box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    -webkit-border-radius: 12px;
    border-radius: 12px;
}

.cv-me .cv-react {
    right: auto;
    left: 10px;
}

.cv-react.cv-pop {
    -webkit-animation: cv-react-pop 0.42s cubic-bezier(0.2, 0.9, 0.25, 1.4);
    animation: cv-react-pop 0.42s cubic-bezier(0.2, 0.9, 0.25, 1.4);
}

.cv-more {
    -webkit-flex: none;
    flex: none;
    -webkit-align-self: center;
    align-self: center;
    width: 28px;
    height: 28px;
    margin: 0 2px;
    padding: 0px;
    border: 0px;
    outline: none;
    background: transparent;
    color: #93a4bf;
    cursor: pointer;
    opacity: 0;
    -webkit-tap-highlight-color: transparent;
    -webkit-border-radius: 50%;
    border-radius: 50%;
    -webkit-transition: opacity 0.15s ease, background-color 0.15s ease, color 0.15s ease;
    transition: opacity 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.cv-more svg.cv-i {
    width: 18px;
    height: 18px;
    margin: 0 auto;
    stroke-width: 3;
}

.cv-row:hover .cv-more,
.cv-row.cv-picked .cv-more {
    opacity: 1;
}

.cv-more:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

@media (hover: none) {
    .cv-more {
        opacity: 0.5;
    }
}

.cv-menu-bg {
    display: none;
    position: absolute;
    top: 0px;
    right: 0px;
    bottom: 0px;
    left: 0px;
    z-index: 5;
}

.cv-menu {
    display: none;
    position: absolute;
    top: 0px;
    left: 0px;
    z-index: 6;
    min-width: 200px;
    max-width: calc(100% - 16px);
    padding: 6px;
    box-sizing: border-box;
    background-color: #18263f;
    border: 1px solid rgba(255, 255, 255, 0.1);
    -webkit-box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
    -webkit-border-radius: 18px;
    border-radius: 18px;
}

.chat-container[item-menu] .cv-menu-bg,
.chat-container[item-menu] .cv-menu {
    display: block;
}

.chat-container[item-menu] .cv-menu {
    -webkit-animation: cv-menu-in 0.16s ease-out;
    animation: cv-menu-in 0.16s ease-out;
}

.cv-reacts {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-pack: justify;
    -webkit-justify-content: space-between;
    justify-content: space-between;
}

.cv-reacts:not(:last-child) {
    margin-bottom: 4px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cv-r {
    width: 40px;
    height: 40px;
    padding: 0px;
    border: 0px;
    outline: none;
    background: transparent;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
    font-size: 24px;
    line-height: 40px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    -webkit-border-radius: 50%;
    border-radius: 50%;
    -webkit-transition: -webkit-transform 0.12s ease, background-color 0.12s ease;
    transition: transform 0.12s ease, background-color 0.12s ease;
}

.cv-r:hover {
    background-color: rgba(255, 255, 255, 0.07);
    -webkit-transform: scale(1.18);
    transform: scale(1.18);
}

.cv-r:active {
    -webkit-transform: scale(0.9);
    transform: scale(0.9);
}

.cv-r.cv-on {
    background-color: rgba(240, 197, 85, 0.2);
    -webkit-box-shadow: inset 0 0 0 1.5px rgba(240, 197, 85, 0.6);
    box-shadow: inset 0 0 0 1.5px rgba(240, 197, 85, 0.6);
}

.cv-act {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 0px;
    outline: none;
    background: transparent;
    color: #e9eff9;
    font: inherit;
    font-size: 14.5px;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    -webkit-border-radius: 12px;
    border-radius: 12px;
}

.cv-act:hover {
    background-color: rgba(255, 255, 255, 0.07);
}

.cv-act svg.cv-i {
    width: 19px;
    height: 19px;
    margin-right: 12px;
    color: #93a4bf;
}

.cv-act.cv-del,
.cv-act.cv-del svg.cv-i {
    color: #ff7a87;
}

.cv-act.cv-del[item-confirm] {
    background-color: rgba(255, 77, 94, 0.16);
}

/* quoted message inside a bubble */
.cv-q {
    display: block;
    margin: -2px -5px 6px;
    padding: 5px 9px;
    border-left: 3px solid #f0c555;
    background-color: rgba(0, 0, 0, 0.18);
    font-size: 12.5px;
    line-height: 1.35;
    cursor: pointer;
    -webkit-border-radius: 8px;
    border-radius: 8px;
}

.cv-me .cv-q {
    border-left-color: rgba(255, 255, 255, 0.85);
    background-color: rgba(0, 0, 0, 0.14);
}

.cv-q b {
    display: block;
    font-size: 11.5px;
    color: #f0c555;
}

.cv-me .cv-q b {
    color: #ffffff;
}

.cv-q span {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    opacity: 0.85;
}

/* deleted message */
.cv-bub.cv-gone {
    background: transparent !important;
    border: 1px dashed rgba(255, 255, 255, 0.18) !important;
    color: #93a4bf !important;
    font-style: italic;
    -webkit-box-shadow: none !important;
    box-shadow: none !important;
}

/* replying bar above the input */
.cv-reply {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-flex: none;
    flex: none;
    margin: 0 12px;
    padding: 7px 6px 7px 12px;
    border-left: 3px solid #f0c555;
    background-color: rgba(255, 255, 255, 0.06);
    -webkit-border-radius: 10px;
    border-radius: 10px;
    -webkit-animation: cv-fade-in 0.15s ease-out;
    animation: cv-fade-in 0.15s ease-out;
}

.cv-reply[item-hidden] {
    display: none;
}

.cv-reply-t {
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    flex: 1;
    min-width: 0;
    font-size: 12.5px;
    line-height: 1.35;
}

.cv-reply-t b {
    display: block;
    font-size: 11.5px;
    color: #f0c555;
}

.cv-reply-t span {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: #c9d6ea;
}

.cv-reply .cv-hb {
    width: 30px;
    height: 30px;
    margin-left: 6px;
}

/* one time hint */
.cv-tip {
    position: absolute;
    left: 50%;
    bottom: 12px;
    z-index: 4;
    max-width: calc(100% - 32px);
    padding: 9px 14px;
    box-sizing: border-box;
    background-color: #f0c555;
    color: #1b1407;
    font-size: 12.5px;
    font-weight: bold;
    line-height: 1.35;
    text-align: center;
    cursor: pointer;
    -webkit-transform: translateX(-50%);
    transform: translateX(-50%);
    -webkit-box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
    -webkit-border-radius: 14px;
    border-radius: 14px;
    -webkit-animation: cv-tip-in 0.3s cubic-bezier(0.2, 0.9, 0.25, 1.2);
    animation: cv-tip-in 0.3s cubic-bezier(0.2, 0.9, 0.25, 1.2);
}

/* ---------- messenger conversation list (users.js friends) ---------- */
.big-dialog.friends-dialog.cv-convs .cv-convs-head {
    position: relative;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: justify;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    padding: 20px 20px 8px;
}

.big-dialog.friends-dialog.cv-convs .cv-convs-head::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    width: 40px;
    height: 4px;
    margin-left: -20px;
    background-color: rgba(0, 0, 0, 0.15);
    -webkit-border-radius: 2px;
    border-radius: 2px;
}

.big-dialog.friends-dialog.cv-convs .cv-convs-head b {
    font-size: 18px;
    font-weight: bold;
    color: #1e1e1e;
}

.big-dialog.friends-dialog.cv-convs .cv-convs-head span {
    padding: 3px 10px;
    background-color: rgba(255, 59, 92, 0.12);
    color: #e8304f;
    font-size: 12px;
    font-weight: bold;
    -webkit-border-radius: 999px;
    border-radius: 999px;
}

.big-dialog.friends-dialog.cv-convs .cv-convs-head span:empty {
    display: none;
}

.big-dialog.friends-dialog.cv-convs .friends-list {
    padding: 2px 8px 12px;
}

.big-dialog.friends-dialog.cv-convs .friends-list::before {
    display: none;
}

.big-dialog.friends-dialog.cv-convs .friend-item.cv-conv {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    margin: 0px;
    padding: 9px 12px;
    border: 0px;
    background: transparent;
    -webkit-box-shadow: none;
    box-shadow: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-border-radius: 16px;
    border-radius: 16px;
    -webkit-transition: background-color 0.15s ease;
    transition: background-color 0.15s ease;
}

.big-dialog.friends-dialog.cv-convs .friend-item.cv-conv + .friend-item.cv-conv {
    margin-top: 2px;
}

.big-dialog.friends-dialog.cv-convs .friend-item.cv-conv:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

.big-dialog.friends-dialog.cv-convs .friend-item.cv-conv:active {
    background-color: rgba(0, 0, 0, 0.07);
}

.big-dialog.friends-dialog.cv-convs .cv-conv .friend-item-photo {
    display: block;
    -webkit-flex: none;
    flex: none;
    width: 50px;
    height: 50px;
    margin-right: 13px;
    background-color: #22345c;
    background-size: cover;
    -webkit-box-shadow: none;
    box-shadow: none;
}

.big-dialog.friends-dialog.cv-convs .cv-conv .friend-item-photo.cv-conv-nophoto {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%237f93b8'%3E%3Ccircle cx='12' cy='9' r='4'/%3E%3Cpath d='M4.5 20c.8-4 3.9-6 7.5-6s6.7 2 7.5 6z'/%3E%3C/svg%3E");
    background-size: 60% 60%;
}

.big-dialog.friends-dialog.cv-convs .cv-conv-t {
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    flex: 1;
    min-width: 0;
}

.big-dialog.friends-dialog.cv-convs .cv-conv-top,
.big-dialog.friends-dialog.cv-convs .cv-conv-bot {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
}

.big-dialog.friends-dialog.cv-convs .cv-conv-bot {
    margin-top: 3px;
}

.big-dialog.friends-dialog.cv-convs .cv-conv .friend-item-name {
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 15px;
    font-weight: bold;
    color: #1e1e1e;
}

.big-dialog.friends-dialog.cv-convs .cv-conv-top time {
    -webkit-flex: none;
    flex: none;
    margin-left: 10px;
    font-size: 11.5px;
    color: #8a94a6;
}

.big-dialog.friends-dialog.cv-convs .cv-conv .friend-item-message {
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    flex: 1;
    min-width: 0;
    margin: 0px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 13.5px;
    color: #7d8799;
}

.big-dialog.friends-dialog.cv-convs .cv-conv-badge {
    -webkit-flex: none;
    flex: none;
    min-width: 18px;
    height: 18px;
    margin-left: 10px;
    padding: 0 5px;
    box-sizing: border-box;
    background-color: #ff3b5c;
    color: #ffffff;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 10.5px;
    font-weight: bold;
    line-height: 18px;
    text-align: center;
    -webkit-box-shadow: 0 2px 8px rgba(255, 59, 92, 0.35);
    box-shadow: 0 2px 8px rgba(255, 59, 92, 0.35);
    -webkit-border-radius: 9px;
    border-radius: 9px;
    -webkit-animation: cv-pop-small 0.3s cubic-bezier(0.2, 0.9, 0.25, 1.3);
    animation: cv-pop-small 0.3s cubic-bezier(0.2, 0.9, 0.25, 1.3);
}

.big-dialog.friends-dialog.cv-convs .cv-conv[item-unread] .friend-item-message {
    color: #1e1e1e;
    font-weight: 600;
}

.big-dialog.friends-dialog.cv-convs .cv-conv[item-unread] .cv-conv-top time {
    color: #ff3b5c;
    font-weight: bold;
}

/* the round messenger button would cover the last conversation */
body:has(.big-dialog.friends-dialog.cv-convs) .chat-float {
    display: none;
}

/* new lobby (dark) */
body[data-lobby="v2"] .big-dialog.friends-dialog.cv-convs .cv-convs-head::before {
    background-color: rgba(255, 255, 255, 0.2);
}

body[data-lobby="v2"] .big-dialog.friends-dialog.cv-convs .cv-convs-head b,
body[data-lobby="v2"] .big-dialog.friends-dialog.cv-convs .cv-conv .friend-item-name {
    color: #ffffff;
}

body[data-lobby="v2"] .big-dialog.friends-dialog.cv-convs .cv-convs-head span {
    background-color: rgba(255, 59, 92, 0.16);
    color: #ff7088;
}

body[data-lobby="v2"] .big-dialog.friends-dialog.cv-convs .friend-item.cv-conv:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

body[data-lobby="v2"] .big-dialog.friends-dialog.cv-convs .friend-item.cv-conv:active {
    background-color: rgba(255, 255, 255, 0.08);
}

body[data-lobby="v2"] .big-dialog.friends-dialog.cv-convs .cv-conv-top time {
    color: #7f90ad;
}

body[data-lobby="v2"] .big-dialog.friends-dialog.cv-convs .cv-conv .friend-item-message {
    color: #8fa1bd;
}

body[data-lobby="v2"] .big-dialog.friends-dialog.cv-convs .cv-conv[item-unread] .friend-item-message {
    color: #eef3fb;
}

body[data-lobby="v2"] .big-dialog.friends-dialog.cv-convs .cv-conv[item-unread] .cv-conv-top time {
    color: #ff7088;
}

body[data-lobby="v2"] .big-dialog.friends-dialog.cv-convs .cv-conv-badge {
    -webkit-box-shadow: 0 0 0 2px #16233d, 0 2px 8px rgba(255, 59, 92, 0.4);
    box-shadow: 0 0 0 2px #16233d, 0 2px 8px rgba(255, 59, 92, 0.4);
}

/* ---------- chat button on the game table ---------- */
.chat-icon {
    position: absolute;
    right: 5px;
    top: 50%;
    margin-top: 8px;
    width: 46px;
    height: 46px;
    box-sizing: border-box;
    z-index: +1;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background-color: rgba(10, 18, 34, 0.72);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 12.5a7.5 7.5 0 0 1-11.2 6.5L4 20l1.1-4.4A7.5 7.5 0 1 1 20 12.5z'/%3E%3Cpath d='M9 12.5h.01M12.5 12.5h.01M16 12.5h.01'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 22px 22px;
    -webkit-box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    border-radius: 50%;
    -webkit-transition: background-color 0.15s ease, -webkit-transform 0.15s ease;
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.chat-icon:hover {
    background-color: rgba(20, 32, 58, 0.86);
}

.chat-icon:active {
    -webkit-transform: scale(0.94);
    transform: scale(0.94);
}

.game-area[item-align-chat="bottom"] .chat-icon {
    top: auto;
    bottom: 20px;
}

.chat-icon[item-accepted="yes"] {
    border-color: rgba(31, 191, 95, 0.7);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232ee07a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 12.5a7.5 7.5 0 0 1-11.2 6.5L4 20l1.1-4.4A7.5 7.5 0 1 1 20 12.5z'/%3E%3Cpath d='M9 12.5h.01M12.5 12.5h.01M16 12.5h.01'/%3E%3C/svg%3E");
    -webkit-animation: cv-ring 1.2s ease-out 3;
    animation: cv-ring 1.2s ease-out 3;
}

.chat-icon[item-loading="yes"] {
    background-image: none;
}

.chat-icon[item-loading="yes"]::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    box-sizing: border-box;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: #f0c555;
    -webkit-border-radius: 50%;
    border-radius: 50%;
    -webkit-animation: cv-spin 0.8s linear infinite;
    animation: cv-spin 0.8s linear infinite;
}

.chat-icon[item-loading="yes"] .chat-icon-badge {
    display: none !important;
}

.chat-icon-badge {
    display: none;
    position: absolute;
    right: -5px;
    top: -5px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    box-sizing: border-box;
    text-align: center;
    line-height: 20px;
    font-size: 11px;
    font-weight: bold;
    background-color: #ff4d5e;
    color: #ffffff;
    -webkit-box-shadow: 0 0 0 2px rgba(10, 18, 34, 0.9), 0 4px 10px rgba(255, 77, 94, 0.4);
    box-shadow: 0 0 0 2px rgba(10, 18, 34, 0.9), 0 4px 10px rgba(255, 77, 94, 0.4);
    -webkit-border-radius: 10px;
    -moz-border-radius: 10px;
    border-radius: 10px;
    -webkit-animation: cv-pop-small 0.3s cubic-bezier(0.2, 0.9, 0.25, 1.3);
    animation: cv-pop-small 0.3s cubic-bezier(0.2, 0.9, 0.25, 1.3);
}

/* ---------- animations ---------- */
@-webkit-keyframes cv-up { from { opacity: 0; -webkit-transform: translateY(40px); } to { opacity: 1; -webkit-transform: none; } }
@keyframes cv-up { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }
@-webkit-keyframes cv-pop { from { opacity: 0; -webkit-transform: translateY(14px) scale(0.96); } to { opacity: 1; -webkit-transform: none; } }
@keyframes cv-pop { from { opacity: 0; transform: translateY(14px) scale(0.96); } to { opacity: 1; transform: none; } }
@-webkit-keyframes cv-out { to { opacity: 0; -webkit-transform: translateY(30px); } }
@keyframes cv-out { to { opacity: 0; transform: translateY(30px); } }
@-webkit-keyframes cv-fade-out { to { opacity: 0; } }
@keyframes cv-fade-out { to { opacity: 0; } }
@-webkit-keyframes cv-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes cv-fade-in { from { opacity: 0; } to { opacity: 1; } }
@-webkit-keyframes cv-fade-in { from { opacity: 0; } to { opacity: 1; } }
@-webkit-keyframes cv-in { from { opacity: 0; -webkit-transform: translateY(6px) scale(0.96); } to { opacity: 1; -webkit-transform: none; } }
@keyframes cv-in { from { opacity: 0; transform: translateY(6px) scale(0.96); } to { opacity: 1; transform: none; } }
@-webkit-keyframes cv-pop-small { from { opacity: 0; -webkit-transform: scale(0.5); } to { opacity: 1; -webkit-transform: none; } }
@keyframes cv-pop-small { from { opacity: 0; transform: scale(0.5); } to { opacity: 1; transform: none; } }
@-webkit-keyframes cv-gift { 0% { opacity: 0; -webkit-transform: scale(0.6) translateY(10px); } 60% { opacity: 1; -webkit-transform: scale(1.04); } 100% { -webkit-transform: none; } }
@keyframes cv-gift { 0% { opacity: 0; transform: scale(0.6) translateY(10px); } 60% { opacity: 1; transform: scale(1.04); } 100% { transform: none; } }
@-webkit-keyframes cv-shine { 0% { left: -60%; opacity: 1; } 100% { left: 130%; opacity: 1; } }
@keyframes cv-shine { 0% { left: -60%; opacity: 1; } 100% { left: 130%; opacity: 1; } }
@-webkit-keyframes cv-wiggle { 0%, 100% { -webkit-transform: none; } 20% { -webkit-transform: rotate(-12deg) scale(1.08); } 40% { -webkit-transform: rotate(10deg) scale(1.08); } 60% { -webkit-transform: rotate(-6deg); } 80% { -webkit-transform: rotate(4deg); } }
@keyframes cv-wiggle { 0%, 100% { transform: none; } 20% { transform: rotate(-12deg) scale(1.08); } 40% { transform: rotate(10deg) scale(1.08); } 60% { transform: rotate(-6deg); } 80% { transform: rotate(4deg); } }
@-webkit-keyframes cv-dot { 0%, 100% { opacity: 0.3; -webkit-transform: none; } 50% { opacity: 1; -webkit-transform: translateY(-4px); } }
@keyframes cv-dot { 0%, 100% { opacity: 0.3; transform: none; } 50% { opacity: 1; transform: translateY(-4px); } }
@-webkit-keyframes cv-spin { to { -webkit-transform: rotate(360deg); } }
@keyframes cv-spin { to { transform: rotate(360deg); } }
@-webkit-keyframes cv-ring { 0% { -webkit-box-shadow: 0 0 0 0 rgba(31, 191, 95, 0.55); } 100% { -webkit-box-shadow: 0 0 0 14px rgba(31, 191, 95, 0); } }
@keyframes cv-ring { 0% { box-shadow: 0 0 0 0 rgba(31, 191, 95, 0.55); } 100% { box-shadow: 0 0 0 14px rgba(31, 191, 95, 0); } }

@-webkit-keyframes cv-react-pop { 0% { opacity: 0; -webkit-transform: scale(0.2); } 60% { opacity: 1; -webkit-transform: scale(1.35); } 100% { -webkit-transform: none; } }
@keyframes cv-react-pop { 0% { opacity: 0; transform: scale(0.2); } 60% { opacity: 1; transform: scale(1.35); } 100% { transform: none; } }
@-webkit-keyframes cv-menu-in { from { opacity: 0; -webkit-transform: scale(0.92); } to { opacity: 1; -webkit-transform: none; } }
@keyframes cv-menu-in { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: none; } }
@-webkit-keyframes cv-flash { 0%, 40% { -webkit-box-shadow: 0 0 0 3px rgba(240, 197, 85, 0.75); } 100% { -webkit-box-shadow: 0 0 0 3px rgba(240, 197, 85, 0); } }
@keyframes cv-flash { 0%, 40% { box-shadow: 0 0 0 3px rgba(240, 197, 85, 0.75); } 100% { box-shadow: 0 0 0 3px rgba(240, 197, 85, 0); } }
@-webkit-keyframes cv-tip-in { from { opacity: 0; -webkit-transform: translate(-50%, 10px); } to { opacity: 1; -webkit-transform: translate(-50%, 0); } }
@keyframes cv-tip-in { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (prefers-reduced-motion: reduce) {
    .cv-app,
    .chat-container[item-closing],
    .chat-container[item-closing] .cv-app,
    .cv-row.cv-in .cv-bub,
    .cv-row.cv-in .cv-bub.cv-gift,
    .cv-row.cv-in .cv-bub.cv-gift::after,
    .cv-row.cv-in .cv-box,
    .cv-gift-emb,
    .chat-icon[item-accepted="yes"],
    .chat-icon-badge,
    .cv-react.cv-pop,
    .cv-st,
    .cv-row.cv-flash .cv-bub,
    .chat-container[item-menu] .cv-menu,
    .cv-tip {
        -webkit-animation: none;
        animation: none;
    }
}

/* ---------- messenger button (lobby) ---------- */
.chat-float {
    position: fixed;
    right: 10px;
    bottom: 10px;
    width: 56px;
    height: 56px;
    background-size: 20px 20px;
    background-position: center center;
    background-repeat: no-repeat;
    background-image: url(../images/icon-message.svg);
    background-color: rgba(0, 0, 0, 0.5);
    cursor: pointer;
    
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    border-radius: 50%;
}

.chat-float:hover {
    background-color: rgba(0, 0, 0, 0.6);
}

.chat-float[item-conversations]::after {
	content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 16px;
    height: 16px;

    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    border-radius: 50%;

    -webkit-animation: blinking 1s infinite alternate;
    animation: blinking 1s infinite alternate;
}

@keyframes blinking {
    from {
        background-color: #ffe601;
		transform: scale(1);
	}

    to {
		background-color: #f30909;
		transform: scale(0.7);
    }
}

@-webkit-keyframes blinking {
    from {
        background-color: #ffe601;
		transform: scale(1);
	}

    to {
		background-color: #f30909;
		transform: scale(0.7);
    }
}

/* ---------- drag the conversation down to close ---------- */
.cv-head,
.cv-grab {
    touch-action: none;
}

.chat-container[item-dragging] .cv-app {
    -webkit-animation: none;
    animation: none;
    will-change: transform;
}

/* ---------- messenger button (lobby): solid green circle ---------- */
html body .chat-float.logged-only {
    width: 58px;
    height: 58px;
    box-sizing: border-box;
    border: 0px;
    background-color: #1fbf5f;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23ffffff' d='M12 3.6c-5 0-9 3.5-9 7.8 0 2.4 1.2 4.5 3.2 5.9l-.8 3c-.1.4.3.7.7.5l3.4-1.8c.8.2 1.6.3 2.5.3 5 0 9-3.5 9-7.9S17 3.6 12 3.6z'/%3E%3Ccircle cx='8.2' cy='11.4' r='1.25' fill='%2317a352'/%3E%3Ccircle cx='12' cy='11.4' r='1.25' fill='%2317a352'/%3E%3Ccircle cx='15.8' cy='11.4' r='1.25' fill='%2317a352'/%3E%3C/svg%3E"), linear-gradient(145deg, #36db7c 0%, #18a553 55%, #0f8a43 100%);
    background-repeat: no-repeat, no-repeat;
    background-position: center 54%, center center;
    background-size: 28px 28px, 100% 100%;
    -webkit-tap-highlight-color: transparent;
    -webkit-box-shadow: 0 10px 24px rgba(18, 153, 74, 0.35), 0 3px 8px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -2px 0 rgba(0, 0, 0, 0.12);
    box-shadow: 0 10px 24px rgba(18, 153, 74, 0.35), 0 3px 8px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -2px 0 rgba(0, 0, 0, 0.12);
    -webkit-transition: -webkit-transform 0.18s ease, box-shadow 0.18s ease;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

html body .chat-float.logged-only:hover {
    background-color: #1fbf5f;
    -webkit-transform: translateY(-2px);
    transform: translateY(-2px);
    -webkit-box-shadow: 0 14px 30px rgba(18, 153, 74, 0.45), 0 4px 10px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -2px 0 rgba(0, 0, 0, 0.12);
    box-shadow: 0 14px 30px rgba(18, 153, 74, 0.45), 0 4px 10px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -2px 0 rgba(0, 0, 0, 0.12);
}

html body .chat-float.logged-only:active {
    -webkit-transform: scale(0.94);
    transform: scale(0.94);
}

html body .chat-float.logged-only[item-conversations] {
    -webkit-animation: cv-float-ring 2s ease-out 3;
    animation: cv-float-ring 2s ease-out 3;
}

html body .chat-float.logged-only[item-conversations]::after {
    content: attr(item-conversations);
    position: absolute;
    top: -4px;
    right: -4px;
    bottom: auto;
    left: auto;
    width: auto;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    box-sizing: border-box;
    border: 2px solid #ffffff;
    background-color: #ff3b5c;
    color: #ffffff;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11px;
    font-weight: bold;
    line-height: 18px;
    text-align: center;
    -webkit-transform: none;
    transform: none;
    -webkit-box-shadow: 0 3px 8px rgba(255, 59, 92, 0.45);
    box-shadow: 0 3px 8px rgba(255, 59, 92, 0.45);
    -webkit-border-radius: 11px;
    border-radius: 11px;
    -webkit-animation: cv-pop-small 0.3s cubic-bezier(0.2, 0.9, 0.25, 1.3);
    animation: cv-pop-small 0.3s cubic-bezier(0.2, 0.9, 0.25, 1.3);
}

html body[data-lobby="v2"] .chat-float.logged-only[item-conversations]::after {
    border-color: #0e1a33;
}

@-webkit-keyframes cv-float-ring { 0% { -webkit-box-shadow: 0 10px 24px rgba(18, 153, 74, 0.35), 0 3px 8px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -2px 0 rgba(0, 0, 0, 0.12), 0 0 0 0 rgba(37, 211, 102, 0.5); } 100% { -webkit-box-shadow: 0 10px 24px rgba(18, 153, 74, 0.35), 0 3px 8px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -2px 0 rgba(0, 0, 0, 0.12), 0 0 0 16px rgba(37, 211, 102, 0); } }
@keyframes cv-float-ring { 0% { box-shadow: 0 10px 24px rgba(18, 153, 74, 0.35), 0 3px 8px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -2px 0 rgba(0, 0, 0, 0.12), 0 0 0 0 rgba(37, 211, 102, 0.5); } 100% { box-shadow: 0 10px 24px rgba(18, 153, 74, 0.35), 0 3px 8px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -2px 0 rgba(0, 0, 0, 0.12), 0 0 0 16px rgba(37, 211, 102, 0); } }

@media (prefers-reduced-motion: reduce) {
    html body .chat-float.logged-only[item-conversations],
    html body .chat-float.logged-only[item-conversations]::after {
        -webkit-animation: none;
        animation: none;
    }
}

/* ---------- conversation list: close button, the open conversation ---------- */
.big-dialog.friends-dialog.cv-convs .cv-convs-head span {
    margin-left: 10px;
    margin-right: auto;
}

.big-dialog.friends-dialog.cv-convs .cv-convs-x {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    -webkit-flex: none;
    flex: none;
    width: 34px;
    height: 34px;
    margin: -4px -6px -4px 8px;
    padding: 0px;
    border: 0px;
    background-color: rgba(0, 0, 0, 0.05);
    color: #5b6578;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    -webkit-border-radius: 50%;
    border-radius: 50%;
    -webkit-transition: background-color 0.15s ease, color 0.15s ease;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.big-dialog.friends-dialog.cv-convs .cv-convs-x:hover {
    background-color: rgba(0, 0, 0, 0.1);
    color: #1e1e1e;
}

.big-dialog.friends-dialog.cv-convs .cv-convs-x svg.cv-i {
    width: 18px;
    height: 18px;
}

body[data-lobby="v2"] .big-dialog.friends-dialog.cv-convs .cv-convs-x {
    background-color: rgba(255, 255, 255, 0.07);
    color: #aab6cf;
}

body[data-lobby="v2"] .big-dialog.friends-dialog.cv-convs .cv-convs-x:hover {
    background-color: rgba(255, 255, 255, 0.14);
    color: #ffffff;
}

.big-dialog.friends-dialog.cv-convs .friend-item.cv-conv[item-active],
.big-dialog.friends-dialog.cv-convs .friend-item.cv-conv[item-active]:hover {
    background-color: rgba(53, 103, 234, 0.1);
    -webkit-box-shadow: inset 3px 0 0 #3567ea;
    box-shadow: inset 3px 0 0 #3567ea;
}

body[data-lobby="v2"] .big-dialog.friends-dialog.cv-convs .friend-item.cv-conv[item-active],
body[data-lobby="v2"] .big-dialog.friends-dialog.cv-convs .friend-item.cv-conv[item-active]:hover {
    background-color: rgba(53, 103, 234, 0.18);
}

/* ---------- desktop: messenger docked bottom right, the lobby stays usable ---------- */
@media only screen and (min-width: 900px) and (hover: hover) and (pointer: fine) {
    html body .big-dialog.friends-dialog.cv-convs {
        background-color: transparent !important;
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
        pointer-events: none;
        -webkit-animation: none;
        animation: none;
    }

    html body .big-dialog.friends-dialog.cv-convs .big-dialog-inner {
        position: absolute;
        right: 20px;
        bottom: 0px;
        width: 340px !important;
        min-width: 0px;
        max-width: none !important;
        height: 560px;
        max-height: calc(100% - 80px) !important;
        margin: 0px !important;
        pointer-events: auto;
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-bottom: 0px;
        -webkit-border-radius: 18px 18px 0 0 !important;
        border-radius: 18px 18px 0 0 !important;
        -webkit-box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.45);
        box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.45);
    }

    html body .big-dialog.friends-dialog.cv-convs .cv-convs-head {
        padding-top: 16px;
    }

    html body .big-dialog.friends-dialog.cv-convs .cv-convs-head::before {
        display: none;
    }

    html body .chat-container[item-source="chat"] {
        background: none !important;
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
        pointer-events: none;
    }

    html body .chat-container[item-source="chat"] .cv-app {
        left: auto;
        right: 20px;
        width: 370px;
        margin-left: 0px;
        height: 560px;
        max-height: calc(100% - 80px);
        bottom: 0px;
        pointer-events: auto;
        border-bottom: 0px;
        -webkit-border-radius: 18px 18px 0 0;
        border-radius: 18px 18px 0 0;
        -webkit-box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.5);
        box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.5);
        -webkit-animation-name: cv-up;
        animation-name: cv-up;
        -webkit-transition: right 0.25s cubic-bezier(0.2, 0.9, 0.25, 1);
        transition: right 0.25s cubic-bezier(0.2, 0.9, 0.25, 1);
    }

    /* next to the open conversation list */
    body:has(.big-dialog.friends-dialog.cv-convs) .chat-container[item-source="chat"] .cv-app {
        right: 372px;
    }

    body:has(.chat-container[item-source="chat"]:not([style*="none"])) .chat-float {
        display: none;
    }
}

/* ---------- rematch request in the finish dialog ---------- */
.rm-offer {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    gap: 10px;
    margin: 4px 20px 2px;
    padding: 10px 10px 10px 12px;
    box-sizing: border-box;
    text-align: left;
    color: #ffffff;
    background-color: #2f5ce0;
    background-image: linear-gradient(135deg, #3567ea 0%, #2443c2 100%);
    -webkit-border-radius: 14px;
    border-radius: 14px;
    -webkit-box-shadow: 0 6px 18px rgba(36, 67, 194, 0.35);
    box-shadow: 0 6px 18px rgba(36, 67, 194, 0.35);
    -webkit-animation: rm-in 0.32s cubic-bezier(0.2, 0.9, 0.25, 1.12) both;
    animation: rm-in 0.32s cubic-bezier(0.2, 0.9, 0.25, 1.12) both;
}

.rm-offer.rm-gone {
    -webkit-animation: cv-fade-out 0.3s ease forwards;
    animation: cv-fade-out 0.3s ease forwards;
}

.rm-offer i {
    -webkit-box-flex: 0;
    -webkit-flex: 0 0 40px;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    background: #1c2a47 center / cover no-repeat;
    -webkit-border-radius: 50%;
    border-radius: 50%;
    -webkit-animation: rm-ring 1.6s ease-out infinite;
    animation: rm-ring 1.6s ease-out infinite;
}

.rm-offer div {
    -webkit-box-flex: 1;
    -webkit-flex: 1 1 auto;
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.25;
}

.rm-offer b {
    display: block;
    overflow: hidden;
    font-size: 14px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.rm-offer span {
    display: block;
    font-size: 12.5px;
    opacity: 0.85;
}

.rm-offer em {
    -webkit-box-flex: 0;
    -webkit-flex: 0 0 auto;
    flex: 0 0 auto;
    min-width: 30px;
    height: 30px;
    font-size: 12px;
    font-style: normal;
    font-weight: bold;
    line-height: 30px;
    text-align: center;
    background-color: rgba(255, 255, 255, 0.18);
    -webkit-border-radius: 15px;
    border-radius: 15px;
    font-variant-numeric: tabular-nums;
}

.big-dialog .big-dialog-button.rm-hot {
    outline: 2px solid rgba(53, 103, 234, 0.9);
    outline-offset: 2px;
    -webkit-animation: rm-pulse 1.4s ease-in-out infinite;
    animation: rm-pulse 1.4s ease-in-out infinite;
}

@-webkit-keyframes rm-in { from { opacity: 0; -webkit-transform: translateY(8px) scale(0.97); } to { opacity: 1; -webkit-transform: none; } }
@keyframes rm-in { from { opacity: 0; transform: translateY(8px) scale(0.97); } to { opacity: 1; transform: none; } }
@-webkit-keyframes rm-ring { 0% { box-shadow: 0 0 0 2px #ffffff, 0 0 0 2px rgba(255, 255, 255, 0.6); } 100% { box-shadow: 0 0 0 2px #ffffff, 0 0 0 10px rgba(255, 255, 255, 0); } }
@keyframes rm-ring { 0% { box-shadow: 0 0 0 2px #ffffff, 0 0 0 2px rgba(255, 255, 255, 0.6); } 100% { box-shadow: 0 0 0 2px #ffffff, 0 0 0 10px rgba(255, 255, 255, 0); } }
@-webkit-keyframes rm-pulse { 0%, 100% { outline-color: rgba(53, 103, 234, 0.9); outline-offset: 2px; } 50% { outline-color: rgba(53, 103, 234, 0.25); outline-offset: 5px; } }
@keyframes rm-pulse { 0%, 100% { outline-color: rgba(53, 103, 234, 0.9); outline-offset: 2px; } 50% { outline-color: rgba(53, 103, 234, 0.25); outline-offset: 5px; } }
@-webkit-keyframes cv-fade-out { to { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
    .rm-offer,
    .rm-offer i,
    .big-dialog .big-dialog-button.rm-hot {
        -webkit-animation: none;
        animation: none;
    }

    .rm-offer i {
        box-shadow: 0 0 0 2px #ffffff;
    }
}
