/* Лента чата, кинотеатр, панель пользователей, кнопки, тосты, погода */

/* Область сообщений и строка ввода */

.chat-row {
  display: flex;
  gap: 15px;
  align-items: stretch;
  position: relative;
}
#chat-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 480px;
}
#messages,
#cinema-container {
  height: 480px;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--bg-messages);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: background 0.3s, border-color 0.3s;
  overflow: hidden;
  flex-shrink: 0;
}
#messages {
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  z-index: 1;
}
#cinema-container {
  display: none;
  padding: 0;
  z-index: 0;
}
#cinema-player {
  width: 100%;
  height: 100%;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}
#cinema-player video,
#cinema-player iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  object-fit: contain;
}
#chat-container.cinema-mode #cinema-container {
  display: block;
  position: relative;
  z-index: 0;
}
#chat-container.cinema-mode #messages {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100%;
  background: transparent !important;
  border: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  padding: 10px;
  border-radius: 8px;
  pointer-events: none;
  overflow-y: auto;
  z-index: 2;
  box-sizing: border-box;
}
#chat-container.cinema-mode #messages .message {
  pointer-events: auto;
  opacity: 0.6;
  transition: opacity 0.5s ease;
}
#chat-container.cinema-mode #messages .message.hidden {
  opacity: 0;
  pointer-events: none;
}
#chat-container.cinema-mode #typing-indicator {
  background: rgba(0,0,0,0.5);
  color: #fff;
}
#msg-counter { display: none !important; }
.cinema-info {
  margin-top: 6px;
  font-size: 8px;
  color: var(--text-muted);
  text-align: center;
}
.input-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  position: relative;
  z-index: 3;
  width: 100%;
}
.input-row input[type="text"] {
  flex: 1;
  margin: 0;
  border-radius: 8px;
  padding: 10px;
  background: var(--input-bg);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 10px;
}
.input-row .emoji-toggle {
  order: -1;
}
#emoji-menu {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 0;
  z-index: 9999;
  background: var(--bg-container);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  background: rgba(22, 33, 62, 0.9);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 10px;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
  margin-bottom: 5px;
  width: 280px;
}
#emoji-menu.active { display: grid; }
#emoji-menu span { font-size: 20px; cursor: pointer; text-align: center; transition: transform 0.1s; }
#emoji-menu span:hover { transform: scale(1.3); }
#chat-container.cinema-mode .input-row .icon-btn:not(.emoji-toggle) { display: none; }
#chat-container.cinema-mode .input-row .emoji-toggle { display: inline-flex; }
/* Кинотеатр: строка ссылки и кнопки управления плеером */

.cinema-url-row {
  display: none;
  background: rgba(0,0,0,0.3);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 8px;
  padding: 8px 12px;
  margin-top: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  justify-content: center;
}
body.light-theme .cinema-url-row { background: rgba(255,255,255,0.3); }
#chat-container.cinema-mode .cinema-url-row { display: flex; }
.cinema-url-row input {
  flex: 1;
  min-width: 120px;
  background: var(--input-bg);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  padding: 6px 10px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 10px;
  margin: 0;
}
.cinema-url-row button {
  padding: 6px 16px;
  font-size: 10px;
  margin: 0;
}
.cinema-controls-wrapper {
  display: none;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  z-index: 3;
  position: relative;
}
#chat-container.cinema-mode .cinema-controls-wrapper { display: flex; }
.cinema-controls-wrapper .cinema-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--btn-bg);
  color: #fff;
  border: 2px solid var(--border-light);
  padding: 4px 10px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 10px;
  cursor: pointer;
  box-shadow: 0 0 8px var(--shadow-color);
  transition: all 0.2s ease;
  text-shadow: 1px 1px 0 #000;
  margin: 0;
  white-space: nowrap;
  flex-shrink: 0;
}
body.light-theme .cinema-controls-wrapper .cinema-control { text-shadow: none; }
.cinema-controls-wrapper .cinema-control:hover {
  background: var(--btn-hover);
  transform: translateY(-2px);
  box-shadow: 0 0 12px var(--shadow-color);
}
.cinema-controls-wrapper .cinema-control:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
/* Панель пользователей онлайн и индикатор набора текста */

