/* Social V6 — compact community composer, player profiles, friends and media chat. */

html[data-theme] body.dashboard-v2.dashboard-v3 .community-page-v5 {
  height: calc(100dvh - 74px);
  min-height: 560px;
  overflow: hidden;
}

html[data-theme] body.dashboard-v2.dashboard-v3 .community-page-v5 .community-layout-v5,
html[data-theme] body.dashboard-v2.dashboard-v3 .community-page-v5 .community-feed {
  height: 100%;
  min-height: 0;
}

html[data-theme] body.dashboard-v2.dashboard-v3 .community-page-v5 .community-feed {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

html[data-theme] body.dashboard-v2.dashboard-v3 .community-page-v5 .community-feed__head {
  margin-bottom: 14px;
}

html[data-theme] body.dashboard-v2.dashboard-v3 .community-page-v5 .community-post-grid {
  min-height: 0;
  grid-auto-rows: max-content;
  align-content: start;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 4px 10px 0;
  scrollbar-width: thin;
}

html[data-theme] body.dashboard-v2.dashboard-v3 .community-page-v5 .community-post-card__image,
html[data-theme] body.dashboard-v2.dashboard-v3 .community-page-v5 .community-post-card__video {
  aspect-ratio: auto !important;
  min-height: 0;
}

html[data-theme] body.dashboard-v2.dashboard-v3 .community-page-v5 .community-post-card__image img,
html[data-theme] body.dashboard-v2.dashboard-v3 .community-page-v5 .community-post-card__video video {
  width: 100%;
  height: auto !important;
  max-height: none !important;
  object-fit: contain !important;
  object-position: center;
  transform: none !important;
}

html[data-theme] body.dashboard-v2.dashboard-v3 .community-page-v5 .community-publish-card {
  position: relative !important;
  inset: auto !important;
  z-index: 2;
  margin-top: 4px;
  padding: 0 !important;
  overflow: visible;
  background: var(--dash-surface-solid) !important;
  border: 1px solid var(--dash-border-strong) !important;
  border-radius: 13px !important;
  box-shadow: 0 -8px 24px rgb(15 23 42 / 0.06) !important;
}

.community-composer-toggle {
  width: 100%;
  min-height: 62px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 10px 13px;
  color: var(--dash-text);
  background: transparent;
  border: 0;
  text-align: left;
}

.community-composer-toggle:hover {
  background: var(--dash-surface-hover);
}

.community-composer-toggle__icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--dash-primary);
  border-radius: 8px;
  font-size: 22px;
  font-weight: 500;
}

.community-composer-toggle > span:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.community-composer-toggle strong {
  color: var(--dash-heading);
  font-size: 14px;
}

