.chat-input-wrapper {
    position: relative;
}

.chat-input-notices .alert,
.chat-input-notices .chat-reply-preview {
    margin: 0;
}

.chat-input-wrapper.game-active .chat-input-notices .alert,
.chat-input-wrapper.game-active .chat-input-notices .chat-reply-preview {
    border: 0;
}

.chat-input-wrapper:not(.game-active) .chat-input-notices .alert,
.chat-input-wrapper:not(.game-active) .chat-input-notices .chat-reply-preview {
    border-top-left-radius: var(--radius-sm, 10px);
    border-top-right-radius: var(--radius-sm, 10px);
}

.chat-view .chat-input-notices {
    display: grid;
    gap: 4px;
    margin-bottom: 2px;
}

.chat-view .chat-input-notices .alert,
.chat-view .chat-input-notices .chat-reply-preview {
    margin: 0 !important;
    padding: 6px 8px;
}

.chat-view .chat-input-wrapper {
    margin-bottom: 4px;
}

.chat-view .chat-navbar {
    margin-bottom: 2px !important;
    padding-top: 3px !important;
    padding-bottom: 3px !important;
}

.chat-view .chat-navbar .nav-actions {
    gap: 3px;
}

.chat-view #messages {
    margin-top: 0 !important;
}

.chat-view #quizBox {
    margin-bottom: 4px;
    position: relative;
}

.chat-input-group {
    display: flex;
    flex-direction: column;
    position: relative;
    gap: 4px;
    border: 1px solid var(--border, #dee2e6);
    border-radius: var(--radius-sm, 10px);
    background: var(--surface, #ffffff);
    overflow: hidden;
}

.chat-input-group #messageBox {
    font-family: var(--font-body, system-ui);
    font-size: 16px;
    line-height: 1.5;
}


.chat-input-group:focus-within {
    border-color: rgba(31, 122, 140, 0.4);
    box-shadow: 0 0 0 0.15rem rgba(31, 122, 140, 0.18);
}

.chat-input-group #messageBox {
    border: 0;
    border-radius: 0;
    margin: 0 !important;
    box-shadow: none;
}

.chat-input-group #sendButton {
    font-family: var(--font-body, system-ui);
    border: 0;
    border-radius: 0;
    margin: 0;
    font-weight: 500;
    font-size: 16px;
    padding: 7px 10px;
}

.chat-input-wrapper.game-active {
    border: 1px solid var(--border, #dee2e6);
    border-radius: var(--radius-sm, 10px);
    background: var(--surface, #ffffff);
    overflow: visible;
}

.chat-input-wrapper.game-active #quizBox {
    margin: 0;
    border: 0;
    border-bottom: 1px solid var(--border, #dee2e6);
    border-radius: var(--radius-sm, 10px) var(--radius-sm, 10px) 0 0;
}

.chat-input-wrapper.game-active .chat-input-group {
    border: 0;
    border-radius: 0 0 var(--radius-sm, 10px) var(--radius-sm, 10px);
}

.chat-suggestions {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 1050;
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
    max-height: 220px;
    overflow-y: auto;
    display: none;
}

.chat-suggestion-item {
    padding: 6px 10px;
    cursor: pointer;
    font-size: 13px;
}

.chat-suggestion-item.active,
.chat-suggestion-item:hover {
    background: #e9f2ff;
}

.game-command-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 10;
    background: rgba(13, 110, 253, 0.1);
    border: 1px solid rgba(13, 110, 253, 0.2);
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #0d6efd;
    font-size: 14px;
}

.game-command-btn:hover {
    background: rgba(13, 110, 253, 0.2);
    border-color: rgba(13, 110, 253, 0.4);
}

.game-command-btn i {
    display: block;
}

.chat-reply-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 6px 10px;
    margin-bottom: 6px;
    font-size: 12px;
}

.chat-reply-preview.display-none {
    display: none;
}

