/* Friends */
#friendsOpen { display: inline-flex; align-items: center; gap: 5px; }
#friendsOpen[hidden] { display: none; }
#friendsBadge { min-width: 18px; padding: 0 5px; border-radius: 999px; background: #ec3d70; color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
#friendsBadge[hidden] { display: none; }
#friendsDialog { width: min(480px, calc(calc(100vw / var(--site-zoom, 1)) - 24px)); max-height: calc(calc(100dvh / var(--site-zoom, 1)) - 32px); overflow-y: auto; }
#friendsDialog h3 { margin: 16px 0 6px; font-size: 15px; }
#friendsStatus { margin: 8px 0 0; font-weight: 700; }
#friendsStatus:empty { display: none; }
.friends-last { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0 12px; padding: 10px 12px; border: 2px solid var(--ink); border-radius: 10px; background: #b6f06b; color: #252046; }
.friends-last > div { display: grid; min-width: 0; }
.friends-last small { overflow-wrap: anywhere; }
.friends-last button { flex: none; min-height: 44px; }
.friend-add label { margin: 4px 0 6px; font-weight: 700; font-size: 14px; }
.friend-add > div { display: flex; gap: 6px; }
.friend-add input { flex: 1; min-width: 0; min-height: 44px; font-size: 16px; }
.friend-add button[type="submit"] { flex: none; min-height: 44px; }
.friend-add small { display: block; margin-top: 6px; font-size: 12px; }
.link-button { min-height: 32px; padding: 2px 6px; border: 0 !important; background: none !important; box-shadow: none !important; color: inherit; text-decoration: underline; font-weight: 700; }
.friend-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.friend-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: #fffaf0; color: #252046; }
.friend-face { width: 48px; height: 48px; padding: 0; overflow: hidden; border-radius: 8px; box-shadow: none; }
.friend-face svg, .friend-face img { display: block; width: 100%; height: 100%; object-fit: cover; }
.friend-info { display: grid; min-width: 0; }
.friend-info b, .friend-info small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend-info small { font-size: 12px; opacity: .8; }
.friend-room { color: #1f7a4d; font-weight: 700; opacity: 1 !important; }
.friend-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.friend-actions button { min-height: 36px; padding: 4px 10px; font-size: 12px; }
.friends-empty { font-size: 13px; }
.friend-card { display: grid; justify-items: center; gap: 4px; margin-top: 6px; text-align: center; }
.friend-card-avatar { width: 128px; height: 128px; overflow: hidden; border: 3px solid var(--ink); border-radius: 14px; box-shadow: 4px 4px 0 var(--ink); }
.friend-card-avatar svg, .friend-card-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.friend-card h3 { margin: 10px 0 0; font-size: 22px; }
.friend-card > p { margin: 0; }
.friend-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 8px 0; }
.friend-stats span { display: grid; min-width: 78px; padding: 6px 10px; border: 2px solid var(--ink); border-radius: 8px; background: #fff3cf; color: #252046; font-size: 12px; }
.friend-stats b { font-size: 15px; }
.friend-favs { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 0; padding: 0; list-style: none; }
.friend-favs li { padding: 3px 9px; border: 1px solid var(--ink); border-radius: 999px; background: #c6abff; color: #252046; font-size: 12px; }
.friend-card h4 { margin: 12px 0 4px; }
.friend-remove { margin-top: 10px; color: #a13f2c; }
#roomLast { margin: 10px 0 0; }
#roomRejoin { width: 100%; min-height: 44px; background: #b6f06b; }
@media (max-width: 680px) {
  #friendsOpen .friends-label { display: none; }
  .friend-row { grid-template-columns: 44px minmax(0, 1fr); }
  .friend-face { width: 44px; height: 44px; }
  .friend-actions { grid-column: 1 / -1; justify-content: stretch; }
  .friend-actions button { flex: 1; min-height: 40px; }
}

/* Shop: each outfit shows a small preview of your avatar wearing it. */
#profileSkins button { display: flex; align-items: center; gap: 8px; text-align: left; }
.skin-preview { flex: none; width: 34px; height: 34px; overflow: hidden; border-radius: 6px; }
.skin-preview svg { display: block; width: 100%; height: 100%; }

/* Phones: four header buttons in one row when signed in (profile and friends show as icons). */
@media (max-width: 680px) {
  html body:has(#friendsOpen:not([hidden])) #headerMenu { grid-template-columns: 1fr 48px 52px 1.4fr; }
  html body #headerMenu #friendsOpen { justify-content: center; gap: 2px; padding-inline: 2px; }
}

/* Your friend code */
.friend-code { display: grid; justify-items: center; gap: 4px; margin: 4px 0 12px; padding: 12px; border: 2px dashed #7a4fc1; border-radius: 14px; background: #f1e9ff; color: #252046; text-align: center; }
.friend-code small { font-size: 12px; opacity: .8; }
#friendCopy { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 6px 16px; border-radius: 12px; background: #252046; color: #f8d633; box-shadow: 3px 3px 0 #7a4fc1; }
#friendCopy b { font: 800 24px/1 ui-monospace, Menlo, monospace; letter-spacing: 3px; }
#friendCopy span { font-size: 16px; opacity: .8; }
.friend-card-code { font-family: ui-monospace, Menlo, monospace; letter-spacing: 1px; color: #7a4fc1; }
