@font-face {
    font-family: 'DinCompPro';
    src: url('/fonts/Kelson-Sans-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}


:root {
  /* Светлая тема */
  --primary: #fed22e;
  --secondary: #fff;
  --tertiary: #000;
  --primary-hover: #FFD949;
  --secondary-hover: #d5d5d5;
  --tertiary-hover: #7C6717;
}

[data-bs-theme="dark"] {
  /* Тёмная тема */
  --primary: #fed22e;
  --secondary: #160909;
  --tertiary: #fff;
  --primary-hover: #FFD949;
  --secondary-hover: #7C6717;
  --tertiary-hover: #d5d5d5;
}

body {
  overflow: hidden;
  margin: 0;
  padding: 0;
  font-size: 16px;
  font-family: 'DinCompPro', Roboto, Helvetica, Arial, sans-serif;

  /* Используем переменные, которые меняются в зависимости от темы */
  background: var(--secondary);
  color: var(--primary);
}

.chat__input__wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.chat__emoji-btn {
  margin-left: 6px;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  user-select: none;
margin-bottom: 4px;
}

/* === Основное (десктоп) === */
.emoji-picker__container {
  position: absolute;
  bottom: 45px;

  z-index: 999;
}

.emoji-picker {
  width: 300px;
  max-height: 350px;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  background: #fff;
}

/* === Мобильная адаптация === */
@media (max-width: 600px) {
  .emoji-picker__container {
    position: fixed; /* фиксируем к экрану */
    bottom: 60px; /* чуть выше поля ввода */
    left: 50%;
    transform: translateX(-50%); /* центрируем по горизонтали */
    z-index: 9999;
  }

  .emoji-picker {
    width: 90vw; /* почти вся ширина экрана */
    max-height: 60vh; /* не занимает весь экран */
    border-radius: 12px;
  }

  /* Чтобы окно выглядело как модалка */
  .emoji-picker__container::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(2px);
    z-index: -1;
  }
}

/* Panel */
.chat__panel {
    position: fixed;
    bottom: 0;
    display: flex;
    width: 100%;

    margin: 0;
    box-shadow: none;
    justify-content: center;
}

.chat__login {
    width: 100%;
    height: 100%;
    display: flex;
    gap: 1em;
    align-items: center;
    justify-content: center;
    border-top: 2px solid var(--primary);
    padding: 1em 0;
}


.chat__login__auth {
    display: inline-flex;
    align-items: center;
    gap: .25em;
    font-size: 1.3125em;
    color: var(--primary);
    text-decoration: none;

}
.chat__login__auth:hover {
    color: var(--tertiary-hover);
}

.chat__login__auth__icon {
    width: 1.25em;
    height: 1.25em;
}

.chat__login__auth__icon {
  width: 1.25em;
  height: 1.25em;
  background-color: var(--primary);
  mask: url('/icons/vk.svg') no-repeat center / contain;
  -webkit-mask: url('/icons/vk.svg') no-repeat center / contain;
  display: inline-block;
}

.chat__login__auth__icon:hover {
  background-color: var(--tertiary-hover);
}

.chat__button {
    background: var(--primary);
    font: inherit;
    font-size: 1.3125em;
    font-weight: bold;
    color: var(--secondary);
    border: 2px solid var(--primary);
    text-transform: uppercase;
    padding: 0 1em 0 1.75em;
    cursor: pointer;
    transition: all .2s;
}

.chat__button:hover {
    background: var(--primary-hover);
}
.chat__button:disabled {
    color: var(--secondary-hover);
    cursor: not-allowed;
}
.chat__button:disabled:hover {
    background: var(--primary);
}

.chat__button--login {
    width: 100%;
    padding: 1em;
}

.chat__input {
    background: var(--secondary);
    font: inherit;
    font-size: 1.3125em;
    border: none;
    padding: .5em;
    outline: none;
    flex: 1;
    color: var(--primary);
}
.chat__input--blocked {
    font-weight: 300;
    color: #aaa;
}
.chat__input__container {
    border: 2px solid var(--primary);
    position: relative;
    flex: 1;
    display: flex;
}
.chat__input__container:before {
    content: "";
    display: block;
    position: absolute;
    z-index: 10;
    right: -1.5em;
    width: 0;
    border-style: solid;
    border-width: 2.875em 1.5em 0 0;
    border-color: var(--secondary) transparent transparent transparent;
}

/* Messages */

.chat__messages {
  padding: .5em 1em;
    position: fixed;
    top: 3.125em;
    left: 0;
    width: calc(100% - 2em);
    height: calc(100vh - 9.5em);
    overflow: auto;
background: var(--secondary);
}

.chat__message {
    font-size: 1.3125em;
    word-break: auto-phrase;
    border-bottom: 1px solid var(--secondary-hover);
    padding: .5em 0;
    position: relative;
}




.chat__message__text {
}

.chat__message__text__link {
    color: var(--tertiary);
}
.chat__message__text__link:hover {
    color: var(--tertiary-hover);
}

.chat__message__name {
    cursor: pointer;
    color: var(--tertiary);
    margin: 0 .25em;
}
.chat__message__name:hover {
    color: var(--tertiary-hover);
}

.chat__message__time {
    font-size: .875em;
    letter-spacing: 1px;
}
.chat__message__delete {
    cursor: pointer;
    position: absolute;
    z-index: 10000;
    right: 0;
    opacity: 0;
    transition: opacity .2s;
 background: var(--primary);
    color: var(--secondary);
    padding: 5px;
    border-radius: 5px;
font-size: 10px;
}
.chat__message:hover .chat__message__delete {
    opacity: 1;
}

/* Users */
.chat__users__header {
    color: var(--secondary);
    background: var(--primary);
    border-bottom: 2px solid var(--primary);
    padding: .5em 1em;
    display: inline-block;
    position: relative;
    font-size: 1.5em;
    flex: 1;
    margin-right: -2em;
}
.chat__users__top {
    display: flex;
    justify-content: space-between;
    position: fixed;
    top: 0;
    width: calc(100% + 1em);
}
.chat__users__total {
    position: relative;
    left: .5em;
    display: flex;
    font-size: 1.5em;
    font-weight: bold;
    background: var(--secondary);
    border-bottom: 2px solid var(--primary);
    padding: .25em 4em .25em 2.5em;
    color: var(--primary);
    transform: skew(-30deg);
    cursor: pointer;
    transition: all .2s;
}
.chat__users__total:hover {
    background: var(--secondary-hover);
}
.chat__users__total__icon {
    width: .875em;
    margin-right: .35em;
}
.chat__users__total__inner {
    transform: skew(30deg);
    display: flex;
    align-items: center;
}
.chat__users__close {
    width: calc(100% - 1.2em);
    text-align: center;
    top: 2.5em;
    right: 1em;
    font-size: 1.4em;
    cursor: pointer;
    color: var(--secondary);
    background: var(--primary);
    padding: 10px;
    border-radius: 10px;
}
.chat__users__close:hover {
    color: var(--secondary-hover);
}

.chat__users__list {
    position: fixed;
    top: 4.2em;
    height: calc(100% - 10.5em);
    background: var(--secondary);
    border: 2px solid var(--primary);
    border-radius: 1em;
    overflow: auto;
    left: 1em;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .5em;
    width: calc(100% - 4em);
    padding: 1em;
}


.chat__user {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 1.3125em;
    padding-bottom: .25em;
    border-bottom: 1px solid var(--secondary-hover);
}
.chat__user__info {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: var(--tertiary);
    text-decoration: none;
}

.chat__user__info img {
border-radius: 10px;
}

.chat__user__info:hover {
    color: var(--tertiary-hover);
}

.chat__user--blocked .chat__user__link {
    opacity: .5;
    text-decoration: line-through;
}
.chat__user__avatar {
    width: 1.75em;
    margin-right: .5em;
}
.chat__user__block {
    cursor: pointer;
    position: absolute;
    z-index: 10000;
    right: 0;
    opacity: 0;
    transition: opacity .2s;
}
.chat__user:hover .chat__user__block {
    opacity: 1;
}

/* Loading */
.chat__loading {
    position: absolute;
    top: 2.5em;
    left: 0;
    width: 100%;
    height: calc(100vh - 5.5em);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    background: rgba(0, 0, 0, .5);
    z-index: 1000;
    font-weight: bold;
}
.chat__loading__icon {
    width: 1.75em;
    margin-right: .5em;
    animation: loadingIcon 1s infinite forwards;
}

@keyframes loadingIcon {
    from {transform: rotate(0deg)}
    to {transform: rotate(360deg)}
}

.is-admin:before {
    content: '';
    display: inline-block;
    width: 1em;
    height: 1em;
    position: relative;
    top: .125em;
    margin-right: .25em;
    background: url('/icons/alien.svg') no-repeat center center;
    background-size: contain;
}

.chat__settings {
    font-size: 1.75em;
    margin-top: 2em;
    padding: 1em;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .5em;
}

.chat__settings__input {
    display: flex;
    align-items: center;
    gap: .5em;
    width: 100%;
}
.chat__settings__input__link {
    color: var(--primary);
}

.chat__settings__saved {
    color: var(--tertiary);
}

.chat__settings__input__element {
    font: inherit;
    flex: 1;
    background: none;
    border: none;
    border-bottom: 2px solid var(--primary);
    color: var(--tertiary);
}

.chat__settings__save {
    font: inherit;
    background: var(--primary);
    border: none;
    padding: .25em 1em;
    cursor: pointer;
}
.chat__settings__save:hover {
    background: var(--primary-hover);
}

.chat__settings__save:disabled {
    opacity: .5;
}

@media (max-width: 767.98px) {
body {
font-size: 12px;
}

.chat__messages {

    max-height: 90%;
 
}
}