html[data-sneebo-theme="graphite"] {
    color-scheme: dark;
    --site-bg: #191a1d;
    --site-surface: #232428;
    --site-surface-muted: #202125;
    --site-surface-raised: #2a2c31;
    --site-border: #35363b;
    --site-border-strong: #686a73;
    --site-text: #eceef1;
    --site-muted: #a8abb3;
    --site-primary: #3473c7;
    --site-primary-hover: #407fd3;
    --site-primary-text: #ffffff;
    --site-link: #8fb6ed;
    --site-selected: #23334a;
    --site-success: #95bca3;
    --site-danger: #efa0ad;
    --site-warning: #e6b14f;
    --bs-body-bg: var(--site-bg);
    --bs-body-color: var(--site-text);
    --bs-border-color: var(--site-border);
    --bs-secondary-color: var(--site-muted);
    --bs-secondary-bg: var(--site-surface);
    --bs-tertiary-bg: var(--site-surface-muted);
    --bs-emphasis-color: var(--site-text);
    --bs-heading-color: var(--site-text);
    --bs-primary-rgb: 52, 115, 199;
    --bs-link-color: var(--site-link);
    --bs-link-hover-color: #b0ccf3;
    --bg: var(--site-bg);
    --surface: var(--site-surface);
    --surface-muted: var(--site-surface-muted);
    --border: var(--site-border);
    --text: var(--site-text);
    --text-muted: var(--site-muted);
    --primary: var(--site-primary);
    --primary-strong: var(--site-primary-hover);
    --gradient-start: var(--site-primary);
    --gradient-mid: var(--site-primary);
    --gradient-end: var(--site-primary);
    --shadow-sm: none;
    --shadow-md: none;
    --shadow-glow: none;
}

html[data-sneebo-theme] body {
    --primary: var(--site-primary);
    --primary-strong: var(--site-primary-hover);
    --primary-glow: transparent;
    --bg: var(--site-bg);
    --surface: var(--site-surface);
    --surface-muted: var(--site-surface-muted);
    --border: var(--site-border);
    --text: var(--site-text);
    --text-muted: var(--site-muted);
    background: var(--site-bg) !important;
    color: var(--site-text) !important;
}

html[data-sneebo-theme] body::before,
html[data-sneebo-theme] body::after,
html[data-sneebo-theme] .bg-particles,
html[data-sneebo-theme] .flow-bg-dots {
    display: none !important;
}

html[data-sneebo-theme] :is(.card, .modal-content, .offcanvas, .dropdown-menu,
.list-group-item, .login-card, .about-modal-content, .logo-card, .avatar-card,
.shop-buy-card, .shop-buy-pack, .channel-card, .channel-info-card,
.user-menu-main, .user-menu-section, .poll-card, .poll-voters-modal-dialog,
.logo-modal-content, .autocomplete-results, .chat-suggestions,
.landing-hero-card, .landing-panel, .landing-feature-card, .landing-cta-card) {
    background: var(--site-surface) !important;
    color: var(--site-text);
    border-color: var(--site-border) !important;
    box-shadow: none !important;
}

html[data-sneebo-theme] :is(.navbar, .chat-navbar, .arcade-header, .site-footer,
.modal-header, .modal-footer, .card-header, .card-footer, .offcanvas-header,
.chat-input-wrapper, .chat-input-group, .chat-reply-preview, .polls-page-header) {
    background: var(--site-bg) !important;
    border-color: var(--site-border) !important;
    box-shadow: none !important;
}

html[data-sneebo-theme] :is(.brand-name, .navbar-brand, .arcade-title h1,
.title-arcade, .account-title, .games-page h1, .games-page h2,
.landing-hero h1, .flow-login-title, .login-card h1, .login-card h2) {
    color: var(--site-text) !important;
    background-image: none !important;
    -webkit-text-fill-color: currentColor;
    text-shadow: none !important;
}

html[data-sneebo-theme] :is(.text-muted, .form-text, .footer-credit,
.mobile-username-hint, .terms, .flow-login-terms, .footer-links,
.site-footer, .brand-tagline, .login-card > p) {
    color: var(--site-muted) !important;
}

html[data-sneebo-theme] :is(.form-control, .form-select, .login-card input:not([type="checkbox"]):not([type="hidden"]),
.quiz-answer-input, .wc-input, .flow-login-input, .arena-invite-input,
.arena-invite-select, .chat-suggestions) {
    background-color: var(--site-surface-muted) !important;
    color: var(--site-text) !important;
    border-color: var(--site-border) !important;
    box-shadow: none;
}

html[data-sneebo-theme] :is(input, textarea)::placeholder {
    color: var(--site-muted);
    opacity: 0.85;
}

