/*
 * components/chat.css — canonical main .chat block
 *
 * Extracted in M7 from main.v28.css:
 *   Block 1: lines 1229-1557 (primary chat UI — messages, input, smiles)
 *   Block 2: lines 3154-3334 (chat header-info, giveaway, buttons, bottom)
 *
 * NOT MIGRATED (multi-selector rules — stay in main):
 *   1239 — .chat__msg--your .chat__msg-info b, .close-chat, .preloader.preloader-remove
 *   1334 — .chat__input, .chat__input input, .crash__top, .history__game, ...
 *   1396 — .theme--dark .chat__send .chat__buttons .send, a.d-flex.align-center.justify-center.send.blues
 *   1412 — .header__links li a .icon, .header__user-dropdown a .icon
 *   1418 — .chat__send .chat__buttons a.active, svg.icon.blue
 *   1436 — .chat__smiles.chat__smiles--active, .overlayed.active
 *   1486 — .chat__buttons, .chat__smiles .ss-content, .footer__links, ...
 *   1548 — .chat__msg:hover .chat__buttons-admins, .popup.active
 *   3168 — @media with .chat__header-info + .games (mixed)
 *   3231 — .chat__buttons a:last-child, .select
 *   3328 — .buttons_slot_game svg, .chat__buttons-admins a .icon
 *
 * NOT MIGRATED YET (scattered elsewhere, 18 in jack.v15.css with !important,
 *   6 in index.v13.css — to be cleaned in follow-up passes):
 *   main lines 398, 437, 807, 3511, 6365, 7227+, 9424, 10692+ — later
 *   .close-chat (1553-1557) — not `.chat` prefix, stays in main for now
 *
 * Loaded AFTER main.v28.css to preserve cascade.
 */

/* === Base === */
.chat {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    border-left: 1px solid #dee2f8;
    z-index: 1;
}

.chat__online {
    gap: 10px;
}

.chat__heading {
    padding: 8px 16px;
    line-height: 20px;
    min-height: var(--header-height);
    border-bottom: 1px solid #212739;
}

/* === Messages === */
.chat__send {
    background-color: var(--color-bg-card, #181b27);
    border-radius: 12px;
}

.chat__messages {
    padding: 0 23px;
}

.chat__messages .ss-content {
    padding-top: 20px;
    padding-bottom: 20px;
}

.chat__msg {
    width: 100%;
}

.chat .chat__messages .ss-wrapper .ss-content {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
}

.chat__msg-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
}

.chat__msg-info {
    width: calc(100% - 42px);
    line-height: 18px;
    padding-left: 10px;
}

.chat__msg-info span {
    color: #2d2a73;
    font-weight: 500;
}

.chat__msg-info b {
    position: absolute;
    right: 0;
    top: 0;
    font-size: 12px;
    color: rgba(118, 125, 171, .5);
    font-weight: 600;
}

@media (max-width: 768px) {
    .chat__msg-info b {
        right: 12px;
    }
}

.chat__msg-message {
    font-size: 12px;
    padding: 8px 12px;
    background: #f9f9ff;
    margin-top: 8px;
    border-radius: 0 12px 12px;
    width: -webkit-fit-content;
    width: -moz-fit-content;
    width: fit-content;
    max-width: 90%;
}

.chat__msg-message span {
    font-weight: 400;
    line-height: normal;
    color: #7785b3;
}

/* === Your-own message variant === */
.chat__msg--your .chat__msg-avatar {
    -webkit-box-ordinal-group: 2;
    order: 1;
}

.chat__msg--your .chat__msg-info {
    padding-left: 0;
    padding-right: 20px;
    align-items: flex-end;
}

