
.wru-live-chat {
    margin-top: 30px;
    padding: 22px;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.025));
}

.wru-live-chat-floating {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 9999;
    width: min(420px, calc(100vw - 28px));
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    pointer-events: none;
}

.wru-chat-launcher,
.wru-chat-panel {
    pointer-events: auto;
}

.wru-chat-launcher {
    margin-left: auto;
    width: min(360px, calc(100vw - 28px));
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(255,207,55,.95), rgba(255,126,38,.92));
    color: #120b02;
    box-shadow: 0 18px 60px rgba(0,0,0,.42);
    cursor: pointer;
    text-align: left;
}

.wru-chat-launcher-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0,0,0,.18);
    font-size: 20px;
}

.wru-chat-launcher-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.wru-chat-launcher-text strong {
    font-size: 15px;
    font-weight: 950;
}

.wru-chat-launcher-text small {
    opacity: .82;
    font-weight: 800;
}

.wru-chat-launcher-pulse {
    position: absolute;
    width: 12px;
    height: 12px;
    right: 18px;
    top: 10px;
    border-radius: 50%;
    background: #27ff7a;
    box-shadow: 0 0 0 0 rgba(39,255,122,.55);
    animation: wruChatPulse 1.8s infinite;
}

@keyframes wruChatPulse {
    0% { box-shadow: 0 0 0 0 rgba(39,255,122,.55); }
    70% { box-shadow: 0 0 0 12px rgba(39,255,122,0); }
    100% { box-shadow: 0 0 0 0 rgba(39,255,122,0); }
}

.wru-chat-panel {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: min(680px, calc(100vh - 110px));
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(14,18,32,.98), rgba(7,9,17,.98));
    box-shadow: 0 24px 80px rgba(0,0,0,.55);
}

.wru-live-chat-floating.is-collapsed .wru-chat-panel {
    display: none;
}

.wru-live-chat-floating:not(.is-collapsed) .wru-chat-launcher {
    display: none;
}

.wru-live-chat-floating .wru-chat-head {
    padding: 16px 16px 12px;
    margin: 0;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.wru-live-chat-floating .wru-chat-head h2 {
    margin: 0;
    font-size: 20px;
}

.wru-chat-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.wru-chat-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wru-chat-close {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 50%;
    background: rgba(255,255,255,.08);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.wru-chat-messages {
    height: 420px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 18px;
    background: rgba(0,0,0,.24);
}

.wru-live-chat-floating .wru-chat-messages {
    height: min(430px, calc(100vh - 330px));
    min-height: 230px;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
}

.wru-chat-message {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.wru-chat-avatar {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: rgba(255,255,255,.13);
    border: 1px solid rgba(255,255,255,.16);
    font-weight: 900;
}

.wru-chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wru-chat-bubble {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.09);
}

.wru-chat-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
    color: rgba(255,255,255,.72);
    font-size: 12px;
}

.wru-chat-meta strong {
    color: #fff;
    font-size: 13px;
}

.wru-chat-verified {
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(255,207,55,.15);
    color: var(--gold, #ffcf37);
    font-weight: 900;
    font-size: 11px;
}

.wru-chat-bubble p {
    margin: 0;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.wru-chat-form {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.wru-live-chat-floating .wru-chat-form {
    padding: 12px;
    margin: 0;
    background: rgba(255,255,255,.035);
}

.wru-chat-form input[name="message"] {
    flex: 1;
    min-height: 42px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(0,0,0,.28);
    color: #fff;
    padding: 0 16px;
}

.wru-chat-login-box {
    margin-top: 12px;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.04);
}

.wru-live-chat-floating .wru-chat-login-box {
    margin: 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    border-radius: 0;
}

.wru-chat-teaser-box p {
    margin: 6px 0 12px;
}

.wru-chat-status {
    margin-top: 8px;
    color: rgba(255,255,255,.72);
    font-size: 12px;
}

@media (max-width: 768px) {
	    .wru-cookie-notice.is-visible ~ .wru-live-chat-floating {
        display: none !important;
    }
    .wru-live-chat {
        padding: 16px;
    }

    .wru-live-chat-floating {
        right: 14px;
        bottom: 14px;
        width: calc(100vw - 28px);
        padding: 0;
    }

    .wru-chat-launcher {
        width: 100%;
    }

    .wru-chat-head,
    .wru-chat-form {
        flex-direction: column;
    }

    .wru-live-chat-floating .wru-chat-head {
        flex-direction: row;
    }

    .wru-chat-form button {
        width: 100%;
    }

    .wru-live-chat-floating .wru-chat-form button {
        width: auto;
    }

    .wru-chat-messages {
        height: 360px;
        padding: 10px;
    }

    .wru-live-chat-floating .wru-chat-messages {
        height: min(380px, calc(100vh - 320px));
    }
}

/* Floating chat button/form repair */
.wru-live-chat-floating,
.wru-live-chat-floating * {
    box-sizing: border-box;
}

.wru-live-chat-floating .wru-chat-head {
    align-items: flex-start;
    gap: 12px;
    padding-right: 14px;
}

.wru-live-chat-floating .wru-chat-head > div:first-child {
    min-width: 0;
    flex: 1;
}

.wru-live-chat-floating .wru-chat-head-actions {
    flex-shrink: 0;
    gap: 8px;
    margin-left: 6px;
}

.wru-chat-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
    margin: 0;
    line-height: 1;
    text-align: center;
    transform: none;
}

.wru-live-chat-floating .wru-chat-form {
    align-items: center;
}

.wru-live-chat-floating .wru-chat-form input[name="message"] {
    min-width: 0;
}

.wru-chat-status {
    padding: 0 14px 12px;
}

.wru-chat-status.is-error {
    color: #ffb1b1;
    font-weight: 800;
}

/* Cosmetic titles should not repaint the whole chat row. */
.wru-chat-message.wru-cosmetic-title-race-champion,
.wru-chat-message.wru-cosmetic-title-neon-commander,
.wru-chat-message.wru-cosmetic-badge-season-champion,
.wru-chat-message.wru-cosmetic-badge-season-podium,
.wru-chat-message.wru-cosmetic-badge-season-top-10,
.wru-chat-message.wru-cosmetic-badge-founder,
.wru-chat-message.wru-cosmetic-title-top-pilot {
    background: transparent !important;
    border: 0 !important;
    color: inherit !important;
    text-shadow: none !important;
}

.wru-chat-message.wru-cosmetic-title-race-champion .wru-chat-bubble,
.wru-chat-message.wru-cosmetic-title-neon-commander .wru-chat-bubble {
    border-color: rgba(255,207,55,.26);
    box-shadow: 0 0 20px rgba(255,207,55,.08);
}

/* WRUniverse mobile chat reset after cookie notice fix. */
@media (max-width: 768px) {
    .wru-live-chat-floating {
        right: 14px !important;
        bottom: 14px !important;
        width: calc(100vw - 28px) !important;
    }
}