html[data-sneebo-theme] :is(.form-control, .form-select, .flow-login-input):focus {
    border-color: var(--site-primary) !important;
    box-shadow: 0 0 0 3px rgb(52 115 199 / 20%) !important;
}

html[data-sneebo-theme] .form-check-input {
    background-color: var(--site-surface-muted);
    border-color: var(--site-border-strong);
}

html[data-sneebo-theme] .form-check-input:checked {
    background-color: var(--site-primary);
    border-color: var(--site-primary);
}

html[data-sneebo-theme] :is(.btn-primary, .btn-success, .btn-play,
.btn-arcade-primary, .mobile-primary, .btn-play-now, .flow-login-btn,
.sn-primary, .poll-submit-btn, .game-command-btn.is-active) {
    background: var(--site-primary) !important;
    color: var(--site-primary-text) !important;
    border-color: var(--site-primary) !important;
    border-radius: 10px;
    text-shadow: none !important;
    box-shadow: none !important;
}

html[data-sneebo-theme] :is(.btn-primary, .btn-success, .btn-play,
.btn-arcade-primary, .mobile-primary, .btn-play-now, .flow-login-btn):hover {
    background: var(--site-primary-hover) !important;
    color: var(--site-primary-text) !important;
}

html[data-sneebo-theme] :is(.btn-play, .btn-arcade-primary, .btn-play-now)::before {
    display: none !important;
}

html[data-sneebo-theme] :is(.btn-outline-primary, .btn-outline-secondary,
.btn-arcade-outline, .btn-secondary, .btn-dice, .lang-btn.active,
.nav-pills .nav-link.active, .tab.active, .arcade-tab.is-active,
.btn-check:checked + label, .channel-filter-btn.active,
.channel-filter-btn.is-active) {
    background: var(--site-selected) !important;
    color: var(--site-text) !important;
    border-color: var(--site-border) !important;
    text-shadow: none !important;
    box-shadow: none !important;
}

html[data-sneebo-theme] :is(.btn-arcade-outline, .btn-outline-primary,
.btn-outline-secondary):hover {
    background: var(--site-surface-raised) !important;
}

html[data-sneebo-theme] :is(.nav-link, .lang-btn, .footer-links a,
.about-feature, .mobile-shortcuts a, .dropdown-item, .list-group-item-action) {
    color: var(--site-muted);
}

html[data-sneebo-theme] :is(.dropdown-item, .list-group-item-action):hover {
    background: var(--site-surface-raised);
    color: var(--site-text);
}

html[data-sneebo-theme] :is(.bg-light, .bg-white) {
    background: var(--site-surface) !important;
}

html[data-sneebo-theme] .text-dark {
    color: var(--site-text) !important;
}

html[data-sneebo-theme] .bg-primary {
    background-color: var(--site-primary) !important;
    color: var(--site-primary-text);
}

html[data-sneebo-theme] .text-primary {
    color: var(--site-link) !important;
}

html[data-sneebo-theme] :is(.alert-info, .alert-primary) {
    color: #c2d5ef;
    background: #23334a;
    border-color: #3e5473;
}

html[data-sneebo-theme] :is(.alert-warning, .game-unranked, .game-demo) {
    color: #e5cc99;
    background: #302a20;
    border-color: #554830;
}

html[data-sneebo-theme] :is(.alert-danger, .flow-login-error) {
    color: var(--site-danger);
    background: #3b272d;
    border-color: #66404b;
}

html[data-sneebo-theme] .alert-success {
    color: var(--site-success);
    background: #24342b;
    border-color: #3c5947;
}

html[data-sneebo-theme] .bg-warning.text-dark {
    color: #231d12 !important;
}

html[data-sneebo-theme] .table {
    --bs-table-bg: var(--site-surface);
    --bs-table-color: var(--site-text);
    --bs-table-border-color: var(--site-border);
    --bs-table-striped-bg: var(--site-surface-muted);
    --bs-table-striped-color: var(--site-text);
    --bs-table-hover-bg: var(--site-surface-raised);
    --bs-table-hover-color: var(--site-text);
    color: var(--site-text);
}

html[data-sneebo-theme] :is(.cookie-banner, .cookie-banner__content) {
    background: var(--site-surface) !important;
    color: var(--site-text) !important;
    border-color: var(--site-border) !important;
    box-shadow: none !important;
}

html[data-sneebo-theme] :is(.cookie-banner__text, .cookie-banner__link) {
    color: var(--site-muted) !important;
}

html[data-sneebo-theme] .btn-close {
    filter: invert(1) grayscale(1) brightness(1.8);
}

