.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.profile-card {
  overflow: hidden;
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  background: var(--color-surface);
  box-shadow: 0 10px 28px rgba(67, 22, 37, 0.1);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.profile-card:hover,
.profile-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: var(--shadow-soft);
  outline: none;
}

.profile-photo {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #eadfe2;
  contain: paint;
}

.profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 220ms ease;
  content-visibility: auto;
}

.profile-card:hover .profile-photo img,
.profile-card:focus-visible .profile-photo img {
  transform: scale(1.04);
}

.photo-shade {
  position: absolute;
  inset: auto 0 0;
  height: 48%;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(19, 7, 10, 0.78));
}

.profile-name {
  position: absolute;
  left: 18px;
  bottom: 16px;
  z-index: 2;
  color: #fff;
  font-size: 1.22rem;
  font-weight: 900;
}

.online-status {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(19, 7, 10, 0.58);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
  backdrop-filter: blur(10px);
}

.online-dot {
  position: relative;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #18c36b;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
}

.online-dot::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: inherit;
  border: 2px solid rgba(24, 195, 107, 0.72);
  animation: online-pulse 1.55s ease-out infinite;
}

@keyframes online-pulse {
  0% {
    opacity: 0.85;
    transform: scale(0.5);
  }

  100% {
    opacity: 0;
    transform: scale(1.45);
  }
}

.overlay-button {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--color-primary-dark);
  cursor: pointer;
  font-weight: 850;
  opacity: 0;
  transform: translate(-50%, -38%);
  transition: opacity 180ms ease, transform 180ms ease;
  white-space: nowrap;
}

.profile-card:hover .overlay-button,
.profile-card:focus-visible .overlay-button {
  opacity: 1;
  transform: translate(-50%, -50%);
}

.profile-body {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.profile-country {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 850;
}

.country-flag {
  width: 24px;
  height: 16px;
  border-radius: 3px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(35, 25, 29, 0.12);
}

.country-code-badge {
  display: inline-flex;
  min-width: 30px;
  min-height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #fff1f5;
  color: var(--color-primary-dark);
  font-size: 0.78rem;
  font-weight: 950;
  line-height: 1;
}

.profile-city {
  min-height: 21px;
  color: var(--color-muted);
  font-size: 0.95rem;
}

.profile-bio {
  min-height: 48px;
  margin: 2px 0 8px;
  color: var(--color-muted);
  font-size: 0.95rem;
}

.message-button {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--color-primary), #ff6f8d);
  color: #fff;
  cursor: pointer;
  font-weight: 850;
}

.profile-actions {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}

.profile-status {
  min-height: 24px;
  margin-top: 18px;
  color: var(--color-muted);
  text-align: center;
}
