.friend-search-panel {
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
}

.friend-search-panel h2,
.friend-search-panel p {
  margin: 0;
}

.friend-search-panel h2,
.friend-section h2 {
  font: 600 20px Fredoka;
}

.friend-search-panel p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.friend-search {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 9px;
  margin-top: 17px;
  padding: 6px 6px 6px 13px;
  border: 1px solid #dfe4e8;
  border-radius: 10px;
  background: #fbfcfd;
}

.friend-search > span {
  color: #89939c;
  font-size: 19px;
}

.friend-search input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: 14px 'DM Sans';
}

.friend-search button,
.friend-action {
  padding: 9px 13px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--red);
  font: 700 12px 'DM Sans';
  cursor: pointer;
}

#friend-search-results,
#friend-requests {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.friend-section {
  margin-top: 30px;
}

.friend-section .section-heading {
  margin: 0 0 15px;
}

.friend-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}

.friend-row .avatar {
  flex: 0 0 auto;
}

.friend-row-info {
  min-width: 0;
  flex: 1;
}

.friend-row-info strong,
.friend-row-info small {
  display: block;
}

.friend-row-info small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.friend-row-actions {
  display: flex;
  gap: 7px;
}

.friend-action.secondary {
  border: 1px solid #dfe4e8;
  color: #68747f;
  background: #fff;
}

.friend-action:disabled {
  opacity: .5;
  cursor: wait;
}

.friend-card {
  position: relative;
}

.friend-card .friend-state {
  display: inline-block;
  margin-top: 13px;
  padding: 5px 9px;
  border-radius: 99px;
  color: #368567;
  background: #eaf8f1;
  font-size: 10px;
  font-weight: 700;
}

.friend-profile-button {
  width: 100%;
  margin-top: 12px;
  padding: 9px 12px;
  border: 1px solid #dfe4e8;
  border-radius: 9px;
  color: var(--ink);
  background: #fff;
  font: 700 11px 'DM Sans';
  cursor: pointer;
}

.friend-profile-button:hover {
  border-color: var(--red);
  color: var(--red);
}

.friend-profile-header {
  display: flex;
  align-items: center;
  gap: 17px;
  margin: 17px 0 26px;
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.friend-profile-header .avatar {
  width: 58px;
  height: 58px;
  font-size: 20px;
}

.friend-profile-header h1,
.friend-profile-header p,
.friend-profile-section h3 {
  margin: 0;
}

.friend-profile-header h1,
.friend-profile-section h3 {
  font-family: Fredoka;
}

.friend-profile-header h1 {
  font-size: 27px;
}

.friend-profile-header p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.friend-profile-section {
  margin-top: 27px;
}

.friend-profile-section h3 {
  margin-bottom: 13px;
  font-size: 19px;
}

.friend-featured-grid,
.friend-progress-grid,
.friend-collection-grid,
.friend-album-grid {
  display: grid;
  gap: 13px;
}

.friend-featured-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.friend-featured-card,
.friend-featured-empty {
  min-height: 180px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  text-align: center;
}

.friend-featured-card img {
  width: 100%;
  height: 145px;
  object-fit: contain;
}

.friend-featured-card strong,
.friend-featured-card small {
  display: block;
}

.friend-featured-card strong {
  margin-top: 6px;
  font-size: 12px;
}

.friend-featured-card small,
.friend-featured-empty {
  color: var(--muted);
  font-size: 10px;
}

.friend-featured-empty {
  display: grid;
  place-items: center;
}

.friend-progress-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.friend-set-progress,
.friend-shared-album {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.friend-set-progress {
  width: 100%;
  color: var(--ink);
  font-family: 'DM Sans';
  text-align: left;
  cursor: pointer;
}

.friend-set-progress:hover {
  border-color: #f6a4a9;
  box-shadow: 0 8px 22px #24313f0d;
}

.friend-set-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.friend-set-title strong,
.friend-set-title small {
  display: block;
}

.friend-set-title small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.friend-set-title > span {
  color: var(--red);
  font-size: 10px;
  font-weight: 700;
}

.friend-set-progress > strong,
.friend-progress-line span,
.friend-progress-line small {
  display: block;
}

.friend-progress-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 11px;
}

.friend-progress-line b {
  font-size: 10px;
}

.friend-progress-line span {
  margin-bottom: 5px;
  font-size: 10px;
  font-weight: 700;
}

.friend-progress-line small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  text-align: right;
}

.friend-collection-grid {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}