.chat__msg--your .chat__msg-info span {
    color: transparent;
    -webkit-background-clip: text;
    background-image: -webkit-gradient(linear, left top, right top, from(#f24e47), to(#f542b9));
    background-image: linear-gradient(to right, #f24e47, #f542b9);
}

.chat__msg--your .chat__msg-message span {
    color: #767dab !important;
    background-image: none;
}

/* === Input === */
.chat__input input {
    padding: 16px;
    font-weight: 500;
    color: #29315d;
}

.chat__input input::-webkit-input-placeholder {
    color: #8895ba;
    -webkit-transition: .15s ease-in-out;
    transition: .15s ease-in-out;
}

.chat__input input:focus::-webkit-input-placeholder {
    opacity: 0;
}

/* === Send bar / buttons === */
.chat__send .chat__buttons {
    padding: 8px 8px 8px 0;
}

.chat__send .chat__buttons a {
    background: 0 0;
    margin-right: 3px;
}

.chat__buttons a .icon {
    margin: 0;
    width: 16px;
    height: 16px;
}

/* === Smiles / stickers === */
.chat__smiles {
    background: #f3f4f8;
    position: relative;
    width: calc(100% - 18px);
    height: 270px;
    opacity: 0;
    top: 5px;
    left: -1px;
    visibility: hidden;
    padding: 13px 13px 0;
    display: none;
}

.chat__smiles.chat__smiles--smiles .chat__smiles-scroll {
    position: relative;
    display: -ms-grid;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-gap: 11px;
}

.chat__smiles.chat__smiles--stickers .chat__smiles-scroll {
    width: calc(100% - 18px);
    position: relative;
    display: -ms-grid;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-gap: 11px;
}

.chat.chat--smiles .chat__smiles--smiles,
.chat.chat--stickers .chat__smiles--stickers {
    visibility: visible;
    display: block;
    opacity: 1;
}

.chat__smiles.chat__smiles--stickers .chat__smiles-item {
    height: 66px;
    width: 66px;
    padding: 25px;
}

.chat.chat--smiles .chat__messages,
.chat.chat--stickers .chat__messages {
    height: calc(100% - 420px) !important;
}

/* NOTE: the non-!important duplicate from main:1474 is identical except for
   the !important flag; using the !important variant above is sufficient. */

.chat__smiles.chat__smiles--stickers .chat__smiles-item img {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    padding: 5px;
}

.chat__smiles-item {
    height: 24px;
    width: 24px;
    border-radius: 6px;
    position: relative;
    cursor: pointer;
    -webkit-transition: .15s;
    transition: .15s;
}

.chat__smiles-item:hover {
    background: #22293b;
    -webkit-box-shadow: 0 6px 13px rgba(0, 0, 0, .05);
    box-shadow: 0 6px 13px rgba(0, 0, 0, .05);
}

.chat__smiles-item img {
    pointer-events: none;
    width: 20px;
    height: 20px;
    padding: 2px;
}

.chat__msg-smile {
    width: 16px;
    height: 16px;
    position: relative;
    vertical-align: middle;
    margin: 0;
    pointer-events: none;
}

.chat__msg-stickers {
    vertical-align: middle;
    width: 80px;
    height: 80px;
    pointer-events: none;
}

.chat__msg-message--sticker {
    background: 0 0;
}

.chat__msg .chat__buttons-admins {
    position: absolute;
    bottom: 0;
    right: 0;
    visibility: hidden;
}

/* ============================================================ */
/* === Block 2 (main.v28 lines 3154-3334) === */
/* ============================================================ */

/* === Header-info banner === */
.chat__header-info {
    padding: 5px 12px 5px 23px;
    line-height: 22px;
    position: absolute;
    top: 70px;
    z-index: 1000;
    width: 100%;
    background: linear-gradient(286.81deg, #f0f2ff 14.71%, #ebecf2);
}

.theme--dark .chat__header-info {
    background: linear-gradient(262deg, #232845 2.45%, #1e223f 61.7%) !important;
}

/* === Giveaway === */
.chat__giveaway {
    position: relative;
    width: 100%;
    margin-top: 5px;
    margin-bottom: 5px;
}

.chat__giveaway-inner {
    background-color: #fafaff;
    padding: 15px 25px;
    border-radius: 17px;
    overflow: hidden;
    border: 4px solid #b2b7d3;
    position: relative;
}

.theme--dark .chat__giveaway-inner {
    background-color: #262b4d;
    border: 4px solid #4d517e;
}

.chat__giveaway-inner h5 {
    font-size: 13px;
    color: #475a89;
    font-weight: 800;
    padding-bottom: 12px;
}

.theme--dark .chat__giveaway-inner h5 {
    color: #fff;
}

.chat__giveaway-timer--span {
    background-color: #b2b7d3;
    border-radius: 7px;
    width: 28px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 28px;
    font-weight: 900;
    color: #fff !important;
    margin: 0 2px;
}

.theme--dark .chat__giveaway-timer--span {
    background-color: #4d517e;
}

.chat__giveaway-timer span {
    color: #9c6df2;
}

.chat__giveaway-image {
    position: absolute;
    right: -12px;
    top: 0;
    pointer-events: none;
}

/* === Buttons + bottom === */
/* A11y: touch targets ≥44x44 (Apple HIG), 48x48 preferred (Android) */
.chat__bottom .chat__buttons a:not(.send) {
    width: 44px;
    height: 44px;
}

.chat__buttons a {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background-color: #fff;
    margin-right: 6px;
    color: #7887ae;
}

.chat__buttons a:hover {
    color: #2d2a73;
}

/* === Messages override (block 2 adds layout props on top of block 1 padding) === */
.chat__messages {
    position: relative;
    flex: 1;
    min-height: 0;
    -webkit-transition: .1s ease-in-out;
    transition: .1s ease-in-out;
}

.chat__bottom {
    padding: 8px;
}

.chat__buttons-admins {
    position: absolute;
    bottom: 0;
    right: 0;
}

.chat__buttons-admins a {
    position: relative;
    border-radius: 50%;
    margin-right: 6px;
    color: rgba(118, 125, 171, .5);
}

.chat__buttons-admins a:hover {
    color: #767dab;
}

/* =================================================================
 * Chat heading + bottom v2 — translucent glass with tenant-accent rim
 * (matches popup--wallet styling). Body of chat is left untouched.
 * ================================================================= */

.chat__heading--v2 {
    background: linear-gradient(180deg, rgba(20, 18, 32, 0.55), rgba(12, 10, 22, 0.45));
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px 14px;
    min-height: var(--header-height);
    box-shadow: 0 0 0 1px rgba(var(--color-accent-rgb, 184, 58, 58), 0.10) inset;
    color: #d8d8e6;
}
.chat__heading--v2 .chat__online {
    gap: 8px;
    color: #c8c8d8;
    font-weight: 600;
    font-size: 13px;
}
.chat__heading--v2 .chat__online .icon {
    width: 16px;
    height: 16px;
    color: var(--color-accent, #B83A3A);
}
.chat__heading--v2 .chat__online .online {
    color: #fff;
    font-weight: 800;
    font-size: 14px;
    margin: 0 4px 0 0;
}

/* Action buttons in heading (rules/close) and bottom (send/smiles) */
.chat__action {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #b6b6cc;
    cursor: pointer;
    transition: background 0.16s, border-color 0.16s, color 0.16s, transform 0.12s;
    text-decoration: none;
    flex: 0 0 auto;
}
.chat__action + .chat__action { margin-left: 6px; }
.chat__action .icon { width: 14px; height: 14px; }
.chat__action:hover {
    background: rgba(var(--color-accent-rgb, 184, 58, 58), 0.16);
    border-color: rgba(var(--color-accent-rgb, 184, 58, 58), 0.35);
    color: #fff;
}
.chat__action--send {
    background: rgba(var(--color-accent-rgb, 184, 58, 58), 0.78);
    border-color: color-mix(in srgb, var(--color-accent, #B83A3A) 50%, #fff 50%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(var(--color-accent-rgb, 184, 58, 58), 0.28);
}
.chat__action--send:hover {
    background: rgba(var(--color-accent-rgb, 184, 58, 58), 0.95);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(var(--color-accent-rgb, 184, 58, 58), 0.50);
}

/* Bottom bar — same translucent dark surface */
.chat__bottom--v2 {
    padding: 10px 12px;
    background: linear-gradient(180deg, rgba(12, 10, 22, 0.45), rgba(20, 18, 32, 0.55));
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 1px rgba(var(--color-accent-rgb, 184, 58, 58), 0.10) inset;
}
.chat__bottom--v2 .chat__send {
    background: rgba(0, 0, 0, 0.30);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 4px 4px 4px 12px;
    gap: 6px;
    transition: border-color 0.18s, box-shadow 0.18s;
}
.chat__bottom--v2 .chat__send:focus-within {
    border-color: var(--color-accent, #B83A3A);
    box-shadow: 0 0 0 3px rgba(var(--color-accent-rgb, 184, 58, 58), 0.15);
}
.chat__bottom--v2 .chat__input {
    flex: 1 1 auto;
    min-width: 0;
}
.chat__bottom--v2 .chat__input input {
    width: 100%;
    background: transparent;
    border: 0;
    outline: 0;
    color: #fff;
    font-size: 13px;
    padding: 8px 0;
    height: 32px;
}
.chat__bottom--v2 .chat__input input::placeholder { color: #7a7a90; }

/* Smiles panel — appears above bottom bar when .chat--smiles is active */
.chat .chat__smiles--smiles {
    display: none;
    visibility: hidden;
    background: linear-gradient(180deg, rgba(20, 18, 32, 0.85), rgba(12, 10, 22, 0.90));
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px 12px;
    max-height: 220px;
    overflow-y: auto;
}
.chat.chat--smiles .chat__smiles--smiles {
    display: block;
    visibility: visible;
}
.chat__smiles--smiles .chat__smiles-scroll {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
    gap: 4px;
}
.chat__smiles--smiles .chat__smiles-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    font-size: 22px;
    line-height: 1;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.12s;
    user-select: none;
}
.chat__smiles--smiles .chat__smiles-item:hover {
    background: rgba(var(--color-accent-rgb, 184, 58, 58), 0.16);
}

/* Pointer cursor must persist on the inner <svg>/<span> of every chat action
   button — global `span { cursor: default }` from reset.css would otherwise
   flicker the cursor to default when crossing the icon. */
.chat__action,
.chat__action *,
.chat__action::before,
.chat__action::after,
.chat__smiles--smiles .chat__smiles-item {
    cursor: pointer;
}
