.ag-social-drawer {
  --ag-chat-accent: #f5b84c;
  --ag-social-friends-column: 128px;
  --ag-social-dock-top: 62px;
  --ag-social-dock-right: 10px;
  --ag-presence-dot-size: 10px;
  --ag-presence-dot-inner-ring: 3px;
  --ag-presence-dot-color-ring: 4px;
  --ag-presence-dot-glow: 9px;
  position: fixed;
  top: var(--ag-social-dock-top);
  right: var(--ag-social-dock-right);
  bottom: auto;
  left: auto;
  z-index: 29;
  width: min(400px, calc(100vw - 61px));
  height: 42px;
  color: #fff4df;
  font-family: 'Montserrat', sans-serif;
  transition: height 240ms cubic-bezier(.22, .8, .24, 1);
}

@property --ag-social-unread-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

@keyframes ag-social-unread-border-orbit {
  to { --ag-social-unread-angle: 360deg; }
}

@keyframes ag-social-active-chat-glow {
  0%, 100% {
    box-shadow: 0 0 0 rgba(245, 184, 76, 0), inset 0 0 0 1px rgba(255, 226, 163, .04);
  }
  50% {
    box-shadow: 0 0 9px rgba(245, 184, 76, .22), inset 0 0 7px rgba(255, 193, 78, .08);
  }
}

.ag-social-drawer.is-open {
  height: min(370px, calc(100dvh - var(--ag-social-dock-top) - 12px));
}

.ag-social-drawer-shell {
  position: relative;
  z-index: 2;
  display: grid;
  height: 100%;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(255, 221, 157, .34);
  border-top: 0;
  border-radius: 0 0 12px 12px;
  background:
    radial-gradient(circle at 85% 115%, rgba(236, 137, 38, .30), transparent 48%),
    linear-gradient(160deg, rgba(17, 25, 35, .97), rgba(20, 23, 29, .98) 52%, rgba(43, 29, 22, .98));
  box-shadow: 0 12px 30px rgba(0, 0, 0, .38), inset 0 1px 0 rgba(255, 255, 255, .10);
  backdrop-filter: blur(20px) saturate(135%);
  -webkit-backdrop-filter: blur(20px) saturate(135%);
  transition: width 220ms cubic-bezier(.22, .8, .24, 1);
}

.ag-social-drawer.has-unread .ag-social-drawer-shell::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 4;
  padding: 1px;
  border-radius: inherit;
  background: conic-gradient(
    from var(--ag-social-unread-angle),
    transparent 0deg 250deg,
    rgba(255, 86, 76, .05) 278deg,
    rgba(255, 105, 94, .88) 315deg,
    rgba(255, 196, 171, .48) 330deg,
    transparent 360deg
  );
  filter: drop-shadow(0 0 3px rgba(255, 78, 68, .46));
  pointer-events: none;
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: ag-social-unread-border-orbit 2.7s linear infinite;
}

.ag-social-drawer:not(.is-open) .ag-social-drawer-shell {
  width: calc(100% - 33px);
}

.ag-social-drawer.is-open .ag-social-drawer-shell {
  box-shadow: 0 18px 42px rgba(0, 0, 0, .46), 0 0 0 1px rgba(255, 185, 73, .08), inset 0 1px 0 rgba(255, 255, 255, .12);
}

