.users-page-main,
.profile-page-main {
  align-items: stretch;
  justify-content: flex-start;
  width: 100%;
  min-height: 100vh;
  padding: 84px 24px 90px;
}

.users-container,
.profile-container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
}

.users-header {
  position: static;
  display: block;
  width: 100%;
  height: auto;
  margin: 0 0 32px;
  padding: 0;
  background: transparent;
  text-align: left;
}

.users-header h1 {
  position: static;
  display: block;
  margin: 0 0 10px;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.1;
  text-align: left;
}

.users-header p,
.users-status,
.profile-status,
.user-handle,
.user-level,
.profile-username,
.profile-bio,
.profile-stat span {
  color: var(--text-muted);
  font-family: var(--font-body);
  font-weight: 800;
}

.users-header p {
  position: static;
  display: block;
  margin: 0;
  line-height: 1.5;
  text-align: left;
}

.users-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.users-status {
  display: none;
}

.users-status.error,
.profile-status.error {
  color: var(--danger);
}

.user-search {
  width: 100%;
  max-width: 380px;
  padding: 13px 16px;
  border: 0;
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--bg-surface);
  color: var(--text-light);
  font-family: var(--font-body);
  font-size: 14px;
  transition:
    border-color 0.2s,
    background 0.2s;
}

.user-search::placeholder {
  color: var(--text-muted);
}

.user-search:focus {
  outline: none;
  background: var(--bg-raised);
}

.retry-button {
  margin-top: 16px;
  padding: 10px 22px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--rr-blue);
  color: white;
  font-weight: 800;
  cursor: pointer;
}

.retry-button:hover {
  background: var(--rr-blue-hover);
}

.users-grid {
  position: static;
  clear: both;
  display: grid;
  width: 100%;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 130px;
  padding: 22px;
  border: 0;
  background: var(--bg-surface);
  color: var(--text-light);
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.2s,
    border-color 0.2s,
    background 0.2s;
}

.user-card:hover,
.user-card:focus {
  outline: none;
  background: var(--bg-raised);
  color: var(--text-light);
  transform: translateY(-4px);
}

.user-avatar {
  display: flex;
  flex: 0 0 72px;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  overflow: hidden;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rr-blue), var(--rr-blue-hover));
  color: white;
  font-size: 24px;
  font-weight: 800;
}

.user-profile-image {
  object-fit: cover;
}

.user-card-content {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.user-display-name {
  margin: 0 0 5px;
  overflow-wrap: anywhere;
  font-size: 23px;
  line-height: 1.15;
}

.user-handle {
  margin: 0 0 11px;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.user-level {
  color: var(--rr-blue-text);
  font-size: 13px;
  font-weight: 800;
}

.users-category-title {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 0;
  padding-bottom: 10px;
  border-bottom: 0;
  font-size: 22px;
  text-transform: none;
  letter-spacing: 1px;
}

.users-category-title:first-child {
  margin-top: 0;
}

.users-category-count {
  padding: 2px 10px;
  background: var(--bg-surface);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: 0;
}

.users-empty {
  grid-column: 1 / -1;
  padding: 60px 20px;
  color: var(--text-muted);
  font-family: var(--font-body);
  text-align: center;
}

.profile-container {
  padding-bottom: 30px;
}

.back-to-users {
  display: inline-block;
  margin-bottom: 28px;
  color: var(--rr-blue-text);
  font-family: var(--font-body);
  font-weight: 800;
  text-decoration: none;
}

.back-to-users:hover {
  color: var(--text-light);
}

.profile-card {
  width: 100%;
  overflow: hidden;
  background: transparent;
  box-shadow: none;
}

.profile-banner {
  position: relative;
  width: 100%;
  height: min(42vw, 500px);
  min-height: 280px;
  background:
    linear-gradient(135deg, rgba(85, 191, 255, 0.85), rgba(53, 168, 232, 0.9)), var(--bg-surface);
}

.profile-content {
  position: relative;
  width: 100%;
  padding: 105px 60px 70px;
  background: var(--bg-surface);
}

.profile-avatar {
  position: absolute;
  top: -70px;
  left: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 140px;
  height: 140px;
  overflow: hidden;
  padding: 5px;
  border: 5px solid var(--bg-dark);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--rr-blue), var(--rr-blue-hover));
  color: white;
  font-size: 44px;
  font-weight: 800;
}

.profile-image {
  width: 100%;
  height: 100%;
  border-radius: var(--radius);
  object-fit: cover;
}

.profile-name {
  margin-bottom: 10px;
  overflow-wrap: anywhere;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1;
}

.profile-username {
  margin-bottom: 24px;
  font-size: 16px;
}

.profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}

.user-badge {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 800;
}

.badge-admin {
  background: rgba(220, 53, 69, 0.2);
  color: var(--danger);
}

.badge-owner {
  background: rgba(13, 40, 120, 0.4);
  color: #6f9bff;
}

