#openFriends { position: relative; }
#friendRequestBadge {
 display: inline-grid;
 place-items: center;
 margin-inline-start: 3px;
 padding: 1px 5px;
 min-width: 17px;
 border: 1px solid #cab380;
 background: #3a3529;
 color: #f5dda6;
 font: 700 10px/1.2 var(--ops-body);
}
.commandBar #openFriends[data-duo-invites] {
 border-color: #83b6be;
 box-shadow: inset 0 0 0 1px #577c83;
}
#openFriends[data-duo-invites] #friendRequestBadge {
 border-color: #83b6be;
 background: #213c42;
 color: #bceaf0;
}

.lobbyDuoNotice {
 position: fixed;
 z-index: 45;
 inset-inline-end: clamp(12px, 2.5vw, 40px);
 inset-block-end: max(16px, env(safe-area-inset-bottom));
 box-sizing: border-box;
 width: min(340px, calc(100vw - 24px));
 padding: 15px 16px;
 overflow-wrap: anywhere;
 border: 1px solid #60848d;
 border-inline-start: 3px solid #a5d6db;
 background: linear-gradient(125deg, #283f49, #18242d 75%);
 box-shadow: 0 12px 32px #070e15aa;
}
.lobbyDuoNotice h2 {
 margin: 0 0 6px;
 color: #d9f0f2;
 font: 700 21px/1.15 var(--ops-title);
}
.lobbyDuoNotice p {
 margin: 0;
 color: #c7d4d8;
 font: 400 13px/1.4 var(--ops-body);
}
.lobbyDuoNotice strong { color: #f6f0e0; }
.lobbyDuoNotice small {
 display: block;
 margin-block-start: 5px;
 color: #a5c1c8;
 font: 500 11px/1.35 var(--ops-body);
}
.lobbyDuoNoticeActions {
 display: grid;
 grid-template-columns: repeat(2, minmax(0, 1fr));
 gap: 8px;
 margin-block-start: 12px;
}
.lobbyDuoNoticeActions button {
 min-height: 38px;
 padding: 7px 10px;
 font: 600 13px/1.2 var(--ops-body);
}
#declineLobbyDuoInvite {
 border-color: #536d76;
 background: #293941;
 color: #e0ebed;
}
#declineLobbyDuoInvite:hover:not(:disabled) { background: #374a52; }
.lobbyDuoNoticeActions button:focus-visible { outline: 2px solid #e2edb9; outline-offset: 2px; }

#friendsMenu {
 --friends-line: #41535d;
 --friends-muted: #a9b8bc;
 --friends-active: #d8e8ad;
 width: min(620px, calc(100% - 28px));
 max-height: calc(100dvh - 28px);
 margin: auto;
 padding: 0;
 border: 1px solid #64747b;
 color: var(--ops-ink);
 background: #182228;
 font: 13px/1.45 var(--ops-body);
 box-shadow: 0 24px 75px #070b0ecc;
}
#friendsMenu::backdrop { background: #080d12c9; }
.friendsHeader {
 position: sticky;
 top: 0;
 z-index: 1;
 display: flex;
 justify-content: space-between;
 align-items: center;
 gap: 15px;
 height: auto;
 margin: 0;
 padding: 16px 20px;
 border-top: 2px solid #a5b280;
 border-bottom: 1px solid var(--friends-line);
 background: linear-gradient(110deg, #26363c, #1d2931 70%);
}
#friendsMenu h2, #friendsMenu h3 { margin: 0; }
#friendsMenu h2 { color: #f6f0e0; font: 700 30px/1 var(--ops-title); }
#friendsMenu h3 { font: 700 18px/1.2 var(--ops-title); }
#friendsMenu p { margin: 0; }
.friendsBody { display: grid; gap: 16px; padding: 16px 20px 20px; }
.friendsIdentity {
 display: flex;
 flex-wrap: wrap;
 align-items: center;
 justify-content: space-between;
 gap: 12px;
 padding: 10px 12px;
 border: 1px solid var(--friends-line);
 background: #1f2e36;
}
.friendsSelf { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 140px; }
.friendsSelf strong, .friendsSelf span { display: block; }
.friendsSelf strong { overflow-wrap: anywhere; }
.friendsSelf span { color: var(--friends-muted); font-size: 11px; }
#friendsMenu button {
 min-block-size: 34px;
 padding: 6px 10px;
 border-color: #4f646a;
 background: #2a3940;
 color: #e6edec;
 font: 600 12px/1.2 var(--ops-body);
}
#friendsMenu input:focus-visible,
#friendsMenu button:focus-visible { outline: 2px solid var(--friends-active); outline-offset: 2px; }
#friendsMenu button:hover:not(:disabled) { background: #374a52; }

#friendsMenu [data-presence="online"] { --presence-color: #72d491; }
#friendsMenu [data-presence="away"] { --presence-color: #f3c46c; }
#friendsMenu [data-presence="offline"] { --presence-color: #8a9aa3; }
.friendsPresenceDot, #friendPresence::after {
 display: inline-block;
 flex: none;
 width: 9px;
 height: 9px;
 border-radius: 50%;
 background: var(--presence-color);
}
#friendsMenu #friendPresence {
 display: grid;
 place-items: center;
 flex: 0 0 34px;
 width: 34px;
 min-block-size: 34px;
 padding: 0;
 background: #18242a;
}
#friendPresence::after { content: ""; box-shadow: 0 0 0 2px color-mix(in srgb, var(--presence-color) 23%, transparent); }