.chat-reply-preview-body {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chat-reply-preview-label {
    color: #6c757d;
}

.chat-reply-preview-user {
    font-weight: 600;
}

.chat-reply-preview-text {
    color: #495057;
}

.chat-reply-cancel {
    border: 0;
    background: transparent;
    color: #6c757d;
    padding: 0 4px;
    cursor: pointer;
}

.chat-reply-cancel:hover {
    color: #0d6efd;
}

.chat-reply-inline {
    display: block;
    border-left: 2px solid #dee2e6;
    padding-left: 8px;
    margin: 4px 0;
    font-size: 12px;
    color: #6c757d;
}

.chat-reply-user {
    font-weight: 600;
}

.chat-reply-text {
    color: #495057;
}

.chat-reply-btn {
    border: 0;
    background: transparent;
    color: #6c757d;
    margin-left: 6px;
    padding: 0;
    font-size: 12px;
    cursor: pointer;
}

.chat-reply-btn:hover {
    color: #0d6efd;
}

.onboarding-card {
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: var(--bs-body-bg, #fff);
    border-radius: 16px;
    padding: 14px;
    margin: 12px 0;
}

.onboarding-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.onboarding-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--bs-body-color, #212529);
}

.onboarding-subtitle {
    font-size: 13px;
    color: #6c757d;
}

.onboarding-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.onboarding-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.onboarding-info {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.onboarding-info-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6c757d;
}

.onboarding-info-link {
    text-decoration: none;
    font-weight: 600;
    color: #0d6efd;
}

.onboarding-info-link:hover {
    text-decoration: underline;
}

.onboarding-channels {
    margin-top: 12px;
}

.onboarding-channels-title {
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.onboarding-channel-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.onboarding-channel-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(13, 110, 253, 0.2);
    background: rgba(13, 110, 253, 0.06);
    color: var(--bs-body-color, #212529);
    text-decoration: none;
    font-size: 12px;
}

.onboarding-channel-chip:hover {
    border-color: rgba(13, 110, 253, 0.4);
    background: rgba(13, 110, 253, 0.12);
}

.onboarding-channel-chip .badge {
    font-size: 10px;
    padding: 2px 6px;
}

.onboarding-dismiss {
    border: 0;
    background: transparent;
    color: #adb5bd;
    padding: 0;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.avatar-nudge {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.avatar-nudge.display-none {
    display: none;
}

.avatar-nudge-body {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.avatar-nudge-text {
    font-size: 13px;
}

.avatar-nudge-actions .btn {
    white-space: nowrap;
}

.avatar-nudge-dismiss {
    border: 0;
    background: transparent;
    color: #6c757d;
    padding: 0;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.user-menu-offcanvas {
    width: min(100vw, 360px);
}

.user-menu-offcanvas .offcanvas-header {
    padding: 12px 16px;
}

.user-menu-offcanvas .offcanvas-body {
    padding: 12px 16px 16px;
}

.user-menu-profile {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.channel-info-card {
    margin-bottom: 12px;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: var(--bs-body-bg, #fff);
}

.channel-info-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.channel-info-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.06);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex: 0 0 40px;
}

.channel-info-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.channel-info-title {
    font-weight: 600;
    font-size: 0.82rem;
    color: #111827;
    letter-spacing: 0.02em;
    text-transform: lowercase;
}

.channel-info-desc {
    display: flex;
    gap: 6px;
    align-items: flex-start;
    font-size: 12px;
    color: #6c757d;
    line-height: 1.4;
    font-family: "Georgia", "Times New Roman", serif;
}

.channel-info-desc i {
    font-size: 0.95em;
    color: #adb5bd;
    margin-top: 1px;
}

.channel-info-desc-text {
    min-width: 0;
}

.channel-info-link {
    display: flex;
    gap: 6px;
    align-items: center;
    font-size: 12px;
    color: #6c757d;
    margin-top: 8px;
}

.channel-info-link i {
    font-size: 0.95em;
    color: #adb5bd;
}

.channel-info-link-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #6c757d;
    font-size: 12px;
    cursor: pointer;
    word-break: break-all;
}

.channel-info-link-button:hover,
.channel-info-link-button:focus {
    color: #6c757d;
    box-shadow: none;
}

.channel-info-meta {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.channel-info-polls {
    margin-top: 8px;
}

.channel-info-polls-link {
    width: 100%;
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: rgba(15, 23, 42, 0.04);
    border-radius: 10px;
    padding: 6px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #111827;
    text-decoration: none;
}

.channel-info-polls-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.channel-info-polls-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 600;
    background: rgba(15, 23, 42, 0.1);
    color: #475569;
    line-height: 1;
}

.channel-info-polls-link:hover {
    background: rgba(15, 23, 42, 0.08);
    color: #111827;
}

.channel-info-polls-action {
    color: #6c757d;
    font-weight: 500;
}

.chat-view .message-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 2px;
}

.chat-view .container {
    max-width: 764px;
}

@media (max-width: 576px) {
    .chat-view .container {
        padding-left: clamp(0.4em, 2.6vw, 1em);
        padding-right: clamp(0.4em, 2.6vw, 1em);
    }
}

.chat-view .chat-empty-state {
    margin: 4px 0 12px;
    display: grid;
    gap: 8px;
    color: var(--text-muted, #6c757d);
}

.chat-view .chat-empty-card {
    border: 1px solid var(--border, #dee2e6);
    border-radius: var(--radius, 16px);
    background: var(--surface, #ffffff);
    box-shadow: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.08));
    overflow: hidden;
}

.chat-view .chat-empty-card .chat-card-body {
    display: grid;
    gap: 8px;
}

.chat-view .chat-empty-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.chat-view .chat-empty-avatar {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: 50%;
    background: linear-gradient(90deg, var(--surface-muted, #f1f5f9) 0%, rgba(255, 255, 255, 0.35) 50%, var(--surface-muted, #f1f5f9) 100%);
    background-size: 200% 100%;
    animation: chat-flash 1.6s ease-in-out infinite;
}

.chat-view .chat-empty-lines {
    flex: 1 1 auto;
    display: grid;
    gap: 8px;
}

.chat-view .chat-empty-line {
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--surface-muted, #f1f5f9) 0%, rgba(255, 255, 255, 0.35) 50%, var(--surface-muted, #f1f5f9) 100%);
    background-size: 200% 100%;
    animation: chat-flash 1.6s ease-in-out infinite;
}

.chat-view .chat-empty-line.is-title {
    width: 32%;
    height: 8px;
}

.chat-view .chat-empty-line.is-short {
    width: 38%;
}

.chat-view .chat-empty-line.is-medium {
    width: 58%;
}

.chat-view .chat-empty-line.is-long {
    width: 74%;
}

.chat-view .chat-empty-line:nth-child(2) {
    animation-delay: 0.15s;
}

.chat-view .chat-empty-line:nth-child(3) {
    animation-delay: 0.3s;
}

.chat-view .chat-empty-line:nth-child(4) {
    animation-delay: 0.45s;
}

.chat-view .chat-empty-label {
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-align: center;
}

@keyframes chat-flash {
    0% {
        background-position: 0 0;
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
    100% {
        background-position: 200% 0;
        opacity: 0.7;
    }
}

@media (prefers-reduced-motion: reduce) {
    .chat-view .chat-empty-line {
        animation: none;
    }

    .chat-view .chat-empty-avatar {
        animation: none;
    }
}

body.chat-compact .chat-empty-avatar {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
}

body.chat-compact .chat-empty-state {
    margin: 2px 0 8px;
    gap: 6px;
}

.chat-view .chat-card-body {
    padding: 0.5rem 0.6rem !important;
}

.chat-view .chat-message-row {
    gap: 6px;
}

.chat-view .chat-avatar {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    font-size: 0.75em;
    line-height: 1;
}

.chat-view .chat-message-text {
    display: inline;
    max-width: none;
    line-height: 1.5;
    font-size: 16px;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.chat-view .chat-sys-text {
    font-size: 14px;
    line-height: 1.4;
}

.chat-view .chat-footer-meta {
    gap: 3px;
    font-size: 12px;
    color: var(--text-muted, #6c757d);
}

.chat-view .chat-footer-meta .chat-time-text {
    font-size: 1em;
}

.chat-view .chat-grouped-row {
    margin-top: 0.06rem;
    margin-bottom: 0.06rem;
}

@media (max-width: 576px) {
    .chat-view .chat-card-body {
        padding: 0.45rem 0.55rem !important;
    }

    .chat-view .chat-message-row {
        gap: 5px;
    }

    .chat-view .chat-avatar {
        width: 24px;
        height: 24px;
        flex: 0 0 24px;
        font-size: 0.7em;
    }

    .chat-view .chat-message-text {
        font-size: 16px;
    }

    .chat-view .chat-footer-meta {
        font-size: 12px;
    }

    .chat-view .chat-input-group #messageBox {
        padding: 6px 10px;
    }

    .chat-view .chat-input-group #sendButton {
        padding: 3.5px 10px;
    }
}

@media (min-width: 768px) {
    .chat-view .chat-message-text {
        max-width: none;
        line-height: 1.45;
        font-size: 15px;
    }

    .chat-view .chat-sys-text {
        font-size: 13px;
        line-height: 1.35;
    }

    .chat-view .chat-footer-meta {
        font-size: 11px;
    }

    .chat-input-group #messageBox {
        font-size: 15px;
        line-height: 1.45;
    }

    .chat-input-group #sendButton {
        font-size: 15px;
        padding: 6px 9px;
    }
}

.channel-info-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1;
}

.channel-info-badge i {
    font-size: 0.9em;
}

.channel-info-public {
    border-color: rgba(37, 99, 235, 0.35);
    background: rgba(37, 99, 235, 0.15);
    color: #1d4ed8;
}

.channel-info-private {
    border-color: rgba(100, 116, 139, 0.35);
    background: rgba(100, 116, 139, 0.15);
    color: #475569;
}

.channel-info-registered {
    border-color: rgba(22, 163, 74, 0.35);
    background: rgba(22, 163, 74, 0.16);
    color: #16a34a;
}

.channel-info-moderators {
    border-color: rgba(14, 116, 144, 0.35);
    background: rgba(14, 116, 144, 0.16);
    color: #0e7490;
}

.user-menu-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: #f1f3f5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #6c757d;
    flex-shrink: 0;
}

.user-menu-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-menu-profile-info {
    min-width: 0;
    flex: 1;
}

.user-menu-username {
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-menu-profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
}

.user-menu-profile-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    line-height: 1;
}

.user-menu-profile-emoji {
    font-size: 13px;
}

.user-menu-section {
    margin-top: 12px;
}

.user-menu-section:first-child {
    margin-top: 0;
}

.user-menu-section-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6c757d;
    margin-bottom: 6px;
}

.user-menu-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.user-menu-tile {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: var(--bs-body-bg, #fff);
}

.user-menu-tile-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(13, 110, 253, 0.12);
    color: #0d6efd;
    flex-shrink: 0;
}

.user-menu-tile-icon.is-warning {
    background: rgba(245, 158, 11, 0.18);
    color: #f59e0b;
}

.user-menu-tile-icon.is-success {
    background: rgba(22, 163, 74, 0.18);
    color: #16a34a;
}

.user-menu-tile-icon.is-indigo {
    background: rgba(37, 99, 235, 0.18);
    color: #2563eb;
}

.user-menu-tile-icon.is-teal {
    background: rgba(13, 148, 136, 0.18);
    color: #0d9488;
}

.user-menu-tile-title {
    font-size: 14px;
    font-weight: 600;
    display: block;
}

.user-menu-tile-meta {
    font-size: 12px;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 6px;
}

.user-menu-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: #0d6efd;
    color: #fff;
    font-size: 11px;
}

.user-menu-count.is-coin {
    background: rgba(245, 158, 11, 0.18);
    color: #b45309;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.user-menu-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 9px;
    text-decoration: none;
    color: inherit;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: var(--bs-body-bg, #fff);
}

.user-menu-row span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.user-menu-row-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    color: #6c757d;
}

.user-menu-row-lang {
    justify-content: space-between;
}

.user-menu-lang-meta {
    gap: 6px;
}

.user-menu-lang-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 6px;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    text-decoration: none;
    font-size: 0.75em;
    font-weight: 600;
    color: #1b2430;
    background: rgba(15, 23, 42, 0.04);
}

