@layer chat-interface {
  body.river-chat .message-list{padding:18px clamp(14px,3vw,46px)!important}
  body.river-chat .message,body.river-chat .message.own{width:100%!important;max-width:100%!important;margin:0!important;padding:8px 10px!important;flex-direction:row!important;align-items:flex-start!important;border-radius:7px!important;gap:14px!important}
  body.river-chat .message:hover{background:#ffffff0a!important}
  body.river-chat .message>.avatar{width:38px!important;height:38px!important;min-width:38px!important;font-size:12px!important;margin:2px 0 0!important}
  body.river-chat .message-content,body.river-chat .message.own .message-content{width:100%!important;max-width:100%!important;flex:1!important;padding:0!important;margin:0!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important}
  body.river-chat .message-author{margin-bottom:3px!important}
  body.river-chat .message-author strong{font-size:14px!important;color:var(--text)!important;font-weight:700!important}
  body.river-chat .message-author time,body.river-chat .message-author small{font-size:11px!important}
  body.river-chat .message-text{font-size:15px!important;line-height:1.55!important}
  body.river-chat .message-grouped{margin-top:0!important;padding-top:2px!important;padding-bottom:2px!important}
  body.river-chat .message-grouped>.avatar{visibility:hidden!important}
  body.river-chat .message-actions{top:-15px!important;right:10px!important}
  body.river-chat .message-receipt{margin:0 12px 6px auto!important}
  body.river-chat .game-card-v6{grid-template-columns:62px minmax(0,1fr) auto!important;gap:17px!important;min-height:166px!important;padding:22px!important;border:1px solid #ffffff14!important;border-radius:18px!important}
  body.river-chat .game-card-v6 strong{font-size:18px!important;line-height:1.2!important}
  body.river-chat .game-card-v6 small{font-size:12px!important;color:#b8bac2!important}
  body.river-chat .game-card-v6 p{font-size:14px!important;line-height:1.45!important;margin:7px 0!important;color:#c6c9d0!important}
  body.river-chat .game-card-v6 em{font-size:12px!important}
  body.river-chat .game-card-top span{font-size:11px!important;padding:4px 8px!important}
  body.river-chat .game-card-play{font-size:13px!important}
  body.river-chat .game-card-art{width:62px!important;height:62px!important}
  body.river-chat #messageForm #dictateQuick{display:grid!important;place-items:center!important;width:38px!important;min-width:38px!important;height:38px!important;min-height:38px!important;border-radius:12px!important}
  body.river-chat #messageForm #dictateQuick.active{color:#fff!important;background:#d0475e!important;animation:brMicPulse 1.2s ease-in-out infinite alternate}
  body.river-chat .camera-capture{color:var(--text)!important;gap:18px!important}
  body.river-chat .camera-toolbar{align-items:center!important;flex-wrap:wrap!important}
  body.river-chat .capture-mode-switch{display:flex!important;gap:4px!important;padding:4px!important;border:1px solid var(--line)!important;border-radius:99px!important;background:#18191d!important;margin:auto!important}
  body.river-chat .capture-mode-switch button{min-width:82px!important;min-height:38px!important;padding:7px 14px!important;border:0!important;border-radius:99px!important;color:#c8cbd2!important;background:transparent!important;font-size:13px!important;font-weight:700!important}
  body.river-chat .capture-mode-switch button[aria-pressed=true]{background:var(--accent)!important;color:#071427!important}
  body.river-chat .camera-preview{width:100%!important;max-height:min(58dvh,620px)!important;min-height:280px!important;aspect-ratio:16/9!important;background:#07090b!important}
  body.river-chat .camera-preview video,body.river-chat .camera-preview img{width:100%!important;height:100%!important;object-fit:contain!important}
  body.river-chat .camera-actions{gap:10px!important;padding:6px!important}
  body.river-chat .camera-shutter{display:grid!important;place-items:center!important;width:70px!important;height:70px!important;min-width:70px!important;min-height:70px!important;padding:6px!important;border:3px solid #f5f6f8!important;border-radius:50%!important;background:#111418!important;box-shadow:0 0 0 4px #0005!important}
  body.river-chat .camera-shutter span{width:100%!important;height:100%!important;border-radius:50%!important;background:#f5f6f8!important}
  body.river-chat .camera-shutter.video-shutter span{background:#fa4b61!important}
  body.river-chat .camera-shutter.video-shutter.recording span{width:52%!important;height:52%!important;border-radius:8px!important}
  body.river-chat .camera-screen-flash .camera-toolbar,body.river-chat .camera-screen-flash .camera-capture .hint{color:#17191d!important}
  body.river-chat .camera-screen-flash .camera-capture,body.river-chat .camera-screen-flash .camera-toolbar label,body.river-chat .camera-screen-flash #cameraStatus{color:#17191d!important}
  body.river-chat #callPanel.transparent-chat #callChatPanel{background:#090d13a6!important;backdrop-filter:blur(12px)!important}
  body.river-chat #callPanel.transparent-chat .call-chat-head,body.river-chat #callPanel.transparent-chat .call-chat-composer{background:transparent!important}
  body.river-chat #callPanel .call-top{cursor:move!important;touch-action:none!important}
  body.river-chat #callPanel .call-top button{cursor:pointer!important}
  body.river-chat .call-floating-messages{position:absolute;left:20px;bottom:92px;z-index:9;display:grid;gap:8px;width:min(390px,calc(100% - 40px));pointer-events:none}
  body.river-chat .call-floating-message{display:grid;gap:2px;padding:11px 14px;border:1px solid #ffffff30;border-radius:13px;background:#101419a8;color:#fff;backdrop-filter:blur(9px);box-shadow:0 6px 22px #0006;animation:brCallToast 15s linear forwards}
  body.river-chat .call-floating-message strong{font-size:11px;color:#b7d1ff}
  body.river-chat .call-floating-message span{font-size:14px;line-height:1.35;overflow-wrap:anywhere}
  body.river-chat .peer-photo-light{position:fixed;inset:0;z-index:999999;background:#fff;pointer-events:none;animation:brPhotoLight 1.2s ease-out forwards}
  body.river-chat .call-preferences{display:grid;gap:14px;max-width:530px}
  body.river-chat .call-preferences label{display:flex;justify-content:space-between;align-items:center;gap:18px;font-size:14px}
  body.river-chat .call-preferences input[type=checkbox]{width:22px;height:22px;accent-color:var(--accent)}
  body.river-chat .call-preferences input[type=range]{width:50%;accent-color:var(--accent)}
  body.river-chat .call-preferences p{font-size:12px;line-height:1.5;color:var(--muted)}
  body.river-chat .rich-profile-editor{max-width:820px;margin:auto}
  body.river-chat .profile-editor-preview{display:flex;align-items:end;gap:16px;min-height:175px;margin-bottom:22px;background:var(--profile-banner);background-size:cover;background-position:center}
  body.river-chat .profile-editor-preview strong{font-size:24px!important;color:#fff!important;text-shadow:0 2px 12px #000c}
  body.river-chat .profile-editor-fields{display:grid;gap:15px}
  body.river-chat .profile-editor-fields>label{display:grid;gap:6px;font-size:13px;font-weight:700}
  body.river-chat .profile-media-actions{display:flex;gap:8px;flex-wrap:wrap}
  body.river-chat .profile-media-actions .photo-choice{display:inline-flex;align-items:center;gap:7px;padding:10px 14px;border:1px solid var(--line);border-radius:12px;background:var(--panel2);font-size:13px;cursor:pointer}
  body.river-chat .profile-games-editor{display:grid;gap:9px;padding-top:18px;border-top:1px solid var(--line)}
  body.river-chat .profile-games-editor h3,body.river-chat .rich-profile-view h3{margin:0;font-size:16px}
  body.river-chat .profile-games-editor h3 small{color:var(--muted);font-size:12px}
  body.river-chat .profile-games-editor p{margin:0;color:var(--muted);font-size:13px}
  body.river-chat .profile-game-results{display:grid;gap:4px;max-height:260px;overflow:auto}
  body.river-chat .profile-game-results button{display:flex;align-items:center;gap:10px;text-align:left;padding:7px 10px;border:1px solid var(--line);border-radius:10px;background:var(--panel2);color:var(--text)}
  body.river-chat .profile-game-results button img{width:76px;height:36px;object-fit:cover;border-radius:5px}
  body.river-chat .profile-game-results button span{flex:1;font-size:13px}
  body.river-chat .profile-games-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:9px}
  body.river-chat .profile-game-tile{display:flex;align-items:center;gap:10px;min-width:0;padding:8px;border:1px solid var(--line);border-radius:12px;background:var(--panel2);cursor:pointer}
  body.river-chat .profile-game-tile>img{width:66px;height:48px;object-fit:cover;border-radius:7px}
  body.river-chat .profile-game-tile>span{display:grid;gap:3px;min-width:0;flex:1}
  body.river-chat .profile-game-tile strong{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  body.river-chat .profile-game-tile small{font-size:11px;color:var(--muted)}
  body.river-chat .profile-game-tile>button{border:0;background:transparent;color:var(--muted);padding:4px}
  body.river-chat .rich-profile-view{max-width:760px;margin:auto;display:grid;gap:20px}
  body.river-chat .rich-profile-view>header{height:180px;border-radius:17px;background-image:var(--profile-banner);background-size:cover;background-position:center}
  body.river-chat .rich-profile-identity{margin-top:-55px;padding:0 18px}
  body.river-chat .rich-profile-identity .avatar{width:90px!important;height:90px!important;border:5px solid var(--panel)}
  body.river-chat .rich-profile-identity h2{margin:8px 0 0;font-size:25px}
  body.river-chat .rich-profile-identity p{margin:4px 0;color:var(--muted)}
  body.river-chat .rich-profile-view>section{display:grid;gap:10px;padding:0 18px}
  body.river-chat .rich-profile-view>section p{margin:0;line-height:1.55;white-space:pre-wrap}
  body.river-chat .rich-profile-links{display:flex;flex-wrap:wrap;gap:7px}
  body.river-chat .rich-profile-links a{display:inline-flex;gap:5px;align-items:center;padding:8px 11px;border-radius:8px;background:var(--panel2);color:var(--accent)}
  body.river-chat .profile-game-detail{display:grid;gap:18px;max-width:900px;margin:auto}
  body.river-chat .profile-game-hero{display:block;width:100%;max-height:400px;object-fit:contain;background:#08090a;border-radius:14px}
  body.river-chat .profile-game-detail p{font-size:15px;line-height:1.6;margin:0}
  body.river-chat .profile-game-meta{display:flex;flex-wrap:wrap;gap:8px}
  body.river-chat .profile-game-meta span{padding:5px 9px;background:var(--panel2);border-radius:99px;font-size:12px}
  body.river-chat .profile-game-screens{display:flex;gap:10px;overflow:auto}
  body.river-chat .profile-game-screens img{max-height:170px;border-radius:10px}
  @media(max-width:700px){body.river-chat .message-list{padding:12px 8px!important}body.river-chat .message,body.river-chat .message.own{gap:8px!important;padding:7px 5px!important}body.river-chat .message>.avatar{width:31px!important;height:31px!important;min-width:31px!important}body.river-chat .game-card-v6{grid-template-columns:52px minmax(0,1fr)!important;padding:14px!important}body.river-chat .game-card-play{grid-column:2!important}body.river-chat .camera-preview{min-height:220px!important}body.river-chat #messageForm #dictateQuick{width:33px!important;min-width:33px!important}}
}
@keyframes brMicPulse{to{box-shadow:0 0 0 5px #d0475e55}}
@keyframes brCallToast{0%,85%{opacity:1;transform:translateY(0)}100%{opacity:0;transform:translateY(-10px)}}
@keyframes brPhotoLight{0%,50%{opacity:.95}100%{opacity:0}}

.group-call-panel{position:fixed;inset:3.5dvh 3vw;z-index:1000;display:grid;grid-template-rows:auto minmax(0,1fr) auto auto;gap:16px;padding:18px;border:1px solid #ffffff27;border-radius:24px;background:#111317;color:#f7f8fa;box-shadow:0 28px 100px #000b;font-family:system-ui,sans-serif}
.group-call-head{display:flex;justify-content:space-between;align-items:center;gap:20px;min-width:0}
.group-call-head>div:first-child{display:grid;gap:3px}
.group-call-head small{color:#a9bbd4;font-size:10px;font-weight:800;letter-spacing:.12em}
.group-call-head h2{margin:0;font-size:22px}
.group-call-head span{color:#aeb4c0;font-size:12px}
.group-call-head>div:last-child{display:flex;gap:9px;align-items:center}
.group-call-head button,.group-call-panel footer button{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:42px;padding:10px 14px;border:1px solid #ffffff22;border-radius:12px;background:#25292f;color:#fff;cursor:pointer}
.group-call-head .group-call-end{background:#c12f49;border-color:#c12f49}
.group-call-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(240px,100%),1fr));grid-auto-rows:minmax(190px,1fr);gap:12px;min-height:0;overflow:auto}
.group-call-card{position:relative;display:grid;place-items:center;overflow:hidden;min-height:190px;border:1px solid #ffffff17;border-radius:17px;background:#0b0e12}
.group-call-card video{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}
.group-call-card .group-call-fallback{display:grid;place-items:center}
.group-call-card .group-call-fallback .avatar{width:84px;height:84px;font-size:26px}
.group-call-card.video-connected .group-call-fallback{display:none}
.group-call-card>strong{position:absolute;left:12px;bottom:12px;padding:5px 10px;border-radius:8px;background:#000a;font-size:13px}
.group-call-card .group-peer-state{position:absolute;top:12px;left:12px;font-size:11px;color:#c1c9d7}
.group-call-card.connected .group-peer-state{display:none}
.group-call-card .group-peer-mute{position:absolute;top:10px;right:10px;width:36px;height:36px;display:grid;place-items:center;border:1px solid #ffffff25;border-radius:10px;background:#0009;color:#fff;cursor:pointer}
.group-call-card .group-peer-mute svg{width:18px;height:18px}
.group-call-chat{position:relative;display:grid;gap:7px}
#groupCallToasts{position:absolute;left:0;bottom:calc(100% + 8px);display:grid;gap:6px;width:min(410px,90%);pointer-events:none}
.group-call-toast{display:grid;gap:3px;padding:10px 12px;border:1px solid #ffffff2a;border-radius:11px;background:#131921cd;backdrop-filter:blur(10px);font-size:13px;animation:brCallToast 15s linear forwards}
.group-call-toast strong{font-size:11px;color:#abc7ff}
#groupCallForm{display:flex;gap:8px;padding:6px;border:1px solid #ffffff20;border-radius:12px;background:#1e2228}
#groupCallInput{flex:1;min-width:0;padding:8px;border:0;background:transparent;color:#fff;font-size:14px;outline:none}
#groupCallForm button{min-width:44px;min-height:40px;border:0;border-radius:9px;background:#9bbdff;color:#081324}
.group-call-panel footer{display:flex;justify-content:center;gap:8px}
.group-call-panel footer button.off{background:#bc3148}
.group-call-panel.minimized{inset:auto 20px 20px auto;width:280px;height:auto;display:block;padding:12px}
.group-call-panel.minimized .group-call-grid,.group-call-panel.minimized .group-call-chat,.group-call-panel.minimized footer{display:none}
.group-call-panel.minimized .group-call-head h2{font-size:14px}
.group-call-panel.minimized .group-call-head small{display:none}
.group-invite{display:grid;justify-items:center;gap:12px;padding:12px;text-align:center}.group-invite h3{font-size:20px;margin:0}.group-invite p{margin:0;color:var(--muted)}
@media(max-width:700px){.group-call-panel{inset:0;border:0;border-radius:0;padding:12px;gap:10px}.group-call-grid{grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:minmax(150px,1fr)}.group-call-card{min-height:150px}.group-call-head h2{font-size:17px}.group-call-head .group-call-end{font-size:0;padding:9px}.group-call-panel footer button{flex:1;padding:8px}.group-call-panel footer button span{display:none}}

.call-soundboard{display:grid;gap:20px;max-width:750px;margin:auto}.call-soundboard header h3{font-size:20px;margin:0 0 5px}.call-soundboard header p{margin:0;color:var(--muted);font-size:13px;line-height:1.5}.call-soundboard h4{font-size:14px;margin:16px 0 8px}.soundboard-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:8px}.soundboard-grid article{display:flex;align-items:stretch;min-height:90px;border:1px solid var(--line);border-radius:12px;background:var(--panel2);overflow:hidden}.soundboard-grid article>button:first-child{display:grid;align-content:center;justify-items:start;gap:3px;flex:1;min-width:0;padding:12px;border:0;background:transparent;color:var(--text);text-align:left;cursor:pointer}.soundboard-grid article>button:first-child svg{color:var(--accent)}.soundboard-grid article strong{font-size:13px}.soundboard-grid article small{font-size:11px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}.soundboard-grid article em{font-size:10px;color:var(--accent);font-style:normal}.soundboard-grid article>button:last-child:not(:first-child){width:32px;border:0;border-left:1px solid var(--line);background:transparent;color:var(--muted);cursor:pointer}.call-soundboard form{display:grid;gap:12px;padding-top:16px;border-top:1px solid var(--line)}.call-soundboard form label{display:grid;gap:6px;font-size:13px;font-weight:700}.call-soundboard form label small{font-weight:400;color:var(--muted)}.call-soundboard form .soundboard-visibility{display:flex;align-items:center;gap:9px;font-weight:500}.call-soundboard form .soundboard-visibility input{width:20px;height:20px;accent-color:var(--accent)}.call-soundboard form button{justify-self:start}