.community-composer-toggle small {
  overflow: hidden;
  color: var(--dash-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-composer-toggle > b {
  color: var(--dash-primary);
  font-size: 12px;
  font-weight: 750;
}

.community-composer-panel {
  max-height: min(72dvh, 650px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 16px;
  border-top: 1px solid var(--dash-border);
  scrollbar-width: thin;
}

.community-composer-panel[hidden],
.community-composer-toggle[hidden] {
  display: none !important;
}

.community-publish-head__actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

#communityComposerCloseButton {
  min-height: 28px;
  padding: 0 9px;
  color: var(--dash-muted);
  background: var(--dash-surface-soft);
  border: 1px solid var(--dash-border);
  border-radius: 8px;
  font-size: 12px;
}

.community-author,
.community-comment__profile,
.chat-message__profile,
.player-avatar-trigger {
  appearance: none;
  color: inherit;
  background: transparent;
  border: 0;
  font: inherit;
  text-align: left;
}

.community-author,
.community-comment__profile,
.chat-message__profile,
.player-avatar-trigger,
.chat-message__avatar {
  cursor: pointer;
}

.community-author:hover strong,
.community-comment__profile:hover strong,
.chat-message__profile:hover strong {
  color: var(--dash-primary) !important;
}

/* Player avatars stay square in every social surface. */
.profile-avatar,
.sidebar-profile__avatar,
.top-profile__avatar,
.community-author__avatar,
.community-comment__avatar,
.community-identity__avatar,
.chat-message__avatar,
.chat-identity__avatar,
.chat-avatar-picker__preview,
.player-activity__avatar,
.server-playtime-avatar,
.player-profile-avatar,
.profile-friend-avatar {
  aspect-ratio: 1 / 1 !important;
  border-radius: 8px !important;
  overflow: hidden;
}

.profile-avatar img,
.sidebar-profile__avatar img,
.top-profile__avatar img,
.community-author__avatar img,
.community-comment__avatar img,
.community-identity__avatar img,
.chat-message__avatar img,
.chat-identity__avatar img,
.chat-avatar-picker__preview img,
.player-activity__avatar img,
.server-playtime-avatar img,
.player-profile-avatar img,
.profile-friend-avatar img {
  width: 100% !important;
  height: 100% !important;
  display: block;
  object-fit: cover !important;
  border-radius: inherit !important;
}

/* Announcement list styled as a calm notice center. */
.announcement-board {
  min-width: 0;
  margin-bottom: 18px;
  padding: 18px;
  background: var(--dash-surface-solid);
  border: 1px solid var(--dash-border);
  border-radius: 14px;
  box-shadow: var(--dash-shadow);
}

.announcement-board__header {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.announcement-board__header > div:first-child {
  display: grid;
  gap: 1px;
}

.announcement-board__header span {
  color: var(--dash-muted);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.08em;
}

.announcement-board__header h2 {
  margin: 0;
  color: var(--dash-heading);
  font-size: 19px;
}

.announcement-board__header > div:last-child {
  display: flex;
  align-items: center;
  gap: 9px;
}

.announcement-board__header button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--dash-muted);
  background: var(--dash-surface-soft);
  border: 1px solid var(--dash-border);
  border-radius: 9px;
}

.announcement-board__header button svg {
  width: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.announcement-board__header button.is-loading svg {
  animation: social-spin 700ms linear infinite;
}

.announcement-list {
  display: grid;
  gap: 12px;
}

.announcement-card {
  min-width: 0;
  padding: 18px 20px;
  background: var(--dash-surface-soft);
  border: 1px solid var(--dash-border);
  border-radius: 13px;
}

.announcement-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--dash-border);
}

.announcement-card__head > div {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.announcement-card__title {
  margin: 0;
  color: var(--dash-heading);
  font-size: 16px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.announcement-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 15px;
  color: var(--dash-muted);
  font-size: 12px;
}

.announcement-card__pin {
  flex: 0 0 auto;
  padding: 4px 8px;
  color: var(--dash-primary);
  background: var(--dash-primary-soft);
  border: 1px solid color-mix(in srgb, var(--dash-primary) 24%, var(--dash-border));
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
}

.announcement-card__content {
  margin: 15px 0 0;
  color: var(--dash-text);
  font-size: 14px;
  line-height: 1.8;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.announcement-card.is-loading {
  color: var(--dash-muted);
}

/* Chat composer tools, stickers and media. */
html[data-theme] body.dashboard-v2.dashboard-v3 .chat-room__footer {
  position: relative;
  z-index: 3;
}

html[data-theme] body.dashboard-v2.dashboard-v3 .chat-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 9px 10px;
}

.chat-composer__toolbar,
.chat-emoji-panel,
.chat-media-preview,
.chat-sticker-preview {
  grid-column: 1 / -1;
}

.chat-composer__toolbar {
  display: flex;
  align-items: center;
  gap: 7px;
}

.chat-composer__toolbar button,
.chat-media-picker {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 9px;
  color: var(--dash-text);
  background: var(--dash-surface-soft);
  border: 1px solid var(--dash-border);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.chat-composer__toolbar button:hover,
.chat-media-picker:hover,
.chat-composer__toolbar button[aria-expanded="true"] {
  color: var(--dash-primary);
  border-color: color-mix(in srgb, var(--dash-primary) 35%, var(--dash-border));
}

.chat-media-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.chat-emoji-panel {
  max-height: 220px;
  overflow-y: auto;
  padding: 10px;
  background: var(--dash-surface-soft);
  border: 1px solid var(--dash-border);
  border-radius: 10px;
  scrollbar-width: thin;
}

.chat-emoji-panel[hidden],
.chat-media-preview[hidden],
.chat-sticker-preview[hidden] {
  display: none !important;
}

.chat-emoji-panel__section + .chat-emoji-panel__section {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--dash-border);
}

.chat-emoji-panel__section > strong {
  display: block;
  margin-bottom: 7px;
  color: var(--dash-muted);
  font-size: 11px;
}

.chat-emoji-panel__grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(30px, 1fr));
  gap: 5px;
}

