.user-auth-popup,
.author-profile-popup {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.6);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  padding: 16px;
}

.user-auth-popup {
  z-index: 200900;
}

.author-profile-popup {
  z-index: 200000;
}

.author-profile-popup.is-transparent {
  background: transparent;
}

@media screen and (max-width: 768px) {
  .author-profile-popup--authors-page {
    background: rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }
}

@media screen and (min-width: 769px) {
  .author-profile-popup--authors-page {
    background: rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }
}

.user-auth-popup.show,
.author-profile-popup.show {
  display: flex;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.author-profile-popup.closing {
  display: flex;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.user-auth-content,
.author-profile-content {
  background: #121c24;
  border: 1px solid #2b3a46;
  border-radius: 10px;
  padding: 18px;
  width: min(640px, 92vw);
  color: #e8f4ff;
  position: relative;
}

.user-auth-content {
  --user-auth-selection-bg: rgba(193, 201, 208, 0.82);
  --user-auth-selection-color: #0f151b;
  width: min(300px, 92vw);
}

.user-auth-content::selection,
.user-auth-content *::selection {
  background: var(--user-auth-selection-bg) !important;
  color: var(--user-auth-selection-color) !important;
}

.user-auth-content::-moz-selection,
.user-auth-content *::-moz-selection {
  background: var(--user-auth-selection-bg) !important;
  color: var(--user-auth-selection-color) !important;
}

.author-profile-content {
  max-height: 85vh;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(79, 195, 247, 0.65) rgba(18, 34, 45, 0.6);
}

.author-profile-content::-webkit-scrollbar {
  width: 6px;
}

.author-profile-content::-webkit-scrollbar-track {
  background: rgba(18, 34, 45, 0.6);
  border-radius: 999px;
}

.author-profile-content::-webkit-scrollbar-thumb {
  background: rgba(79, 195, 247, 0.65);
  border-radius: 999px;
}

.author-profile-content::-webkit-scrollbar-thumb:hover {
  background: rgba(79, 195, 247, 0.85);
}


.author-profile-close-float {
  position: fixed;
  bottom: 200px;
  left: 50%;
  transform: translateX(-50%);
  background: #d32f2f;
  color: white;
  border: none;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(211, 47, 47, 0.4);
  z-index: 200005;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
  white-space: nowrap;
  width: auto !important;
  min-width: unset !important;
  max-width: unset !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 !important;
}

.author-profile-popup.show .author-profile-close-float {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.author-profile-content .author-profile-close-desktop {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(79, 195, 247, 0.55);
  border-radius: 8px;
  background: rgba(15, 34, 46, 0.9);
  color: #dff3ff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  display: inline-flex;
}

.author-profile-content .author-profile-close-desktop:hover {
  border-color: #ff8a8a;
  background: rgba(70, 28, 28, 0.95);
  transform: translateY(-1px);
}

.author-profile-content .author-profile-close-desktop svg {
  width: 16px;
  height: 16px;
  display: block;
}

@media screen and (max-width: 768px) {
  .author-profile-content .author-profile-close-desktop {
    display: none !important;
  }
  .author-profile-popup {
    padding: 0;
  }
  .author-profile-popup .author-profile-close-float {
    display: none !important;
  }
  .author-profile-popup.show,
  .author-profile-popup.closing {
    align-items: flex-end;
    justify-content: center;
  }
  .author-profile-content {
    width: 100%;
    max-width: 100%;
    max-height: 80vh;
    border-radius: 20px 20px 0 0;
    transform: translate3d(0, 100%, 0);
    transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
  }
  .author-profile-popup.show .author-profile-content {
    transform: translate3d(0, 0, 0);
  }
  .author-profile-popup.closing .author-profile-content {
    transform: translate3d(0, 100%, 0);
  }
  .author-profile-content::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 48px;
    height: 4px;
    background: rgba(79, 195, 247, 0.35);
    border-radius: 2px;
    pointer-events: none;
  }
  .author-profile-close-float {
    bottom: 15px;
    padding: 6px 14px;
    font-size: 13px;
    max-width: 120px;
  }
}

@media screen and (min-width: 769px) {
  .author-profile-close-float {
    display: none !important;
  }
}

.user-auth-content input,
.user-auth-content button {
  width: 100%;
  margin: 6px 0;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #2b3a46;
}

.user-auth-content button {
  background: #4fc3f7;
  color: #10222c;
  cursor: pointer;
  font-weight: 600;
}

.user-auth-label {
  display: block;
  margin: 10px 0 4px;
  color: #b0cfe0;
  font-size: 13px;
  font-weight: 600;
}

.user-auth-remember {
  margin-top: 8px;
  color: #9fb2c1;
  font-size: 12px;
}

.user-auth-remember label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.user-auth-remember input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 2px;
  appearance: auto;
  accent-color: #4fc3f7;
}

.required-field::after {
  content: " *";
  color: #ff5c5c;
  font-weight: 700;
}

.user-popup-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  border: 1px solid #4fc3f7;
  background: #0f151b;
  color: #4fc3f7;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-weight: 700;
  width: 28px !important;
  height: 28px !important;
  min-width: 28px;
  max-width: 28px;
  margin: 0 !important;
  flex: 0 0 28px;
}

