/* Visual parity with Android 6.25: backgrounds, artwork and the Anime sunset palette. */
body { --mess-page-background: url('assets/wallpapers/page_light.svg'); }
body.dark-theme { --mess-page-background: url('assets/wallpapers/page_dark.svg'); }
body.glass-theme { --mess-page-background: radial-gradient(circle at 8% 4%,rgba(43,138,232,.34),transparent 34%),radial-gradient(circle at 94% 21%,rgba(134,83,214,.27),transparent 38%),radial-gradient(circle at 70% 90%,rgba(14,167,157,.16),transparent 36%),linear-gradient(145deg,#0c1629 0%,#121d36 48%,#0a1425 100%); }
html.anime-theme { background: #241422; color-scheme: dark; }
html.anime-theme body, body.anime-theme.dark-theme {
    --mess-page-background: url('assets/wallpapers/page_anime.svg');
    --bg-app: #241422; --bg-white: #6a314a; --text-dark: #fff5ef; --text-gray: #f4c0c5;
    --chat-center-bg: #281628; --blue-accent: #0a84ff; --input-bg: #813f59;
    --msg-me-bg: linear-gradient(135deg,rgba(255,156,99,.819608),rgba(236,74,122,.819608));
    --msg-me-text: #fff; --msg-other-bg: rgba(240,226,218,.831373); --msg-other-text: #4c2637;
    --chat-sheet-bg: #241422; --chat-field-bg: #813f59;
    --profile-bg: #241422; --profile-center-bg: transparent; --profile-card-bg: #6a314a;
    --profile-info-main-text: #fff5ef; --profile-info-sub-text: #f4c0c5; --profile-info-icon: #0a84ff;
    --profile-btn-bg: #813f59; --profile-border: transparent; --profile-list-border: transparent;
    --border-color: #a85d73; --bg-main: #241422;
    color-scheme: dark;
}
body #chats-list-screen, body #settings-screen, body #auth-screen,
body #call-screen, body.glass-theme #call-screen, body.anime-theme.dark-theme #call-screen {
    background: var(--mess-page-background) center / 100% 100% no-repeat !important;
}
body #chats-list-screen .chats-scroll-wrap, body #chats-list-screen .chat-list,
body #settings-screen .settings-scroll-wrap, body #settings-screen .settings-sections,
body #feed-list-container {
    background: transparent !important;
}
/* A sibling of the scrollable messages: artwork never stretches with overscroll. */
#chat-wallpaper-layer { position:absolute; pointer-events:none; z-index:0; background-position:center; background-size:cover; background-repeat:no-repeat; }
#chat-wallpaper-layer[hidden] { display:none; }
#messages.has-art-wallpaper { position:relative; background:transparent !important; }
#messages.has-art-wallpaper .chat-background-pattern { display:none; }
#chat-wallpaper-grid > div { width:100%; min-width:0; }
/* The existing desktop layout stays intact; expose its wallpaper picker as on mobile. */
@media(min-width:700px) { #wallpaper-btn { display:flex !important; } }

/* Anime bars use one solid color, including the composer outside the input field. */
body.anime-theme.dark-theme .header-large, body.anime-theme.dark-theme .header-small,
body.anime-theme.dark-theme #settings-screen .header-large, body.anime-theme.dark-theme .bottom-nav-bar,
body.anime-theme.dark-theme #input-area, body.anime-theme.dark-theme #call-screen-header,
body.anime-theme.dark-theme #call-screen .header {
    background:#241422 !important; border-color:transparent !important; box-shadow:none !important;
    backdrop-filter:none; -webkit-backdrop-filter:none;
}
body.anime-theme.dark-theme #splash-screen { background:#241422; }
body.anime-theme.dark-theme #msg-form { background:#813f59 !important; border-color:transparent; }
body.anime-theme.dark-theme #msg-input { background:transparent !important; }
body.anime-theme.dark-theme input::placeholder, body.anime-theme.dark-theme textarea::placeholder { color:#f4c0c5; opacity:1; }
body.anime-theme.dark-theme #sticker-btn svg { stroke:#0a84ff !important; opacity:1 !important; }
body.anime-theme.dark-theme #search-users-modal > div,
body.anime-theme.dark-theme #group-create-modal > div { background:var(--mess-page-background) center / 100% 100% no-repeat !important; }
body.anime-theme.dark-theme .modal-box, body.anime-theme.dark-theme .user-profile-sheet,
body.anime-theme.dark-theme #chat-wallpaper-sheet, body.anime-theme.dark-theme #sticker-panel {
    background:#6a314a !important; color:#fff5ef;
}
body.anime-theme.dark-theme .header-app-title, body.anime-theme.dark-theme .app-title { color:#fff5ef; }
body.anime-theme.dark-theme .call-name { color:#fff5ef; }
body.anime-theme.dark-theme .call-status, body.anime-theme.dark-theme #call-type-label { color:#f4c0c5 !important; }
body.anime-theme.dark-theme .call-avatar { background:#6a314a !important; }
body.anime-theme.dark-theme .call-log-pill { background:#6a314a; }

/* Filled bubbles match the latest native alpha values. Real media stays untouched. */
body.anime-theme.dark-theme .msg.other:not(.msg-photo):not(.msg-video):not(.system-msg):not(.chat-post-message),
body.anime-theme.dark-theme .msg.other.poll-message { background:var(--msg-other-bg) !important; color:#4c2637 !important; }
body.anime-theme.dark-theme .msg.me:not(.msg-photo):not(.msg-video):not(.system-msg):not(.chat-post-message),
body.anime-theme.dark-theme .msg.me.poll-message { background:var(--msg-me-bg) !important; color:#fff !important; }
body.anime-theme.dark-theme .msg.chat-post-message:not(.msg-photo) { background:rgba(106,49,74,.8) !important; color:#fff5ef !important; }
body.anime-theme.dark-theme .msg.other:not(.chat-post-message):not(.msg-photo):not(.msg-video) .msg-time,
body.anime-theme.dark-theme .msg.other:not(.chat-post-message):not(.msg-photo):not(.msg-video) .msg-inline-meta,
body.anime-theme.dark-theme .msg.other:not(.chat-post-message):not(.msg-photo):not(.msg-video) .poll-question,
body.anime-theme.dark-theme .msg.other:not(.chat-post-message) .poll-footer,
body.anime-theme.dark-theme .msg.other:not(.chat-post-message) .poll-footer .msg-time { color:#673747 !important; }
body.anime-theme.dark-theme .msg.other .eq-v5 .bar { background:#ba9da5 !important; }
body.anime-theme.dark-theme .msg.other .eq-v5 .bar.played { background:#690f31 !important; box-shadow:none !important; }
body.anime-theme.dark-theme .msg.other:not(.chat-post-message):not(.msg-photo):not(.msg-video) .msg-photo-text { color:#4c2637 !important; }
body.anime-theme.dark-theme .poll-option { background:#6a314a; color:#fff5ef; border-color:#964c69; }
body.anime-theme.dark-theme .poll-option-percent { color:#fff5ef; }
body.anime-theme.dark-theme .poll-option-fill { background:rgba(255,111,134,.32); }
body.anime-theme.dark-theme .msg.me .poll-question, body.anime-theme.dark-theme .msg.me .poll-footer,
body.anime-theme.dark-theme .msg.me .poll-footer .msg-time { color:#fff !important; }

body.glass-theme { --msg-me-bg:linear-gradient(135deg,rgba(24,137,255,.8),rgba(91,82,255,.8)); --msg-other-bg:rgba(48,60,82,.8); }
body.glass-theme .msg.other:not(.msg-photo):not(.msg-video):not(.system-msg):not(.chat-post-message),
body.glass-theme #messages.has-custom-wallpaper .msg.other:not(.msg-photo):not(.msg-video):not(.system-msg):not(.chat-post-message) { background:rgba(48,60,82,.8) !important; }
body.glass-theme .msg.chat-post-message:not(.msg-photo) { background:rgba(45,62,82,.8) !important; }