.chat-emoji-panel__grid button {
  min-width: 0;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  padding: 0;
  background: var(--dash-surface-solid);
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 20px;
}

.chat-emoji-panel__grid button:hover {
  background: var(--dash-primary-soft);
  border-color: color-mix(in srgb, var(--dash-primary) 25%, var(--dash-border));
}

.chat-emoji-panel__grid.is-stickers button {
  font-size: 27px;
}

.chat-media-preview,
.chat-sticker-preview {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px;
  background: var(--dash-surface-soft);
  border: 1px solid var(--dash-border);
  border-radius: 10px;
}

.chat-media-preview img,
.chat-media-preview video {
  width: 72px;
  height: 56px;
  flex: 0 0 auto;
  display: block;
  object-fit: cover;
  background: #0d1015;
  border-radius: 7px;
}

.chat-media-preview > div {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 3px;
}

.chat-media-preview strong,
.chat-media-preview small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-media-preview strong {
  color: var(--dash-heading);
  font-size: 12px;
}

.chat-media-preview small {
  color: var(--dash-muted);
  font-size: 11px;
}

.chat-media-preview button,
.chat-sticker-preview button {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 8px;
  color: #d34b55;
  background: transparent;
  border: 1px solid color-mix(in srgb, #d34b55 25%, var(--dash-border));
  border-radius: 7px;
}

.chat-sticker-preview > span {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  font-size: 34px;
}

.chat-sticker-preview > strong {
  flex: 1;
  color: var(--dash-heading);
  font-size: 13px;
}

html[data-theme] body.dashboard-v2.dashboard-v3 .chat-composer textarea {
  min-height: 44px;
  max-height: 120px;
  resize: vertical;
}

.chat-composer__actions {
  align-self: stretch;
  display: flex !important;
  align-items: flex-end !important;
  justify-content: flex-end !important;
}

.chat-character-count {
  display: none !important;
}

.chat-message__main {
  min-width: 0;
}

.chat-message__meta {
  flex-wrap: wrap;
}

.chat-message__profile {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0;
}

.chat-message__friend {
  min-height: 24px;
  padding: 0 7px;
  color: var(--dash-primary);
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--dash-primary) 24%, var(--dash-border));
  border-radius: 7px;
  font-size: 10px;
}

.chat-message__media {
  max-width: min(520px, 100%);
  margin-top: 7px;
  overflow: hidden;
  background: #0d1015;
  border: 1px solid var(--dash-border);
  border-radius: 10px;
}

.chat-message__media img,
.chat-message__media video {
  width: 100%;
  max-height: 420px;
  display: block;
  object-fit: contain;
  background: #0d1015;
}

.chat-message__sticker {
  display: inline-grid;
  place-items: center;
  min-width: 82px;
  min-height: 82px;
  margin-top: 5px;
  font-size: 58px;
  line-height: 1;
}

/* My activity and friends. */
.profile-activity-panel,
.profile-friends-panel {
  min-width: 0;
  padding: 18px;
  background: var(--dash-surface-solid);
  border: 1px solid var(--dash-border);
  border-radius: 14px;
  box-shadow: var(--dash-shadow);
}

.profile-activity-panel[hidden],
.profile-friends-panel[hidden] {
  display: none !important;
}