.user-auth-links {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  justify-content: space-between;
}

.user-auth-links button {
  background: transparent;
  border: none;
  color: #4fc3f7;
  cursor: pointer;
  padding: 0;
}

.user-auth-help {
  font-size: 12px;
  color: #9fb2c1;
  margin: 6px 0 10px;
}

.user-inline-status {
  font-size: 11px;
  color: #b0cfe0;
  text-align: center;
  margin-top: 4px;
}

.favorite-btn {
  background: transparent;
  border: 1px solid #4fc3f7;
  color: #4fc3f7;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
}

.favorite-btn.favorite-active {
  background: #4fc3f7;
  color: #10222c;
}

.author-profile-content a {
  color: #4fc3f7;
}

.author-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-bottom: 1px solid #22313b;
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.author-hero {
  position: relative;
  margin: -6px -6px 10px;
  padding-bottom: 34px;
}

.author-banner-wrap {
  margin: -6px -6px 10px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #22313b;
  margin: 0;
}

.author-banner {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 5;
  object-fit: cover;
}

.author-banner-placeholder {
  background: linear-gradient(135deg, #1a2731, #111b24);
}

.author-avatar-hero {
  position: absolute;
  left: 14px;
  bottom: -2px;
}

.author-name-over-hero {
  position: absolute;
  left: 132px;
  right: 12px;
  bottom: -2px;
  height: 104px;
  display: flex;
  align-items: center;
  min-width: 0;
}

.author-name-over-hero h3 {
  margin: 0;
  font-size: 22px;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.85), 0 0 12px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.author-name-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}

.author-admin-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 0;
  font-size: 0;
  line-height: 1;
  background: transparent;
  border: 0;
  color: #ffffff;
  box-shadow: none;
  flex: 0 0 auto;
}

.author-admin-badge-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.author-admin-role {
  display: inline-block;
  font-size: 11px;
  line-height: 1;
  font-weight: 400;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.85);
}

.author-admin-icon {
  width: 30px;
  height: 30px;
  display: block;
}

.author-avatar {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #0f1820;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.38);
  background: #0f1820;
  flex: 0 0 auto;
}

