:root {
  --bg: #0b0d12;
  --bg-soft: #0e1117;
  --panel: #141821;
  --panel-2: #191e28;
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #eceff6;
  --text-dim: #9aa3b2;
  --text-faint: #6b7485;
  --accent: #8b6cff;
  --accent-strong: #a892ff;
  --accent-soft: rgba(139, 108, 255, 0.16);
  --green: #4dd4ac;
  --green-soft: rgba(77, 212, 172, 0.16);
  --red: #ff6b6b;
  --red-soft: rgba(255, 107, 107, 0.14);
  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: -20% -10% auto -10%;
  height: 70vh;
  background:
    radial-gradient(45% 55% at 22% 18%, rgba(139, 108, 255, 0.22), transparent 70%),
    radial-gradient(40% 50% at 78% 8%, rgba(77, 212, 172, 0.13), transparent 70%);
  filter: blur(10px);
  pointer-events: none;
  z-index: 0;
}

h1,
h2,
p {
  margin: 0;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

/* ---------- Лобби ---------- */

.lobby {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 40px 20px 28px;
  overflow-y: auto;
}

.lobby__glow {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(60% 50% at 50% 40%, #000 20%, transparent 75%);
  pointer-events: none;
}

.lobby__card {
  position: relative;
  width: min(500px, 100%);
  background: linear-gradient(180deg, rgba(25, 30, 40, 0.94), rgba(15, 18, 25, 0.97));
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 30px 32px 26px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(18px);
  animation: rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.99);
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  border-radius: 14px;
  background: linear-gradient(145deg, #8b6cff, #5b3fd6 60%, #4a8d7d);
  box-shadow: 0 8px 22px rgba(139, 108, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  color: #fff;
}

.brand__mark .icon {
  width: 26px;
  height: 26px;
  stroke-width: 2.4;
}

.brand__text {
  display: flex;
  flex-direction: column;
}

.brand__name {
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand__tag {
  font-size: 13px;
  color: var(--text-dim);
}

.lobby__lead {
  margin-top: 22px;
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.55;
}

.join {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field__label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
}

.field__label em {
  font-style: normal;
  color: var(--text-faint);
  font-weight: 400;
}

.field__row {
  display: flex;
  gap: 8px;
}

.input {
  width: 100%;
  background: rgba(9, 11, 16, 0.75);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  outline: none;
}

.input::placeholder {
  color: #5b6373;
}

.input:focus {
  border-color: rgba(139, 108, 255, 0.65);
  box-shadow: 0 0 0 3px rgba(139, 108, 255, 0.16);
  background: rgba(9, 11, 16, 0.95);
}

select.input {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%),
    linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
  background-position: calc(100% - 20px) 55%, calc(100% - 14px) 55%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  padding-right: 40px;
}

.join__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14.5px;
  font-weight: 550;
  transition: transform 0.12s, background 0.16s, border-color 0.16s, box-shadow 0.16s, opacity 0.16s;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px) scale(0.995);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn--primary {
  background: linear-gradient(180deg, #9a7dff, #7757f0);
  color: #fff;
  box-shadow: 0 10px 24px rgba(119, 87, 240, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.btn--primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #a78dff, #8464f7);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.045);
  border-color: var(--line);
  color: var(--text);
}

.btn--ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--line-strong);
}

.btn--quiet {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--line);
  color: var(--text-dim);
  padding: 10px 14px;
}

.btn--quiet:hover:not(:disabled) {
  color: var(--text);
  background: rgba(255, 255, 255, 0.09);
}

.btn--link {
  background: none;
  border: none;
  padding: 4px 0;
  color: var(--accent-strong);
  font-size: 14px;
  text-decoration: underline;
  text-decoration-color: rgba(168, 146, 255, 0.4);
  text-underline-offset: 4px;
}

.btn--link:hover {
  text-decoration-color: currentColor;
}

.btn--danger {
  background: var(--red-soft);
  border-color: rgba(255, 107, 107, 0.28);
  color: #ff9d9d;
}

.btn--danger:hover {
  background: rgba(255, 107, 107, 0.22);
  color: #fff;
}

.btn--wide {
  width: 100%;
}

.form-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--red-soft);
  border: 1px solid rgba(255, 107, 107, 0.25);
  color: #ffb4b4;
  font-size: 13.5px;
}

