.btn.login-button.logged-in {
  overflow: hidden;
  opacity: 1 !important;
  cursor: pointer;
}
.btn.login-button .login-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.profile-wrapper {
  width: 100%;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.5s ease, padding 0.5s ease;
  padding: 0 var(--main-padding-gap);
  box-sizing: border-box;
}
.header.profile-expanded .profile-wrapper {
  max-height: 860px;
  padding: var(--main-padding-gap);
  overflow: hidden;
}

.auth-box-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 15px;
  font-family: var(--screen-font-family);
  color: var(--secondary-text-color);
  overflow: hidden;
  background: var(--content-bg);
  border-radius: var(--screen-border-radius);
}

.profile-panel > .auth-box {
  width: min(100%, 560px);
  margin: 0 auto;
  padding: 2px 10px 4px;
  box-sizing: border-box;
}

.profile-panel > .auth-box .profile-card {
  padding: 11px 12px;
  background: rgba(0, 0, 0, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
}

.profile-panel > .auth-box .profile-card-info {
  min-width: 0;
}

.profile-panel > .auth-box .profile-x-connect {
  width: min(100%, 390px);
  margin-inline: auto;
  box-sizing: border-box;
  margin-top: 2px;
  padding: 7px;
  background: rgba(255, 255, 255, 0.025);
  border-color: rgba(255, 255, 255, 0.08);
}

.profile-panel > .auth-box .profile-x-connect-btn {
  width: auto;
  min-width: 178px;
  align-self: center;
  padding: 7px 13px;
}

.profile-panel > .auth-box .profile-x-connected {
  width: min(100%, 340px);
  align-self: center;
}

.profile-panel > .auth-box .ach-profile-section {
  width: min(100%, 390px);
  margin-inline: auto;
  margin-top: 7px;
  margin-bottom: 9px;
}

.profile-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 2px;
}

.profile-actions .auth-submit-btn {
  width: auto;
  min-width: 128px;
  padding: 8px 16px;
}

.profile-actions .auth-text-btn {
  width: auto;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 5px;
  text-decoration: none;
  transition: background 0.2s ease, opacity 0.2s ease;
}

.profile-actions .auth-text-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.profile-panel > .profile-setup {
  width: min(100%, 440px);
  padding: 6px 14px 8px;
}

.profile-setup .auth-title {
  margin-bottom: 2px;
}

.profile-setup .auth-input {
  width: min(100%, 340px);
  margin: 2px auto 3px;
}

.profile-setup .avatar-picker-label,
.profile-setup .avatar-grid {
  width: min(100%, 360px);
  margin-inline: auto;
}

.profile-setup .avatar-picker-label {
  margin-top: 4px;
}

.profile-setup .avatar-grid {
  grid-template-columns: repeat(5, minmax(0, 56px));
  justify-content: center;
  gap: 7px;
}

.profile-setup .auth-submit-btn {
  display: block;
  width: auto;
  min-width: 142px;
  margin: 5px auto 0;
  padding: 8px 16px;
}

.profile-setup .auth-text-btn {
  display: block;
  width: auto;
  margin: 2px auto 0;
  padding: 6px 10px;
}

.auth-title {
  font-size: 1.1rem;
  letter-spacing: 2px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 8px;
  opacity: 0.85;
}
.auth-subtitle {
  font-size: 0.8rem;
  opacity: 0.7;
  text-align: center;
  margin: 0;
  line-height: 1.4;
}
.auth-loading {
  padding: 20px;
  text-align: center;
  font-family: var(--screen-font-family);
  color: var(--secondary-text-color);
  opacity: 0.7;
}

.auth-google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--secondary-text-color);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s ease;
}
.auth-google-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  opacity: 0.5;
  font-size: 0.75rem;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}
.auth-divider span {
  padding: 0 10px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.auth-form input,
.auth-input {
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--secondary-text-color);
  font-family: inherit;
  font-size: 0.9rem;
  box-sizing: border-box;
}
.auth-form input::placeholder,
.auth-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}
.profile-social-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: -3px;
  font-size: 0.8rem;
  opacity: 0.82;
}
.profile-social-label span {
  font-size: 0.72rem;
  opacity: 0.65;
}

.auth-submit-btn {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 6px;
  background: #68786e;
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: bold;
  letter-spacing: 1px;
  cursor: pointer;
  transition: filter 0.2s ease;
}
.auth-submit-btn:hover {
  filter: brightness(1.15);
}

.auth-text-btn {
  background: none;
  border: none;
  color: var(--secondary-text-color);
  opacity: 0.6;
  font-family: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
}
.auth-text-btn:hover {
  opacity: 1;
}

.auth-error {
  color: #ff8080;
  font-size: 0.8rem;
  text-align: center;
  min-height: 1em;
}
.auth-error.auth-success {
  color: #9fd3b0;
}

.auth-switch {
  font-size: 0.8rem;
  text-align: center;
  opacity: 0.8;
}
.auth-switch button {
  background: none;
  border: none;
  color: #9fd3b0;
  font-family: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
}

