/* Social layer (Social UX 47, "LA Postcard"): person cards, Friends panel, private chat, doorbell.
   Cream postcards with a blue tape top-left and a pink tape bottom-right, pastel pills, the 3D prop icons.
   Everything is scoped under #soc so the game's own button / input styles don't leak in or out. */
#soc { --pc-bg: #fff9ec; --pc-edge: #e7d7ba; --pc-ink: #345e58; --pc-mute: #99a18d; --pc-rule: #d6c6a8;
  --pc-mint: #d2e9e1; --pc-mint-ink: #477b6d; --pc-pink: #f5dce6; --pc-pink-ink: #a06a82; --pc-sand: #f2ebdc;
  position: fixed; inset: 0; pointer-events: none; font-family: Nunito, "Noto Sans SC", system-ui, sans-serif; color: var(--pc-ink); }
#soc .soc-card, #soc .soc-pills { pointer-events: auto; }
#soc button { font: inherit; color: inherit; border: 0; cursor: pointer; background: none; padding: 0; margin: 0; }
#soc button:disabled { opacity: .45; cursor: default; }
#soc input[type=text] { font: inherit; width: 100%; background: transparent; border: 0; box-shadow: none; border-radius: 0; padding: 0; color: var(--pc-ink); font-weight: 700; outline: none; }
#soc input::placeholder { color: #a7ac99; font-weight: 700; }
#soc .toy { width: 28px; height: 28px; object-fit: contain; flex-shrink: 0; vertical-align: middle; }
#soc .toy.sm { width: 22px; height: 22px; } #soc .toy.lg { width: 42px; height: 42px; }

/* the postcard */
#soc .soc-card { position: fixed; background: var(--pc-bg); border: 5px solid var(--pc-edge); border-radius: 22px; isolation: isolate;
  box-shadow: inset 0 0 0 2px #fffef5, 0 5px 0 #c5b596, 0 8px 12px #5e675e20; }
