.profile-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.profile-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 2rem 1.75rem;
  backdrop-filter: blur(12px);
}

.profile-loading,
.profile-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem 0;
}

.profile-empty-title {
  font-size: 1.05rem;
  color: var(--text);
  margin-bottom: 1rem;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 2rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
}

.profile-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #f5c96a);
  color: #1a1205;
  font-size: 2rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 0 24px rgba(245, 201, 106, 0.25);
  overflow: hidden;
}

.profile-avatar.has-image {
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid rgba(245, 201, 106, 0.35);
  box-shadow: 0 0 24px rgba(124, 108, 240, 0.15);
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.profile-avatar-hint {
  margin: -0.5rem 0 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.profile-avatar-subtitle {
  margin: 1.25rem 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.profile-avatar-upload {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin-bottom: 0.5rem;
}

.profile-avatar-status {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
}

.profile-avatar-status--pending {
  background: rgba(124, 108, 240, 0.08);
  border: 1px solid rgba(124, 108, 240, 0.25);
}

.profile-avatar-status--rejected {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.profile-avatar-status p {
  margin: 0 0 0.35rem;
}

.profile-avatar-status p:last-child {
  margin-bottom: 0;
}

.profile-avatar-pending-preview {
  margin-top: 0.65rem;
}

.profile-avatar-pending-preview img {
  width: 5rem;
  height: 5rem;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--border);
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.profile-avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5rem, 1fr));
  gap: 0.65rem;
}

.profile-avatar-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 5.5rem;
  padding: 0.45rem 0.35rem 0.4rem;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.profile-avatar-option:hover {
  border-color: rgba(124, 108, 240, 0.45);
}

.profile-avatar-option.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(245, 201, 106, 0.35);
}

.profile-avatar-option--default .profile-avatar-option-default {
  width: 2.75rem;
  height: 2.75rem;
  font-size: 1.1rem;
}

.profile-avatar-option-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.2;
}

.profile-avatar-option.is-selected .profile-avatar-option-label {
  color: var(--accent);
  font-weight: 600;
}

.profile-avatar-option img {
  width: 2.75rem;
  height: 2.75rem;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  flex-shrink: 0;
}

.profile-avatar-option-default {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #f5c96a);
  color: #1a1205;
  font-size: 1.1rem;
  font-weight: 700;
  flex-shrink: 0;
}

.profile-loading-inline {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}

.profile-head-text {
  min-width: 0;
}

.profile-name {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0.35rem 0 0.25rem;
  line-height: 1.3;
}

.profile-joined {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

.profile-section {
  margin-bottom: 1.5rem;
}

.profile-section:last-child {
  margin-bottom: 0;
}

.profile-section h2 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 1rem;
}

.profile-section--private {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.profile-stats {
  display: flex;
  gap: 1.5rem;
}

.profile-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 4rem;
}

.profile-stat-num {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}

.profile-stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.profile-community-link {
  margin: 1.25rem 0 0;
  font-size: 0.9rem;
}

.profile-community-link a {
  color: var(--accent);
  text-decoration: none;
}

.profile-community-link a:hover {
  text-decoration: underline;
}

.profile-dl {
  margin: 0;
}

.profile-dl > div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin-bottom: 0.75rem;
}

.profile-dl dt {
  font-size: 0.85rem;
  color: var(--text-muted);
  min-width: 3rem;
}

.profile-dl dd {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text);
}

.profile-verified {
  font-size: 0.75rem;
  color: #6ee7a0;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  background: rgba(110, 231, 160, 0.12);
}

.profile-unverified {
  font-size: 0.75rem;
  color: #fbbf24;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  background: rgba(251, 191, 36, 0.12);
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

@media (max-width: 480px) {
  .profile-header {
    flex-direction: column;
    text-align: center;
  }

  .profile-name {
    justify-content: center;
  }

  .profile-stats {
    justify-content: center;
  }

  .profile-stat {
    align-items: center;
  }
}