.ag-social-handle {
  position: absolute;
  top: 2px;
  right: 0;
  z-index: 1;
  display: grid;
  width: 62px;
  height: 38px;
  place-items: center end;
  padding: 0 8px 0 0;
  border: 1px solid rgba(255, 221, 157, .42);
  border-left: 0;
  border-radius: 0 999px 999px 0;
  outline: 0;
  background: radial-gradient(circle at 32% 28%, rgba(255, 235, 187, .30), transparent 36%), linear-gradient(180deg, #d7872e, #8e461b);
  color: #fff4d7;
  cursor: pointer;
  box-shadow: 7px 5px 16px rgba(0, 0, 0, .34), inset 0 1px 0 rgba(255, 255, 255, .24);
  transition: filter 160ms ease, transform 160ms ease;
}

.ag-social-handle:hover,
.ag-social-handle:focus-visible {
  filter: brightness(1.12);
  transform: translateX(2px);
}

.ag-social-handle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.ag-presence-control {
  position: absolute;
  top: 6px;
  right: 45px;
  left: auto;
  z-index: 9;
  width: 29px;
  height: 29px;
}

.ag-presence-handle {
  position: static;
  z-index: 1;
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 221, 157, .42);
  border-radius: 50%;
  outline: 0;
  background: radial-gradient(circle at 68% 28%, rgba(255, 235, 187, .30), transparent 36%), linear-gradient(180deg, #d7872e, #8e461b);
  cursor: pointer;
  box-shadow: -7px 5px 16px rgba(0, 0, 0, .34), inset 0 1px 0 rgba(255, 255, 255, .24);
  transition: filter 160ms ease, transform 160ms ease;
}

.ag-presence-handle:hover,
.ag-presence-handle:focus-visible,
.ag-chat-close:hover,
.ag-chat-close:focus-visible {
  filter: brightness(1.12);
  transform: scale(1.04);
}

.ag-chat-close {
  position: absolute;
  top: 6px;
  right: 8px;
  z-index: 9;
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 221, 157, .42);
  border-radius: 50%;
  outline: 0;
  background: radial-gradient(circle at 68% 28%, rgba(255, 235, 187, .22), transparent 36%), linear-gradient(180deg, #65402b, #2c2523);
  color: #ffe6b8;
  cursor: pointer;
  box-shadow: -7px 5px 16px rgba(0, 0, 0, .34), inset 0 1px 0 rgba(255, 255, 255, .20);
  transition: filter 160ms ease, transform 160ms ease;
}

.ag-chat-close-mark {
  position: relative;
  display: block;
  width: 13px;
  height: 13px;
}

.ag-chat-close-mark::before,
.ag-chat-close-mark::after {
  position: absolute;
  top: 5.5px;
  left: 0;
  width: 13px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.ag-chat-close-mark::before { transform: rotate(45deg); }
.ag-chat-close-mark::after { transform: rotate(-45deg); }
.ag-social-drawer:not(.is-open) .ag-chat-close { display: none; }

.ag-presence-handle-dot,
.ag-presence-option-dot,
.ag-social-friend-status {
  display: inline-block;
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--ag-presence-color) 68%, white);
  border-radius: 50%;
  background: var(--ag-presence-color);
  box-shadow: 0 0 8px color-mix(in srgb, var(--ag-presence-color) 72%, transparent);
}

.ag-presence-handle-dot {
  position: relative;
  width: var(--ag-presence-dot-size);
  height: var(--ag-presence-dot-size);
  border-color: rgba(255, 255, 255, .68);
  background:
    radial-gradient(circle at 32% 27%, rgba(255, 255, 255, .75) 0 9%, transparent 26%),
    var(--ag-presence-color);
  box-shadow:
    0 0 0 var(--ag-presence-dot-inner-ring) rgba(28, 20, 15, .55),
    0 0 0 var(--ag-presence-dot-color-ring) color-mix(in srgb, var(--ag-presence-color) 24%, transparent),
    0 0 var(--ag-presence-dot-glow) color-mix(in srgb, var(--ag-presence-color) 58%, transparent);
}
.ag-presence-option-dot { width: 9px; height: 9px; }
.ag-social-friend-status { width: 7px; height: 7px; }