.friend-owned-card {
  display: flex;
  gap: 11px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.friend-owned-card img {
  width: 62px;
  height: 86px;
  object-fit: contain;
}

.friend-owned-card > div {
  min-width: 0;
}

.friend-owned-card strong,
.friend-owned-card small {
  display: block;
}

.friend-owned-card strong {
  font-size: 12px;
}

.friend-owned-card small,
.friend-owned-variants {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.friend-owned-variants {
  line-height: 1.5;
}

.friend-album-grid {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

.friend-trade-count {
  min-width: 32px;
  padding: 6px 9px;
  border-radius: 99px;
  color: #247655;
  background: #e7f7ef;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.friend-trade-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 11px;
}

.friend-trade-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px;
  overflow: hidden;
  border: 1px solid #cfe9dc;
  border-radius: 13px;
  color: var(--ink);
  background: linear-gradient(135deg, #fff, #f3fbf7);
  font-family: 'DM Sans';
  text-align: left;
  cursor: pointer;
}

.friend-trade-card:hover {
  border-color: var(--green);
  box-shadow: 0 8px 22px #397d6017;
  transform: translateY(-1px);
}

.friend-trade-card img {
  flex: 0 0 auto;
  width: 66px;
  height: 91px;
  object-fit: contain;
}

.friend-trade-card > div {
  min-width: 0;
}

.friend-trade-card strong,
.friend-trade-card small,
.friend-trade-card span,
.friend-trade-card b {
  display: block;
}

.friend-trade-card strong {
  font: 600 15px Fredoka;
}

.friend-trade-card small {
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-trade-card span {
  width: fit-content;
  margin-top: 7px;
  padding: 3px 7px;
  border-radius: 99px;
  color: #247655;
  background: #e2f5eb;
  font-size: 9px;
  font-weight: 700;
}

.friend-trade-card b {
  margin-top: 6px;
  color: #247655;
  font-size: 9px;
}

.friend-shared-album strong,
.friend-shared-album small {
  display: block;
}

.friend-profile-back {
  margin-bottom: 24px;
}

.friend-set-detail-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.friend-set-detail-heading h1,
.friend-set-detail-heading p {
  margin: 0;
}

.friend-set-detail-heading h1 {
  font: 600 34px Fredoka;
}

.friend-set-detail-heading p:not(.eyebrow) {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.friend-set-legend {
  display: flex;
  gap: 13px;
  color: var(--muted);
  font-size: 10px;
}

.friend-set-legend span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.friend-set-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.friend-set-legend i.owned {
  background: var(--green);
}

.friend-set-legend i.missing {
  background: #cbd2d8;
}

.friend-set-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(205px, 1fr));
  gap: 15px;
}

.friend-set-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}

.friend-set-card.missing {
  opacity: .58;
}

.friend-card-image {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 198px;
  padding: 13px;
  background: #f4f6f8;
}

.friend-card-image img {
  width: 100%;
  height: 172px;
  object-fit: contain;
}

.friend-card-image > span {
  position: absolute;
  right: 9px;
  top: 9px;
  padding: 5px 8px;
  border-radius: 99px;
  color: #fff;
  background: #929ca5;
  font-size: 9px;
  font-weight: 700;
}

.friend-set-card.owned .friend-card-image > span {
  background: var(--green);
}

.friend-set-card > div:last-child {
  padding: 13px;
}

.friend-set-card strong,
.friend-set-card small {
  display: block;
}

.friend-set-card strong {
  font: 600 15px Fredoka;
}

.friend-set-card small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.friend-card-variants {
  display: grid;
  gap: 5px;
  margin-top: 10px;
}

.friend-variant-state {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 9px;
}

.friend-variant-state i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: #adb5bc;
  font-size: 8px;
  font-style: normal;
}

.friend-variant-state.owned i {
  background: var(--green);
}

.friend-variant-state.trade-match {
  flex-wrap: wrap;
  padding: 6px;
  border-radius: 7px;
  color: #247655;
  background: #e7f7ef;
  font-weight: 700;
}

.friend-variant-state.trade-match b {
  width: 100%;
  padding-left: 19px;
  font-size: 8px;
}

.friend-shared-album small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.friends-empty {
  grid-column: 1 / -1;
  padding: 34px;
  border: 1px dashed #d9e0e5;
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 600px) {
  .friend-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .friend-row-actions {
    width: 100%;
  }

  .friend-row-actions .friend-action {
    flex: 1;
  }

  .friend-featured-grid {
    gap: 7px;
  }

  .friend-featured-card,
  .friend-featured-empty {
    min-height: 128px;
    padding: 7px;
  }

  .friend-featured-card img {
    height: 98px;
  }

  .friend-featured-card strong {
    font-size: 9px;
  }

  .friend-featured-card small {
    display: none;
  }

  .friend-progress-grid {
    grid-template-columns: 1fr;
  }

  .friend-set-detail-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .friend-set-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .friend-trade-grid {
    grid-template-columns: 1fr;
  }

  .friend-card-image {
    min-height: 150px;
    padding: 8px;
  }

  .friend-card-image img {
    height: 135px;
  }
}