html[data-sneebo-theme] .arcade-user-link {
    flex-direction: row-reverse;
    color: var(--site-muted);
    background: transparent;
    box-shadow: none;
}

html[data-sneebo-theme] .arcade-user-link > i {
    font-size: 24px;
    color: var(--site-muted);
}

html[data-sneebo-theme] .mobile-quick-card {
    align-items: center;
    text-align: center;
    background: var(--site-surface);
    border-color: var(--site-border);
    border-radius: 10px;
    box-shadow: none;
}

html[data-sneebo-theme] :is(.mobile-disclosure, .mobile-together) {
    background: transparent;
    border-color: var(--site-border);
    box-shadow: none;
}

html[data-sneebo-theme] :is(.mobile-quick-card, .mobile-game-link,
.arena-card a, .mobile-together) {
    --game-color: #91b3c7;
}

html[data-sneebo-theme] [data-game-icon] {
    --game-color: #91b3c7;
}

html[data-sneebo-theme] body :is([href*="/arcade/reaction"], [data-game-icon="reaction"]) { --game-color: #e6b14f; }
html[data-sneebo-theme] body :is([href*="/arcade/quiz-challenge"], [data-game-icon="quiz"]) { --game-color: #df83a2; }
html[data-sneebo-theme] body :is([href*="/arcade/sudoku"], [data-game-icon="sudoku"]) { --game-color: #81a9e4; }
html[data-sneebo-theme] body :is([href*="/arcade/aim-trainer"], [data-game-icon="aim"]) { --game-color: #91b7a0; }
html[data-sneebo-theme] body :is([href*="/arcade/hangman"], [data-game-icon="hangman"]) { --game-color: #d8a27d; }
html[data-sneebo-theme] body [href*="/arcade/emoji-rush"] { --game-color: #dab36c; }
html[data-sneebo-theme] body [href*="/arcade/shape-swipe"] { --game-color: #a593c7; }
html[data-sneebo-theme] body [href*="/arcade/pattern-match"] { --game-color: #83b4ad; }
html[data-sneebo-theme] body [href*="/arcade/maze-escape"] { --game-color: #a8b584; }
html[data-sneebo-theme] body [href*="/arcade/breakout"] { --game-color: #d39b80; }
html[data-sneebo-theme] body [href*="/arcade/candy-match"] { --game-color: #d78da9; }
html[data-sneebo-theme] body [href*="/arcade/flow-free"] { --game-color: #83b5b8; }
html[data-sneebo-theme] body [href*="/arcade/word-chain"] { --game-color: #a3adc9; }

html[data-sneebo-theme] :is(.mobile-quick-card > i, .mobile-game-link > i:first-child,
.site-game-icon) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border: 1px solid color-mix(in srgb, var(--game-color) 30%, var(--site-border));
    border-radius: 50%;
    color: var(--game-color);
    background: color-mix(in srgb, var(--game-color) 12%, var(--site-bg));
    font-size: 23px;
}

html[data-sneebo-theme] .mobile-game-link > i:first-child {
    width: 34px;
    height: 34px;
    font-size: 20px;
}

html[data-sneebo-theme] .mobile-together > i:first-child {
    color: #91b3c7;
}

html[data-sneebo-theme] body .mobile-bottom-nav {
    background: var(--site-bg);
    border-color: var(--site-border);
    box-shadow: none;
}

html[data-sneebo-theme] .mobile-bottom-nav .nav-item {
    color: var(--site-muted);
    background: transparent;
}

html[data-sneebo-theme] .mobile-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 32px;
    border-radius: 16px;
}

html[data-sneebo-theme] .mobile-nav-icon > i {
    font-size: 23px;
    line-height: 1;
}

html[data-sneebo-theme] .mobile-bottom-nav .nav-item.active {
    background: transparent;
    color: var(--site-text);
}

html[data-sneebo-theme] .mobile-bottom-nav .nav-item.active .mobile-nav-icon {
    background: var(--site-primary);
    color: var(--site-primary-text);
}

html[data-sneebo-theme] .mobile-chat-count {
    background: var(--site-selected);
    color: #c2d5ef;
}

html[data-sneebo-theme] :is(.chat-suggestion-item:hover, .emoji-picker,
.emoji-picker-popover, .user-menu-offcanvas, .channel-sidebar,
.message-context-menu, .chat-sidebar, .chat-suggestions) {
    background: var(--site-surface) !important;
    color: var(--site-text);
    border-color: var(--site-border);
}

html[data-sneebo-theme] :is(.chat-message, .message-bubble, .pm-message,
.channel-info-polls-link, .channel-info-emojis-link, .game-command-btn) {
    border-color: var(--site-border);
}

html[data-sneebo-theme] :is(.chat-input-group #sendButton, .chat-reply-preview) {
    background: var(--site-selected);
    color: var(--site-link);
}

html[data-sneebo-theme] :is(.reaction-target, .at-playfield, .bo-canvas-wrap,
.mz-playfield, .pm-game-area, .cm-board, .ff-overlay, .pm-game-over-content,
.hm-modal, .result-modal-content, .waiting-modal-card, .no-coins-modal-content,
.at-game-over-modal, .arcade-modal-card, .wc-pause-overlay, .ff-modal) {
    border-color: var(--site-border);
    box-shadow: none;
}

html[data-sneebo-theme] .reaction-target:not(.waiting):not(.ready):not(.too-soon) {
    background: var(--site-surface);
    color: var(--site-text);
}

html[data-sneebo-theme] :is(.login-card, .brand-logo) {
    box-shadow: none !important;
}

html[data-sneebo-theme] .login-home .login-card {
    background: transparent !important;
}

html[data-sneebo-theme] :is(.flow-login-btn, .btn-play) {
    text-transform: none;
    letter-spacing: 0;
}

html[data-sneebo-theme] body.mobile-home .mobile-quick-card > i {
    color: var(--game-color);
    background: color-mix(in srgb, var(--game-color) 12%, var(--site-bg));
    border-color: color-mix(in srgb, var(--game-color) 30%, var(--site-border));
}

html[data-sneebo-theme] :is(.ff-btn, .btn-reaction-primary, .at-game-over-btn.primary) {
    background: var(--site-primary) !important;
    color: var(--site-primary-text) !important;
    border-color: var(--site-primary) !important;
    box-shadow: none !important;
}

html[data-sneebo-theme] :is(.ff-header, .ff-leaderboard, .ff-achievements,
.ff-modal, .ff-modal-header, .ff-modal-overlay .ff-modal,
.flow-login-container, .flow-login-container .flow-login-field) {
    background: var(--site-surface);
    color: var(--site-text);
    border-color: var(--site-border);
    box-shadow: none;
}

html[data-sneebo-theme] :is(.ff-title, .ff-modal-title, .ff-stat-value,
.flow-login-title, .flow-login-subtitle) {
    color: var(--site-text) !important;
    text-shadow: none !important;
}

html[data-sneebo-theme] .login-card .brand-logo {
    max-width: 56px;
    max-height: 56px;
    padding: 0;
    background: transparent;
    border: 0;
}

html[data-sneebo-theme] .at-target {
    background: radial-gradient(circle, var(--site-text) 0 18%, var(--site-primary) 19% 42%, var(--site-link) 43%);
    border-color: var(--site-text);
}


html[data-sneebo-theme] .mobile-hero h1 {
    max-width: 310px;
}

html[data-sneebo-theme] .chat-view .container > .row {
    margin-left: 0;
    margin-right: 0;
}

html[data-sneebo-theme] :is(.onboarding-card, .avatar-nudge-card,
.logo-mode-button, .logo-option, .hide-list-cost) {
    background: var(--site-surface) !important;
    color: var(--site-text) !important;
    border-color: var(--site-border) !important;
    box-shadow: none !important;
}

html[data-sneebo-theme] :is(.logo-mode-button.is-active, .logo-option.is-active) {
    background: var(--site-selected) !important;
    border-color: var(--site-primary) !important;
}

html[data-sneebo-theme] .message {
    background: var(--site-surface);
}

html[data-sneebo-theme] .message.message-mine {
    background: var(--site-selected);
    border-left-color: var(--site-primary);
}

html[data-sneebo-theme] .message.system-message {
    background: var(--site-surface-muted);
    border-left-color: var(--site-border);
}

html[data-sneebo-theme] .message:hover {
    background: var(--site-surface-raised);
}

html[data-sneebo-theme] :is(.btn-danger, .btn-arcade-danger) {
    background: #b44455 !important;
    color: var(--site-primary-text) !important;
    border-color: #b44455 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    border-radius: 10px;
}

html[data-sneebo-theme] :is(.btn-danger, .btn-arcade-danger):hover {
    background: #a23b4b !important;
}

html[data-sneebo-theme] :is(.table-light, .table thead th) {
    --bs-table-bg: var(--site-surface-raised);
    --bs-table-color: var(--site-text);
    background: var(--site-surface-raised) !important;
    color: var(--site-text) !important;
    border-color: var(--site-border);
}

html[data-sneebo-theme] .rpg-park-page .park-container > div[style] > div[style] {
    background: var(--site-surface) !important;
    border: 1px solid var(--site-border);
}

html[data-sneebo-theme] [data-game-icon="line_duel"] { --game-color: #88a8d4; }
html[data-sneebo-theme] [data-game-icon="card_war"] { --game-color: #c5a47b; }
html[data-sneebo-theme] [data-game-icon="blackjack"] { --game-color: #c58c98; }

html[data-sneebo-theme] .arena-page .arena-card .site-game-icon {
    color: var(--game-color);
    background: color-mix(in srgb, var(--game-color) 12%, var(--site-bg));
    border: 1px solid color-mix(in srgb, var(--game-color) 30%, var(--site-border));
    border-radius: 50%;
    font-size: 23px;
}

html[data-sneebo-theme] a {
    color: var(--site-link);
}

html[data-sneebo-theme] :is(.chat-emoji-picker, .game-rules-modal-dialog,
.game-rules-modal-header, .poll-voters-modal-header, .text-bg-light) {
    background: var(--site-surface) !important;
    color: var(--site-text) !important;
    border-color: var(--site-border) !important;
    box-shadow: none !important;
}

html[data-sneebo-theme] body.game-mobile :is(.game-unranked, .game-demo) {
    color: #e5cc99;
    background: #302a20;
    border-color: #554830;
}

/* Keep conversation navigation on one accessible, compact row. */
html[data-sneebo-theme] body.mobile-chat {
    --mobile-nav-height: calc(48px + env(safe-area-inset-bottom, 0px));
}

html[data-sneebo-theme] body.mobile-chat .mobile-bottom-nav {
    padding-top: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

html[data-sneebo-theme] body.mobile-chat .mobile-bottom-nav .nav-item {
    min-height: 47px;
    flex-direction: row;
    gap: 5px;
    border-radius: 0;
}

html[data-sneebo-theme] body.mobile-chat .mobile-nav-icon {
    width: 32px;
    height: 28px;
    flex-shrink: 0;
}

html[data-sneebo-theme] body.mobile-chat .mobile-nav-icon > i {
    font-size: 20px;
}

html[data-sneebo-theme] body.mobile-chat .mobile-nav-label {
    font-size: 11px;
    gap: 3px;
}


/* Conversation menu stays readable and scrolls independently of the chat. */
html[data-sneebo-theme] body.mobile-chat .user-menu-offcanvas {
    width: min(380px, calc(100vw - 16px));
    max-width: calc(100vw - 16px);
    height: 100dvh;
    max-height: 100dvh;
    font-size: 14px;
}

html[data-sneebo-theme] .user-menu-offcanvas .offcanvas-header {
    flex-shrink: 0;
    gap: 12px;
    min-height: 60px;
    padding: max(12px, env(safe-area-inset-top, 0px)) 16px 12px;
    border-bottom: 1px solid var(--site-border);
}

html[data-sneebo-theme] .user-menu-offcanvas .offcanvas-header > div {
    min-width: 0;
    overflow-wrap: anywhere;
}

html[data-sneebo-theme] .user-menu-offcanvas .btn-close {
    flex-shrink: 0;
    min-width: 24px;
    min-height: 24px;
    padding: 10px;
    margin: 0;
}

html[data-sneebo-theme] .user-menu-offcanvas .offcanvas-body {
    min-height: 0;
    padding: 16px 12px max(20px, env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
}

html[data-sneebo-theme] .user-menu-offcanvas .user-menu-profile {
    padding: 0 4px 16px;
    margin: 0;
    border-bottom: 1px solid var(--site-border);
}

html[data-sneebo-theme] .user-menu-offcanvas .user-menu-section {
    margin-top: 16px;
}

html[data-sneebo-theme] .user-menu-offcanvas .user-menu-section-title {
    color: var(--site-muted);
    font-size: 12px;
    line-height: 1.5;
    text-transform: none;
    letter-spacing: 0;
    margin-bottom: 6px;
}

html[data-sneebo-theme] .user-menu-offcanvas .user-menu-row {
    min-height: 48px;
    padding: 10px;
    gap: 8px;
    font-size: 14px;
    line-height: 1.4;
}

html[data-sneebo-theme] .user-menu-offcanvas .user-menu-row > span:first-child {
    min-width: 0;
    overflow-wrap: anywhere;
}

html[data-sneebo-theme] .user-menu-offcanvas .user-menu-row > span:first-child > i {
    flex-shrink: 0;
    width: 20px;
    font-size: 20px;
}

html[data-sneebo-theme] .user-menu-offcanvas .user-menu-row-meta {
    flex-shrink: 0;
    gap: 5px;
}

html[data-sneebo-theme] .user-menu-offcanvas .user-menu-lang-btn {
    min-width: 40px;
    min-height: 40px;
    font-size: 13px;
}

html[data-sneebo-theme] .user-menu-channel > summary {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 10px;
    border: 1px solid var(--site-border);
    border-radius: 10px;
    cursor: pointer;
    list-style: none;
}

html[data-sneebo-theme] .user-menu-channel > summary::-webkit-details-marker {
    display: none;
}

html[data-sneebo-theme] .user-menu-channel > summary > span {
    flex: 1;
    min-width: 0;
}

html[data-sneebo-theme] .user-menu-channel[open] > summary > i:last-child {
    transform: rotate(180deg);
}

html[data-sneebo-theme] .user-menu-channel .channel-info-card {
    margin: 8px 0 0;
    overflow-wrap: anywhere;
}

html[data-sneebo-theme] .user-menu-offcanvas .user-menu-list {
    background: var(--site-bg);
    border-color: var(--site-border);
}

html[data-sneebo-theme] .user-menu-offcanvas .user-menu-row {
    color: var(--site-text);
}

html[data-sneebo-theme] .user-menu-offcanvas .user-menu-list .user-menu-row + .user-menu-row {
    border-color: var(--site-border);
}

html[data-sneebo-theme] .user-menu-offcanvas .user-menu-lang-btn.is-active {
    background: var(--site-primary);
    border-color: var(--site-primary);
    color: var(--site-primary-text);
}

html[data-sneebo-theme] .user-menu-offcanvas .user-menu-profile-info > a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 8px 12px;
    font-size: 13px;
}


html[data-sneebo-theme] .channel-last-message {
    color: var(--site-muted);
    font-size: 12px;
}

html[data-sneebo-theme] .game-share-action,
html[data-sneebo-theme] .chat-game-challenge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: 8px 12px;
    white-space: normal;
    overflow-wrap: anywhere;
}

html[data-sneebo-theme] .chat-game-challenge {
    margin-top: 6px;
    border: 1px solid var(--site-border-strong);
    border-radius: 8px;
    color: var(--site-link);
    text-decoration: none;
}

html[data-sneebo-theme] .game-challenge-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    margin: 10px 12px;
    border: 1px solid var(--site-border);
    border-radius: 10px;
    background: var(--site-selected);
    color: var(--site-text);
    font-size: 14px;
}

html[data-sneebo-theme] .game-share-action[hidden] {
    display: none !important;
}


/* A shared return action keeps its destination visible without crowding the header. */
html[data-sneebo-theme] body a.chat-back-link {
    display: inline-flex !important;
    align-items: center;
    justify-content: flex-start;
    gap: 9px;
    min-width: 0;
    min-height: 48px;
    max-width: min(100%, 260px);
    padding: 7px 12px 7px 8px;
    border: 1px solid var(--site-border-strong) !important;
    border-radius: 12px !important;
    background: var(--site-selected) !important;
    color: var(--site-text) !important;
    box-shadow: none !important;
    text-decoration: none;
    text-align: left;
    white-space: normal;
    text-transform: none;
    letter-spacing: normal;
}

html[data-sneebo-theme] body a.chat-back-link::before,
html[data-sneebo-theme] body a.chat-back-link::after {
    display: none !important;
}

html[data-sneebo-theme] .chat-back-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--site-primary);
    color: var(--site-primary-text);
}

html[data-sneebo-theme] .chat-back-arrow > i {
    font-size: 22px;
    line-height: 1;
}

html[data-sneebo-theme] .chat-back-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 1px;
}

html[data-sneebo-theme] .chat-back-title {
    color: var(--site-text);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
}

html[data-sneebo-theme] .chat-back-destination {
    overflow: hidden;
    color: var(--site-link);
    font-size: 12px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

html[data-sneebo-theme] body a.chat-back-link:hover {
    border-color: var(--site-link) !important;
}

html[data-sneebo-theme] .navbar .chat-back-link {
    max-width: min(46vw, 190px);
    flex-shrink: 1;
}

html[data-sneebo-theme] .navbar .ms-auto:has(> .chat-back-link) {
    min-width: 0;
}

/* Compact live chat state, using the existing graphite and blue palette. */
.chat-live-strip{display:flex;gap:.5rem;min-width:0;padding:0 .25rem .35rem;color:#a9afb9;font-size:.78rem;line-height:1.35}
.chat-live-strip[hidden],.chat-unread-button[hidden],.chat-live-strip [hidden]{display:none!important}
#chatTypingState{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat-unread-button{position:fixed;right:1rem;bottom:calc(4rem + env(safe-area-inset-bottom));z-index:1040;max-width:calc(100vw - 2rem);padding:.6rem .9rem;border:1px solid #5688c8;border-radius:1.5rem;background:#28548c;color:#f1f5fa;font-size:.85rem;box-shadow:0 3px 12px #0004}
.chat-unread-button:focus-visible{outline:2px solid #a3c4ef;outline-offset:3px}
.chat-is-unread{box-shadow:-2px 0 #5688c8}
.channel-unread-badge{display:inline-block;margin-left:.35rem;padding:.1rem .4rem;border-radius:1rem;background:#3473c7;color:#fff;font-size:.7rem;font-weight:600;vertical-align:middle}

.channel-unread-badge[hidden]{display:none!important}

html.chat-manual-scroll{overflow-anchor:none}

/* Subtle message motion, without changing message height or reading position. */
#chatTypingState{display:inline-flex;align-items:center;gap:.35rem}
#chatTypingState>span:first-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat-typing-dots{display:inline-flex;align-items:center;gap:3px;flex-shrink:0;height:14px}
.chat-typing-dots i{display:block;width:4px;height:4px;border-radius:50%;background:#91a9c8;animation:chat-typing-dot 1.2s ease-in-out infinite}
.chat-typing-dots i:nth-child(2){animation-delay:.16s}
.chat-typing-dots i:nth-child(3){animation-delay:.32s}
@keyframes chat-typing-dot{0%,60%,100%{transform:translateY(0);opacity:.4}30%{transform:translateY(-3px);opacity:1}}
#sendButton.is-loading:not(.is-refreshing) .send-icon i{display:inline-block;animation:chat-send-flight .34s ease-out}
@keyframes chat-send-flight{0%{transform:translate(0,0);opacity:1}55%{transform:translate(8px,-6px) rotate(-10deg);opacity:.2}56%{transform:translate(-4px,3px);opacity:0}100%{transform:translate(0,0);opacity:1}}
@media(prefers-reduced-motion:reduce){.chat-typing-dots i,#sendButton.is-loading:not(.is-refreshing) .send-icon i{animation:none!important}}

.chat-history-button{display:block;margin:1rem auto 1.5rem;padding:.65rem 1rem;background:#232428;color:#c3ccda;border:1px solid #3b414c;border-radius:12px;font-size:.85rem}
.chat-history-button[hidden]{display:none}
.chat-tools{display:inline-flex;align-items:center;gap:.35rem;margin-left:.3rem;vertical-align:middle}
.chat-more-button{border:0;background:transparent;color:#9ca9bc;font-weight:700;padding:0 .35rem;min-width:30px;min-height:30px;line-height:1;border-radius:8px}
.chat-more-button:hover,.chat-more-button:focus-visible{background:#303641;color:#dbe8fa}
.chat-edited{font-size:.65rem;color:#929ba8;font-style:italic}
.chat-reactions{display:flex;gap:.3rem;flex-wrap:wrap;margin:.25rem 0 .2rem}
.chat-reaction{padding:.15rem .45rem;border-radius:12px;border:1px solid #3b414c;background:#292d34;color:#c8d0dc;font-size:.75rem;min-height:28px}
.chat-reaction.is-mine{background:#243e60;border-color:#5688c8;color:#edf4ff}
.chat-message-deleted .chat-message-text{color:#929ba8;font-style:italic}
[data-chat-message-id]{touch-action:pan-y pinch-zoom}
.chat-message-dialog{width:min(420px,calc(100vw - 24px));max-height:calc(100dvh - 32px);padding:0;border:1px solid #414854;border-radius:20px;background:#232428;color:#dbe3ee;box-shadow:0 12px 48px #0006}
.chat-message-dialog::backdrop{background:#0009}
.chat-message-dialog-body{padding:1rem;display:flex;flex-direction:column;gap:.45rem;min-width:0}
.chat-sheet-quote{font-size:.85rem;color:#a9b3c2;overflow-wrap:anywhere;margin:.25rem 0 .5rem;max-height:6rem;overflow:auto}
.chat-sheet-button{padding:.7rem .8rem;text-align:left;border:0;border-radius:10px;background:#2c3038;color:#dbe3ee;min-height:44px}
.chat-sheet-button:hover,.chat-sheet-button:focus-visible{background:#343e4c}
.chat-sheet-button.is-danger{color:#e7a3a7}
.chat-reaction-choices{display:grid;grid-template-columns:repeat(4,1fr);gap:.4rem;margin-bottom:.3rem}
.chat-reaction-choices button{text-align:center;font-size:1.35rem}
.chat-message-dialog textarea{width:100%;padding:.65rem;border-radius:10px;border:1px solid #4b586b;background:#191a1d;color:#e0e7f1;resize:vertical;font-size:1rem}
.channel-preview{display:block;font-size:.76rem;color:#aab3c0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
@media(max-width:575px){.chat-message-dialog{margin:auto auto max(12px,env(safe-area-inset-bottom));border-radius:20px}}

.chat-channel-display .chat-channel-text{min-width:0;flex-shrink:1}
.chat-connection-indicator{display:inline-flex;align-items:center;justify-content:center;flex:0 0 24px;width:24px;min-height:28px;padding:2px;border:0;border-radius:7px;background:transparent;color:#d0ae64;cursor:pointer}
#chatConnectionIndicator i{font-size:15px;line-height:1}
.chat-connection-indicator[data-state="live"]{color:#79b792}
.chat-connection-indicator[data-state="offline"]{color:#929ba8}
.chat-connection-indicator:hover{background:#ffffff0a}
.chat-connection-indicator:focus-visible{outline:0;box-shadow:inset 0 0 0 2px #91b8e8}
.chat-connection-detail{position:fixed;z-index:1060;width:max-content;max-width:min(260px,calc(100vw - 24px));padding:.65rem .8rem;border:1px solid #465365;border-radius:10px;background:#252b34;color:#dbe3ef;font-size:.8rem;line-height:1.45;box-shadow:0 5px 18px #0005;white-space:normal}
.chat-connection-detail[hidden]{display:none}

.chat-reaction-picker{display:flex;flex-direction:column;gap:.4rem;min-width:0}
.chat-reaction-search{width:100%;min-width:0;padding:.55rem .65rem;border:1px solid #465365;border-radius:10px;background:#191a1d;color:#dbe3ef;font-size:1rem}
.chat-reaction-status{font-size:.75rem;color:#a9b4c4;line-height:1.35}
.chat-reaction-catalog{grid-template-columns:repeat(auto-fill,minmax(38px,1fr));max-height:min(210px,30dvh);overflow-y:auto;overscroll-behavior:contain;padding:2px;margin:0}
.chat-reaction-catalog .chat-sheet-button{display:flex;justify-content:center;align-items:center;min-width:0;min-height:42px;padding:.25rem}
.chat-reaction-catalog .chat-sheet-button.is-selected{background:#243e60;box-shadow:inset 0 0 0 1px #5688c8}
.chat-reaction-image{display:inline-block;width:25px;height:25px;object-fit:contain;vertical-align:middle;flex-shrink:0}
.chat-reaction{display:inline-flex;align-items:center;gap:.25rem}
.chat-reaction .chat-reaction-image{width:20px;height:20px}
.chat-reaction-more{padding:.4rem .7rem;font-size:.8rem;text-align:center;min-height:36px}
.chat-reaction-more[hidden]{display:none}

.chat-reaction-code{display:inline-block;max-width:10rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat-reaction-catalog .chat-sheet-button{overflow:hidden}

/* Room-scoped message search and reaction participants */
.chat-find-heading{font-size:1.05rem;margin:0 0 .75rem;color:inherit}
.chat-find-body{min-width:0}.chat-find-form{display:flex;gap:.5rem;align-items:center}.chat-find-form input{min-width:0;flex:1;margin:0}.chat-find-form button{width:auto;flex-shrink:0}
.chat-find-list{max-height:48dvh;overflow-y:auto;overscroll-behavior:contain;overflow-wrap:anywhere}
.chat-find-result{padding:.75rem 0;border-bottom:1px solid rgba(150,165,185,.18)}.chat-find-result small{display:block;opacity:.65;font-size:.72rem}.chat-find-result p{white-space:pre-wrap;margin:.4rem 0}.chat-find-person{padding:.5rem 0;margin:0;border-bottom:1px solid rgba(150,165,185,.14)}.chat-find-open{margin:.25rem auto!important;font-size:.8rem;padding:.35rem .75rem!important}.chat-find-highlight{outline:2px solid #729ac7;outline-offset:3px;border-radius:8px}

.chat-search-icon{display:inline-flex;align-items:center;justify-content:center;flex:0 0 28px;width:28px;min-height:32px;padding:2px;border:0;border-radius:7px;background:transparent;color:#91b8e8;cursor:pointer;font-size:18px}.chat-search-icon:hover{background:#ffffff0a}.chat-search-icon:focus-visible{outline:2px solid #91b8e8;outline-offset:1px}

.chat-navbar .chat-channel-display{flex:1 1 0;max-width:none;min-width:0}.chat-navbar .chat-channel-text{flex:1 1 0;min-width:0}.chat-navbar .chat-channel-name{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