[data-presence-dot="online"] { --ag-presence-color: #55df86; }
[data-presence-dot="offline"] { --ag-presence-color: #858b91; }
[data-presence-dot="away"] { --ag-presence-color: #f2c94c; }
[data-presence-dot="busy"] { --ag-presence-color: #ef5350; }

html[data-ag-viewport-bucket="small"] .ag-social-drawer {
  --ag-presence-dot-size: 8px;
  --ag-presence-dot-inner-ring: 2px;
  --ag-presence-dot-color-ring: 3px;
  --ag-presence-dot-glow: 7px;
}

html[data-ag-viewport-bucket="middle"] .ag-social-drawer {
  --ag-presence-dot-size: 9px;
  --ag-presence-dot-inner-ring: 2px;
  --ag-presence-dot-color-ring: 3px;
  --ag-presence-dot-glow: 8px;
}

html[data-ag-viewport-bucket="big"] .ag-social-drawer {
  --ag-presence-dot-size: 10px;
  --ag-presence-dot-inner-ring: 3px;
  --ag-presence-dot-color-ring: 4px;
  --ag-presence-dot-glow: 9px;
}

html[data-ag-viewport-bucket="tablet"] .ag-social-drawer {
  --ag-presence-dot-size: 11px;
  --ag-presence-dot-inner-ring: 3px;
  --ag-presence-dot-color-ring: 4px;
  --ag-presence-dot-glow: 10px;
}

.ag-presence-menu {
  position: absolute;
  top: 34px;
  right: 0;
  left: auto;
  z-index: 7;
  display: grid;
  width: 154px;
  padding: 7px;
  border: 1px solid rgba(255, 221, 157, .34);
  border-radius: 10px;
  background: linear-gradient(155deg, rgba(18, 25, 34, .98), rgba(43, 29, 22, .98));
  box-shadow: 0 14px 32px rgba(0, 0, 0, .48), inset 0 1px 0 rgba(255, 255, 255, .08);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
}

.ag-presence-menu[hidden] { display: none; }

.ag-presence-menu-title {
  padding: 4px 8px 7px;
  color: rgba(255, 235, 199, .58);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .12em;
}

.ag-presence-menu button {
  display: grid;
  min-height: 32px;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 0 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: rgba(255, 244, 223, .78);
  cursor: pointer;
  font: 800 10px/1 'Montserrat', sans-serif;
  text-align: left;
}

.ag-presence-menu button:hover,
.ag-presence-menu button:focus-visible,
.ag-presence-menu button.is-active {
  outline: 0;
  background: rgba(255, 204, 119, .10);
  color: #fff5e3;
}

.ag-presence-menu button.is-active {
  box-shadow: inset 2px 0 0 var(--ag-chat-accent);
}

.ag-presence-menu button:disabled { cursor: wait; opacity: .58; }

.ag-presence-menu-status {
  min-height: 0;
  padding: 3px 8px 0;
  color: #e9b36f;
  font-size: 8px;
  line-height: 1.3;
}

.ag-presence-menu-status:empty { display: none; }

.ag-social-handle-badge {
  position: absolute;
  top: -5px;
  right: 1px;
  display: grid;
  min-width: 17px;
  height: 17px;
  place-items: center;
  padding: 0 4px;
  border: 2px solid #2a1b16;
  border-radius: 999px;
  background: #e94f45;
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
}

.ag-social-drawer.is-open .ag-social-handle-badge,
.ag-social-handle-badge[hidden] {
  display: none;
}

.ag-social-drawer-content {
  position: relative;
  display: grid;
  height: auto;
  min-height: 0;
  grid-template-columns: var(--ag-social-friends-column) minmax(0, 1fr);
  border-top: 1px solid rgba(255, 224, 164, .13);
}

.ag-social-drawer-content[hidden] { display: none; }

.ag-social-friends {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr);
  padding: 8px 7px;
  border-right: 1px solid rgba(255, 224, 164, .12);
  background: rgba(0, 0, 0, .12);
}

.ag-social-search {
  display: grid;
  min-width: 0;
  height: 29px;
  grid-template-columns: 17px minmax(0, 1fr);
  align-items: center;
  padding: 0 7px;
  border: 1px solid rgba(255, 224, 164, .14);
  border-radius: 8px;
  background: rgba(3, 8, 13, .38);
}

.ag-social-search:focus-within {
  border-color: rgba(255, 194, 92, .56);
  box-shadow: 0 0 0 2px rgba(255, 174, 61, .08);
}

.ag-social-search svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: rgba(255, 239, 211, .52);
  stroke-linecap: round;
  stroke-width: 1.8;
}

.ag-social-search input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff3dd;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
}

.ag-social-search input::placeholder { color: rgba(235, 235, 232, .40); }

.ag-social-friend-list {
  min-height: 0;
  margin-top: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-color: rgba(230, 153, 62, .42) transparent;
  scrollbar-width: thin;
}

.ag-social-list-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 4px 3px;
  color: rgba(240, 225, 199, .42);
  font-size: 7.5px;
  font-weight: 900;
  letter-spacing: .08em;
}

.ag-social-list-label > .ag-social-request-badge {
  display: grid;
  min-width: 14px;
  height: 14px;
  place-items: center;
  border-radius: 999px;
  background: rgba(235, 83, 69, .82);
  color: #fff;
  font-size: 7px;
}

.ag-social-requests-trigger {
  width: 100%;
  min-height: 38px;
  margin: 0;
  padding: 6px 5px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: background-color 160ms ease, color 160ms ease;
}

.ag-social-requests-trigger__copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.ag-social-requests-trigger__copy strong,
.ag-social-requests-trigger__copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ag-social-requests-trigger__copy strong {
  color: rgba(255, 240, 213, .92);
  font-size: 8.5px;
  font-weight: 950;
  letter-spacing: .035em;
}

.ag-social-requests-trigger__copy small {
  color: rgba(231, 235, 237, .44);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0;
}

.ag-social-requests-trigger:hover,
.ag-social-requests-trigger:focus-visible,
.ag-social-requests-trigger.is-active {
  outline: 0;
  background: rgba(221, 126, 37, .10);
  color: rgba(255, 232, 193, .78);
}

.ag-social-request {
  display: grid;
  min-width: 0;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 5px;
  align-items: center;
  padding: 6px 4px;
  border: 1px solid rgba(255, 191, 88, .13);
  border-radius: 9px;
  background: rgba(221, 126, 37, .07);
}

.ag-social-request-actions {
  display: flex;
  gap: 3px;
}

