.sidebar .category-menu {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

/* Стиль для ссылок категорий */
.sidebar .category-menu li {
  margin: 10px 0;
  text-align: center;
}

.sidebar .category-menu li:last-child {
  margin: 0;
}

.sidebar .category-menu li a, .sidebar .category-menu li button {
  text-decoration: none;
  color: var(--white);
  font-weight: bold;
  display: block;
  padding: 10px;
  background-color: var(--ddark);
  border-radius: 10px;
  transition: background-color 0.2s ease;
  position: relative;
  width: 100%;
  border: none;
  box-sizing: border-box;
}

.sidebar .category-menu li a:hover, .sidebar .category-menu li button:hover {
  color: var(--white);
  background-color: var(--ten)
}

.sidebar.closed {
  width: 50px;
}

.sidebar.closed .category-menu li a, .sidebar.closed .category-menu li button {
  font-size: 12px;
  text-align: center;
}

.category-link.active {
  outline: 1px solid var(--white-transp);
  box-shadow: 0 0 10px var(--white-transp);
}

.sub-category-menu .active {
  outline: 1px solid var(--white-transp);
  box-shadow: 0 0 10px var(--white-transp);
}


/* Активные ссылки для категории */
.category-link.active {
  font-weight: bold;
  color: #007BFF;
}

/* Основной стиль для категории */
.category-item {
  list-style-type: none;
  margin: 5px 0;
}

/* Стиль для подкатегорий - скрыто по умолчанию */
.sub-category-menu {
  padding-left: 20px;
  list-style-type: none;
}

/* Стиль для ссылок */
.category-link {
  cursor: pointer;
  text-decoration: none;
  color: #333;
}

/* Для подкатегорий */
.sub-category-menu a, .sub-category-menu button {
  color: #555;
  text-decoration: none;
  padding: 5px 0;
  display: block;
}
.mini-chat {
  position: fixed;
  bottom: var(--footer-spacer);
  right: 50px;
  width: 400px;
  background: var(--overlay-dark);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--outline-main);
  border-radius: 10px;
  box-shadow: 0 0 12px var(--ten);
  color: var(--white);
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 99;
  overscroll-behavior: none;
}

.mini-chat.collapsed {
  width: 50px;
  height: 50px;
  opacity: 0.85;
  background: var(--overlay-dark);
  box-shadow: 0 0 12px var(--dslite);
  border: 1px solid var(--outline-main);
}

.mini-chat.collapsed:hover {
  transform: scale(1.05);
  opacity: 1;
}

.btn-sound {
  background: transparent;
  border: none;
  font-size: 20px;
  color: var(--white);
  padding: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: all .2s ease-in-out;
  justify-content: center;
  z-index: 9;
}

.btn-toggle {
  background: transparent;
  border: none;
  font-size: 20px;
  color: var(--white);
  padding: 10px;
  cursor: pointer;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  transition: all .2s ease-in-out;
  justify-content: center;
  position: relative;
  z-index: 9;
}

.mini-chat:not(.collapsed) .btn-toggle {
  position: absolute;
  width: auto;
  height: auto;
  top: 10px;
  right: 10px;
}

.mini-chat.collapsed .new-message-indicator {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 10px;
  height: 10px;
  background: var(--dslite);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--overlay-dark);
  animation: simplePulse 1.5s ease-in-out infinite;
}

@keyframes simplePulse {

  0%,
  100% {
    transform: scale(1);
    box-shadow:
      0 0 0 2px var(--overlay-dark),
      0 0 8px var(--dslite);
  }

  50% {
    transform: scale(1.1);
    box-shadow:
      0 0 0 2px var(--overlay-dark),
      0 0 12px var(--dslite),
      0 0 16px rgba(101, 114, 250, 0.4);
  }
}

.mini-chat:not(.collapsed) .btn-sound {
  position: absolute;
  top: 10px;
  right: 45px;
  width: auto;
  height: auto;
}

.mini-chat.collapsed .btn-sound {
  display: none;
}

.btn-sound:hover,
.btn-toggle:hover {
  color: var(--dslite);
}

.btn-sound i {
  font-size: 18px;
}

.chat-body {
  display: flex;
  flex-direction: column;
  height: 450px;
}

