/* Townsfolk: friend cards with hearts, chat and gift buttons, personal requests, the gift picker and the boosts in the
   side panel (townsfolk.js). The park cards share the hearts and buttons. */
.friend-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 0 14px 16px;
  overflow: hidden;
  border: 3px solid #e2c9a6;
  border-radius: 18px;
  background: #fffaf0;
  box-shadow: 0 5px 0 #e6d3b5;
  text-align: center;
}
.friend-card h3 { margin: 0; color: #5a3d2b; font-size: 19px; }
.friend-role { margin: -4px 0 0; color: #8a7663; font-size: 13px; }
.friend-stage { position: relative; width: calc(100% + 28px); height: 176px; margin: 0 -14px 2px; background: linear-gradient(#f7e5c9 0 72%, #d9b48b 72%); border-bottom: 3px solid #e2c9a6; overflow: hidden; }
.park-npc-stage { overflow: hidden; }
.friend-stage .avatar { bottom: 0; transform: translateX(-50%) scale(.5); transform-origin: bottom center; }
.npc-owl { position: absolute; left: 50%; bottom: 0; width: 200px; height: 360px; transform: translateX(-50%) scale(.5); transform-origin: bottom center; }
.park-npc-stage .npc-owl { transform: translateX(-50%) scale(.56); }
.npc-owl-art { display: block; width: 100%; height: 100%; }
.friend-bubble { margin: 2px 0 0; font-size: 13.5px; }

/* Five hearts; the next one fills from the left as friendship grows. */
.friend-hearts { display: flex; justify-content: center; gap: 2px; color: #e46f98; font-size: 21px; line-height: 1; letter-spacing: 0; }
.friend-hearts span { position: relative; display: inline-block; width: 1em; text-align: center; text-shadow: 0 1px 0 #fff; }
.friend-hearts span:not(.is-full) { color: #e9b9c9; }
.friend-hearts .is-next::after { content: '♥'; position: absolute; inset: 0; width: var(--fill, 0%); overflow: hidden; color: #e46f98; text-align: left; }
.friend-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: 100%; }
.friend-actions .button, .friend-actions .text-button { flex: 1 1 110px; min-height: 40px; padding: 8px 12px; }
.friend-chat { background: #e46f98; color: #fff; box-shadow: 0 4px 0 #b44c74; }
.friend-chat:hover:not(:disabled) { box-shadow: 0 6px 0 #b44c74; }
.friend-gift { border: 2px solid #ecc9d6; background: #fff4f8; color: #a94a71; }
.friend-actions button:disabled { cursor: default; opacity: .6; transform: none; box-shadow: none; }
.friend-next { margin: 0; color: #8a6a5a; font-size: 12.5px; font-weight: 700; line-height: 1.35; }
.friend-request { width: 100%; margin-top: 4px; padding: 10px 12px; border: 2px dashed #d7b98c; border-radius: 14px; background: #fff6e2; text-align: left; }
.friend-request strong { display: block; color: #6b4a2a; font: 900 14px/1.25 Nunito, system-ui, sans-serif; }
.friend-request p { margin: 4px 0 6px; color: #7a6450; font-size: 13px; line-height: 1.4; }
.friend-request ul { margin: 0 0 8px; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 4px 10px; color: #8a6a4f; font-size: 13px; font-weight: 800; }
.friend-request li.is-met { color: #3f7d4f; }
.friend-request .button { width: 100%; padding: 9px 12px; }
.friend-request.is-ready { border-color: #e8b94a; background: #fff3cc; }
.friend-request.is-done { border-style: solid; border-color: #c9dcbc; background: #f2f8ec; }
.friend-request.is-done strong { color: #3f7d4f; }

/* The park: visitors stand out a little, and every card shows hearts. */
.park-npc .friend-hearts { margin: -2px 0 -2px; }
.park-npc .friend-actions { margin-top: 2px; }
.park-npc.visitor { border-color: #e2c9a6; box-shadow: 0 5px 0 #e6d3b5; }
.park-npc.visitor .park-npc-stage { background: linear-gradient(#fbe9d2 0 70%, #a9d38a 70%); border-bottom-color: #e2c9a6; }
.park-visitor-tag { position: absolute; top: 10px; left: 10px; padding: 3px 9px; border: 2px solid #d9a35a; border-radius: 99px; background: #fff3d6; color: #8a5a1f; font: 900 11px Nunito, system-ui, sans-serif; letter-spacing: .5px; text-transform: uppercase; }
.park-visitor-note { margin: 0; color: #7a6a58; font-size: 12.5px; font-weight: 700; line-height: 1.4; }
.park-npcs { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* The gift picker. */
.gift-dialog { width: min(520px, calc(100% - 24px)); max-height: calc(100% - 28px); padding: 20px; border: 3px solid #e2c9a6; border-radius: 22px; background: #fffaf0; box-shadow: 0 20px 70px #3a2a2055; }
.gift-dialog::backdrop { background: #2f231c9c; }
.gift-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.gift-head h2 { margin: 0; color: #5a3d2b; font-size: 24px; }
.gift-close { width: 36px; height: 36px; border: 0; border-radius: 50%; background: #f3e6d2; color: #6b4a2a; font-size: 22px; line-height: 1; }
.gift-hint { margin: 6px 0 12px; color: #8a7663; font-size: 13.5px; }
.gift-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 9px; }
.gift-item { position: relative; display: grid; justify-items: center; gap: 2px; padding: 10px 8px; border: 2px solid #ead7bb; border-radius: 14px; background: #fff; color: #5a3d2b; font: 800 13px/1.2 Nunito, system-ui, sans-serif; transition: transform .15s, border-color .15s; }
.gift-item:hover { transform: translateY(-2px); border-color: #e46f98; }
.gift-emoji { font-size: 30px; }
.gift-item small { color: #9a8670; font-weight: 800; }
.gift-known { position: absolute; top: 4px; right: 6px; font-size: 15px; }
.gift-empty { grid-column: 1 / -1; margin: 6px 0; color: #8a7663; text-align: center; }

/* Boosts in the side panel. */
.buddy-buffs { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; padding-top: 9px; border-top: 2px dashed #ffffff3a; }
.buff-chip { display: inline-flex; align-items: center; gap: 3px; padding: 3px 7px 3px 4px; border: 2px solid #1d4057; border-radius: 99px; background: #fff3cf; color: #5a3f0a; font: 900 12px/1 Nunito, system-ui, sans-serif; box-shadow: 0 2px 0 #1d4057; cursor: help; }
.buff-icon { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #ffe08a; font-size: 13px; }

@media (max-width: 900px) {
  .buddy-buffs { margin-top: 6px; padding-top: 6px; }
}
@media (max-width: 650px) {
  .park-npcs { grid-template-columns: 1fr; }
  .friend-stage { height: 160px; }
  .gift-dialog { padding: 16px; }
}

/* Friends in the profile panel. */
.friends-panel { margin-top: 16px; padding: 14px 16px; border: 2px solid #f0d6e0; border-radius: 16px; background: #fff7fa; }
.friends-panel h4 { margin: 0 0 8px; color: #8a3f5f; font: 900 16px Nunito, system-ui, sans-serif; }
.friends-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px 14px; margin: 0; padding: 0; list-style: none; }
.friends-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 8px; padding: 5px 0; border-bottom: 1px dashed #efd3de; }
.friends-row strong { color: #5a3d4b; font: 900 14px Nunito, system-ui, sans-serif; }
.friends-row .friend-hearts { font-size: 15px; justify-content: flex-end; }
.friends-row small { grid-column: 1 / -1; color: #9a7f8a; font-size: 11.5px; font-weight: 700; }
.friends-titles { margin: 10px 0 0; color: #8a5a1f; font-size: 13px; font-weight: 800; }
