.forum-header-item,
.forum-header-link,
.show_user {
  position: relative;
}

.forum-header-link {
  display: block;
}

.forum-conversations-item {
  position: relative;
  z-index: 950;
}

.forum-conversations-dropdown {
  position: absolute;
  z-index: 980;
  top: 43px;
  right: -18px;
  display: none;
  width: 330px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 13px;
  box-shadow: 0 16px 38px rgba(0, 0, 0, .45);
  background: #292929;
  color: #fff;
}

.forum-conversations-dropdown.is-open {
  display: block;
}

.forum-conversations-dropdown::before {
  position: absolute;
  top: -7px;
  right: 24px;
  width: 14px;
  height: 14px;
  border-top: 1px solid rgba(255, 255, 255, .10);
  border-left: 1px solid rgba(255, 255, 255, .10);
  background: #303030;
  content: '';
  transform: rotate(45deg);
}

.forum-conversations-head,
.forum-conversations-footer {
  display: flex;
  align-items: center;
}

.forum-conversations-head {
  position: relative;
  min-height: 48px;
  padding: 0 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  background: #303030;
  justify-content: space-between;
}

.forum-conversations-head > span {
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.forum-conversations-head > a,
.forum-conversations-footer > a {
  color: #e8a05d;
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
}

.forum-conversations-head > a:hover,
.forum-conversations-footer > a:hover {
  color: #ffb676;
}

.forum-conversations-preview {
  max-height: 340px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.forum-conversation-preview-item {
  display: flex;
  min-height: 76px;
  padding: 10px 13px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  background: rgba(255, 255, 255, .015);
  color: #fff;
  gap: 10px;
  align-items: center;
  text-decoration: none;
  transition: background .18s ease;
}

.forum-conversation-preview-avatar {
  display: flex;
  overflow: hidden;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(145deg, #76533a, #3a3a3a);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  align-items: center;
  justify-content: center;
}

.forum-conversation-preview-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.forum-conversation-preview-body {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-direction: column;
}

.forum-conversation-preview-item:hover {
  background: rgba(218, 146, 86, .13);
  color: #fff;
}

.forum-conversation-preview-heading {
  display: flex;
  min-width: 0;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.forum-conversation-preview-heading strong {
  overflow: hidden;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forum-conversation-preview-heading time {
  flex: 0 0 auto;
  color: #9c9c9c;
  font-size: 9px;
  font-weight: 600;
}

.forum-conversation-preview-meta,
.forum-conversation-preview-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forum-conversation-preview-meta {
  margin-top: 3px;
  color: #e5a066;
  font-size: 9px;
  font-weight: 600;
}

.forum-conversation-preview-text {
  margin-top: 4px;
  color: #aaa;
  font-size: 10px;
  line-height: 14px;
}

.forum-conversations-empty {
  padding: 24px 15px;
  color: #999;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}

.forum-conversations-footer {
  min-height: 43px;
  padding: 0 14px;
  gap: 8px;
  background: #242424;
  justify-content: center;
}

.forum-conversations-footer > a + a::before {
  margin-right: 8px;
  color: #666;
  content: '·';
}

.forum-badge {
  position: absolute;
  z-index: 920;
  top: 6px;
  right: -9px;
  display: none;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border: 3px solid #1f1f1f;
  border-radius: 20px;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  background: linear-gradient(34deg, #41658a 0%, #6597c9 55%);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  pointer-events: none;
}

.forum-alerts-shortcut {
  display: flex;
  width: calc(100% - 20px);
  min-height: 48px;
  margin: 10px;
  padding: 9px 12px;
  gap: 10px;
  border: 1px solid rgba(218, 146, 86, .28);
  border-radius: 11px;
  background: rgba(218, 146, 86, .10);
  color: #fff;
  align-items: center;
  transition: .2s;
}

.forum-alerts-shortcut:hover {
  background: rgba(218, 146, 86, .22);
  color: #fff;
}

.forum-alerts-shortcut > i {
  display: flex;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: rgba(218, 146, 86, .22);
  color: #edaa72;
  font-size: 16px;
  align-items: center;
  justify-content: center;
}

.forum-alerts-shortcut-text {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 15px;
}

.forum-alerts-shortcut-title {
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.forum-alerts-shortcut-description {
  color: #929292;
  font-size: 9.5px;
  font-weight: 600;
}

.forum-alerts-menu-count {
  display: none;
  min-width: 25px;
  height: 25px;
  margin-left: auto;
  padding: 0 7px;
  border-radius: 20px;
  background: linear-gradient(34deg, #be5555 0%, #ed7171 55%);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  align-items: center;
  justify-content: center;
}

/*
 * GameCMS originally keeps #notifications_line in the normal document flow.
 * Once the site and forum counts are combined, that behavior moves the bell.
 * Keep the badge as a pure overlay so no header item can change its position.
 */
.unified-notifications-item,
.unified-notifications-item .show_user {
  position: relative;
}

.wapper .header .unified-notifications-item .show_user > #notifications_line {
  position: absolute;
  z-index: 920;
  top: -7px;
  right: -6px;
  left: auto;
  display: none;
  width: auto;
  min-width: 22px;
  height: 22px;
  margin: 0;
  padding: 0 6px;
  border: 3px solid #1f1f1f;
  border-radius: 20px;
  box-sizing: border-box;
  background: linear-gradient(34deg, #be5555 0%, #ed7171 55%);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.forum-alerts-preview:empty {
  display: none;
}

.forum-alerts-preview {
  display: flex;
  width: calc(100% - 20px) !important;
  margin: 0 10px 10px;
  gap: 5px;
  flex-direction: column;
}

.forum-alert-preview-item {
  display: flex;
  min-height: 39px;
  padding: 7px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .035);
  flex-direction: column;
  justify-content: center;
  line-height: 14px;
  transition: .2s;
}

.forum-alert-preview-item:hover {
  background: rgba(255, 255, 255, .07);
}

.forum-alert-preview-item span {
  display: -webkit-box;
  overflow: hidden;
  color: #d4d4d4;
  font-size: 9.5px;
  font-weight: 600;
  line-height: 14px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

@media (max-width: 767.98px) {
  .forum-conversations-dropdown {
    position: fixed;
    top: 82px;
    right: 12px;
    left: 12px;
    width: auto;
    max-width: none;
  }

  .forum-conversations-dropdown::before {
    display: none;
  }

  .forum-conversations-preview {
    max-height: min(340px, calc(100vh - 190px));
  }

  .forum-badge {
    position: absolute;
    top: 3px;
    right: -5px;
    left: auto;
    display: none;
    width: auto;
    min-width: 18px;
    height: 18px;
    margin: 0;
    padding: 0 4px;
    border-width: 2px;
    box-sizing: border-box;
    font-size: 8px;
    line-height: 14px;
    align-items: center;
    justify-content: center;
  }

  .wapper .header .unified-notifications-item .show_user > #notifications_line {
    position: absolute;
    top: -2px;
    right: -5px;
    left: auto;
    width: auto;
    min-width: 18px;
    height: 18px;
    margin: 0;
    padding: 0 4px;
    border-width: 2px;
    box-sizing: border-box;
    font-size: 8px;
    line-height: 14px;
    align-items: center;
    justify-content: center;
    background: linear-gradient(34deg, #be5555 0%, #ed7171 55%);
  }
}