.author-avatar-placeholder {
  background: linear-gradient(135deg, #1f2c36, #0f1820);
}

.author-subtitle {
  font-size: 12px;
  color: #9fb2c1;
  text-transform: none;
  letter-spacing: 0.2px;
  line-height: 1.35;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.author-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-width: 0;
  margin-top: 0;
}

.author-meta-item {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.author-meta-left {
  justify-content: flex-start;
}

.author-meta-right {
  justify-content: flex-end;
  margin-left: auto;
}

.author-meta-label {
  display: none;
}

.author-meta-value {
  font-size: 13px;
  color: #e8f4ff;
  font-weight: 600;
  white-space: nowrap;
}

.author-meta-flag-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.author-flag-button {
  border: none;
  background: transparent;
  color: inherit;
  padding: 0;
  margin: 0;
  cursor: pointer;
  position: relative;
}

.author-meta-flag-img {
  width: 1.05em;
  height: 1.05em;
  object-fit: cover;
  border-radius: 2px;
  flex: 0 0 auto;
}

.author-label-icon {
  width: 14px;
  height: 14px;
  display: inline-block;
  vertical-align: middle;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.author-section {
  background: #0f1820;
  border: 1px solid #22313b;
  border-radius: 10px;
  padding: 8px 10px;
  margin: 10px 0;
}

.author-stats-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.author-stats-row .author-info-row {
  margin: 0;
  flex: 1 1 auto;
}

@media screen and (max-width: 768px) {
  .author-hero {
    padding-bottom: 30px;
  }
  .author-avatar-hero {
    left: 12px;
    transform: none;
  }
  .author-name-over-hero {
    left: 108px;
    right: 10px;
    bottom: 4px;
    height: 86px;
  }
  .author-name-over-hero h3 {
    font-size: 22px;
  }
  .author-avatar {
    width: 86px;
    height: 86px;
  }
  .author-meta-row {
    gap: 8px;
  }
  .author-meta-label {
    font-size: 10px;
  }
  .author-meta-value {
    font-size: 12px;
  }
  .author-meta-country-name {
    display: none;
  }
  .author-flag-button.is-open::after {
    content: attr(data-country-name);
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    background: rgba(8, 16, 22, 0.96);
    color: #e8f4ff;
    border: 1px solid rgba(79, 195, 247, 0.45);
    border-radius: 7px;
    padding: 5px 8px;
    font-size: 11px;
    line-height: 1.2;
    white-space: nowrap;
    z-index: 3;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  }
  .author-stats-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    text-align: left;
  }
  .author-stats-row .author-info-row {
    justify-content: space-between;
    align-items: center;
    width: 100%;
    flex: 0 0 auto;
    margin: 0;
  }
  .author-stats-row .author-points-btn {
    margin: 6px auto 0;
    align-self: center;
  }
  .author-equipment .author-info-row {
    display: flex;
    align-items: flex-start;
    gap: 6px;
  }
  .author-equipment .author-info-label {
    text-align: left;
    justify-content: flex-start;
    padding-right: 0;
    position: static;
  }
  .author-equipment .author-info-label::after {
    content: " :";
    position: static;
  }
}

.author-socials-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.author-section-title {
  font-weight: 600;
  color: #4fc3f7;
  margin-bottom: 4px;
  font-size: 14px;
}

.author-section-title + .author-section-body {
  margin-top: 0;
}

.author-section-body.author-equipment {
  margin-top: 2px;
  margin-bottom: 2px;
}

.author-section-body {
  color: #e8f4ff;
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-line;
}

.author-grid {
  background: transparent;
  border: none;
  padding: 0;
  margin: 6px 0 8px;
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.author-grid > div {
  flex: 1 1 180px;
  min-width: 180px;
  background: #0f1820;
  border: 1px solid #22313b;
  border-radius: 8px;
  padding: 6px 8px;
}

.author-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.author-social-link {
  background: #1b2630;
  border: 1px solid #2b3a46;
  border-radius: 6px;
  padding: 6px 8px;
  color: #e8f4ff;
  text-decoration: none;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.author-social-icon {
  width: 16px;
  height: 16px;
  display: inline-block;
  flex: 0 0 16px;
}

.author-website-btn {
  background: rgba(34, 197, 94, 0.35);
  border-color: rgba(34, 197, 94, 0.6);
  color: #000;
  font-weight: 700;
}

.author-points-btn {
  margin: 0;
  width: auto;
  background: #4fc3f7;
  color: #10222c;
  border: none;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.author-points-btn:hover {
  background: #6fd0ff;
}

.author-info-row {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  font-size: 12px;
}

.author-equipment .author-info-row {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: start;
  column-gap: 8px;
}

.author-equipment .author-info-value {
  align-self: start;
  min-width: 0;
  white-space: pre-line;
}

.author-equipment .author-info-label {
  min-width: 0;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.4;
  text-align: right;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  position: relative;
  padding-right: 12px;
}

.author-equipment .author-info-label::after {
  content: ":";
  position: absolute;
  right: 0;
  top: 0;
}

.author-info-label {
  color: #9fb2c1;
  min-width: 0;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
}

.author-info-value {
  color: #e8f4ff;
  text-align: left;
}

.author-info-label::after {
  content: " :";
}

.author-empty {
  color: #7f94a6;
  font-size: 12px;
  font-style: italic;
}

.gallery-item-actions {
  margin-top: 6px;
}

.user-author-container {
  position: relative;
}

.user-author-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #101820;
  border: 1px solid #2b3a46;
  border-radius: 6px;
  max-height: 180px;
  overflow-y: auto;
  z-index: 200001;
  display: none;
}

.user-author-suggestions.show {
  display: block;
}

.user-author-suggestion {
  padding: 6px 8px;
  cursor: pointer;
  border-bottom: 1px solid #1f2b34;
}

.user-author-suggestion:last-child {
  border-bottom: none;
}

.user-author-suggestion:hover {
  background: #1c2b36;
}