.mic-check {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.mic-check__hint {
  font-size: 12.5px;
  color: var(--text-faint);
}

.meter {
  position: relative;
  width: 120px;
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.meter--wide {
  width: 100%;
}

.meter__fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), #b8e986 55%, var(--accent));
  transition: width 0.08s linear;
}

.lobby__tip {
  margin-top: 16px;
  font-size: 12.5px;
  color: var(--text-faint);
  line-height: 1.5;
}

.lobby__foot {
  position: relative;
  font-size: 12.5px;
  color: var(--text-faint);
}

/* ---------- Комната ---------- */

.room {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: 304px minmax(0, 1fr) 340px;
  grid-template-rows: 56px minmax(0, 1fr);
  background: var(--bg);
  animation: fade 0.25s ease both;
}

/* Правая колонка оставлена свободной под будущие блоки. */
.rail {
  min-height: 0;
  padding: 16px;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background: linear-gradient(180deg, #0e1219, #0b0e14);
}

@media (max-width: 1240px) {
  .room {
    grid-template-columns: 304px minmax(0, 1fr);
  }

  .rail {
    display: none;
  }
}

/* Общий заголовок приложения: по центру сверху, и в лобби, и в комнате. */
.appbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #10141c, #0c0f15);
  z-index: 5;
}

.appbar__title {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.015em;
  text-align: center;
  color: var(--text);
}

.lobby .appbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}

.lobby {
  padding-top: 84px;
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px;
  background: linear-gradient(180deg, #11151d, #0c0f15);
  border-right: 1px solid var(--line);
  min-height: 0;
  z-index: 4;
}

.sidebar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 2px 0;
}

.brand--compact {
  gap: 10px;
}