.chat-messages {
  flex-grow: 1;
  padding: 10px;
  overflow-y: auto;
  font-size: 14px;
  scrollbar-width: thin;
  scroll-behavior: smooth;
  scrollbar-color: var(--bbb2) transparent;
  overscroll-behavior: contain;
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--dslite);
  border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: var(--ds);
}

.chat-message {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
  word-break: break-word;
  animation: messageSlideIn 0.3s ease-out;
}

.chat-message.highlight {
  animation: highlightMsg 1.5s ease;
}

.chat-message.react .message-bubble {
  transform: scale(1.03);
  box-shadow: 0 0 12px var(--ten);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  z-index: 2;
}

.message-bubble {
  background: linear-gradient(135deg, var(--bbb) 0%, var(--darklite) 100%);
  border-radius: 16px;
  padding: 10px 14px;
  max-width: 260px;
  word-wrap: break-word;
  position: relative;
  border: 1px solid var(--outline-main);
  box-shadow: 0 2px 8px var(--ten);
  transition: all 0.2s ease;
}

.message-bubble:hover {
  box-shadow: 0 4px 12px var(--ten);
  transform: translateY(-1px);
}

/* Контейнер для контента сообщения */
.message-content {
  position: relative;
}

.message-header {
  font-size: 12px;
  color: var(--white2);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  /* меняем на flex-start */
  margin-bottom: 4px;
  gap: 8px;
  /* добавляем отступ между именем и временем */
}

.message-header strong {
  color: var(--white);
  font-weight: 600;
  flex-shrink: 0;
  /* чтобы имя не сжималось */
}

.chat-avatar {
  border-radius: 50%;
  width: 28px;
  height: 28px;
  object-fit: cover;
  flex-shrink: 0;
  margin-top: 2px;
  border: 1px solid var(--outline-main);
  transition: transform 0.2s ease;
}

.chat-avatar:hover {
  transform: scale(1.1);
}

.chat-text {
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--white);
}

.chat-text p {
  margin: 0 auto;
}

.hidden-by-admin {
  opacity: 0.6;
  font-style: italic;
  position: relative;
}

.hidden-by-admin i {
  margin-right: 4px;
  color: #888;
}

.muted {
  color: var(--white2);
  font-style: italic;
}

.chat-time {
  font-size: 0.7rem;
  /* чуть уменьшаем */
  color: var(--white2);
  flex-shrink: 0;
  /* чтобы время не переносилось */
  opacity: 0.8;
}

.reply-preview {
  font-size: 11px;
  color: var(--white2);
  border-left: 2px solid var(--dslite);
  padding-left: 6px;
  margin-bottom: 6px;
  opacity: 0.8;
  display: flex;
  align-items: center;
  gap: 5px;
}

.reply-preview i {
  font-size: 12px;
}

.message-reactions {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  flex-wrap: wrap;
  align-items: center;
  min-height: 24px;
}

.reactions {
  margin-top: 6px;
  font-size: 14px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  -webkit-user-select: none;
          user-select: none;
}

.reaction {
  background: var(--overlay-dark);
  padding: 4px 8px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
  position: relative;
  backdrop-filter: blur(10px);
}

.reaction:hover {
  background: var(--darklite);
  transform: scale(1.05);
}

.reaction.active-reaction {
  background: var(--dslite);
  color: var(--white);
  border-color: var(--dslite);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.reaction-count {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.9;
}

.reaction-menu-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99998;
  background: transparent;
}

.reaction-menu {
  position: absolute;
  background: var(--darklite);
  border: 1px solid var(--outline-main);
  border-radius: 24px;
  padding: 8px;
  display: flex;
  gap: 4px;
  z-index: 9999;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(20px);
}

.reaction-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.2s ease;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

/* Контекстное меню в стиле Telegram - Т-образное */
/* Контекстное меню в стиле Telegram - Т-образное */
.context-menu {
  position: fixed;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 9999;
  min-width: 180px;
  align-items: center;
}

.context-menu-horizontal {
  background: var(--overlay-dark);
  outline: 1px solid var(--outline-main);
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 12px;
  transition: all 0.3s ease;
}

.context-menu-vertical {
  background: var(--overlay-dark);
  outline: 1px solid var(--outline-main);
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: -moz-fit-content;
  width: fit-content;
  padding: 8px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.context-menu-vertical.hidden {
  opacity: 0;
  transform: scale(0.9);
  pointer-events: none;
}

.context-menu-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.2s ease;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--white);
}