.profile-activity-panel > header,
.profile-friends-panel > header,
.player-profile-history > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.profile-activity-panel > header > div,
.profile-friends-panel > header > div {
  display: grid;
  gap: 1px;
}

.profile-activity-panel > header span,
.profile-friends-panel > header span {
  color: var(--dash-muted);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.08em;
}

.profile-activity-panel h2,
.profile-friends-panel h2 {
  margin: 0;
  color: var(--dash-heading);
  font-size: 17px;
}

.profile-activity-panel > header button {
  min-height: 32px;
  padding: 0 10px;
  color: var(--dash-primary);
  background: var(--dash-primary-soft);
  border: 1px solid color-mix(in srgb, var(--dash-primary) 24%, var(--dash-border));
  border-radius: 8px;
}

.profile-activity-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.profile-activity-summary article {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 13px;
  background: var(--dash-surface-soft);
  border: 1px solid var(--dash-border);
  border-radius: 10px;
}

.profile-activity-summary span,
.profile-activity-summary small {
  color: var(--dash-muted);
  font-size: 11px;
}

.profile-activity-summary strong {
  overflow: hidden;
  color: var(--dash-heading);
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-activity-requirements {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.profile-requirement {
  min-width: 0;
  padding: 10px;
  color: var(--dash-muted);
  background: var(--dash-surface-soft);
  border: 1px solid var(--dash-border);
  border-radius: 9px;
  font-size: 11px;
}

.profile-requirement strong {
  display: block;
  margin-bottom: 3px;
  color: var(--dash-heading);
  font-size: 12px;
}

.profile-requirement[data-unlocked="true"] {
  color: #2e9668;
  border-color: color-mix(in srgb, #2e9668 30%, var(--dash-border));
}

.profile-activity-server-list,
.profile-friends-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.profile-activity-server,
.profile-friend-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px;
  background: var(--dash-surface-soft);
  border: 1px solid var(--dash-border);
  border-radius: 10px;
}

.profile-activity-server > div,
.profile-friend-row > div {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 3px;
}

.profile-activity-server strong,
.profile-friend-row strong {
  overflow: hidden;
  color: var(--dash-heading);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-activity-server small,
.profile-friend-row small {
  color: var(--dash-muted);
  font-size: 11px;
}

.profile-activity-server > b {
  flex: 0 0 auto;
  color: var(--dash-heading);
  font-size: 12px;
}

.profile-friend-avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--dash-primary);
  font-size: 13px;
  font-weight: 800;
}

.profile-friend-row > button {
  min-height: 30px;
  padding: 0 8px;
  color: #d34b55;
  background: transparent;
  border: 1px solid color-mix(in srgb, #d34b55 25%, var(--dash-border));
  border-radius: 7px;
  font-size: 11px;
}

.profile-friend-add-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.profile-friend-add-form input {
  min-width: 0;
  height: 40px;
  padding: 0 11px;
  color: var(--dash-text);
  background: var(--dash-surface-soft);
  border: 1px solid var(--dash-border);
  border-radius: 9px;
  outline: none;
}

.profile-friend-add-form input:focus {
  border-color: var(--dash-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--dash-primary) 12%, transparent);
}

.profile-friend-add-form button {
  min-height: 40px;
  padding: 0 13px;
  color: #fff;
  background: var(--dash-primary);
  border: 0;
  border-radius: 9px;
  font-weight: 750;
}

/* Public player profile drawer. */
.player-profile-backdrop {
  position: fixed;
  inset: 0;
  z-index: 145;
  background: rgb(15 23 42 / 0.46);
}

.player-profile-backdrop[hidden],
.player-profile-modal[hidden] {
  display: none !important;
}

.player-profile-modal {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 146;
  width: min(480px, 100vw);
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  color: var(--dash-text);
  background: var(--dash-surface-solid);
  border-left: 1px solid var(--dash-border);
  box-shadow: -20px 0 56px rgb(15 23 42 / 0.18);
}

.player-profile-modal__header {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px;
  border-bottom: 1px solid var(--dash-border);
}

.player-profile-modal__header > div {
  display: grid;
  gap: 1px;
}

.player-profile-modal__header span {
  color: var(--dash-muted);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.08em;
}

.player-profile-modal__header h2 {
  margin: 0;
  color: var(--dash-heading);
  font-size: 18px;
}

.player-profile-modal__header button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--dash-muted);
  background: var(--dash-surface-soft);
  border: 1px solid var(--dash-border);
  border-radius: 9px;
}

