/* Allowlisted, bundled cosmetics. Selection wins over the default identity art. */
.sd-profile-cover{background-image:var(--sd-profile-cover)!important;background-size:cover!important;background-position:center!important}
.sd-profile-cover::before,.sd-profile-cover::after,.sd-profile-cover>.profile-cover-emblem,.sd-profile-cover>.profile-cover-glow,.sd-profile-cover>.lobby-profile-cover-mark,.sd-profile-cover>.lobby-profile-cover-glow,.sd-profile-cover>.sdpp-cover-mark{display:none!important}

/* The frame decorates text only; sender metadata and avatars stay outside it. */
/* Fill under the ornament, then paint the frame above it. Both stretch together. */
.sd-decorated-message{position:relative;isolation:isolate;box-sizing:border-box!important;border:solid transparent!important;border-width:16px 20px 14px!important;border-radius:0!important;border-image:none!important;padding:6px 10px!important;background:transparent!important;width:fit-content;min-width:76px;max-width:100%;color:#edf3f5!important;box-shadow:none!important;overflow-wrap:anywhere;line-height:1.65}
.sd-decorated-message::before{content:"";position:absolute;inset:-9px -13px -8px;border-radius:10px;background:var(--sd-bubble-fill,#24212e);z-index:-1;pointer-events:none}
.sd-decorated-message::after{content:"";position:absolute;inset:-16px -20px -14px;border:solid transparent;border-width:16px 20px 14px;border-image-source:var(--sd-bubble-frame);border-image-slice:55 85 50 85;border-image-repeat:stretch;pointer-events:none;z-index:1}
.sd-decorated-message p,.sd-decorated-message .sd-chat-text,.sd-decorated-message span{color:#edf3f5!important}


#community-chat-messages>.community-chat-message{display:grid;grid-template-columns:34px minmax(0,1fr);gap:10px;align-items:start;width:fit-content;max-width:100%;flex-shrink:0}
#community-chat-messages>.community-chat-message>.community-chat-avatar{grid-column:1;grid-row:1;align-self:start;width:34px;height:34px;min-width:34px;max-width:34px;min-height:34px;max-height:34px;aspect-ratio:1;flex:none;box-sizing:border-box}
#community-chat-messages>.community-chat-message>.community-chat-content{grid-column:2;grid-row:1;display:flex;flex-direction:column;align-items:flex-start;gap:5px;min-width:0;max-width:100%}
#community-chat-messages>.community-chat-message.me{grid-template-columns:minmax(0,1fr) 34px}
#community-chat-messages>.community-chat-message.me>.community-chat-avatar{grid-column:2}
#community-chat-messages>.community-chat-message.me>.community-chat-content{grid-column:1;align-items:flex-end}
#community-chat-messages .community-chat-avatar img{display:block;width:100%;height:100%;object-fit:cover;aspect-ratio:1}
#community-chat-messages .community-chat-meta{direction:rtl;display:flex;align-items:baseline;gap:8px;margin:0;max-width:100%;line-height:1.5}
#community-chat-messages .community-chat-meta strong{font-size:12px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text,#e7edef)}
#community-chat-messages .community-chat-meta time{font-size:10px;white-space:nowrap;flex:none;color:var(--muted,#92a8b0)}
#community-chat-messages .community-chat-bubble{font-size:14px;max-width:100%}
#community-chat-messages .community-chat-bubble p{font-size:14px;margin:0;line-height:1.7}

#sd-chat-messages .sd-chat-message{display:grid!important;grid-template-columns:30px minmax(0,1fr);gap:9px!important;align-items:start!important;width:fit-content;max-width:100%}
#sd-chat-messages .sd-chat-avatar{grid-column:1;grid-row:1;width:30px!important;height:30px!important;min-width:30px;max-width:30px;min-height:30px;max-height:30px;aspect-ratio:1;box-sizing:border-box;align-self:start;flex:none!important}
#sd-chat-messages .sd-chat-avatar img{display:block;width:100%;height:100%;object-fit:cover;aspect-ratio:1}
#sd-chat-messages .sd-chat-content{grid-column:2;grid-row:1;display:flex;flex-direction:column;align-items:flex-start;gap:5px;min-width:0;max-width:100%}
#sd-chat-messages .sd-chat-message.me{grid-template-columns:minmax(0,1fr) 30px}
#sd-chat-messages .sd-chat-message.me>.sd-chat-avatar{grid-column:2}
#sd-chat-messages .sd-chat-message.me>.sd-chat-content{grid-column:1;align-items:flex-end}
#sd-chat-messages .sd-chat-meta{direction:rtl;display:flex;align-items:baseline;gap:8px;max-width:100%;line-height:1.5}
#sd-chat-messages .sd-chat-meta .sd-chat-name{font-size:12px!important;color:#c9b88f!important;margin:0}
#sd-chat-messages .sd-chat-meta time{font-size:10px;white-space:nowrap;color:#92a8b0}
#sd-chat-messages .sd-chat-message-body{max-width:100%;font-size:14px}

/* Product previews use the same frame and text padding as real messages. */
.store-chat-sample{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;width:100%;height:164px;padding:10px!important;box-sizing:border-box;filter:none!important}
.store-chat-preview-meta{display:flex;align-items:baseline;gap:8px;direction:rtl;color:var(--muted,#97acb5);font:11px/1.5 system-ui}
.store-chat-preview-meta strong{font-weight:600;color:var(--text,#e7edef)}
.store-chat-preview-meta small{font-size:10px}
.store-chat-preview{width:100%;max-width:280px;direction:rtl;text-align:right;font:14px/1.65 system-ui}
.store-chat-preview:not(.sd-decorated-message){border:1px solid var(--line,#78939a);border-radius:14px;padding:10px 14px;background:var(--panel,#152832);color:var(--text,#edf3f5)}
.store-item-card .store-chat-preview{font-size:12px}
.store-item-card .store-banner-art{height:164px;width:100%;object-fit:cover;border-radius:12px;padding:0}
.store-product-sheet.has-chat-preview .store-product-art{height:180px;padding:12px}
@media(max-width:600px){.store-chat-sample{height:132px;padding:4px!important}.store-item-card .store-chat-preview{font-size:12px}.store-item-card .store-banner-art{height:132px}.store-product-sheet.has-chat-preview .store-product-art{height:150px;padding:8px}}
.sd-chat-sticker-art{display:block;width:100px;height:100px}.sd-chat-sticker-art>img,.sd-chat-sticker-art>svg{width:100%;height:100%;object-fit:contain}
.sd-chat-sticker-picker{border:1px solid #8eaaae55;border-radius:20px;padding:20px;max-width:min(400px,90vw);background:#f6faf9;color:#263e43}.sd-chat-sticker-picker::backdrop{background:#10242b88}.sd-chat-sticker-picker button{padding:8px;border:0;border-radius:10px;cursor:pointer;background:#e5eeee;color:inherit}.sd-chat-sticker-picker .sd-sprite-badge{width:72px;height:72px;margin:6px}
#sd-chat .sd-sticker-message,.community-chat-message .sd-sticker-message{background:transparent!important;border:0!important;box-shadow:none!important;padding:0!important}

html[data-theme="dark"] .sd-chat-sticker-picker{background:#17272e;color:#e6eeee}html[data-theme="dark"] .sd-chat-sticker-picker button{background:#263940}

.sd-chat-sticker-picker{position:fixed;z-index:1200;box-sizing:border-box;width:320px;max-width:calc(100vw - 16px);max-height:min(360px,60dvh);overflow:auto;padding:12px;border:1px solid #8eaaae55;border-radius:16px;box-shadow:0 8px 28px #0003;background:#f6faf9;color:#263e43}
.sd-chat-sticker-picker header{display:flex;align-items:center;justify-content:space-between;padding:0 4px 8px;font-weight:600}
.sd-chat-sticker-picker header button{font-size:24px;width:32px;height:32px;padding:0;border:0;background:transparent;color:inherit}
.sd-sticker-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.sd-sticker-grid button{min-width:0;min-height:84px;border:0;background:transparent;display:grid;place-items:center;padding:4px}
.sd-sticker-grid p{grid-column:1/-1}
html[data-theme="dark"] .sd-chat-sticker-picker{background:#121c21;color:#e3ecef}

/* The match chat lives at z=15000; its picker must be above that layer. */
.sd-chat-sticker-picker{z-index:20050}
#sd-chat-shell>.sd-sticker-panel-mobile{position:absolute;left:8px;right:8px;bottom:64px;width:auto;max-height:min(300px,50dvh);z-index:20050}

/* Rounded artwork for the new game identities. */
img[src^="/room-sprites/art-20261106/"]{border-radius:16%;}