.brand--compact .brand__mark {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  box-shadow: 0 6px 16px rgba(139, 108, 255, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.brand__mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}

.brand--compact .brand__mark .icon {
  width: 20px;
  height: 20px;
}

.brand--compact .brand__name {
  font-size: 18px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  transition: background 0.15s, color 0.15s;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.icon-btn .icon {
  width: 20px;
  height: 20px;
}

.room-card {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
}

.room-card__label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.room-card__code {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: 0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-card__hint {
  font-size: 12px;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.people {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding: 2px;
}

.people__head {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 4px 4px 0;
}

.people__count {
  letter-spacing: 0;
  font-weight: 500;
}

.people__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.people__empty {
  color: var(--text-faint);
  font-size: 12.5px;
  line-height: 1.5;
  padding: 6px 4px;
}

.person {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 10px;
  transition: background 0.15s;
}

.person:hover {
  background: rgba(255, 255, 255, 0.045);
}

.avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 650;
  color: #0c0f15;
  background: var(--avatar, #8b6cff);
  transition: box-shadow 0.18s;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

.avatar--photo {
  background: var(--avatar, #8b6cff);
}

.avatar::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid transparent;
  transition: border-color 0.15s;
}

.person[data-speaking="true"] .avatar::after {
  border-color: var(--green);
}

.person[data-speaking="true"] .avatar {
  box-shadow: 0 0 0 3px var(--green-soft), 0 0 18px rgba(77, 212, 172, 0.35);
}

.person__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.person__name {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.person__you {
  color: var(--text-faint);
  font-weight: 400;
  font-size: 12.5px;
}

.person__state {
  font-size: 11.5px;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 14px;
}

.person__state .icon {
  width: 13px;
  height: 13px;
}

.person__badges {
  display: flex;
  gap: 4px;
  color: var(--text-faint);
}

.person__badges .icon {
  width: 16px;
  height: 16px;
}

.person[data-mic="false"] .person__badges {
  color: var(--red);
}

.person__action {
  display: flex;
  align-items: center;
}

.person__rename {
  width: 30px;
  height: 30px;
  opacity: 0;
  transition: opacity 0.15s;
}

.person:hover .person__rename,
.person__rename:focus-visible {
  opacity: 1;
}

.person__rename .icon {
  width: 15px;
  height: 15px;
}

@media (hover: none) {
  .person__rename {
    opacity: 0.7;
  }
}

/* Выбор аватарки в лобби. */
.avatar-pick {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
}

.avatar--pick {
  width: 44px;
  height: 44px;
  font-size: 15px;
}

.avatar-pick__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.avatar-pick .field__hint {
  font-size: 11.5px;
}

/* Ползунок громкости собеседника: тихий, чтобы не спорить с именем. */
.person__vol-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  color: var(--text-faint);
}

.person__vol-line .icon {
  width: 12px;
  height: 12px;
  flex: none;
  opacity: 0.75;
}

.person__vol {
  flex: 1;
  min-width: 0;
  height: 14px;
  margin: 0;
  accent-color: #8b6cff;
  cursor: pointer;
  opacity: 0.65;
  transition: opacity 0.15s;
}

.person__vol:hover,
.person__vol:focus-visible {
  opacity: 1;
  outline: none;
}

.sidebar__foot {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
}

.field__hint {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-faint);
}

.field__value {
  float: right;
  font-variant-numeric: tabular-nums;
  color: var(--accent-strong);
  font-weight: 500;
}

.range {
  width: 100%;
  height: 26px;
  margin: 2px 0;
  appearance: none;
  background: transparent;
  accent-color: var(--accent);
  cursor: pointer;
}

.range::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
}

.range::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -6px;
  border-radius: 50%;
  background: linear-gradient(180deg, #9a7dff, #7757f0);
  box-shadow: 0 2px 8px rgba(119, 87, 240, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.range::-moz-range-track {
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
}

.range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(180deg, #9a7dff, #7757f0);
}

.controls {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}

.control {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 9px 4px 8px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-dim);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.control:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.control .icon {
  width: 19px;
  height: 19px;
}

.control__label {
  font-size: 10px;
  font-weight: 500;
}

.control[aria-pressed="true"].control--off {
  background: var(--red-soft);
  border-color: rgba(255, 107, 107, 0.3);
  color: #ff9d9d;
}

/* ---------- Чат ---------- */

.chat {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  width: 100%;
  justify-self: stretch;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background:
    radial-gradient(90% 55% at 50% 0%, rgba(139, 108, 255, 0.07), transparent 60%),
    var(--bg-soft);
}

.chat__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(12, 15, 21, 0.72);
  backdrop-filter: blur(12px);
}

.chat__menu {
  display: none;
}

.chat__titles {
  min-width: 0;
  flex: 1;
}

.chat__title {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat__subtitle {
  font-size: 12.5px;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat__invite {
  padding: 9px 13px;
  font-size: 13.5px;
}

.chat__invite .icon {
  width: 17px;
  height: 17px;
}

.chat__messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px 20px 8px;
  display: flex;
  flex-direction: column;
  scroll-behavior: smooth;
}

.chat__empty {
  margin: auto;
  text-align: center;
  color: var(--text-faint);
  font-size: 13.5px;
  line-height: 1.7;
  max-width: 320px;
}

.chat__empty strong {
  display: block;
  color: var(--text-dim);
  font-size: 15px;
  margin-bottom: 4px;
}

.msg {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  padding: 5px 8px;
  border-radius: 10px;
  transition: background 0.12s;
}

.msg:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* Крестик удаления: виден при наведении, в конце текста сообщения. */
.msg__delete {
  display: none;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  width: 22px;
  height: 22px;
  margin-left: 6px;
  padding: 0;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: rgba(18, 22, 30, 0.92);
  color: var(--text-faint);
  opacity: 0;
  transition: opacity 0.12s, color 0.12s, border-color 0.12s;
}

.msg--own .msg__delete,
.chat--admin .msg__delete {
  display: inline-flex;
}

.msg:hover .msg__delete,
.msg__delete:focus-visible {
  opacity: 1;
}

.msg__delete:hover {
  color: #ff9d9d;
  border-color: rgba(255, 120, 120, 0.45);
}

.msg__delete .icon {
  width: 14px;
  height: 14px;
}

.msg--grouped {
  margin-top: -2px;
}

.msg--grouped .msg__avatar {
  visibility: hidden;
  height: 0;
}

.msg--grouped .msg__head {
  display: none;
}

.msg__avatar {
  width: 38px;
  height: 38px;
  font-size: 14px;
}

.msg__body {
  min-width: 0;
}

.msg__head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 1px;
}

.msg__author {
  font-size: 14px;
  font-weight: 620;
}

.msg__time {
  font-size: 11px;
  color: var(--text-faint);
}

.msg__text {
  font-size: 14.5px;
  line-height: 1.45;
  color: #dfe4ee;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.msg__link {
  color: #9db9ff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.msg__link:hover {
  color: #c6d6ff;
}

.msg__image-link {
  display: inline-block;
  margin-top: 6px;
  max-width: min(360px, 100%);
}

.msg__image {
  display: block;
  max-width: 100%;
  max-height: 280px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.system {
  display: flex;
  align-items: center;
  gap: 8px;
  align-self: center;
  margin: 10px 0;
  padding: 4px 12px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-faint);
  font-size: 12px;
}

.system__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-faint);
}

.chat__messages::-webkit-scrollbar,
.people::-webkit-scrollbar {
  width: 10px;
}

.chat__messages::-webkit-scrollbar-thumb,
.people::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 99px;
  border: 3px solid transparent;
  background-clip: content-box;
}

.composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin: 0 20px 16px;
  padding: 7px 7px 7px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 15px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.composer:focus-within {
  border-color: rgba(139, 108, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(139, 108, 255, 0.1);
}

.composer__input {
  flex: 1;
  min-height: 24px;
  max-height: 132px;
  padding: 8px 0;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  font-size: 14.5px;
  line-height: 1.45;
}

.composer__input::placeholder {
  color: var(--text-faint);
}

.composer__send {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border: none;
  border-radius: 11px;
  background: linear-gradient(180deg, #9a7dff, #7757f0);
  color: #fff;
  box-shadow: 0 6px 16px rgba(119, 87, 240, 0.3);
  transition: opacity 0.15s, transform 0.12s;
}

.composer__send .icon {
  width: 19px;
  height: 19px;
}

.composer__attach {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-dim);
  transition: background 0.15s, color 0.15s;
}

.composer__attach:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.composer__attach .icon {
  width: 19px;
  height: 19px;
}

.composer__send:hover {
  filter: brightness(1.08);
}

.composer__send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.unlock {
  display: flex;
  justify-content: center;
  padding: 0 20px 10px;
}

/* ---------- Плашки, настройки, тосты ---------- */

.banner {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  border-radius: 99px;
  background: rgba(20, 24, 33, 0.94);
  border: 1px solid var(--line);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  font-size: 13px;
  color: var(--text-dim);
  backdrop-filter: blur(10px);
}

.banner--warn {
  border-color: rgba(255, 107, 107, 0.3);
  color: #ffb4b4;
}

.banner__spinner {
  display: grid;
  place-items: center;
  color: var(--accent-strong);
}

.banner__spinner .icon {
  width: 17px;
  height: 17px;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.settings {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
}

.settings__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 10, 0.65);
  backdrop-filter: blur(4px);
  animation: fade 0.2s both;
}

.settings__panel {
  position: relative;
  width: min(430px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow);
  animation: rise 0.25s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.settings__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.settings__head h2 {
  font-size: 18px;
  font-weight: 650;
}

.check {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.check__row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.check__hint {
  font-size: 12.5px;
  color: var(--text-faint);
}

.settings__note {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-faint);
}

.toast {
  position: fixed;
  left: 50%;
  /* Выше поля ввода: композер ~56px + отступ 16px, чтобы тост его не накрывал. */
  bottom: 92px;
  transform: translateX(-50%);
  z-index: 60;
  padding: 10px 18px;
  border-radius: 99px;
  background: rgba(28, 33, 44, 0.97);
  border: 1px solid var(--line-strong);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  font-size: 13.5px;
  animation: toast-in 0.22s ease both;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: 3;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

.noscript {
  padding: 24px;
  text-align: center;
  color: var(--text-dim);
}

/* ---------- Адаптив ---------- */

@media (max-width: 820px) {
  .room {
    grid-template-columns: 1fr;
    grid-template-rows: 56px minmax(0, 1fr);
  }

  .sidebar {
    position: fixed;
    top: 56px;
    bottom: 0;
    left: 0;
    width: min(320px, 88vw);
    transform: translateX(-102%);
    transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 30px 0 60px rgba(0, 0, 0, 0.5);
  }

  .sidebar.is-open {
    transform: none;
  }

  .chat__menu {
    display: grid;
  }

  .chat__head {
    padding: 10px 12px;
  }

  .chat__messages {
    padding: 14px 12px 6px;
  }

  .composer {
    margin: 0 12px calc(10px + env(safe-area-inset-bottom));
  }

  .toast {
    bottom: calc(84px + env(safe-area-inset-bottom));
  }

  .chat__invite span {
    display: none;
  }

  .chat__invite {
    padding: 9px;
  }

  .msg {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 8px;
    padding: 4px 4px;
  }

  .msg__avatar {
    width: 34px;
    height: 34px;
    font-size: 13px;
  }

  .lobby__card {
    padding: 24px 20px 22px;
  }

  .join__actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .brand__tag {
    display: none;
  }

  .lobby {
    justify-content: flex-start;
    padding-top: 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