.player-profile-modal__header svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.player-profile-loading,
.player-profile-content {
  min-height: 0;
  overflow-y: auto;
  padding: 18px;
  scrollbar-width: thin;
}

.player-profile-loading {
  display: grid;
  place-items: center;
  color: var(--dash-muted);
}

.player-profile-identity {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--dash-border);
}

.player-profile-avatar {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--dash-primary);
  font-size: 20px;
  font-weight: 850;
}

.player-profile-identity > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.player-profile-identity h3,
.player-profile-identity p,
.player-profile-identity small {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-profile-identity h3 {
  color: var(--dash-heading);
  font-size: 19px;
}

.player-profile-identity p,
.player-profile-identity small {
  color: var(--dash-muted);
  font-size: 12px;
}

#playerProfileAddFriendButton {
  min-height: 34px;
  padding: 0 10px;
  color: var(--dash-primary);
  background: var(--dash-primary-soft);
  border: 1px solid color-mix(in srgb, var(--dash-primary) 25%, var(--dash-border));
  border-radius: 8px;
  font-weight: 750;
}

#playerProfileAddFriendButton[hidden] {
  display: none !important;
}

.player-profile-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.player-profile-summary article {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 13px;
  background: var(--dash-surface-soft);
  border: 1px solid var(--dash-border);
  border-radius: 10px;
}

.player-profile-summary span {
  color: var(--dash-muted);
  font-size: 11px;
}

.player-profile-summary strong {
  overflow: hidden;
  color: var(--dash-heading);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-profile-history > header {
  margin-bottom: 9px;
}

.player-profile-history h3 {
  margin: 0;
  color: var(--dash-heading);
  font-size: 15px;
}

.player-profile-history header span {
  color: var(--dash-muted);
  font-size: 11px;
}

#playerProfileServerList {
  display: grid;
  gap: 8px;
}

.player-profile-server {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 12px;
  padding: 12px;
  background: var(--dash-surface-soft);
  border: 1px solid var(--dash-border);
  border-radius: 10px;
}