.avatar-picker-label {
  font-size: 0.8rem;
  opacity: 0.7;
}
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.avatar-option {
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  cursor: pointer;
  overflow: hidden;
  aspect-ratio: 1;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.avatar-option img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.avatar-option:hover {
  transform: scale(1.05);
}
.avatar-option.selected {
  border-color: #9fd3b0;
}

.avatar-google-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.avatar-google-img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.25);
}
.avatar-google-label {
  font-size: 0.75rem;
  opacity: 0.6;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
}
.profile-card-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.25);
}
.profile-card-avatar-wrap,
.profile-view-avatar-wrap,
.user-row-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}
.profile-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.profile-card-name {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 1.05rem;
  font-weight: bold;
}
.profile-x-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  box-sizing: border-box;
  color: #fff;
  background: #000;
  border: 1px solid #303030;
  border-radius: 3px;
  font-size: 10px;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.profile-x-link:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.6);
}
.profile-x-link--large {
  width: 28px;
  height: 28px;
  font-size: 14px;
}
.profile-x-connect {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 9px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
}
.profile-x-connect-btn,
.profile-x-connected {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
}
.profile-x-connect-btn {
  justify-content: center;
  padding: 8px 10px;
  color: var(--screen-text-color, #cfe);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 5px;
  font: inherit;
  cursor: pointer;
}
.profile-x-connect-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}
.profile-x-connect-btn:disabled {
  cursor: wait;
  opacity: 0.6;
}
.profile-x-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 21px;
  height: 21px;
  color: #fff;
  background: #000;
  border: 1px solid #303030;
  border-radius: 3px;
  font-size: 11px;
}
.profile-x-connected > span {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  font-size: 0.82rem;
}
.profile-x-connected small {
  opacity: 0.62;
  font-size: 0.68rem;
}
.profile-x-unlink {
  padding: 4px 7px;
  color: #ffabab;
  background: transparent;
  border: 1px solid rgba(255, 120, 120, 0.3);
  border-radius: 4px;
  font: inherit;
  font-size: 0.68rem;
  cursor: pointer;
}
.profile-x-unlink:hover {
  background: rgba(255, 90, 90, 0.1);
}
.profile-x-notice {
  font-size: 0.75rem;
  text-align: center;
  opacity: 0.8;
}
.profile-x-notice.success {
  color: #9fffc0;
}
.profile-x-notice.error {
  color: #ff9f9f;
}
.profile-card-spins {
  font-size: 0.85rem;
  opacity: 0.85;
}
.profile-card-highest {
  color: #d2ff62;
  font-size: 0.8rem;
}
.profile-card-highest i {
  margin-right: 3px;
  color: #ffcf4a;
}
.profile-card-highest strong {
  color: inherit;
}
.profile-card-country {
  font-size: 0.75rem;
  opacity: 0.6;
}

@media (max-width: 480px) {
  .profile-panel > .auth-box {
    padding-inline: 3px;
  }

  .profile-panel > .auth-box .profile-card {
    padding: 9px;
  }

  .profile-actions {
    gap: 6px;
  }

  .profile-actions .auth-submit-btn {
    min-width: 112px;
    padding-inline: 12px;
  }

  .profile-panel > .profile-setup {
    padding-inline: 3px;
  }

  .profile-setup .avatar-grid {
    grid-template-columns: repeat(5, minmax(0, 48px));
    gap: 5px;
  }
}

.profile-public-box {
  position: relative;
  padding-top: 10px;
}
.profile-public-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 1.1rem;
  letter-spacing: 2px;
}
.profile-public-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  background: none;
  border: none;
  color: inherit;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
}
.profile-public-close:hover {
  opacity: 1;
}
.profile-view-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 4px 4px;
}
.profile-view-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.25);
}
.profile-card-avatar-wrap .dev-badge--avatar,
.profile-view-avatar-wrap .dev-badge--avatar,
.user-row-avatar-wrap .dev-badge--avatar {
  top: -5px;
  right: -8px;
}
.profile-view-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1.3rem;
  font-weight: bold;
}
.profile-view-country {
  font-size: 0.85rem;
  opacity: 0.7;
}
.profile-view-spins {
  font-size: 1rem;
  opacity: 0.9;
  margin-top: 4px;
}
.profile-view-highest {
  padding: 6px 10px;
  color: #d2ff62;
  background: rgba(210, 255, 98, 0.06);
  border: 1px solid rgba(210, 255, 98, 0.25);
  border-radius: 4px;
  font-size: 0.9rem;
  text-align: center;
}
.profile-view-highest i {
  margin-right: 4px;
  color: #ffcf4a;
}
.profile-view-highest strong {
  color: inherit;
}
.profile-view-empty {
  padding: 20px;
  opacity: 0.7;
}

.message-author.clickable,
.message-avatar.clickable {
  cursor: pointer;
}
.message-author.clickable:hover {
  text-decoration: underline;
}

.users-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
}
.user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: background 0.15s ease;
}
.user-row:hover {
  background: rgba(255, 255, 255, 0.1);
}
.user-row.dev {
  background: rgba(168, 85, 247, 0.05);
  box-shadow: none;
}
.user-row.dev:hover {
  background: rgba(168, 85, 247, 0.11);
}
.dev-badge {
  display: inline-block;
  padding: 1px 6px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  vertical-align: middle;
  color: #fff;
  background: linear-gradient(135deg, #a855f7, #7c3aed);
  border-radius: 6px;
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.5);
}
.dev-badge--avatar {
  position: absolute;
  z-index: 1;
  margin: 0;
  padding: 1px 4px;
  font-size: 0.55rem;
  line-height: 1.1;
  border-radius: 4px;
}
.user-rank {
  font-weight: bold;
  width: 28px;
  text-align: center;
  opacity: 0.8;
}
.user-row-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.user-row.dev .user-row-avatar,
.profile-card-avatar-wrap.dev .profile-card-avatar,
.profile-view-avatar-wrap.dev .profile-view-avatar {
  border-color: #a855f7;
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.48);
}
.user-row-name {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 1;
  font-weight: 600;
  min-width: 0;
}
.user-row-name-text {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-row-x-link {
  flex-shrink: 0;
  font-size: 0.78rem;
}
.user-row-spins {
  font-size: 0.85rem;
  opacity: 0.85;
  white-space: nowrap;
}