.friendRequestForm { display: grid; gap: 6px; }
.friendRequestForm label { font-weight: 600; }
.friendRequestForm > div { display: flex; flex-wrap: wrap; align-items: stretch; gap: 7px; }
#friendsMenu input {
 min-width: 0;
 min-height: 37px;
 flex: 1 1 160px;
 width: auto;
 padding: 7px 10px;
 border-color: var(--friends-line);
 color: var(--ops-ink);
 background: #111c23;
 font-family: var(--ops-body);
 user-select: text;
}
#friendsMenu .friendsPrimary {
 border-color: #c9d89a;
 background: var(--friends-active);
 color: #21281b;
}
#friendsMenu .friendsPrimary:hover:not(:disabled) { background: #edf5c6; }
#friendsMenu .friendsInvite {
 border-color: #60919a;
 background: #273e49;
 color: #d1edf3;
}
#friendsMenu .friendsInvite:hover:not(:disabled) { background: #345562; }
#friendsMenu .friendsFeedback { color: #d3e2b3; line-height: 1.4; }
#friendsMenu .friendsFeedback[data-error="true"] { color: #ffc1ab; }
#friendsMenu .friendsDuoResponse {
 padding: 8px 10px;
 border-inline-start: 2px solid #a5d6db;
 background: #1b3038;
 color: #d8eef1;
 overflow-wrap: anywhere;
}

.friendsGroup { display: grid; gap: 7px; }
.friendsDuoGroup {
 padding: 10px;
 border: 1px solid #517781;
 background: #1b3038;
}
#friendsMenu .friendsDuoGroup h3 { color: #c3e5ec; }
.friendsDuoGroup .friendsRow { border-color: #49696f; }
#friendsMenu .friendsEmpty { color: var(--friends-muted); line-height: 1.45; }
.friendsList { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }
.friendsRow {
 display: flex;
 flex-wrap: wrap;
 align-items: center;
 justify-content: space-between;
 gap: 6px 12px;
 padding: 7px 8px 7px 10px;
 border: 1px solid #394a53;
 background: #202d34;
}
.friendsRowIdentity, .friendsActions { display: flex; align-items: center; gap: 7px; }
.friendsRowIdentity { flex: 1 1 130px; min-width: 0; }
.friendsContact { display: grid; min-width: 0; }
.friendsContact strong { overflow-wrap: anywhere; }
.friendsContact small { color: var(--friends-muted); font-size: 11px; }
#friendLookup { border-color: #64754a; }
.friendsRowIdentity small { color: var(--friends-muted); white-space: nowrap; }
.friendsActions { flex-wrap: wrap; }
#friendsMenu .friendsQuiet:hover:not(:disabled) { color: #ffd9c7; }

@media (max-width: 490px) {
 .friendsHeader, .friendsBody { padding-inline: 12px; }
 .friendsIdentity { gap: 6px; }
}
@media (max-width: 600px) {
 #friendRequestBadge { inset-inline-end: 1px; top: -5px; position: absolute; }
}