.user-menu-lang-btn.is-active {
    background: var(--primary, #1f7a8c);
    border-color: var(--primary, #1f7a8c);
    color: #fff;
}

.user-menu-list {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    overflow: hidden;
    background: var(--bs-body-bg, #fff);
}

.user-menu-list .user-menu-row {
    border: 0;
    border-radius: 0;
    background: transparent;
}

.user-menu-list .user-menu-row + .user-menu-row {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.user-menu-list .user-menu-row .ti-chevron-right {
    color: #adb5bd;
}

@media (max-width: 576px) {
    .user-menu-offcanvas {
        width: 100vw;
    }
}

.chat-game-updates-details {
    margin: 0;
}

.chat-game-updates {
    cursor: pointer;
}

.chat-game-updates-summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 100%;
    font-weight: 400;
    color: var(--text, #1b2430);
}

.chat-game-updates-summary::-webkit-details-marker {
    display: none;
}

.chat-game-updates-summary::marker {
    display: none;
}

.chat-game-updates-details[open] .chat-game-updates-preview {
    display: none;
}

.chat-game-updates-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
}

.chat-game-updates-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.chat-game-updates-label {
    font-weight: 600;
}

.chat-game-updates-label i {
    color: var(--primary, #1f7a8c);
}

.chat-game-updates-toggle {
    display: inline-flex;
    align-items: center;
    color: var(--text-muted, #6c757d);
    transition: transform 0.2s ease;
}

.chat-game-updates-help {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.2);
    background: var(--bs-body-bg, #fff);
    color: var(--text-muted, #6c757d);
    font-size: 0.75em;
    font-weight: 600;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
}

.chat-game-rules-btn {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.2);
    background: var(--bs-body-bg, #fff);
    color: var(--text-muted, #6c757d);
    font-size: 0.75em;
    font-weight: 600;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    z-index: 2;
}

.chat-game-rules-btn:hover {
    background: rgba(15, 23, 42, 0.08);
}

.chat-game-rules-btn:focus-visible {
    outline: 2px solid rgba(31, 122, 140, 0.4);
    outline-offset: 2px;
}

.chat-game-updates-help:hover {
    background: rgba(15, 23, 42, 0.08);
}

.chat-game-updates-help:focus-visible {
    outline: 2px solid rgba(31, 122, 140, 0.4);
    outline-offset: 2px;
}

.chat-game-updates-details[open] .chat-game-updates-toggle {
    transform: rotate(180deg);
}

.chat-game-updates-preview {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    font-size: 0.85em;
    font-weight: 400;
    color: var(--text-muted, #6c757d);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-game-updates-list {
    margin-top: 8px;
    display: grid;
    gap: 6px;
}

.chat-game-updates-item {
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.06);
    font-size: 0.9em;
    color: var(--text, #1b2430);
}

.game-rules-open {
    overflow: hidden;
}

.game-rules-modal {
    position: fixed;
    inset: 0;
    z-index: 1080;
    display: none;
}

.game-rules-modal.is-open {
    display: block;
}

.game-rules-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
}

.game-rules-modal-dialog {
    position: relative;
    margin: 10vh auto 0;
    background: var(--bs-body-bg, #fff);
    border-radius: 12px;
    max-width: 520px;
    width: calc(100% - 32px);
    padding: 16px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.2);
}

.game-rules-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.game-rules-modal-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
}

.game-rules-modal-close {
    border: 0;
    background: none;
    font-size: 1.1rem;
    line-height: 1;
    color: var(--text-muted, #6c757d);
    cursor: pointer;
}

.game-rules-modal-body {
    max-height: 50vh;
    overflow: auto;
}

.game-rules-modal-label {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.game-rules-list {
    margin: 0;
    padding-left: 1.1em;
    display: grid;
    gap: 6px;
    font-size: 0.9em;
    color: var(--text, #1b2430);
}

body.chat-compact .message-block {
    gap: 4px;
    margin-bottom: 2px;
}

body.chat-compact .chat-card-body {
    padding: 0.45em 0.55em !important;
}

body.chat-compact .chat-message-row {
    gap: 6px;
}

body.chat-compact .chat-avatar {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    font-size: 0.7em;
}

body.chat-compact .chat-sys-text {
    font-size: 14px;
}

body.chat-compact .chat-game-updates-item {
    font-size: 0.78em;
}

body.chat-compact .chat-message-text {
    line-height: 1.5;
    font-size: 16px;
}

body.chat-compact .chat-grouped-row {
    margin-top: 0.06rem;
    margin-bottom: 0.06rem;
}

body.chat-compact .chat-footer-meta {
    gap: 3px;
    font-size: 12px;
    color: var(--text-muted, #6c757d);
}

body.chat-compact .chat-footer-inline {
    margin-left: 4px;
}

body.chat-compact .chat-footer-separator {
    color: var(--text-muted, #6c757d);
    margin-right: 4px;
}

body.chat-compact .chat-footer-meta .chat-time-text {
    font-size: 1em;
    margin-left: 2px;
}

body.chat-compact .chat-input-group {
    flex-direction: row;
    align-items: stretch;
    gap: 6px;
}

body.chat-compact .chat-input-group #messageBox {
    flex: 1 1 auto;
    min-width: 0;
    padding: 5px 7px;
    font-size: 16px;
    line-height: 1.5;
    min-height: 30px;
    resize: none;
    order: 1;
}


body.chat-compact .game-command-btn {
    position: static;
    transform: none;
    margin: 0;
    align-self: center;
    order: 2;
}

body.chat-compact .chat-input-group #sendButton {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
    width: auto !important;
    min-width: 42px;
    padding: 6px 8px;
    font-size: 16px;
    border-top: 0;
    border-left: 1px solid var(--border, #dee2e6);
    border-radius: 0;
    flex: 0 0 auto;
    white-space: nowrap;
    order: 3;
}

body.chat-compact .chat-input-group #sendButton i,
body.chat-compact .chat-input-group #sendButton svg,
body.chat-compact .chat-input-group #sendButton .spinner-border {
    width: 0.95em;
    height: 0.95em;
    font-size: 0.95em;
}

body.chat-compact .chat-input-wrapper #quizBox {
    padding: 6px 8px;
}

body.chat-compact .chat-navbar .nav-actions {
    gap: 4px;
}

body.chat-compact .chat-navbar .nav-actions .btn {
    height: 28px !important;
    padding: 0 8px;
    border-radius: 8px !important;
}

body.chat-compact .navbar .btn i {
    font-size: 1.05em;
}

body.chat-compact .header-layout-pill .nav-actions-full,
body.chat-compact .header-layout-pill .nav-actions-admin {
    padding: 3px;
    border-radius: 12px;
}

@media (min-width: 768px) {
    body.chat-compact .chat-message-text {
        max-width: 65%;
        line-height: 1.45;
        font-size: 15px;
    }

    body.chat-compact .chat-sys-text {
        font-size: 13px;
    }

    body.chat-compact .chat-footer-meta {
        font-size: 11px;
    }

    body.chat-compact .chat-input-group #messageBox {
        font-size: 15px;
        line-height: 1.45;
    }

    body.chat-compact .chat-input-group #sendButton {
        font-size: 15px;
    }
}