.ag-social-request-actions button {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 214, 141, .24);
  border-radius: 6px;
  background: rgba(255, 255, 255, .055);
  color: #ffdda2;
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  font-weight: 900;
}

.ag-social-request-actions button:last-child { color: #ef938a; }
.ag-social-request-actions button:hover { filter: brightness(1.18); }
.ag-social-request-actions button:disabled { cursor: wait; opacity: .45; }

.ag-social-friend {
  position: relative;
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 36px;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: center;
  padding: 6px 5px;
  border: 1px solid rgba(255, 215, 143, .16);
  border-radius: 9px;
  background: rgba(255, 255, 255, .025);
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.ag-social-friend:hover,
.ag-social-friend:focus-visible {
  border-color: rgba(255, 207, 124, .16);
  outline: 0;
  background: linear-gradient(90deg, rgba(238, 148, 51, .18), rgba(238, 148, 51, .035));
}

.ag-social-friend.is-active {
  border-color: rgba(246, 187, 77, .72);
  outline: 0;
  background: linear-gradient(90deg, rgba(238, 148, 51, .22), rgba(238, 148, 51, .055));
  animation: ag-social-active-chat-glow 2.8s ease-in-out infinite;
}

.ag-social-avatar {
  position: relative;
  display: inline-grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255, 241, 216, .34);
  border-radius: 9px;
  color: #1f160e;
  font-size: 8px;
  font-weight: 950;
  letter-spacing: .02em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
}

.ag-social-avatar--amber { background: linear-gradient(145deg, #ffe49d, #d67d25); }
.ag-social-avatar--blue { background: linear-gradient(145deg, #bceeff, #5996bd); }
.ag-social-avatar--rose { background: linear-gradient(145deg, #ffc7bd, #c66e6b); }
.ag-social-avatar--slate { background: linear-gradient(145deg, #d7dce2, #767e89); }

.ag-social-status {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 7px;
  height: 7px;
  border: 2px solid #17202a;
  border-radius: 50%;
  background: var(--ag-presence-color, #858b91);
  box-shadow: 0 0 7px color-mix(in srgb, var(--ag-presence-color, #858b91) 66%, transparent);
}

.ag-social-friend-copy,
.ag-chat-person {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.ag-social-friend-copy strong,
.ag-social-friend-copy small,
.ag-chat-person strong,
.ag-chat-person small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ag-social-friend-copy strong {
  color: rgba(255, 247, 230, .94);
  font-size: 10.5px;
  font-weight: 850;
  letter-spacing: -.015em;
}

.ag-social-friend-copy small {
  padding-right: 12px;
  color: rgba(227, 232, 237, .46);
  font-size: 8.5px;
  font-weight: 650;
}

.ag-social-unread {
  display: grid;
  min-width: 16px;
  height: 16px;
  place-items: center;
  padding: 0 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f3a742, #c96320);
  color: #fff6e4;
  font-size: 9px;
  font-weight: 900;
}

.ag-social-friend-meta {
  position: absolute;
  right: 4px;
  bottom: 7px;
  display: inline-flex;
  min-width: 7px;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.ag-social-friend:has(.ag-social-unread) .ag-social-friend-copy small {
  padding-right: 32px;
}

.ag-social-conversation {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr) auto;
}

.ag-social-conversation[hidden] { display: none; }

.ag-social-requests-view {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr);
  background:
    radial-gradient(circle at 88% 112%, rgba(232, 135, 39, .18), transparent 48%),
    linear-gradient(155deg, rgba(13, 21, 30, .96), rgba(21, 23, 28, .98) 58%, rgba(48, 30, 20, .96));
}

.ag-social-requests-view[hidden] { display: none; }

.ag-social-requests-view__list {
  min-height: 0;
  padding: 8px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-color: rgba(230, 153, 62, .42) transparent;
  scrollbar-width: thin;
}

.ag-social-requests-view__list .ag-social-request {
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 8px;
  padding: 8px;
  border-color: rgba(255, 191, 88, .18);
  background: linear-gradient(90deg, rgba(221, 126, 37, .13), rgba(255, 255, 255, .025));
}

.ag-social-requests-view__list .ag-social-request + .ag-social-request { margin-top: 6px; }
.ag-social-requests-view__list .ag-social-avatar { width: 34px; height: 34px; }
.ag-social-requests-view__list .ag-social-request-actions { gap: 5px; }
.ag-social-requests-view__list .ag-social-request-actions button { width: 27px; height: 27px; font-size: 12px; }

.ag-social-drawer.is-requests-view .ag-player-finder { display: none; }

.ag-chat-header {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255, 224, 164, .10);
}

.ag-chat-drawer-toolbar {
  position: relative;
  padding-right: 82px;
}

.ag-social-desktop-title {
  display: none;
}

body.ag-device-desktop .ag-chat-drawer-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 29px;
  grid-template-rows: 29px 29px;
  gap: 5px 7px;
  padding: 6px 8px 7px;
}

body.ag-device-desktop .ag-social-desktop-title {
  display: grid;
  min-width: 0;
  grid-column: 1 / -1;
  grid-row: 1;
  grid-template-columns: 30px minmax(0, 1fr) 13px;
  gap: 7px;
  align-items: center;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff2dc;
  cursor: pointer;
  font: 900 11px/1 'Montserrat', sans-serif;
  letter-spacing: .035em;
  text-align: left;
}

body.ag-device-desktop .ag-social-desktop-title svg {
  width: 28px;
  height: 22px;
  fill: rgba(192, 120, 49, .28);
  stroke: #d7a35f;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.35;
}

body.ag-device-desktop .ag-social-desktop-chevron {
  width: 9px;
  height: 9px;
  border-right: 2px solid #f3d7a4;
  border-bottom: 2px solid #f3d7a4;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 180ms ease;
}

body.ag-device-desktop .ag-social-desktop-title[aria-expanded="true"] .ag-social-desktop-chevron {
  transform: translateY(2px) rotate(225deg);
}

body.ag-device-desktop .ag-chat-player-search {
  grid-column: 1 / -1;
  grid-row: 2;
}

body.ag-device-desktop .ag-presence-control {
  position: absolute;
  top: 2px;
  right: auto;
  left: 0;
  z-index: 1;
  width: 62px;
  height: 38px;
  --ag-presence-dot-size: 9px;
  --ag-presence-dot-inner-ring: 1px;
  --ag-presence-dot-color-ring: 2px;
  --ag-presence-dot-glow: 7px;
}

body.ag-device-desktop .ag-presence-handle {
  width: 62px;
  height: 38px;
  place-items: center start;
  padding: 0 0 0 11px;
  border: 1px solid rgba(255, 221, 157, .42);
  border-right: 0;
  border-radius: 999px 0 0 999px;
  background: radial-gradient(circle at 68% 28%, rgba(255, 235, 187, .30), transparent 36%), linear-gradient(180deg, #d7872e, #8e461b);
  box-shadow: -7px 5px 16px rgba(0, 0, 0, .34), inset 0 1px 0 rgba(255, 255, 255, .24);
}

body.ag-device-desktop .ag-presence-control:has(.ag-presence-menu:not([hidden])) {
  z-index: 5;
}

body.ag-device-desktop .ag-presence-menu {
  top: 42px;
  right: auto;
  left: 0;
}

body.ag-device-desktop .ag-social-drawer:not(.is-open) .ag-social-drawer-shell {
  width: calc(100% - 66px);
  margin-left: 33px;
}

body.ag-device-desktop .ag-social-drawer.is-open .ag-social-drawer-shell {
  margin-left: 0;
}

body.ag-device-desktop .ag-chat-close {
  display: none;
}

.ag-chat-player-search {
  width: 100%;
  height: 29px;
  box-sizing: border-box;
}

.ag-chat-header .ag-social-avatar { width: 29px; height: 29px; }
.ag-chat-person { flex: 1 1 auto; }
.ag-chat-person strong { color: #fff6e8; font-size: 10px; font-weight: 900; }
.ag-chat-person small { color: #65d98d; font-size: 7.5px; font-weight: 700; }

.ag-chat-invite {
  display: inline-flex;
  min-height: 27px;
  align-items: center;
  gap: 4px;
  padding: 0 7px;
  border: 1px solid rgba(255, 204, 114, .30);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(232, 144, 48, .23), rgba(168, 77, 24, .14));
  color: #ffe5b4;
  cursor: pointer;
  font: inherit;
  font-size: 7.5px;
  font-weight: 900;
}

.ag-chat-invite:hover,
.ag-chat-invite:focus-visible {
  border-color: rgba(255, 218, 150, .64);
  outline: 0;
  filter: brightness(1.08);
}

.ag-chat-invite.is-sent { border-color: rgba(92, 220, 137, .35); color: #8be8ab; }

.ag-chat-invite:disabled,
.ag-chat-composer input:disabled,
.ag-chat-composer button:disabled {
  cursor: default;
  filter: grayscale(.35);
  opacity: .42;
}

.ag-chat-invite svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.ag-chat-messages {
  min-height: 0;
  padding: 6px 8px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-color: rgba(230, 153, 62, .42) transparent;
  scrollbar-width: thin;
}

.ag-chat-empty {
  display: grid;
  height: 100%;
  place-items: center;
  padding: 12px;
  color: rgba(235, 238, 239, .40);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
}

.ag-player-finder {
  position: absolute;
  inset: 0 0 0 var(--ag-social-friends-column);
  z-index: 8;
  display: grid;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 7px;
  padding: 8px;
  border-top: 1px solid rgba(255, 218, 151, .10);
  background:
    radial-gradient(circle at 88% 112%, rgba(232, 135, 39, .22), transparent 48%),
    linear-gradient(155deg, rgba(13, 21, 30, .995), rgba(21, 23, 28, .995) 55%, rgba(48, 30, 20, .995));
}

.ag-player-finder[hidden] { display: none; }

.ag-player-finder__header {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 218, 151, .13);
}

.ag-player-finder__header > span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.ag-player-finder__header strong {
  color: #fff1d5;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .08em;
}

.ag-player-finder__header small {
  overflow: hidden;
  color: rgba(232, 235, 236, .46);
  font-size: 7.5px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ag-player-finder__header button {
  display: grid;
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 216, 146, .22);
  border-radius: 8px;
  background: rgba(255, 255, 255, .055);
  color: #ffddb0;
  cursor: pointer;
  font: inherit;
  font-size: 17px;
}

.ag-player-finder__form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  gap: 7px;
}

.ag-player-finder__form label {
  display: grid;
  height: 34px;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  padding: 0 9px;
  border: 1px solid rgba(255, 221, 158, .17);
  border-radius: 9px;
  background: rgba(2, 8, 14, .44);
}

.ag-player-finder__form label:focus-within {
  border-color: rgba(255, 194, 92, .58);
  box-shadow: 0 0 0 2px rgba(255, 174, 61, .07);
}

.ag-player-finder__form svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: rgba(255, 233, 199, .54);
  stroke-linecap: round;
  stroke-width: 1.8;
}

.ag-player-finder__form input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff4df;
  font: inherit;
  font-size: 9px;
  font-weight: 750;
}

.ag-player-finder__form > button,
.ag-player-result > button {
  border: 1px solid rgba(255, 205, 116, .34);
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(232, 145, 48, .34), rgba(149, 67, 22, .25));
  color: #ffe1aa;
  cursor: pointer;
  font: inherit;
  font-size: 8px;
  font-weight: 950;
  letter-spacing: .04em;
}

.ag-player-finder__form > button:hover,
.ag-player-result > button:hover { filter: brightness(1.13); }
.ag-player-result > button:disabled { cursor: default; filter: grayscale(.4); opacity: .48; }

.ag-player-finder__status {
  min-height: 12px;
  margin: 0;
  color: rgba(240, 224, 198, .52);
  font-size: 8.5px;
  font-weight: 700;
}

.ag-player-finder__results {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-color: rgba(230, 153, 62, .42) transparent;
  scrollbar-width: thin;
}

.ag-player-result {
  display: grid;
  min-width: 0;
  grid-template-columns: 34px minmax(0, 1fr) 64px;
  gap: 9px;
  align-items: center;
  padding: 7px 8px;
  border: 1px solid rgba(255, 222, 162, .11);
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(255, 255, 255, .055), rgba(210, 113, 32, .04));
}

.ag-player-result + .ag-player-result { margin-top: 6px; }
.ag-player-result .ag-social-avatar { width: 34px; height: 34px; }

.ag-player-result__copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.ag-player-result__copy strong,
.ag-player-result__copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ag-player-result__copy strong { color: #fff4df; font-size: 11px; font-weight: 900; }
.ag-player-result__copy small { color: rgba(230, 234, 235, .46); font-size: 8.5px; font-weight: 700; }
.ag-player-result > button { min-height: 28px; padding: 0 7px; }

.ag-player-finder__empty {
  padding: 25px 10px;
  color: rgba(232, 235, 236, .42);
  font-size: 9.5px;
  font-weight: 700;
  text-align: center;
}

.ag-chat-day {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 1px 0 6px;
  color: rgba(230, 232, 232, .32);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .08em;
}

.ag-chat-day::before,
.ag-chat-day::after {
  content: '';
  height: 1px;
  flex: 1 1 auto;
  background: rgba(255, 255, 255, .07);
}

.ag-chat-message { display: flex; margin: 0 0 3px; }
.ag-chat-message.is-mine { justify-content: flex-end; }

.ag-chat-bubble {
  max-width: 86%;
  padding: 3px 8px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 9px 9px 9px 3px;
  background: rgba(255, 255, 255, .075);
  color: rgba(255, 248, 236, .88);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
  word-break: break-word;
}

.ag-chat-message.is-mine .ag-chat-bubble {
  border-color: rgba(255, 194, 94, .22);
  border-radius: 9px 9px 3px 9px;
  background: linear-gradient(145deg, rgba(210, 117, 34, .72), rgba(132, 62, 25, .78));
}

.ag-chat-inline-emoji {
  display: inline-block;
  margin: 0 1px;
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
  vertical-align: -.22em;
}

.ag-chat-time {
  margin-left: 4px;
  color: rgba(255, 244, 225, .42);
  font-size: 8.5px;
  white-space: nowrap;
}

.ag-chat-send-error {
  margin: 5px 0;
  padding: 5px 7px;
  border: 1px solid rgba(238, 108, 94, .24);
  border-radius: 7px;
  background: rgba(172, 55, 46, .12);
  color: #f4a096;
  font-size: 9px;
  font-weight: 750;
  text-align: center;
}

.ag-chat-composer {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px 28px;
  gap: 5px;
  align-items: center;
  padding: 5px 7px 6px;
  border-top: 1px solid rgba(255, 224, 164, .10);
}

.ag-chat-composer input {
  width: 100%;
  min-width: 0;
  height: 29px;
  box-sizing: border-box;
  padding: 0 9px;
  border: 1px solid rgba(255, 224, 164, .15);
  border-radius: 8px;
  outline: 0;
  background: rgba(2, 7, 12, .36);
  color: #fff5e3;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
}

.ag-chat-composer input:focus {
  border-color: rgba(255, 194, 92, .58);
  box-shadow: 0 0 0 2px rgba(255, 174, 61, .08);
}

.ag-chat-composer input::placeholder { color: rgba(232, 233, 231, .36); }

.ag-chat-composer button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(255, 219, 151, .42);
  border-radius: 8px;
  background: linear-gradient(180deg, #eca446, #a65320);
  color: #fff7e8;
  cursor: pointer;
}

.ag-chat-composer button:hover,
.ag-chat-composer button:focus-visible { outline: 0; filter: brightness(1.12); }

.ag-chat-composer button svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.ag-chat-composer .ag-chat-emoji-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-color: rgba(255, 217, 147, .24);
  background: rgba(255, 255, 255, .055);
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
  font-size: 17px;
  line-height: 1;
  text-align: center;
}

.ag-chat-composer .ag-chat-emoji-toggle > span {
  display: block;
  width: 1em;
  height: 1em;
  line-height: 1;
  text-align: center;
}

.ag-chat-composer .ag-chat-emoji-toggle.is-active {
  border-color: rgba(255, 197, 92, .62);
  background: rgba(220, 126, 38, .20);
  box-shadow: 0 0 8px rgba(245, 175, 67, .14);
}

.ag-chat-emoji-picker {
  position: absolute;
  right: 6px;
  bottom: 39px;
  z-index: 20;
  width: min(218px, calc(100% - 12px));
  padding: 6px;
  border: 1px solid rgba(255, 207, 121, .30);
  border-radius: 10px;
  background:
    radial-gradient(circle at 88% 110%, rgba(224, 126, 35, .20), transparent 46%),
    linear-gradient(155deg, rgba(16, 24, 33, .99), rgba(27, 24, 24, .99));
  box-shadow: 0 12px 25px rgba(0, 0, 0, .48), inset 0 1px 0 rgba(255, 255, 255, .07);
}

.ag-chat-emoji-picker[hidden] { display: none; }

.ag-chat-emoji-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 6px;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(255, 222, 161, .10);
}

.ag-chat-composer .ag-chat-emoji-tabs button {
  width: 100%;
  height: 24px;
  box-sizing: border-box;
  padding: 0;
  border-color: transparent;
  border-radius: 6px;
  background: transparent;
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
  font-size: 17px;
}

.ag-chat-composer .ag-chat-emoji-tabs button.is-active {
  border-color: rgba(255, 198, 99, .28);
  background: rgba(224, 133, 42, .18);
}

.ag-chat-emoji-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
  max-height: 136px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-color: rgba(230, 153, 62, .42) transparent;
  scrollbar-width: thin;
}

.ag-chat-composer .ag-chat-emoji-grid button {
  width: 100%;
  height: 31px;
  min-width: 0;
  box-sizing: border-box;
  padding: 0;
  border-color: transparent;
  border-radius: 6px;
  background: transparent;
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
  font-size: 24px;
  line-height: 1;
}

.ag-chat-composer .ag-chat-emoji-grid button:hover,
.ag-chat-composer .ag-chat-emoji-grid button:focus-visible {
  border-color: rgba(255, 206, 119, .22);
  outline: 0;
  background: rgba(255, 177, 65, .13);
}

.ag-social-empty {
  padding: 15px 5px;
  color: rgba(235, 238, 239, .42);
  font-size: 8px;
  font-weight: 700;
  text-align: center;
}

@media (max-width: 720px) {
  .ag-social-drawer {
    --ag-social-friends-column: 112px;
    --ag-social-dock-top: 54px;
    --ag-social-dock-right: 10px;
    right: var(--ag-social-dock-right);
    bottom: auto;
    left: auto;
    width: min(330px, calc(100vw - 20px));
    height: 39px;
  }
  .ag-social-drawer.is-open {
    height: min(330px, calc(100dvh - var(--ag-social-dock-top) - 10px));
  }
  .ag-social-drawer-content { height: auto; grid-template-columns: var(--ag-social-friends-column) minmax(0, 1fr); }
  .ag-social-drawer:not(.is-open) .ag-social-drawer-shell { width: calc(100% - 28px); }
  .ag-social-handle { right: 0; width: 55px; height: 35px; }
  .ag-presence-handle,
  .ag-chat-close { width: 28px; height: 28px; }
  .ag-presence-menu { top: 34px; right: 0; left: auto; }
  .ag-social-friends { padding: 6px 5px; }
  .ag-social-friend { min-height: 34px; grid-template-columns: minmax(0, 1fr); gap: 0; padding: 5px 3px; }
  .ag-social-request { grid-template-columns: 25px minmax(0, 1fr) auto; gap: 4px; padding: 5px 3px; }
  .ag-social-request-actions button { width: 18px; height: 18px; }
  .ag-chat-header { padding-left: 6px; }
  .ag-chat-drawer-toolbar { padding-right: 72px; }
  .ag-player-finder { inset: 0 0 0 var(--ag-social-friends-column); }
  .ag-chat-invite span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ag-social-drawer,
  .ag-social-handle,
  .ag-presence-handle,
  .ag-chat-close { transition: none; }

  .ag-social-drawer.has-unread .ag-social-drawer-shell::after {
    animation: none;
  }

  .ag-social-friend.is-active {
    animation: none;
  }
}

/* Viewport grid placement */
.ag-social-drawer {
  grid-column: 3;
  grid-row: 1 / 3;
  position: relative;
  inset: auto;
  align-self: start;
  justify-self: stretch;
  width: 100%;
  min-width: 0;
  max-width: none;
  height: var(--lobby-friends-height, 5.5dvh);
  max-height: 100%;
  transform: translateX(clamp(5px, .5vw, 9px));
}

.ag-social-drawer.is-open {
  height: 100%;
  max-height: 100%;
}

.ag-social-drawer-shell,
.ag-social-drawer-content {
  min-width: 0;
}

@media (max-width: 720px) {
  .ag-social-drawer {
    position: relative;
    inset: auto;
    width: 100%;
    height: var(--lobby-friends-height, 6dvh);
  }

  .ag-social-drawer.is-open {
    height: 100%;
  }
}

@media (max-width: 60rem) {
  .ag-social-drawer {
    --ag-social-narrow-handle-width: min(16vw, 10dvh);
    --ag-social-narrow-handle-overlap: min(8vw, 5dvh);
    --ag-social-friends-column: clamp(104px, 29vw, 118px);
    grid-column: 1;
    grid-row: 1;
    position: relative;
    inset: auto;
    align-self: start;
    justify-self: end;
    width: min(82vw, 70dvh);
    height: var(--lobby-friends-height, 6dvh);
    max-height: none;
    margin: 0;
    transform: none;
  }

  .ag-social-drawer.is-open {
    height: 72dvh;
    max-height: 72dvh;
  }

  .ag-social-drawer-content {
    height: auto;
    grid-template-columns: var(--ag-social-friends-column) minmax(0, 1fr);
  }

  .ag-social-drawer:not(.is-open) .ag-social-drawer-shell {
    width: calc(100% - var(--ag-social-narrow-handle-overlap));
  }

  .ag-social-handle {
    top: 0;
    right: 0;
    width: var(--ag-social-narrow-handle-width);
    height: var(--lobby-friends-height, 6dvh);
  }

  .ag-presence-handle {
    top: 0;
    left: calc(-1 * var(--ag-social-narrow-handle-overlap));
    width: var(--ag-social-narrow-handle-width);
    height: var(--lobby-friends-height, 6dvh);
  }

  .ag-presence-menu {
    top: calc(var(--lobby-friends-height, 6dvh) + 4px);
    left: calc(-1 * var(--ag-social-narrow-handle-overlap));
  }

  .ag-social-handle:hover,
  .ag-social-handle:focus-visible,
  .ag-presence-handle:hover,
  .ag-presence-handle:focus-visible {
    transform: none;
  }
}