#online-panel {
  /* 225px вместо 200: в ряд теперь помещаются имя, кружок статуса,
     счётчик непрочитанных и кнопка заглушки без обрезания имени */
  width: 225px;
  min-height: 480px;
  height: auto;
  overflow-y: auto;
  background: var(--bg-online);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 10px;
  flex-shrink: 0;
  transition: background 0.3s, border-color 0.3s;
  display: flex;
  flex-direction: column;
  z-index: 0;
  align-self: stretch;
}
#online-panel h3 {
  margin: 0 0 10px;
  color: var(--text-secondary);
  font-size: 10px;
  flex-shrink: 0;
  text-align: center;
}
/* overflow-x гасим явно: при заданном только overflow-y вторая ось по спецификации
   становится auto, длинный статус офлайна вылезал за 178px ширины панели, и внизу
   появлялся толстый синий ползунок горизонтальной прокрутки */
#online-list { flex: 1; overflow-y: auto; overflow-x: hidden; }
/* Один ряд без переносов: имя тянется, статус и счётчик прижаты к правому краю
   строго напротив пользователя */
.online-user {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-bottom: 5px;
  cursor: pointer;
  padding: 3px;
  border-radius: 3px;
  position: relative;
  flex-wrap: nowrap;
}
/* одна тонкая линия на стыке групп: выше — кто в сети, ниже — кто вышел */
.online-divider {
  height: 1px;
  background: var(--divider);
  margin: 8px 2px;
  flex-shrink: 0;
}
.online-user:hover { background: var(--online-user-hover); }
.online-user .avatar { font-size: 16px; flex-shrink: 0; }
.online-user .username {
  color: var(--text-primary);
  font-size: 8px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.online-user .status { font-size: 10px; flex-shrink: 0; line-height: 1; }
.status-online { color: #4caf50; }   /* зелёный: соединение живо */
.status-recent { color: #ff9800; }   /* жёлтый: отошёл, был меньше 10 минут назад */
.status-away   { color: #9aa0a6; }   /* серый: не в сети, но приложение доставит */
.status-offline { color: #888; }     /* оставлен для совместимости со старой разметкой */
.unread-badge {
  background: var(--badge-bg);
  color: var(--badge-color);
  border-radius: 50%;
  padding: 0 5px;
  font-size: 9px;
  min-width: 16px;
  text-align: center;
  line-height: 16px;
  font-weight: bold;
  flex-shrink: 0;
}
.admin-mute-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 11px;
  padding: 0 2px 3px;
  border-radius: 4px;
  color: var(--text-muted);
  transition: background 0.2s, color 0.2s;
  margin: 0;
  flex-shrink: 0;
  line-height: 1;
}
.admin-mute-btn:hover {
  background: var(--admin-btn-bg);
  color: #ff6b6b;
}
.online-user .admin-actions {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
#chat-container.cinema-mode .chat-row { align-items: stretch; }
#chat-container.cinema-mode #online-panel { height: auto; min-height: 480px; }
#typing-indicator {
  position: absolute;
  bottom: 8px;
  right: 12px;
  color: var(--text-secondary);
  font-size: 10px;
  background: var(--bg-messages);
  padding: 4px 12px;
  border-radius: 12px;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  border: 1px solid var(--border-light);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  z-index: 5;
}
#typing-indicator.active { opacity: 1; }
/* Общие стили кнопок */

button {
  background: var(--btn-bg);
  color: #fff;
  border: 2px solid var(--border-light);
  padding: 10px 20px;
  margin: 5px;
  cursor: pointer;
  font-family: inherit;
  font-size: 10px;
  border-radius: 12px;
  box-shadow: 0 0 8px var(--shadow-color);
  transition: all 0.2s ease;
  text-shadow: 1px 1px 0 #000;
}
body.light-theme button { text-shadow: none; }
button:hover:not(:disabled) {
  background: var(--btn-hover);
  transform: translateY(-2px);
  box-shadow: 0 0 12px var(--shadow-color);
}
button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.icon-btn {
  background: none !important;
  border: none !important;
  /* сумма вертикальных отступов прежняя — высота кнопки не меняется,
     но содержимое поднимается к оптическому центру */
  padding: 1px 6px 7px !important;
  margin: 0 !important;
  cursor: pointer;
  color: var(--text-primary) !important;
  font-size: 18px;
  line-height: 1;
  box-shadow: none !important;
  text-shadow: none !important;
  transition: transform 0.15s ease;
  border-radius: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-btn:hover {
  transform: scale(1.2);
  background: none !important;
  box-shadow: none !important;
}
.icon-btn:active { transform: scale(0.95); }
.send-btn {
  background: var(--btn-bg) !important;
  color: #fff !important;
  border: 2px solid var(--border-light) !important;
  padding: 8px 16px !important;
  font-family: inherit;
  font-size: 10px !important;
  border-radius: 12px !important;
  box-shadow: 0 0 8px var(--shadow-color) !important;
  text-shadow: 1px 1px 0 #000 !important;
  transition: all 0.2s ease !important;
  margin: 0 !important;
  font-weight: normal;
  line-height: normal;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.send-btn:hover {
  background: var(--btn-hover) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 0 12px var(--shadow-color) !important;
}
body.light-theme .send-btn { text-shadow: none !important; }
/* Сообщения: пузыри, вложения, голосовые, реакции */

.message {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  max-width: 80%;
  align-items: flex-start;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.message.own {
  margin-right: auto;
  flex-direction: row;
}
.message.other {
  margin-left: auto;
  flex-direction: row-reverse;
}
.message-avatar {
  font-size: 36px;
  flex-shrink: 0;
  line-height: 1;
  width: 42px;
  text-align: center;
}
.message-body {
  display: flex;
  flex-direction: column;
  background: var(--message-bg);
  padding: 6px 12px 8px;
  border-radius: 12px;
  min-width: 0;
  max-width: 100%;
  word-break: break-word;
  /* было overflow: hidden — оно срезало окно выбора реакции, если то
     не помещалось в пузырь. Скругление картинкам не нужно (у них своё),
     а длинные строки держит word-break выше. */
  overflow: visible;
  position: relative;
}
.message.own .message-body {
  background: var(--own-msg-bg);
  color: #1a1a2e;
  border-radius: 12px 12px 4px 12px;
}
.message.other .message-body {
  background: var(--other-msg-bg);
  color: #1a1a2e;
  border-radius: 12px 12px 12px 4px;
}
body.light-theme .message.own .message-body {
  background: var(--own-msg-bg);
  color: #1a1a2e;
}
body.light-theme .message.other .message-body {
  background: var(--other-msg-bg);
  color: #1a1a2e;
}
.message-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.message-header .username {
  font-weight: bold;
  color: var(--msg-username);
  font-size: 11px;
  flex-shrink: 0;
}
.message-header .time {
  font-size: 8px;
  color: var(--msg-time);
  white-space: nowrap;
  flex-shrink: 0;
}
.message-text {
  font-size: 12px;
  line-height: 1.5;
  margin-top: 2px;
  overflow-wrap: break-word;
  word-break: break-word;
}
/* Сообщение из одного эмодзи показываем крупно — размером с аватар (36px) */
.message-text.big-emoji {
  font-size: 36px;
  line-height: 1.2;
  margin-top: 4px;
}
.mention {
  color: var(--msg-mention);
  background: var(--msg-mention-bg);
  padding: 0 2px;
  border-radius: 3px;
}
.admin-delete-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 0 4px 4px;
  border-radius: 4px;
  color: var(--msg-control);
  transition: background 0.2s, color 0.2s;
  margin: 0;
}
.admin-delete-btn:hover {
  background: var(--admin-btn-bg);
  color: #ff6b6b;
}
.message .admin-actions {
  display: flex;
  gap: 4px;
  margin-left: 4px;
  align-items: center;
}
/* Голосовое: собственный плеер вместо браузерного.
   Подложки и рамки нет — плеер лежит прямо на карточке сообщения,
   поэтому дорожка и время красятся переменными для светлого пузыря */
.voice-message {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  width: 100%;
  max-width: 100%;
  padding: 4px 0;
  background: transparent;
  border: none;
  box-sizing: border-box;
}
.voice-message audio { display: none; }

.voice-play {
  background: var(--btn-bg);
  color: #fff;
  border: 1px solid var(--msg-border);
  border-radius: 50%;
  width: 26px;
  height: 26px;
  min-width: 26px;
  padding: 0;
  margin: 0;
  /* символ центрируем флексом: по базовой линии он вставал криво */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
  /* у треугольника ▶ боковые поля неравные — он оптически смещён влево,
     поэтому сдвигаем на пиксель вправо. Для ⏸ фигура симметрична, сдвиг снимаем */
  text-indent: 1px;
  /* чернила глифа сидят ниже центра строки — поднимаем нижним отступом */
  padding-bottom: 3px;
  cursor: pointer;
  box-shadow: 0 0 8px var(--shadow-color);
  transition: all 0.2s ease;
  text-shadow: 1px 1px 0 #000;
  flex-shrink: 0;
}
body.light-theme .voice-play { text-shadow: none; }
.voice-play:hover {
  background: var(--btn-hover);
  box-shadow: 0 0 12px var(--shadow-color);
  transform: scale(1.08);
}

.voice-bar {
  flex: 1;
  min-width: 40px;
  height: 8px;
  background: var(--msg-track);
  border: 1px solid var(--msg-border);
  border-radius: 4px;
  cursor: pointer;
  overflow: hidden;
  position: relative;
}
.voice-progress {
  width: 0;
  height: 100%;
  background: var(--btn-bg);
  box-shadow: 0 0 6px var(--shadow-color);
  transition: width 0.1s linear;
}

.voice-time {
  font-size: 8px;
  color: var(--msg-time);
  white-space: nowrap;
  flex-shrink: 0;
}
.file-attachment { display: block; margin-top: 4px; width: 100%; }
.file-preview-image {
  max-width: 200px;
  max-height: 200px;
  border-radius: 6px;
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: transform 0.2s;
}
.file-preview-image:hover { transform: scale(1.02); }
.file-attachment a {
  color: var(--text-secondary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  border-bottom: 1px dashed var(--border-light);
}
.file-attachment a:hover { text-decoration: underline; }
.reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
  align-items: center;
  position: relative;
}
/* Входящие сообщения зеркальны — прижаты к правому краю, аватар справа.
   Значит и ряд смайликов должен идти от правой стенки, иначе он висит
   слева в пустоте и выглядит оторванным от пузыря. */
.message.other .reactions {
  justify-content: flex-end;
}
.message.other .message-text.big-emoji {
  text-align: right;
}
.reaction-emoji {
  font-size: 16px;
  cursor: default;
  line-height: 1.4;
}
/* Пока реакция не выбрана — бледный смайлик в пунктирной рамке,
   читается как «поставить реакцию» */
.reaction-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px dashed var(--msg-border);
  border-radius: 12px;
  padding: 0 6px;
  font-size: 14px;
  cursor: pointer;
  line-height: 1.5;
  color: var(--msg-control);
  opacity: 0.45;
  filter: grayscale(1);
  transition: all 0.2s;
  box-shadow: none;
  text-shadow: none;
  margin: 0;
}
/* Реакция выбрана — само эмодзи и есть кнопка смены */
.reaction-trigger.has-reaction {
  border: 1px solid var(--msg-username);
  background: var(--msg-mention-bg);
  opacity: 1;
  filter: none;
  font-size: 16px;
}
.reaction-trigger:hover {
  background: var(--msg-mention-bg);
  border-color: var(--msg-username);
  opacity: 1;
  filter: none;
}
.reaction-picker {
  display: none;
  position: absolute;
  background: var(--reaction-picker-bg);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 4px 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  z-index: 100;
  gap: 4px;
  bottom: 100%;
  left: 0;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
/* У входящих кнопка реакции стоит справа — окно выбора раскрываем от правого
   края, иначе оно уезжает за пределы пузыря */
.message.other .reaction-picker {
  left: auto;
  right: 0;
}
.reaction-picker.active { display: flex; }
.reaction-picker button {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 50%;
  transition: all 0.2s;
  margin: 0;
  box-shadow: none;
  text-shadow: none;
}
.reaction-picker button:hover {
  background: var(--online-user-hover);
  transform: scale(1.2);
}
.reaction-picker button.selected {
  background: var(--btn-bg);
  opacity: 0.3;
  border-radius: 50%;
}
/* Всплывающие уведомления */

#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--bg-container);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  background: rgba(22, 33, 62, 0.9);
  border: 1px solid var(--border-color);
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  color: var(--text-primary);
  font-size: 10px;
  max-width: 300px;
  animation: slideIn 0.3s ease;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}
/* Виджет погоды и часов */

#weather-widget {
  margin-top: 20px;
  background: transparent !important;
  border: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  padding: 10px 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
  transition: none;
}
.weather-time {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.weather-clock { font-size: 28px; font-weight: bold; color: var(--text-secondary); letter-spacing: 1px; }
.weather-day { font-size: 12px; color: var(--text-muted); text-transform: capitalize; }
.weather-date { font-size: 10px; color: var(--text-primary); opacity: 0.7; }
.weather-icon { font-size: 48px; cursor: pointer; transition: transform 0.2s; line-height: 1; }
.weather-icon:hover { transform: scale(1.1); }
.weather-info { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.weather-temp { font-size: 28px; font-weight: bold; color: var(--text-secondary); }
.weather-desc { font-size: 12px; color: var(--text-muted); text-transform: capitalize; }
.weather-city { font-size: 10px; color: var(--text-primary); opacity: 0.7; }
.weather-actions {
  display: none;
  flex-basis: 100%;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}
.weather-actions.active { display: flex; }
.weather-actions input {
  background: var(--input-bg);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  padding: 4px 8px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 9px;
  width: 120px;
  transition: background 0.3s, border-color 0.3s, color 0.3s;
}
.weather-actions button { padding: 4px 12px; font-size: 9px; margin: 0; box-shadow: none; }

/* Кнопки плеера без подписи: символ рисуется размером текста и выходил мелким */
#btnPlay, #btnPause, #btnSeek0 {
  font-size: 13px;
  min-width: 34px;
  /* 4px сверху + 4px снизу заменены на 2px + 6px: высота та же, глиф выше */
  padding: 2px 10px 6px;
}

/* На паузе — симметричная фигура ⏸, оптический сдвиг не нужен */
.voice-play.is-playing { text-indent: 0; }

/* ==================== ВЫБОР РЕАКЦИИ ====================
   Пока выбирают реакцию, остальное приглушается: видно, что идёт выбор,
   и что нажатие мимо его отменит. Подложка перехватывает клик сама —
   отдельного «слоя отмены» заводить не нужно. */
/* Приглушаем не слоем поверх всего, а самими соседями. Слой пришлось бы
   поднимать над контекстом наложения #chat-container — и панель вместе со
   своим сообщением оказывались ПОД затемнением, то есть гасли заодно со
   всем остальным. Здесь же в фокусе остаётся ровно то, что нужно. */
body.выбор-реакции #messages .message:not(.в-фокусе),
body.выбор-реакции .private-chat-messages .message:not(.в-фокусе) {
  opacity: 0.3;
  filter: blur(1px);
  transition: opacity 0.15s ease, filter 0.15s ease;
}
body.выбор-реакции h1,
body.выбор-реакции .top-bar,
body.выбор-реакции .input-row,
body.выбор-реакции #weather-widget,
body.выбор-реакции #online-panel {
  opacity: 0.3;
  transition: opacity 0.15s ease;
}
/* Сообщение в фокусе и его панель остаются яркими и поверх соседей */
.message.в-фокусе { position: relative; z-index: 5; }
.reaction-picker.active { z-index: 6; }

/* Окно выбора отсчитывалось от .reactions — а она в самом низу пузыря,
   поэтому «над ней» означало «поверх текста сообщения». Переносим точку
   отсчёта на всё сообщение: теперь окно встаёт над блоком целиком. */
.reactions { position: static; }
.message { position: relative; }
.reaction-picker {
  bottom: calc(100% + 8px);
  z-index: 902;
}
/* у своих реплик прижимаем к правому краю, у чужих — к левому:
   так окно не уезжает за границу экрана */
.message.own .reaction-picker { left: auto; right: 0; }
.message.other .reaction-picker { left: 0; right: auto; }

/* Окно выбора — самостоятельная панель, а не часть соседнего пузыря:
   непрозрачный фон, заметная рамка и тень. Иначе, накрывая сообщение
   сверху, оно выглядело как чужая реакция, приклеенная к чужой реплике. */
.reaction-picker {
  background: var(--reaction-picker-bg);
  border: 2px solid var(--border-light);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
/* У самых верхних сообщений над ними места нет — раскрываем вниз.
   Класс ставит открытьВыборРеакции по замеру, а не наугад. */
.reaction-picker.снизу {
  bottom: auto;
  top: calc(100% + 8px);
}
/* Приглушение поярче: так ясно, что идёт выбор и что нажатие мимо отменит */
body.выбор-реакции::before { background: rgba(0, 0, 0, 0.55); }

/* Прозрачную картинку рисуем без рамки и подложки — иначе стикер или эмодзи
   выглядит наклейкой в коробке. Класс ставит пометитьПрозрачное() в chat.js
   по самим пикселям, а не по расширению файла. */
.file-preview-image.прозрачное {
  border: 0;
  background: transparent;
  border-radius: 0;
}

/* ==================== ПОЛОСА СВЯЗИ ====================
   Тонкая строка сверху, когда связи нет. Нарочно без кнопок: это сообщение
   о состоянии, а не разговор. Появилась — значит молчание объяснимо. */
#полоса-связи {
  position: fixed;
  left: 0; right: 0;
  top: calc(0px + env(safe-area-inset-top));
  z-index: 2147483000;
  padding: 5px 10px;
  font-size: 10px;
  line-height: 1.4;
  text-align: center;
  color: #1a1a2e;
  background: #ffd93d;
  transform: translateY(-110%);
  transition: transform 0.25s ease;
  pointer-events: none;
}
#полоса-связи.видна { transform: translateY(0); }
#полоса-связи[data-вид="нет-сети"] { background: #ff9800; }
#полоса-связи[data-вид="ищем"] { background: #ffd93d; }

/* Комнаты, которым нужен сервер: видно, что они выключены, а не сломаны */
.room-tab.недоступна {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(0.6);
}