.context-menu-btn:hover {
  background: var(--ten);
  transform: scale(1.1);
}

.context-menu-action {
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--white);
  width: 100%;
  text-align: left;
  font-weight: 500;
}

.context-menu-action:hover {
  background: var(--ten);
}

.context-menu-action i {
  font-size: 14px;
  width: 16px;
  opacity: 0.8;
}

.context-menu-btn-more {
  background: var(--ten);
  border: none;
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.2s ease;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--white);
}

.context-menu-btn-more:hover {
  background: var(--dslite);
  transform: scale(1.1);
}

/* Меню всех реакций (5x5 сетка) */
.reactions-grid-menu {
  position: fixed;
  background: var(--overlay-dark);
  outline: 1px solid var(--outline-main);
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  z-index: 10000;
  max-width: 220px;
  animation: scaleIn 0.2s ease;
}

.reactions-grid-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--white);
}

.reactions-grid-btn:hover {
  background: var(--ten);
  transform: scale(1.1);
}

/* Анимация появления */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Трансформация меню */
.context-menu-horizontal.expanded {
  display: none;
}

.reactions-grid-menu.expanded {
  display: grid;
}

/* .chat-btn-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--outline-main);
} */

.btn-reply,
.btn-delete,
.btn-hide {
  background: transparent;
  border: none;
  color: var(--white2);
  font-size: 11px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-reply:hover {
  background: var(--dslite);
  color: var(--white);
}

.btn-delete:hover {
  background: var(--redopas);
  color: var(--red);
}

.btn-hide:hover {
  background: var(--overlay-dark);
  color: var(--white);
}

.delete-btn {
  background: none;
  border: none;
  color: var(--white2);
  font-size: 14px;
  cursor: pointer;
  margin-left: auto;
  padding: 2px;
  opacity: 0.5;
}

.delete-btn:hover {
  opacity: 1;
  color: var(--red);
}

.chat-input {
  display: flex;
  border-top: 1px solid var(--outline-main);
  background: var(--overlay-dark);
  align-items: flex-end;
  padding: 8px;
  gap: 8px;
}

.chat-input .chat-input-x {
  flex-grow: 1;
  padding: 10px 12px;
  border: 1px solid var(--outline-main);
  background: var(--darklite);
  color: var(--white);
  font-family: var(--bulma-family-code);
  resize: none;
  overflow-y: auto;
  border-radius: 12px;
  transition: all 0.2s ease;
  height: 20px;
  min-height: 10px;
  max-height: 200px;
}

.chat-input .chat-input-x::placeholder {
  color: var(--white2);
}

.chat-input .chat-input-x:focus {
  outline: none;
  border-color: var(--dslite);
  box-shadow: 0 0 0 2px var(--dslite);
}

.emoji-container {
  position: relative;
  height: 100%;
  align-items: flex-end;
  display: flex;
}

.emoji-panel {
  position: absolute;
  bottom: 50px;
  right: 0;
  z-index: 10000;
  border-radius: 8px;
  box-shadow: 0 0 10px var(--ten);
}

.btn-emoji,
.btn-send {
  background: linear-gradient(135deg, var(--dslite) 0%, var(--ds) 100%);
  color: var(--white);
  border: none;
  padding: 10px 14px;
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.2s ease;
  font-weight: 600;
}

.btn-emoji:hover,
.btn-send:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--ten);
}

.btn-toggle i {
  font-size: 20px;
}

.btn-send i,
.btn-delete i,
.btn-emoji i {
  font-size: 16px;
  color: var(--white);
}

.emoji-btn,
.btn-delete {
  background: transparent;
  border: none;
  cursor: pointer;
}

.emoji-btn {
  font-size: 20px;
}

.emoji-btn:hover,
.btn-send:hover,
.btn-delete:hover {
  opacity: 0.8;
}

.scroll-to-bottom-btn {
  position: absolute;
  bottom: 60px;
  right: 16px;
  width: 38px;
  height: 38px;
  background: var(--dslite);
  color: var(--white);
  border: none;
  border-radius: 50%;
  box-shadow: 0 4px 12px var(--ten);
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  opacity: 0;
  transform: translateY(20px);
  animation: slideInUp 0.3s forwards;
}

