h1 {
    text-align: center;
}

#avatars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
  padding: 20px;
  background: #0a0e27;
}

#avatars button {
  aspect-ratio: 1;
  border-radius: 4px;
  overflow: hidden;
  background: #1a1f3a;
  transition: background 0.3s ease, box-shadow 0.3s ease, scale .4s ease;
  scale: 0;
}

#avatars button.loaded {
    scale: 1;
}

#avatars button:hover {
  background: #2a3f5f;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

#avatars button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

#avatars button:hover img {
  transform: scale(1.1);
}

#avatars button#create-from-selfie {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #2a3f5f;
  border: 2px dashed #4a6fa5;
}

#avatars button#create-from-selfie:hover {
  background: #3a4f6f;
  border-color: #5a7fb5;
}

#avatars button#create-from-selfie span {
  color: #ffffff;
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  padding: 10px;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 14, 39, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  text-align: center;
  color: #ffffff;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #2a3f5f;
  border-top: 4px solid #5a7fb5;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}