#soc .soc-card.soc-anim { animation: soc-in .18s ease-out; }   /* only when a card first appears, never on refresh */
#soc .soc-card::before { content: ''; position: absolute; left: -8px; top: -4px; width: 38px; height: 12px; background: #b2d7e8; border: 1px solid #e4f1f3; border-radius: 3px; transform: rotate(-19deg); box-shadow: 0 1px 0 #93b9ca88; pointer-events: none; }
#soc .soc-card::after { content: ''; position: absolute; right: -8px; bottom: -2px; width: 38px; height: 12px; background: #edbfd0; border: 1px solid #ffe5ed; border-radius: 3px; transform: rotate(-19deg); box-shadow: 0 1px 0 #c797aa88; pointer-events: none; }
@keyframes soc-in { from { transform: translateY(8px) scale(.98); } }
@media (prefers-reduced-motion: reduce) { #soc .soc-card.soc-anim { animation: none; } }

/* round portraits */
#soc .soc-pt { position: relative; display: block; width: var(--s); height: var(--s); border-radius: 50%; overflow: hidden; flex-shrink: 0; background: #e3eee6; box-shadow: 0 0 0 3px #fffdf4, 0 0 0 4px #ded8c7; }
#soc .soc-pt canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#soc .soc-x { margin-left: auto; align-self: flex-start; font-size: 24px; line-height: 1; color: #a3a795; width: 26px; height: 30px; }
#soc .soc-x:hover { color: var(--pc-ink); }
#soc .soc-on { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: #c7cabb; flex-shrink: 0; }
#soc .soc-on.yes { background: #85bc98; }
#soc .soc-unread { display: inline-block; font-style: normal; background: #f1d2dd; color: #ac7a93; font-size: 9px; min-width: 15px; padding: 1px 4px; border-radius: 6px; margin-left: 4px; text-align: center; font-weight: 800; }
#soc .soc-fine { text-align: center; font-size: 9px; color: #b2ac97; margin: 12px 0 0; }
#soc .soc-empty { font-size: 12px; color: var(--pc-mute); text-align: center; padding: 22px 8px; margin: 0; line-height: 1.5; }

/* person card: player and citizen */
#soc .soc-person { width: 264px; padding: 17px 15px 10px; z-index: 3; }
#soc .soc-head { display: flex; gap: 11px; align-items: center; }
#soc .soc-head h2 { font-size: 21px; font-weight: 900; margin: 0 0 4px; }
#soc .soc-tag { font-size: 10px; background: #e4eee3; padding: 3px 6px; border-radius: 7px; color: #739583; font-weight: 800; }
#soc .soc-note { font-size: 10px; color: var(--pc-mute); padding: 14px 1px 9px; margin: 0; font-weight: 700; }
#soc .soc-say { font-size: 12px; line-height: 1.45; color: #6f7d6a; background: #f3ead8; border: 1px dashed #d5c7aa; border-radius: 12px; padding: 9px 11px; margin: 12px 0 6px; font-weight: 700; }
#soc .soc-rule { border-bottom: 1px dashed var(--pc-rule); margin-bottom: 7px; }
#soc .soc-row { width: 100%; display: flex; gap: 9px; align-items: center; padding: 8px 7px; border-radius: 12px; font-size: 12px; font-weight: 800; min-height: 43px; margin-top: 4px; text-align: left; }
#soc .soc-row:hover { background: #f6efdf; }
#soc .soc-row .toy { width: 27px; height: 27px; }
#soc .soc-row span { flex: 1; }
#soc .soc-row b { margin-left: auto; color: #8faaa1; font-size: 18px; }
#soc .soc-row.soc-em { background: var(--pc-mint); color: var(--pc-mint-ink); box-shadow: 0 2px 0 #b7d2c3; }
#soc .soc-row.soc-pend { background: var(--pc-pink); color: var(--pc-pink-ink); }
#soc .soc-row.soc-ok { background: #e9efdc; color: #7a9277; cursor: default; }
#soc .soc-row.soc-ok a { cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
#soc .soc-row.soc-off { color: #a9a691; cursor: default; }
#soc .soc-row.soc-off:hover, #soc .soc-row.soc-ok:hover { background: #e9efdc; }
#soc .soc-row.soc-off:hover { background: none; }
#soc .soc-pair { display: flex; gap: 6px; align-items: center; }
#soc .soc-pair .soc-row { flex: 1; }
#soc .soc-mini { font-size: 11px; font-weight: 800; padding: 7px 10px; border-radius: 9px; background: var(--pc-sand); color: #9a9f87; margin-top: 4px; white-space: nowrap; }
#soc .soc-mini.em { background: #c4e3db; color: var(--pc-mint-ink); }
#soc .soc-moreb { display: block; width: 100%; padding: 10px 0 2px; color: #a29783; font-size: 10px; font-weight: 800; }
#soc .soc-more { border-top: 1px dashed var(--pc-rule); margin-top: 8px; padding-top: 6px; display: grid; gap: 2px; }
#soc .soc-more > button, #soc .soc-menu > button { display: grid; grid-template-columns: 24px 1fr; column-gap: 8px; align-items: center; text-align: left; padding: 6px 6px; border-radius: 10px; font-size: 12px; font-weight: 800; }
#soc .soc-more > button .toy, #soc .soc-menu > button .toy { width: 22px; height: 22px; grid-row: span 2; }
#soc .soc-more small { grid-column: 2; font-size: 9px; color: #a6a58f; font-weight: 700; }
#soc .soc-more > button:hover, #soc .soc-menu > button:hover { background: #f6efdf; }
#soc .soc-report { background: #fbf2e2; border-radius: 10px; padding: 8px; margin: 2px 0 4px; }
#soc .soc-report p { margin: 0 0 6px; font-size: 11px; font-weight: 800; }
#soc .soc-chip { display: inline-flex; align-items: center; gap: 5px; background: var(--pc-sand); color: #8d8f78; border-radius: 9px; padding: 5px 9px; font-size: 10px; font-weight: 800; margin: 0 5px 5px 0; }
#soc .soc-chip .toy { width: 20px; height: 20px; }
#soc .soc-chips { margin-top: 2px; }

/* the Friends panel */
#soc .soc-panel { right: 22px; top: 214px; width: 432px; max-height: calc(100vh - 236px); padding: 19px 20px 12px; display: flex; flex-direction: column; z-index: 2; }
#soc .soc-phead { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-shrink: 0; }
#soc .soc-hp { width: 47px; height: 47px; border-radius: 15px; background: #f6e1e7; display: grid; place-items: center; flex-shrink: 0; }
#soc .soc-hp .toy { width: 41px; height: 41px; }
#soc .soc-phead h2 { font-size: 25px; font-weight: 900; margin: 0 0 3px; }
#soc .soc-phead p { font-size: 12px; margin: 0; color: #94a18e; font-weight: 700; }
#soc .soc-tabs { display: flex; gap: 7px; border-bottom: 1px dashed var(--pc-rule); padding-bottom: 13px; flex-shrink: 0; }
#soc .soc-tabs button { background: var(--pc-sand); border-radius: 11px; padding: 8px 12px; font-size: 12px; font-weight: 800; color: #9b9b85; }
#soc .soc-tabs button.on { background: var(--pc-pink); color: var(--pc-pink-ink); }
#soc .soc-tabs span { background: #fffaf1; border-radius: 6px; font-size: 10px; padding: 1px 5px; margin-left: 4px; }
#soc .soc-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #d3dfcc transparent; }
#soc .soc-search { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 14px 0 12px; border: 1px solid #d9decd; border-radius: 11px; background: #fffef8; padding: 8px 12px; font-size: 11px; }
#soc .soc-search:focus-within { border-color: #9ccabb; }
#soc .soc-notice { display: flex; align-items: center; gap: 7px; background: #edf1df; border-radius: 10px; font-size: 10px; color: #7b9981; padding: 6px 9px; margin-bottom: 4px; font-weight: 800; }
#soc .soc-notice .toy { width: 24px; height: 24px; }
#soc .soc-fr { position: relative; display: flex; align-items: center; gap: 15px; padding: 14px 3px; border-bottom: 1px dashed #ded4bb; width: 100%; text-align: left; }
#soc .soc-fr:last-child { border-bottom: 0; }
#soc .soc-fi { flex: 1; min-width: 0; }
#soc .soc-fi h3 { margin: 0 0 5px; font-size: 16px; font-weight: 900; display: flex; gap: 8px; align-items: center; }
#soc .soc-fi p { font-size: 10px; color: #9ba58f; margin: 0 0 8px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#soc .soc-acts { display: flex; gap: 7px; flex-wrap: wrap; }
#soc .soc-acts button { font-size: 10px; font-weight: 800; padding: 5px 11px; background: #dcebe4; color: #789b8b; border-radius: 8px; }
#soc .soc-acts button.pink { background: #f5e3e8; color: #a27e8f; }
#soc .soc-dots { padding: 2px 4px; font-size: 16px; letter-spacing: -1px; color: #9ca491; font-weight: 900; align-self: center; }
#soc .soc-thread { cursor: pointer; }
#soc .soc-thread:hover { background: #fbf4e6; }
#soc .soc-thread small { font-size: 9px; color: #b0ad98; align-self: flex-start; margin-top: 4px; }
#soc .soc-menu { position: absolute; right: 0; top: calc(100% - 10px); z-index: 4; background: #fffdf6; border: 2px solid var(--pc-edge); border-radius: 14px; box-shadow: 0 4px 0 #d8c8a8, 0 8px 14px #5e675e22; padding: 6px; width: 220px; display: grid; gap: 1px; }
#soc .soc-find { font-size: 10px; color: #a2a790; margin: 13px 0 7px; font-weight: 800; }
#soc .soc-primary { min-height: 40px; padding: 8px 12px; width: 100%; display: flex; gap: 7px; align-items: center; justify-content: center; background: #c4e3db; border-radius: 12px; font-weight: 900; font-size: 13px; color: var(--pc-mint-ink); box-shadow: 0 2px 0 #accbbd; flex-shrink: 0; }
#soc .soc-primary:hover { background: #b8ddd2; }
#soc .soc-primary .toy { width: 24px; height: 24px; }
#soc .soc-primary.sm { min-height: 32px; font-size: 12px; margin-top: 8px; }
#soc .soc-second { width: 100%; padding: 11px 0 0; font-size: 11px; color: #a1a48c; font-weight: 800; }
#soc .soc-addrow { display: flex; gap: 8px; align-items: center; border: 2px solid #c8dfda; border-radius: 13px; background: #fffef8; padding: 6px 6px 6px 12px; }
#soc .soc-addrow .soc-mini { margin: 0; }
#soc .soc-foot { display: flex; justify-content: space-around; border-top: 1px dashed #dccdb0; margin-top: 12px; padding-top: 9px; flex-shrink: 0; }
#soc .soc-foot button { font-size: 11px; color: #a0a68f; font-weight: 800; padding: 4px 10px; }
#soc .soc-foot button.on { color: #99758b; }

/* invites (in the Invites tab and as chat cards) */
#soc .soc-invite { background: #fbebf0; border: 1px solid #e7cbd5; border-radius: 15px; padding: 13px; margin: 6px 0; }
#soc .soc-log .soc-invite { width: 88%; align-self: flex-end; margin: 2px 0 0; }
#soc .soc-log .soc-invite.in { align-self: flex-start; }
#soc .soc-itop { display: flex; align-items: center; gap: 8px; }
#soc .soc-itop h3 { font-size: 14px; margin: 0 0 5px; font-weight: 900; color: #946f83; }
#soc .soc-itop p { font-size: 10px; color: #ac8e9a; margin: 0; font-weight: 700; }
#soc .soc-iaddr { border-top: 1px dashed #e0bcc9; padding-top: 10px; margin-top: 10px; font-size: 11px; color: #a18893; font-weight: 800; }
#soc .soc-istat { background: #fff8ec; border-radius: 8px; padding: 7px 8px; text-align: center; font-size: 10px; color: #91a38e; margin-top: 10px; font-weight: 800; }
#soc .soc-invite .soc-acts { margin-top: 10px; }

/* private chat */
#soc .soc-dm { padding-bottom: 10px; }
#soc .soc-dhead { position: relative; display: flex; gap: 12px; align-items: center; border-bottom: 1px dashed #dbcdb0; padding-bottom: 15px; flex-shrink: 0; }
#soc .soc-dhead h2 { margin: 0 0 4px; font-size: 21px; font-weight: 900; }
#soc .soc-dhead p { display: flex; gap: 5px; align-items: center; font-size: 10px; color: #95a38f; margin: 0; font-weight: 800; }
#soc .soc-dhead .soc-dots { margin-left: auto; }
#soc .soc-dhead .soc-x { margin-left: 0; }
#soc .soc-dhead .soc-menu { top: 70px; }
#soc .soc-back { font-size: 30px; color: #98ac9a; padding: 0 3px; line-height: 1; }
#soc .soc-log { display: flex; flex-direction: column; gap: 12px; padding: 16px 2px 8px; }
#soc .soc-time { text-align: center; color: #aca68e; font-size: 10px; font-weight: 800; }
#soc .soc-bub { font-size: 12px; line-height: 1.4; font-weight: 800; padding: 10px 13px; max-width: 85%; border: 1px solid #e2dcc6; border-radius: 14px; overflow-wrap: anywhere; }
#soc .soc-bub.in { background: #f3ebd9; align-self: flex-start; border-bottom-left-radius: 5px; }
#soc .soc-bub.out { background: #e7f0e8; align-self: flex-end; border-color: #d2e2d4; border-bottom-right-radius: 5px; }
#soc .soc-spotcard { display: flex; align-items: center; gap: 9px; max-width: 88%; background: #eef4ea; border: 1px solid #d3e3d0; border-radius: 14px; padding: 10px 12px; }
#soc .soc-spotcard.out { align-self: flex-end; } #soc .soc-spotcard.in { align-self: flex-start; }
#soc .soc-spotcard h3 { font-size: 13px; margin: 0 0 3px; font-weight: 900; }
#soc .soc-spotcard p { font-size: 10px; margin: 0; color: #93a28c; font-weight: 700; }
#soc .soc-spotcard .soc-mini { margin: 0 0 0 auto; }
#soc .soc-mstat { text-align: right; font-size: 9px; color: #adb19d; margin-top: -7px; font-weight: 800; }
#soc .soc-spots { border-top: 1px dashed #dbcdb0; padding-top: 8px; margin-top: 4px; display: grid; gap: 2px; max-height: 190px; overflow-y: auto; flex-shrink: 0; }
#soc .soc-spots p { font-size: 10px; color: #a2a790; margin: 0 0 4px; font-weight: 800; }
#soc .soc-spots button { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 10px; font-size: 12px; font-weight: 800; text-align: left; }
#soc .soc-spots button:hover { background: #f4eddd; }
#soc .soc-spots small { margin-left: auto; font-size: 10px; color: #a3a68f; }
#soc .soc-compose { display: flex; align-items: center; gap: 10px; border: 2px solid #c8dfda; border-radius: 13px; background: #fffef8; padding: 6px 7px; margin-top: 12px; font-size: 12px; flex-shrink: 0; }
#soc .soc-compose:focus-within { border-color: #9ccabb; }
#soc .soc-attach { font-size: 23px; line-height: 1; color: #9bb4a7; width: 24px; }
#soc .soc-send { display: grid; place-items: center; width: 30px; height: 30px; margin-left: auto; background: #c7e4db; border-radius: 9px; color: #749d8d; font-size: 18px; font-weight: 900; flex-shrink: 0; }
#soc .soc-quick { display: flex; gap: 8px; margin-top: 10px; flex-shrink: 0; }
#soc .soc-quick button { display: flex; align-items: center; gap: 4px; background: #f1ead9; padding: 5px 9px; border-radius: 9px; font-size: 10px; font-weight: 800; color: #9a9f87; }

/* the doorbell */
#soc .soc-door { right: 22px; top: 214px; width: 376px; padding: 20px; z-index: 5; max-height: calc(100vh - 236px); overflow-y: auto; }
#soc .soc-visitor { display: flex; align-items: center; gap: 15px; padding: 6px 3px 14px; }
#soc .soc-visitor h3 { font-size: 20px; font-weight: 900; margin: 0 0 6px; }
#soc .soc-visitor p { font-size: 11px; color: #99a38e; margin: 0; font-weight: 800; }
#soc .soc-vmsg { background: #f3ead8; border: 1px dashed #d5c7aa; padding: 12px 13px; border-radius: 12px; font-size: 12px; color: #9b957e; margin: 0 0 14px; font-weight: 800; }
#soc .soc-haddr { border-top: 1px dashed #d7c9ad; padding-top: 13px; font-size: 12px; font-weight: 900; }
#soc .soc-haddr span { display: block; font-size: 10px; margin-top: 5px; color: #9aa38d; font-weight: 800; }
#soc .soc-access { display: flex; gap: 11px; align-items: center; background: #edf0df; border-radius: 12px; padding: 12px; margin: 15px 0; }
#soc .soc-key { width: 28px; height: 28px; display: grid; place-items: center; background: #fff9e7; border-radius: 50%; font-size: 12px; color: #93a27f; font-style: normal; font-weight: 900; flex-shrink: 0; }
#soc .soc-access b { font-size: 12px; color: #7a9277; }
#soc .soc-access p { font-size: 10px; color: #9ba68b; margin: 5px 0 0; font-weight: 700; }

/* little status pills (ringing someone's bell; a guest waiting at yours) */
#soc .soc-pills { position: fixed; left: 50%; bottom: 112px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; }
#soc .soc-pill { display: flex; align-items: center; gap: 7px; background: #fff8e9; border: 3px solid var(--pc-edge); border-radius: 12px; padding: 7px 10px; font-size: 11px; font-weight: 800; box-shadow: 0 2px 0 #c5b596; }
#soc .soc-pill b { color: #ae8c9b; font-size: 10px; margin-left: 4px; }
#soc .soc-pill > button { background: var(--pc-sand); color: #8d8f78; border-radius: 8px; padding: 4px 9px; font-size: 10px; font-weight: 800; margin-left: 4px; }
#soc .soc-lock { width: 7px; height: 7px; background: #d5ab88; border-radius: 50%; display: inline-block; }

/* while a social panel is open on the right, the bottom-right shop button steps aside */
body.soc-open #life-shop { visibility: hidden; }
@media (max-height: 720px) { #soc .soc-panel, #soc .soc-door { top: 96px; max-height: calc(100vh - 116px); } }

/* phones and small tablets, landscape: the panel takes the right side top to bottom with thumb-sized targets */
@media (max-height: 560px), (pointer: coarse) and (max-width: 1100px) {
  #soc .soc-panel { top: 10px; bottom: 10px; right: 10px; width: min(440px, 54vw); max-height: none; padding: 14px 16px 10px; }
  #soc .soc-door { top: 10px; right: 10px; width: min(376px, 52vw); max-height: calc(100vh - 20px); padding: 16px; }
  #soc .soc-phead { margin-bottom: 10px; } #soc .soc-hp { width: 40px; height: 40px; } #soc .soc-phead h2 { font-size: 21px; }
  #soc .soc-tabs { padding-bottom: 8px; } #soc .soc-tabs button { min-height: 44px; font-size: 13px; }
  #soc .soc-search { min-height: 44px; margin: 10px 0; font-size: 13px; }
  #soc .soc-notice, #soc .soc-find { display: none; }
  #soc .soc-fr { padding: 9px 2px; gap: 11px; }
  #soc .soc-fr .soc-fi { display: grid; grid-template-columns: 1fr auto; column-gap: 8px; align-items: center; }
  #soc .soc-fr .soc-fi h3 { grid-column: 1; margin: 0 0 3px; font-size: 15px; }
  #soc .soc-fr .soc-fi p { grid-column: 1; margin: 0; font-size: 10px; }
  #soc .soc-fr .soc-acts { grid-column: 2; grid-row: 1 / span 2; gap: 4px; flex-wrap: nowrap; }
  #soc .soc-acts button { min-height: 48px; min-width: 52px; padding: 6px; font-size: 12px; }
  #soc .soc-primary { min-height: 48px; font-size: 14px; }
  #soc .soc-foot { margin-top: 8px; padding-top: 4px; } #soc .soc-foot button { min-height: 44px; min-width: 70px; font-size: 13px; }
  #soc .soc-row { min-height: 46px; } #soc .soc-x { width: 40px; height: 40px; font-size: 28px; }
  #soc .soc-compose { min-height: 46px; } #soc .soc-send { width: 38px; height: 38px; } #soc .soc-quick button { min-height: 40px; font-size: 12px; }
  #soc .soc-pills { bottom: 86px; }
}
@media (max-width: 560px) { #soc .soc-panel, #soc .soc-door { left: 8px; right: 8px; width: auto; } }
