:root{
  /* общая “незаметность” */
  --dim: 1;

  /* более “тихий” стеклянный стиль */
  --text: rgba(255,255,255,.92);
  --name: rgba(255,255,255,.78);
  --muted: rgba(255,255,255,.58);

  --glassA: rgba(0,0,0,.46);
  --glassB: rgba(0,0,0,.30);
  --stroke: rgba(255,255,255,.12);

  /* монохромные иконки */
  --badge: rgba(255,255,255,.62);

  /* плейсхолдер аватара — всегда одинаковый и НЕ яркий */
  --avatarBg: rgba(15,15,18,.75);
  --avatarFg: rgba(255,255,255,.78);
}

html, body{
  width: 100%;
  height: 100%;
  margin: 0;
  background: transparent !important;
  overflow: hidden;
}

body{
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.chat{
  position: absolute;
  left: 0;
  bottom: 0;

  width: 100%;
  max-width: 560px;

  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;

  pointer-events: none;
  opacity: var(--dim);
}

.msg{
  display: flex;
  align-items: flex-start;
  gap: 10px;

  max-width: 100%;
  filter: drop-shadow(0 6px 18px rgba(0,0,0,.45));
  animation: pop .16s ease-out both;
}

@keyframes pop{
  from{ transform: translateY(8px); opacity: 0; }
  to{ transform: translateY(0); opacity: 1; }
}

/* avatar */
.avatar{
  width: 46px;
  height: 46px;
  border-radius: 999px;
  position: relative;
  flex: 0 0 auto;
  overflow: hidden;

  background: var(--avatarBg);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 0 0 1px rgba(0,0,0,.35) inset;
}

.avatar::after{
  content: "";
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 62% 62%;
  opacity: .95;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath fill='rgba(255,255,255,0.78)' d='M32 34c7.2 0 13-5.8 13-13S39.2 8 32 8 19 13.8 19 21s5.8 13 13 13zm0 6c-11.6 0-21 6.3-21 14v2h42v-2c0-7.7-9.4-14-21-14z'/%3E%3C/svg%3E");
}

.avatar img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .18s ease;
  display: block;
}

.avatar.loaded img{ opacity: 1; }
.avatar.loaded::after{ opacity: 0; }

/* bubble */
.bubble{
  position: relative;
  padding: 9px 11px 10px;
  border-radius: 14px;

  background: linear-gradient(180deg, var(--glassA), var(--glassB));
  border: 1px solid var(--stroke);
  backdrop-filter: blur(7px);

  max-width: calc(100% - 56px);
}

.bubble::before,
.bubble::after{
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,.22);
  opacity: .9;
}

.bubble::before{
  left: -6px; top: -6px;
  border-right: 0; border-bottom: 0;
  border-radius: 4px 0 0 0;
}

.bubble::after{
  right: -6px; bottom: -6px;
  border-left: 0; border-top: 0;
  border-radius: 0 0 4px 0;
}

.meta{
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}

.badges{
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.badges svg{
  width: 14px;
  height: 14px;
  display: block;
}

.name{
  font-family: Oxanium, Inter, sans-serif;
  font-weight: 700;
  letter-spacing: .6px;
  font-size: 14px;
  color: var(--name);
  text-transform: uppercase;
}

.text{
  font-size: 15px;
  line-height: 1.25;
  color: var(--text);
  word-break: break-word;

  /* чтобы читалось на любом фоне игры */
  text-shadow: 0 1px 2px rgba(0,0,0,.72);
}

.text img.emote{
  height: 28px;
  vertical-align: -6px;
}