.player-profile-server strong {
  overflow: hidden;
  color: var(--dash-heading);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-profile-server b {
  color: var(--dash-heading);
  font-size: 12px;
}

.player-profile-server small {
  grid-column: 1 / -1;
  color: var(--dash-muted);
  font-size: 11px;
}

.player-profile-message {
  min-height: 38px;
  margin: 0;
  padding: 10px 18px;
  color: var(--dash-muted);
  border-top: 1px solid var(--dash-border);
  font-size: 12px;
}

@media (max-width: 1180px) {
  html[data-theme] body.dashboard-v2.dashboard-v3 .community-page-v5 .community-post-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  html[data-theme] body.dashboard-v2.dashboard-v3 .community-page-v5 .community-post-column {
    width: 100%;
  }
}

@media (max-width: 800px) {
  html[data-theme] body.dashboard-v2.dashboard-v3 .community-page-v5 {
    height: calc(100dvh - 70px);
    min-height: 520px;
  }

  .chat-emoji-panel__grid {
    grid-template-columns: repeat(8, minmax(30px, 1fr));
  }
}

@media (max-width: 520px) {
  html[data-theme] body.dashboard-v2.dashboard-v3 .community-page-v5 .community-feed {
    padding: 12px !important;
  }

  html[data-theme] body.dashboard-v2.dashboard-v3 .community-page-v5 .community-post-grid {
    padding-right: 0;
  }

  .community-composer-panel {
    max-height: 68dvh;
    padding: 13px;
  }

  .community-publish-head {
    align-items: flex-start !important;
  }

  .community-publish-head__actions {
    align-items: flex-end;
    flex-direction: column-reverse;
  }

  html[data-theme] body.dashboard-v2.dashboard-v3 .chat-composer {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .chat-composer__toolbar {
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .chat-composer__toolbar::-webkit-scrollbar {
    display: none;
  }

  .chat-composer__toolbar button,
  .chat-media-picker {
    flex: 0 0 auto;
  }

  .chat-emoji-panel__grid {
    grid-template-columns: repeat(6, minmax(32px, 1fr));
  }

  .profile-activity-summary,
  .profile-activity-requirements,
  .player-profile-summary {
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-friend-add-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .player-profile-modal {
    top: auto;
    bottom: 0;
    width: 100%;
    height: min(88dvh, 760px);
    padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid var(--dash-border);
    border-left: 0;
    border-radius: 16px 16px 0 0;
  }

  .player-profile-identity {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .player-profile-avatar {
    width: 54px;
    height: 54px;
  }

  #playerProfileAddFriendButton {
    grid-column: 1 / -1;
    width: 100%;
  }
}

/* Chat hub: public room and private friend conversations. */
.chat-hub {
  min-width: 0;
  height: clamp(640px, calc(100dvh - 108px), 820px);
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  overflow: hidden;
  background: var(--dash-surface-solid);
  border: 1px solid var(--dash-border);
  border-radius: 16px;
  box-shadow: var(--dash-shadow);
}

.chat-hub__sidebar {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 14px;
  overflow: hidden;
  background: var(--dash-surface-soft);
  border-right: 1px solid var(--dash-border);
}

.chat-hub__sidebar-head,
.shop-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chat-hub__sidebar-head > div {
  display: grid;
  gap: 1px;
}

.chat-hub__sidebar-head span,
.chat-hub__section-title > span {
  color: var(--dash-muted);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.08em;
}

.chat-hub__sidebar-head h2 {
  margin: 0;
  color: var(--dash-heading);
  font-size: 18px;
}

.chat-hub__sidebar-head > button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--dash-muted);
  background: var(--dash-surface-solid);
  border: 1px solid var(--dash-border);
  border-radius: 9px;
}

.chat-hub__sidebar-head svg {
  width: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.chat-hub__sidebar-head > button:disabled svg {
  animation: social-spin 700ms linear infinite;
}

.chat-hub__section-title {
  min-height: 27px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 3px 0;
}

.chat-hub__section-title button {
  padding: 0;
  color: var(--dash-primary);
  background: transparent;
  border: 0;
  font-size: 11px;
  font-weight: 720;
}

.chat-conversation-list {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.chat-conversation {
  min-width: 0;
  width: 100%;
  min-height: 62px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px;
  color: var(--dash-text);
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 11px;
}

.chat-conversation:hover {
  background: var(--dash-surface-solid);
  border-color: var(--dash-border);
}

.chat-conversation.is-active {
  background: var(--dash-primary-soft);
  border-color: color-mix(in srgb, var(--dash-primary) 30%, var(--dash-border));
}

.chat-conversation__avatar,
.chat-room__avatar {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  background: var(--dash-primary);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 820;
}

.chat-conversation__avatar img,
.chat-room__avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.chat-conversation__copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.chat-conversation__copy strong,
.chat-conversation__copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-conversation__copy strong {
  color: var(--dash-heading);
  font-size: 13px;
}

.chat-conversation__copy small {
  color: var(--dash-muted);
  font-size: 10px;
}

.chat-conversation > b {
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  color: #fff;
  background: var(--dash-primary);
  border-radius: 999px;
  font-size: 9px;
}

.chat-conversation-empty {
  margin: 4px 2px;
  padding: 12px;
  color: var(--dash-muted);
  text-align: center;
  background: var(--dash-surface-solid);
  border: 1px dashed var(--dash-border);
  border-radius: 10px;
  font-size: 11px;
  line-height: 1.6;
}

html[data-theme] body.dashboard-v2.dashboard-v3 .chat-hub .chat-room {
  min-width: 0;
  min-height: 0;
  height: auto;
  display: grid;
  grid-template-rows: 66px minmax(0, 1fr) auto;
  overflow: hidden;
  background: var(--dash-surface-solid);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

html[data-theme] body.dashboard-v2.dashboard-v3 .chat-hub .chat-room__header {
  min-height: 66px;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 18px;
  background: var(--dash-surface-solid);
  border-bottom: 1px solid var(--dash-border);
}

.chat-room__identity,
.chat-room__status {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
}

.chat-room__identity > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.chat-room__identity strong {
  overflow: hidden;
  color: var(--dash-heading);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-room__identity small,
.chat-room__status > span {
  color: var(--dash-muted);
  font-size: 10px;
}

.chat-room__status {
  flex: 0 0 auto;
  gap: 13px;
}

html[data-theme] body.dashboard-v2.dashboard-v3 .chat-hub .chat-message-list {
  min-height: 0;
  height: auto;
  padding: 18px;
  background: var(--dash-surface-soft);
}

html[data-theme] body.dashboard-v2.dashboard-v3 .chat-hub .chat-room__footer {
  padding: 12px 14px 13px;
  background: var(--dash-surface-solid);
}

html[data-theme] body.dashboard-v2.dashboard-v3 .chat-hub .chat-message {
  max-width: min(82%, 720px);
}

.profile-friend-row__actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.profile-friend-row__actions > button {
  min-height: 30px;
  padding: 0 8px;
  color: #d34b55;
  background: transparent;
  border: 1px solid color-mix(in srgb, #d34b55 25%, var(--dash-border));
  border-radius: 7px;
  font-size: 11px;
}

.profile-friend-row__actions > button.is-message {
  color: var(--dash-primary);
  border-color: color-mix(in srgb, var(--dash-primary) 28%, var(--dash-border));
}

@media (max-width: 1050px) {
  .chat-hub {
    height: calc(100dvh - 88px);
    min-height: 640px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 84px minmax(0, 1fr);
  }

  .chat-hub__sidebar {
    display: grid;
    grid-template-columns: 142px minmax(0, 1fr);
    gap: 8px;
    padding: 8px;
    border-right: 0;
    border-bottom: 1px solid var(--dash-border);
  }

  .chat-hub__sidebar-head,
  .chat-hub__section-title {
    display: none;
  }

  .chat-conversation-list {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .chat-conversation {
    width: 180px;
    min-height: 66px;
    flex: 0 0 180px;
  }

  .chat-conversation--public {
    width: 142px;
    min-height: 66px;
  }

  .chat-conversation-empty {
    min-width: 230px;
    margin: 0;
  }
}

@media (max-width: 560px) {
  .chat-hub {
    width: calc(100% + 4px);
    min-height: 620px;
    margin-inline: -2px;
    border-radius: 12px;
  }

  .chat-hub__sidebar {
    grid-template-columns: 112px minmax(0, 1fr);
  }

  .chat-conversation--public {
    width: 112px;
    grid-template-columns: 34px minmax(0, 1fr);
    padding: 7px;
  }

  .chat-conversation {
    width: 154px;
    flex-basis: 154px;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 7px;
    padding: 7px;
  }

  .chat-conversation__avatar {
    width: 34px;
    height: 34px;
    border-radius: 8px;
  }

  html[data-theme] body.dashboard-v2.dashboard-v3 .chat-hub .chat-room__header {
    padding: 0 12px;
  }

  .chat-room__identity small,
  .chat-room__status > span {
    display: none;
  }

  .chat-room__status {
    gap: 6px;
  }

  html[data-theme] body.dashboard-v2.dashboard-v3 .chat-hub .chat-message-list {
    padding: 13px 10px;
  }

  html[data-theme] body.dashboard-v2.dashboard-v3 .chat-hub .chat-message {
    max-width: 94%;
  }

  .profile-friend-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .profile-friend-row__actions {
    width: 100%;
    padding-left: 48px;
  }
}

@keyframes social-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .announcement-board__header button.is-loading svg {
    animation: none;
  }
}