.badge-dev {
  background: rgba(155, 89, 182, 0.2);
  color: #d29bea;
}

.badge-editor {
  background: rgba(75, 0, 130, 0.35);
  color: #b892ff;
}

.badge-mod {
  background: rgba(157, 185, 255, 0.16);
  color: var(--rr-blue-text);
}

.badge-music-artist {
  background: rgba(219, 39, 119, 0.2);
  color: #ff8fd0;
}

.badge-tester {
  background: rgba(61, 220, 132, 0.2);
  color: var(--success);
}

.badge-support {
  background: rgba(27, 94, 32, 0.35);
  color: #6fcf7c;
}

.badge-contributor {
  background: rgba(212, 175, 55, 0.2);
  color: #e0c25e;
}

.badge-rqplus {
  background: var(--rr-blue);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.badge-og {
  background: rgba(255, 140, 0, 0.2);
  color: var(--warning);
}

.badge-community-helper {
  background: rgba(0, 188, 180, 0.2);
  color: #5fe3da;
}

.profile-bio {
  width: 100%;
  max-width: 1100px;
  margin-bottom: 35px;
  color: var(--text-light);
  font-size: 17px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 260px));
  gap: 14px;
}

.profile-stat {
  padding: 18px;
  border: 0;
  background: rgba(255, 255, 255, 0.025);
}

.profile-stat strong {
  display: block;
  margin-bottom: 6px;
  color: var(--rr-blue-text);
  font-size: 26px;
}

.profile-stat span {
  font-size: 12px;
  text-transform: uppercase;
}

@media (max-width: 768px) {
  .users-page-main,
  .profile-page-main {
    width: 100%;
    padding: 40px 16px 90px;
  }

  .users-header {
    margin-bottom: 24px;
  }

  .users-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

  .user-search {
    max-width: none;
  }

  .users-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .user-card {
    min-height: 112px;
    padding: 18px;
  }

  .profile-banner {
    height: 300px;
  }

  .profile-avatar {
    top: -48px;
    left: 24px;
    width: 96px;
    height: 96px;
    border-width: 4px;
    border-radius: var(--radius);
    font-size: 32px;
  }

  .profile-image {
    border-radius: var(--radius-sm);
  }

  .profile-content {
    padding: 70px 24px 40px;
  }

  .profile-name {
    font-size: 40px;
  }

  .profile-stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .user-card {
    gap: 14px;
    padding: 15px;
  }

  .user-avatar {
    flex-basis: 58px;
    width: 58px;
    height: 58px;
    font-size: 19px;
  }

  .user-display-name {
    font-size: 19px;
  }

  .profile-banner {
    height: 250px;
  }

  .profile-name {
    font-size: 34px;
  }
}

.community-users-page {
  background: var(--bg-dark);
}

.community-users-page .users-container {
  max-width: 1180px;
  margin: 0 auto;
}

.users-page-main,
.profile-page-main {
  background: var(--bg-dark);
}

.users-container,
.profile-container {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.users-header {
  padding: 30px 0 24px;
  border-bottom: 0;
}

.users-header h1 {
  font-size: clamp(36px, 5vw, 58px);
  font-weight: 800;
  letter-spacing: -1px;
}

.users-header p {
  color: var(--text-muted);
}

.users-toolbar {
  padding: 24px 0 28px;
}

.user-search {
  max-width: 460px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  box-shadow: none;
}

.user-search:focus {
  background: var(--bg-surface);
  box-shadow: none;
}

.users-grid {
  gap: 18px;
}

.users-category-title {
  margin-top: 22px;
  padding: 0 0 12px;
  border-bottom: 0;
}

.users-category-count {
  border: 0;
  border-radius: var(--radius-pill);
}

.user-card {
  min-height: 112px;
  padding: 18px;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  box-shadow: none;
}

.user-card:hover,
.user-card:focus {
  background: var(--bg-raised);
  box-shadow: none;
  transform: translateY(-3px);
}

.user-avatar {
  width: 68px;
  height: 68px;
  flex-basis: 68px;
  border-radius: 50%;
  box-shadow: none;
}

.users-empty {
  padding: 70px 20px;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
}

.profile-container {
  padding-bottom: 40px;
}

.back-to-users {
  display: inline-flex;
  align-items: center;
  margin-bottom: 20px;
  padding: 9px 16px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  color: var(--text-light);
}

.back-to-users:hover {
  color: var(--rr-blue-text);
}

.profile-card {
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  box-shadow: none;
}

.profile-banner {
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: none;
}

.profile-content {
  background: var(--bg-surface);
}

.profile-stat {
  border: 0;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.025);
}

.profile-status {
  margin: 16px 0;
}

@media (max-width: 768px) {
  .users-page-main,
  .profile-page-main {
    padding: 70px 16px 50px;
  }

  .users-header {
    padding-top: 20px;
  }
}