.scroll-to-bottom-btn:hover {
  opacity: 1;
  transform: scale(1.1);
  background: var(--dslite);
}

.scroll-to-bottom-btn i {
  font-size: 16px;
}

.reply-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, var(--darklite) 0%, var(--bbb) 100%);
  border-left: 4px solid var(--dslite);
  padding: 8px 12px;
  font-size: 13px;
  margin: 0 8px 8px 8px;
  border-radius: 8px;
  color: var(--white);
}

.reply-info {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.btn-cancel-reply {
  background: none;
  border: none;
  color: var(--white2);
  font-size: 16px;
  cursor: pointer;
}

.btn-cancel-reply:hover {
  color: var(--white);
}

.rate-limit-warning {
  background: rgba(255, 0, 0, 0.1);
  color: var(--red);
  text-align: center;
  padding: 6px 10px;
  font-size: 13px;
  border-top: 1px solid rgba(255, 0, 0, 0.2);
}

.date-divider {
  text-align: center;
  margin: 2rem 0;
  position: relative;
}

.date-divider span {
  background: linear-gradient(135deg, var(--darklite) 0%, var(--bbb) 100%);
  padding: 0.5rem 1.2rem;
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--white);
  outline: 1px solid var(--outline-main);
  font-weight: 600;
  box-shadow: 0 2px 8px var(--ten);
}

.date-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 20px;
  right: 20px;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--outline-main) 50%, transparent 100%);
  z-index: -1;
}

.typing-indicator {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--white2);
  font-style: italic;
  display: flex;
  align-items: center;
  gap: 4px;
}

.sound-wave {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 2px;
  background: var(--dslite);
  border-radius: 1px;
  animation: soundWave 1.5s infinite;
}

@keyframes highlightMsg {
  0% {
    background-color: var(--dslite);
  }

  100% {
    background-color: transparent;
  }
}

@keyframes slideInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.2);
    opacity: 0.7;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes btnPulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.5);
    opacity: 0.5;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes soundWave {

  0%,
  100% {
    transform: translateX(-50%) scaleX(1);
  }

  50% {
    transform: translateX(-50%) scaleX(0.5);
  }
}

@keyframes typingDots {

  0%,
  20% {
    opacity: 0;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}
.achievements-skeleton {
  display: flex;
  gap: 5px;
  width: 90%;
  background-color: var(--dark);
  padding: 5px 10px 5px 10px;
  border-radius: 5px;
}

.skeleton-line {
  height: 16px;
  background: var(--skeleton-footer-grad);
  background-size: 200% 100%;
  animation: pulse 1.5s infinite ease-in-out;
  border-radius: 4px;
}

@keyframes pulse {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.lang-dropdown {
  position: relative;
  display: inline-block;
}

.lang-toggle {
  background: var(--dark);
  outline: 1px solid var(--outline-main);
  backdrop-filter: var(--glass-blur);
  color: var(--white);
  padding: 6px 12px;
  font-size: 14px;
  display: flex;
  -webkit-user-select: none;
          user-select: none;
  align-items: center;
  border-radius: 8px;
  cursor: default;
  transition: background 0.2s;
}

.lang-toggle:hover {
  background: var(--ddark);
}

.lang-menu-wrapper {
  position: absolute;
  top: 110%;
  right: 0;
  z-index: 10001;
  opacity: 0;
  text-align: start;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.lang-menu-wrapper.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.lang-menu {
  background: var(--gradient-color);
  outline: 1px solid var(--outline-main);
  backdrop-filter: var(--glass-blur);
  border-radius: 8px;
  padding: 4px 0;
  margin: 0;
  list-style: none;
  box-shadow: 0 6px 16px var(--overlay-dark);
}

.lang-menu li {
  padding: 8px 14px;
  cursor: pointer;
  font-size: 14px;
  color: var(--white);
  transition: background 0.2s;
  white-space: nowrap;
}

.lang-menu li:hover,
.lang-menu li.active {
  background-color: var(--bbb);
  font-weight: 500;
}

.gif-flag {
  image-rendering: high-quality;
}

.inline-flag {
  display: inline-block;
  vertical-align: middle;
}

.lang-toggle img {
  display: inline-block;
  vertical-align: middle;
}

.lang-menu li img {
  margin-right: 4px;
  vertical-align: middle;
}
