:root {
  --bg: #141415;
  --bg-2: #0f0f10;
  --panel: #19191b;
  --panel-2: #212123;
  --panel-3: #29292c;
  --border: rgba(237, 237, 237, .08);
  --border-2: rgba(237, 237, 237, .14);
  --accent: #8b7ff5;
  --accent-2: #a99cf9;
  --accent-dim: rgba(139, 127, 245, .14);
  --accent-dim-2: rgba(139, 127, 245, .22);
  --accent-fill: #6c5ce7;
  --accent-fill-2: #5f4fdc;
  --text: #ededed;
  --muted: #a1a1a6;
  --muted-2: #85858b;
  --green: #4cc38a;
  --red: #e5484d;
  --gold: #f2c14e;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --radius: 14px;
  --shadow: 0 16px 50px rgba(0, 0, 0, .5);
  --hatch: repeating-linear-gradient(135deg, #161617 0 12px, #1b1b1d 12px 24px);
}

/* Светлая тема */
:root[data-theme="light"] {
  --bg: #fafafa;
  --bg-2: #f0f0f1;
  --panel: #ffffff;
  --panel-2: #f4f4f5;
  --panel-3: #e8e8ea;
  --border: rgba(23, 23, 23, .09);
  --border-2: rgba(23, 23, 23, .16);
  --accent: #6c5ce7;
  --accent-2: #5a49d4;
  --accent-dim: rgba(108, 92, 231, .12);
  --accent-dim-2: rgba(108, 92, 231, .18);
  --accent-fill: #6c5ce7;
  --accent-fill-2: #5a49d4;
  --text: #171717;
  --muted: #525252;
  --muted-2: #737373;
  --green: #16a34a;
  --red: #dc2626;
  --gold: #a16207;
  --shadow: 0 8px 24px rgba(0, 0, 0, .08);
  --hatch: repeating-linear-gradient(135deg, #f0f0f1 0 12px, #e8e8ea 12px 24px);
}
:root[data-theme="light"] body { background: var(--bg); }

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; min-height: 100vh;
}
input, button, textarea { font-family: inherit; font-size: 15px; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
h1, h2, h3 { font-weight: 600; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; }
.stat, .label, .sub, .ph-sub, .rc-meta, .st-num, .ohours, .online-more, .notif-time, .m-time, .dm-conv-time, .pl-num, .rev-time, .film-meta, .cat-sub { font-variant-numeric: tabular-nums; }

/* ===================== Кнопки ===================== */
.btn {
  border: 1px solid var(--border-2); background: var(--panel-2); color: var(--text);
  padding: 8px 16px; border-radius: 10px; cursor: pointer; font-weight: 500; font-size: 14px; line-height: 18px;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), transform .12s var(--ease); white-space: nowrap;
}
.btn:hover { background: var(--panel-3); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.solid, .btn.big { background: var(--accent-fill); color: #fff; border-color: transparent; }
.btn.solid:hover, .btn.big:hover { background: var(--accent-fill-2); }
.btn.subtle { background: transparent; border-color: var(--border-2); color: var(--text); }
.btn.subtle:hover { background: var(--panel-2); }
.btn.big { width: 100%; padding: 12px; justify-content: center; }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: rgba(229, 72, 77, .1); border-color: rgba(229, 72, 77, .3); }
.btn.block { width: 100%; text-align: center; }

/* ===================== Инпуты ===================== */
input[type=text], input[type=password], input[type=email], input[type=url], textarea {
  width: 100%; background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  padding: 12px 16px; border-radius: 10px; outline: none; transition: border-color .15s var(--ease); resize: vertical;
}
input:focus, textarea:focus { border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input[type=range], input[type=checkbox], input[type=radio] { accent-color: var(--accent-fill); }
.field { margin-bottom: 16px; }
.field > label:not(.radio):not(.checkbox) { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; font-weight: 500; }

.label { font-size: 12px; font-weight: 500; letter-spacing: 0; color: var(--muted); margin-bottom: 12px; }

.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }
.hatch { background: var(--hatch); }

/* ===================== Чипы ===================== */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--border); background: var(--panel-2); color: var(--muted); padding: 8px 16px; border-radius: 10px; cursor: pointer; font-weight: 500; font-size: 13px; line-height: 14px; transition: color .15s var(--ease), background-color .15s var(--ease), border-color .15s var(--ease); }
.chip:hover { color: var(--text); }
.chip.active { background: var(--panel-3); color: var(--text); border-color: var(--border-2); }

/* ===================== Аватары ===================== */
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-weight: 500; flex-shrink: 0; width: 40px; height: 40px; font-size: 17px; overflow: hidden; background: var(--panel-3); }
.avatar.xs { width: 24px; height: 24px; font-size: 12px; }
.avatar.sm { width: 32px; height: 32px; font-size: 14px; }
.avatar.md { width: 44px; height: 44px; font-size: 20px; }
.avatar.lg { width: 60px; height: 60px; font-size: 28px; }
.avatar.xl { width: 116px; height: 116px; font-size: 52px; border-radius: 22px; border: 4px solid var(--panel); }

/* ===================== Верхняя панель ===================== */
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 24px; height: 64px; padding: 0 24px; background: var(--bg); border-bottom: 1px solid var(--border); }
.brand { display: inline-flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 600; letter-spacing: -.2px; color: var(--text); }
.brand .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
/* Логотип: на тёмной теме светлое слово, на светлой — тёмное */
.brand-logo { display: block; height: 32px; width: auto; }
.brand-logo-light { display: none; }
:root[data-theme="light"] .brand-logo-dark { display: none; }
:root[data-theme="light"] .brand-logo-light { display: block; }
.topnav { display: flex; align-items: center; gap: 20px; }
.navlink { color: var(--muted); font-weight: 500; font-size: 15px; padding: 4px 0; cursor: pointer; background: none; border: none; transition: color .15s var(--ease); }
.navlink:hover { color: var(--text); }
.navlink.active { color: var(--text); }
.search { flex: 1; max-width: 400px; margin-left: auto; position: relative; }
.search input { border-radius: 10px; padding-top: 8px; padding-bottom: 8px; padding-left: 40px; line-height: 18px; background: var(--panel); }
.search .search-ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-results { position: absolute; top: 44px; left: 0; right: 0; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; z-index: 60; }
.sr-item { display: flex; align-items: center; gap: 12px; padding: 8px 12px; }
.sr-item:hover { background: var(--panel-2); }
.sr-info { display: flex; flex-direction: column; line-height: 1.2; }
.sr-info small { color: var(--muted); font-size: 12px; }
.sr-empty { padding: 16px; color: var(--muted); text-align: center; font-size: 14px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.lang-toggle { display: flex; border: 1px solid var(--border-2); border-radius: 10px; overflow: hidden; }
.lang-toggle button { background: transparent; border: none; color: var(--muted); padding: 8px 12px; line-height: 18px; cursor: pointer; font-weight: 500; font-size: 12px; }
.lang-toggle button.active { background: var(--panel-3); color: var(--text); }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: 17px; display: inline-flex; align-items: center; justify-content: center; transition: background-color .15s var(--ease), color .15s var(--ease); }
.icon-btn:hover { background: var(--panel-2); color: var(--text); }
.avatar-btn { border: none; cursor: pointer; }

/* ===================== Раскладка ленты ===================== */
.layout { max-width: 1300px; margin: 0 auto; padding: 24px; display: grid; grid-template-columns: 232px minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.col-left, .col-right { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 88px; }
.side-card { padding: 16px; }

/* Сейчас смотрят */
.wn-item { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.wn-item .wn-name { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wn-item .wn-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; animation: live-pulse 2.2s ease-out infinite; }
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 var(--accent-dim-2); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .wn-item .wn-dot { animation: none; } }
.side-card .btn { margin-top: 12px; }

/* Последние отзывы: постер, справа фильм → оценка и автор → текст отзыва */
.lr-item { display: flex; gap: 12px; }
.lr-item + .lr-item { margin-top: 16px; }
.lr-poster { flex: 0 0 auto; width: 48px; height: 72px; padding: 0; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: var(--panel-2); cursor: pointer; }
.lr-poster img { display: block; width: 100%; height: 100%; object-fit: cover; }
.lr-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lr-title { padding: 0; background: none; border: none; color: var(--text); font-size: 14px; font-weight: 500; line-height: 18px; text-align: left; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-meta { display: flex; align-items: center; gap: 4px; min-width: 0; margin-top: 4px; font-size: 12px; line-height: 16px; color: var(--muted-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lr-meta > * + *::before { content: '·'; display: inline-block; margin-right: 4px; color: var(--muted-2); }
.lr-stars { flex: 0 0 auto; color: var(--gold); }
.lr-name { min-width: 0; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.lr-time { flex: 0 0 auto; }
.lr-text { margin-top: 8px; font-size: 13px; line-height: 18px; color: var(--text); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; word-break: break-word; }
.lr-title:hover, .lr-name:hover { text-decoration: underline; text-underline-offset: 2px; }
.lr-card-right { display: none; }
/* Боковые колонки с отзывами могут не влезть в экран: прокручиваются сами */
.col-left, .col-right { max-height: calc(100vh - 112px); overflow-y: auto; scrollbar-width: thin; }

/* Разделы */
.sections { display: flex; flex-direction: column; gap: 2px; }
.sec-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; cursor: pointer; background: none; border: none; text-align: left; font-size: 14px; line-height: 20px; width: 100%; transition: background-color .15s var(--ease), color .15s var(--ease); }
.sec-item:hover { background: var(--panel-2); color: var(--text); }
.sec-item.active { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
.sec-item .sec-ic { width: 18px; text-align: center; }

/* ===================== Композер ===================== */
/* Минималистичный композер: [картинка] [Что нового?] [счётчик] [кружок-отправить] */
.composer { padding: 12px; }
.composer-row { display: flex; align-items: center; gap: 12px; }
.composer-media { flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--border); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: background-color .15s var(--ease), color .15s var(--ease); }
.composer-media:hover { color: var(--text); background: var(--panel-3); }
.composer-media.on { color: var(--accent-2); border-color: var(--accent); background: var(--accent-dim); }
.composer-media .icon { width: 18px; height: 18px; }
.composer-row textarea { flex: 1; min-width: 0; min-height: 40px; max-height: 160px; border: none; background: transparent; padding: 10px 4px; line-height: 20px; resize: none; }
.composer-row textarea:focus { border: none; }
.composer-count { flex-shrink: 0; align-self: center; font-size: 12px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.composer-count.warn { color: var(--accent-2); }
.composer-send { flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; background: var(--panel-2); color: var(--muted); border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: background-color .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease); }
.composer-send:hover { background: var(--panel-3); color: var(--text); }
/* Отправка подсвечивается акцентом, только когда есть что публиковать */
.composer:has(textarea[placeholder]:not(:placeholder-shown)) .composer-send,
.composer:has(.composer-extra:not(.hidden)) .composer-send { background: var(--accent-fill); border-color: transparent; color: #fff; }
.composer:has(textarea[placeholder]:not(:placeholder-shown)) .composer-send:hover,
.composer:has(.composer-extra:not(.hidden)) .composer-send:hover { background: var(--accent-fill-2); }
.composer-send .icon { width: 18px; height: 18px; }
.composer-extra { margin: 12px 0 0; }
.composer-extra input { font-size: 16px; }
.composer-tools .btn { margin-left: auto; }

/* ===================== Фильтр ленты ===================== */
.feed-filter { display: flex; align-items: center; justify-content: space-between; margin: 16px 0; }
.feed-filter .sort { color: var(--muted); font-size: 13px; }

/* ===================== Пост ===================== */
.feed { display: flex; flex-direction: column; gap: 16px; }
.post { padding: 16px 20px; }
.post-head { display: flex; align-items: center; gap: 12px; }
.post-head .ph-name { font-weight: 500; }
.post-head .ph-sub { color: var(--muted); font-size: 13px; }
.badge { border: 1px solid var(--border-2); color: var(--muted); font-size: 12px; padding: 4px 8px; border-radius: 6px; font-weight: 500; }
.post-head .badge.host { color: var(--accent-2); border-color: var(--accent); }
.post-menu { margin-left: auto; background: none; border: none; color: var(--muted); cursor: pointer; font-size: 18px; padding: 2px 8px; border-radius: 8px; }
.post-menu:hover { background: var(--panel-2); color: var(--text); }
.post-text { line-height: 1.55; margin: 12px 0; white-space: pre-wrap; word-break: break-word; }
.post-media { border-radius: 10px; overflow: hidden; margin: 12px 0; border: 1px solid var(--border); }
.post-media img { display: block; width: 100%; max-height: 560px; object-fit: contain; background: #000; }
.post-media.hatch { aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center; color: var(--muted-2); font-size: 13px; font-family: ui-monospace, monospace; }
.post-foot { display: flex; align-items: center; gap: 20px; margin-top: 8px; }
.stat { display: inline-flex; align-items: center; gap: 8px; background: none; border: none; color: var(--muted); cursor: pointer; font-size: 14px; font-weight: 500; transition: color .15s var(--ease); }
.stat:hover { color: var(--text); }
.stat.liked { color: var(--accent-2); }
.post-foot .btn { margin-left: auto; }

/* ===================== Правый сайдбар ===================== */
.online-avatars { display: flex; align-items: center; }
.online-avatars .avatar { margin-right: -8px; border: 2px solid var(--panel); }
.online-more { margin-left: 16px; color: var(--muted); font-size: 13px; font-weight: 500; }
.links-card a { display: block; color: var(--muted); padding: 8px 0; font-size: 14px; transition: color .15s var(--ease); }
.links-card a:hover { color: var(--text); }
.socials { display: flex; gap: 12px; }
.soc { width: 40px; height: 40px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; color: var(--muted); font-size: 17px; transition: background-color .15s var(--ease), color .15s var(--ease); }
.soc:hover { color: var(--text); background: var(--panel-3); }
.foot-note { color: var(--muted-2); font-size: 12px; line-height: 16px; }

/* ===================== Комнаты (2b) ===================== */
.rooms-wrap { max-width: 1300px; margin: 0 auto; padding: 24px; }
.rooms-create-btn, .create-nav-btn { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; }
.create-nav-btn { text-decoration: none; }
/* Страница создания комнаты */
.create-wrap { max-width: 640px; margin: 0 auto; padding: 24px; }
.create-head { margin-bottom: 16px; }
.create-back { display: inline-flex; align-items: center; gap: 8px; }
.create-wrap .create-card { position: static; top: auto; }
.rooms-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 12px; }
.rooms-head h1 { font-size: 28px; }
.rooms-head .sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.rooms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 200px)); gap: 16px; justify-content: start; }
.room-card { overflow: hidden; display: flex; flex-direction: column; }
.rc-preview { position: relative; aspect-ratio: 16/10; display: flex; align-items: center; justify-content: center; color: var(--muted-2); font-family: ui-monospace, monospace; font-size: 12px; }
.rc-src { position: absolute; top: 8px; left: 8px; background: var(--accent-dim-2); color: var(--accent-2); font-size: 12px; font-weight: 500; padding: 4px 8px; border-radius: 6px; }
.rc-dur { position: absolute; bottom: 8px; right: 8px; background: rgba(0,0,0,.7); color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 6px; }
/* Карточка комнаты: название всегда занимает две строки, создатель и зрители прижаты к низу,
   поэтому строки в соседних карточках стоят на одной высоте */
.rc-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.rc-title { font-weight: 500; font-size: 16px; line-height: 20px; min-height: 40px; margin-bottom: 8px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
.rc-room-name, .rc-host { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-host { margin-top: auto; padding-top: 4px; margin-bottom: 12px; }
.rc-host span { color: var(--text); }
.rc-meta { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 13px; }
.rc-empty { border: 1px dashed var(--border-2); background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); text-align: center; gap: 8px; min-height: 200px; cursor: pointer; transition: border-color .15s var(--ease), color .15s var(--ease); }
.rc-empty .plus { font-size: 30px; }
.rc-empty:hover { border-color: var(--muted-2); color: var(--text); }

/* Создать комнату */
.create-card { padding: 20px; position: sticky; top: 88px; }
.create-card h2 { font-size: 22px; margin-bottom: 16px; }
.seg { display: flex; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 4px; gap: 4px; }
.seg button { flex: 1; background: transparent; border: none; color: var(--muted); padding: 8px; border-radius: 6px; cursor: pointer; font-weight: 500; font-size: 13px; transition: background-color .15s var(--ease), color .15s var(--ease); }
.seg button.active { background: var(--panel-3); color: var(--text); }
:root[data-theme="light"] .seg button.active { background: var(--panel); box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.vid-preview { display: flex; gap: 12px; align-items: center; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin: 12px 0; }
.vid-preview .thumb { width: 64px; height: 42px; border-radius: 6px; flex-shrink: 0; }
.vid-preview .vp-title { font-size: 13px; font-weight: 500; line-height: 1.3; }
.vid-preview .vp-sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.radio { display: flex; align-items: center; gap: 12px; padding: 8px 0; cursor: pointer; color: var(--text); font-size: 14px; }
.radio input { accent-color: var(--accent-fill); width: 16px; height: 16px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; margin: 16px 0; font-size: 14px; }
.switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; background: var(--panel-3); border-radius: 12px; transition: background-color .16s var(--ease); }
.switch .track::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .16s var(--ease); }
.switch input:checked + .track { background: var(--accent-fill); }
.switch input:checked + .track::before { transform: translateX(20px); }

/* ===================== Авторизация (2e) ===================== */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
/* Колонка входа: логотип сверху, форма по центру оставшегося места, подвал прижат к низу */
.auth-form { padding: 40px min(9%, 88px); display: flex; flex-direction: column; max-width: 620px; width: 100%; margin-left: auto; }
.auth-top { display: flex; align-items: center; justify-content: space-between; }
.auth-main { margin-block: auto; padding: 40px 0; }
.auth-foot { line-height: 20px; }
.auth-foot a { transition: color .15s var(--ease); }
.auth-foot a:hover { color: var(--text); }
.auth-top-right { display: flex; align-items: center; gap: 8px; }
.auth-form h1 { font-size: 34px; margin-bottom: 8px; }
.auth-form .subtitle { color: var(--muted); margin-bottom: 24px; }
.seg.big button { padding: 12px; font-size: 15px; }
.seg.big { margin-bottom: 24px; }
.row-between { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 16px; }
.checkbox { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; cursor: pointer; }
.checkbox input { accent-color: var(--accent-fill); width: 16px; height: 16px; }
.link { color: var(--accent-2); cursor: pointer; }
.divider-or { display: flex; align-items: center; gap: 16px; color: var(--muted-2); font-size: 13px; margin: 20px 0; }
.divider-or::before, .divider-or::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.oauth { display: flex; gap: 12px; }
.oauth .btn { flex: 1; justify-content: center; display: flex; align-items: center; gap: 8px; }
.fineprint { color: var(--muted); font-size: 13px; margin-top: 24px; }
.pass-wrap, .password-input { position: relative; }
.pass-wrap .eye, .password-input .eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; background: none; border: none; border-radius: 8px; color: var(--muted); cursor: pointer; }
.pass-wrap .eye:hover, .password-input .eye:hover { color: var(--text); background: rgba(255,255,255,.06); }
.pass-wrap .eye .icon, .password-input .eye .icon { width: 18px; height: 18px; }
.password-input input { padding-right: 44px; }
.plain-btn { background: none; border: none; padding: 0; font: inherit; }
.row-between .link { font-size: 14px; }
.auth-hero { position: relative; display: flex; flex-direction: column; justify-content: flex-end; padding: 44px; background: #0f0f10; overflow: hidden; }
.hero-slides { position: absolute; inset: 0; z-index: 0; background: #0f0f10; }
.hero-slide { position: absolute; inset: 0; background-size: cover; background-position: center; filter: brightness(.5) saturate(1.05); opacity: 0; transition: opacity 1.6s var(--ease); will-change: opacity; }
.hero-slide.on { opacity: 1; }
.auth-hero::before { content: ''; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(14,14,15,.35) 0%, rgba(14,14,15,.4) 45%, rgba(14,14,15,.9) 100%); }
.auth-hero h2 { position: relative; z-index: 2; font-weight: 500; font-size: 30px; line-height: 1.2; max-width: 440px; color: #fff; text-shadow: 0 2px 14px rgba(0,0,0,.7); transition: opacity .6s var(--ease); }
.auth-hero h2.fade { opacity: 0; }
.input-icon-left { padding-left: 16px; }
.password-input { position: relative; }

/* ===================== Экран просмотра (2c) ===================== */
.watch { display: grid; grid-template-columns: minmax(0,1fr) 360px; grid-template-rows: auto 1fr; height: 100vh; }
.player-area { min-height: 0; }
.watch-header { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; height: 60px; padding: 0 20px; border-bottom: 1px solid var(--border); }
.watch-header .brand { font-size: 17px; }
.watch-title { font-weight: 500; margin-left: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.watch-titles { display: flex; flex-direction: column; min-width: 0; }
.watch-titles .watch-title { margin-left: 0; }
.watch-sub { display: none; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.watch-back { display: none; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border); color: var(--text); align-items: center; justify-content: center; background: var(--panel-2); flex-shrink: 0; }
.watch-header .badge.src { color: var(--accent-2); border-color: var(--accent); }
.watch-header .spacer { flex: 1; }
.player-area { display: flex; flex-direction: column; min-width: 0; padding: 16px; gap: 16px; overflow: hidden; }
.player-box { position: relative; flex: 1; min-height: 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; background: #000; }
#video { width: 100%; height: 100%; display: none; }
#yt-player { width: 100%; height: 100%; }
#video { object-fit: contain; }
#yt-player iframe, .embed-frame { width: 100%; height: 100%; border: 0; }
.player-ph { flex-direction: column; align-items: center; gap: 4px; padding: 20px; text-align: center; cursor: pointer; }
.player-ph .ph-title { color: #ededed; font-size: 17px; font-weight: 500; }
.player-ph .ph-sub { color: #85858b; font-size: 14px; }
.player-ph .ph-btn { margin-top: 16px; display: inline-flex; align-items: center; gap: 8px; background: #212123; border-color: rgba(237, 237, 237, .14); color: #ededed; }
.player-ph:hover .ph-btn { background: #29292c; }
.player-overlay { position: absolute; top: 16px; right: 16px; background: rgba(0,0,0,.55); backdrop-filter: blur(6px); border: 1px solid var(--border); padding: 8px 12px; border-radius: 10px; font-size: 12px; color: #fff; display: flex; align-items: center; gap: 8px; }
.player-overlay .live { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.sync-note { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%) translateY(10px); background: rgba(0,0,0,.7); border: 1px solid var(--border); padding: 8px 16px; border-radius: 10px; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .25s var(--ease), transform .25s var(--ease); }
.sync-note.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Кастомные контролы */
.seekbar { height: 4px; background: var(--panel-3); border-radius: 3px; cursor: pointer; position: relative; }
.seekbar .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: 3px; width: 0; }
.seekbar .knob { position: absolute; top: 50%; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); transform: translate(-50%, -50%); left: 0; }
.controls { display: flex; align-items: center; gap: 16px; }
.controls .cbtn { background: none; border: none; color: var(--text); cursor: pointer; font-size: 17px; display: inline-flex; align-items: center; justify-content: center; }
.controls .cbtn.play { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--accent); color: var(--accent); }
.controls .cbtn.play:hover { background: var(--accent-dim); }
.controls .time { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.controls .grow { flex: 1; }
.queue { display: flex; align-items: center; gap: 16px; padding: 12px 16px; }
.queue .q-label { font-size: 12px; color: var(--muted-2); font-weight: 500; }
.queue .q-thumb { width: 60px; height: 38px; border-radius: 6px; flex-shrink: 0; }
.queue .q-title { font-weight: 500; font-size: 14px; }
.queue .q-add { margin-left: auto; color: var(--text); cursor: pointer; font-weight: 500; background: none; border: none; transition: color .15s var(--ease); }
.queue .q-add .icon { color: var(--muted); }
.queue .q-add:hover .icon { color: var(--text); }

/* Чат-панель */
.chat-panel { border-left: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; background: var(--panel); }
.chat-tabs { display: flex; align-items: center; gap: 20px; padding: 0 16px; border-bottom: 1px solid var(--border); position: relative; }
.chat-tab { background: none; border: none; color: var(--muted); font-weight: 500; padding: 16px 0; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.chat-tab.active { color: var(--text); border-bottom-color: var(--accent); }
.participants-bar { display: none; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.participants-bar .avatar { margin-right: -8px; border: 2px solid var(--panel); }
.host-badge { margin-left: auto; background: var(--panel-2); border: 1px solid var(--border); font-size: 12px; padding: 4px 8px; border-radius: 6px; color: var(--muted); }
.messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.messages::-webkit-scrollbar { width: 8px; }
.messages::-webkit-scrollbar-thumb { background: var(--panel-3); border-radius: 4px; }
.msg { display: flex; gap: 12px; }
.msg .m-body { min-width: 0; }
.msg .m-head { font-size: 13px; margin-bottom: 2px; }
.msg .m-name { font-weight: 500; }
.msg .m-time { color: var(--muted-2); margin-left: 8px; font-size: 12px; }
.msg .m-text { line-height: 1.4; word-break: break-word; }
.msg-sys { align-self: center; background: var(--panel-2); border: 1px solid var(--border); color: var(--muted); font-size: 13px; padding: 4px 12px; border-radius: 10px; text-align: center; }
.typing { height: 16px; padding: 0 16px; font-size: 12px; color: var(--muted); }
.participants-list { flex: 1; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 4px; }
.p-row { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 10px; }
.p-row:hover { background: var(--panel-2); }
.chat-input-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); }
.chat-input-row input { border-radius: 10px; }
.send-btn { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel-2); color: var(--muted); cursor: pointer; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; transition: background-color .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease); }
.send-btn:hover { background: var(--panel-3); color: var(--text); }
.chat-input-row:has(input[placeholder]:not(:placeholder-shown)) .send-btn,
.dm-input-row:has(input[placeholder]:not(:placeholder-shown)) .send-btn { background: var(--accent-fill); border-color: transparent; color: #fff; }
.chat-input-row:has(input[placeholder]:not(:placeholder-shown)) .send-btn:hover,
.dm-input-row:has(input[placeholder]:not(:placeholder-shown)) .send-btn:hover { background: var(--accent-fill-2); }

/* ===================== Профиль (2d) ===================== */
.profile-wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px 40px; display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 24px; align-items: start; }
.profile-full { grid-column: 1 / -1; }
.cover { height: 220px; border-radius: 0 0 16px 16px; }
.profile-header { display: flex; align-items: flex-end; gap: 20px; margin-top: -52px; flex-wrap: wrap; }
.profile-header .avatar { position: relative; z-index: 1; }
.ph-info { flex: 1; min-width: 200px; padding-bottom: 8px; }
.ph-name-row { font-size: 26px; font-weight: 600; }
.ph-handle { color: var(--muted); margin-top: 2px; }
.ph-actions { display: flex; gap: 12px; padding-bottom: 8px; }
.bio { margin: 16px 0; line-height: 1.55; max-width: 640px; }
.stats { display: flex; gap: 32px; padding: 8px 0; border-bottom: 1px solid var(--border); margin: 0 0 8px; }
.stats .st-num { font-size: 20px; font-weight: 600; }
.stats .st-lbl { color: var(--muted); font-size: 13px; }
.ptabs { display: flex; gap: 24px; padding: 8px 0; margin-bottom: 8px; }
.ptab { background: none; border: none; color: var(--muted); font-weight: 500; cursor: pointer; padding: 8px 0; border-bottom: 2px solid transparent; }
.ptab.active { color: var(--text); border-bottom-color: var(--accent); }
.friends-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.friends-grid .fr { aspect-ratio: 1; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--muted); font-weight: 500; }
.often-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.often-row .oname { font-weight: 500; }
.often-row .ohours { margin-left: auto; color: var(--muted); font-size: 13px; }
.room-now-preview { aspect-ratio: 16/9; border-radius: 10px; margin-bottom: 12px; }

/* ===================== Модалки ===================== */
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(6,6,10,.72); display: flex; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(5px); }
.modal.hidden { display: none; }
body:has(.modal:not(.hidden)) { overflow: hidden; }
.modal-card { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 24px; width: 460px; max-width: 100%; box-shadow: var(--shadow); max-height: 88vh; overflow-y: auto; }
.modal-card.wide { width: 780px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-head h3 { font-size: 20px; }
.modal-x { background: none; border: none; color: var(--muted); font-size: 18px; cursor: pointer; padding: 8px; border-radius: 8px; }
.modal-x:hover { background: var(--panel-2); color: var(--text); }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.emoji-pick, .color-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.emoji-opt { width: 40px; height: 40px; border-radius: 10px; border: 2px solid transparent; background: var(--panel-2); font-size: 20px; cursor: pointer; }
.emoji-opt.sel { border-color: var(--accent); }
.color-opt { width: 32px; height: 32px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; }
.color-opt.sel { border-color: #fff; }

/* Каталог фильмов */
.catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px; }
.movie-card { text-align: left; background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; cursor: pointer; padding: 0; color: var(--text); }
.movie-card:hover { border-color: var(--border-2); }
.poster { position: relative; aspect-ratio: 2/3; background: var(--hatch); display: flex; align-items: center; justify-content: center; }
.poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.poster-emoji { font-size: 38px; }
.poster-len { position: absolute; bottom: 6px; right: 6px; background: rgba(0,0,0,.72); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 10px; z-index: 2; }
.movie-meta { padding: 8px 12px; }
.movie-title { font-size: 14px; font-weight: 500; }
.movie-sub { font-size: 12px; color: var(--muted); }
.error { color: var(--red); margin-top: 12px; min-height: 20px; font-size: 14px; opacity: 0; transition: opacity .2s var(--ease); }
.error.show { opacity: 1; }

/* ===================== Адаптив ===================== */
@media (max-width: 1080px) {
  .layout { grid-template-columns: minmax(0,1fr) 300px; }
  .col-left { display: none; }
  .lr-card-right { display: block; }
}
@media (max-width: 900px) {
  .layout, .rooms-wrap, .profile-wrap { grid-template-columns: 1fr; }
  .col-right, .profile-wrap > .col-right { display: none; }
  /* Комната: экран не скроллится целиком, видео/кнопки зафиксированы сверху,
     прокручивается только лента чата */
  .watch { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
  .chat-panel { border-left: none; border-top: 1px solid var(--border); min-height: 0; height: auto; }
  .player-area { min-height: 0; overflow: hidden; padding: 12px 12px; gap: 12px; }
  .auth { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .topnav { display: none; }
  /* Карточка создания комнаты, показываем под списком, не sticky */
  .create-card { display: block; position: static; top: auto; }
}

/* ===================== Мобильная навигация и адаптив ===================== */
.mobile-nav { display: none; }
.dm-back { display: none; } /* кнопка «назад» в ЛС, только на мобиле */
@media (max-width: 900px) {
  .mobile-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: var(--panel); border-top: 1px solid var(--border);
    padding: 4px 0 calc(4px + env(safe-area-inset-bottom, 0px));
  }
  .mnav-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: none; color: var(--muted); font-size: 11px; cursor: pointer; padding: 4px 0; text-decoration: none; }
  .mnav-item.active { color: var(--text); }
  .mnav-item svg { width: 22px; height: 22px; }
  /* место под нижнюю панель */
  #app, .profile-wrap { padding-bottom: 80px; }
  .layout, .rooms-wrap { padding-left: 16px; padding-right: 16px; }
  /* топбар компактнее, чат-иконку сверху прячем (она в нижней навигации) */
  .topbar { gap: 12px; padding: 0 16px; }
  #nav-chat, .lang-toggle { display: none; }
  .search { max-width: none; }

  /* Личные сообщения: одна колонка, показ списка или чата; аккуратные скруглённые карточки.
     Страница не скроллится: высота = вьюпорт минус топбар; нижний отступ оставляет место под навигацию. */
  /* ЛС «без окна»: заподлицо на весь экран, топбар скрыт (как в концепте) */
  #app:has(#page-messages:not(.hidden)) { padding-bottom: 0; }
  #app:has(#page-messages:not(.hidden)) .topbar { display: none; }
  .dm-wrap { grid-template-columns: 1fr; max-width: none; margin: 0; gap: 0; padding: 0 0 calc(56px + env(safe-area-inset-bottom, 0px)); height: 100dvh; }
  .dm-list, .dm-chat { border-radius: 0; border: none; background: transparent; height: 100%; }
  .dm-wrap:not(.dm-open) .dm-chat { display: none; }
  .dm-wrap.dm-open .dm-list { display: none; }
  .dm-back { display: inline-flex; }
  .dm-bubble { max-width: 82%; }
  /* Список диалогов: крупные строки во всю ширину с разделителями */
  .dm-list { padding: 0; }
  .dm-list-head { padding: 16px 16px 12px; font-size: 22px; }
  .dm-conv { padding: 12px 16px; border-radius: 0; gap: 12px; }
  .dm-conv + .dm-conv { border-top: 1px solid var(--border); }
  .dm-conv:active { background: var(--panel-2); }

  /* Комната: игрок сверху (зафиксирован), кнопки переносятся, чат снизу */
  .watch-header { flex-wrap: wrap; height: auto; padding: 8px 12px; gap: 8px; }
  .watch-header .btn { padding: 8px 12px; font-size: 13px; }
  .card.queue { flex-wrap: wrap; gap: 8px 12px; padding: 8px 12px; }
  .card.queue .q-label { display: none; }
  .card.queue .q-add { margin-left: 0; font-size: 13px; }
  .player-box { flex: none; min-height: 0; height: 32vh; height: 32dvh; }

  /* Профиль: действия и статистика переносятся */
  .ph-actions { flex-wrap: wrap; }
  .profile-header { flex-wrap: wrap; }
  .modal-card { max-width: 94vw; }
}

/* Чат-панель: колонка с растягивающимся чатом */
.watch { overflow: hidden; }
#tab-chat { flex: 1; display: flex; flex-direction: column; min-height: 0; }
#tab-people.participants-list { flex: 1; }
.chat-tab .m-name { }

/* ===================== Векторные иконки ===================== */
.icon { width: 1.2em; height: 1.2em; display: inline-block; vertical-align: -0.2em; flex-shrink: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }
.avatar.av-empty { background: var(--panel-3); color: var(--muted); }
.avatar.av-empty .icon { width: 62%; height: 62%; vertical-align: 0; }
.navlink .icon, .stat .icon, .tool-btn .icon, .sec-item .icon, .btn .icon { vertical-align: -0.18em; }
.icon-btn .icon { width: 18px; height: 18px; }
.search .search-ic .icon { width: 18px; height: 18px; }
.cbtn .icon { width: 20px; height: 20px; }
.cbtn.play .icon { width: 22px; height: 22px; }
.send-btn .icon { width: 18px; height: 18px; }
.soc .icon { width: 18px; height: 18px; }
.rc-src .icon, .rc-meta .icon { vertical-align: -0.15em; }

/* Загрузка аватара/баннера в редакторе профиля */
.upload-avatar { position: relative; width: 96px; height: 96px; border-radius: 16px; overflow: hidden; cursor: pointer; background: var(--panel-3); color: var(--muted); display: flex; align-items: center; justify-content: center; }
.upload-avatar img { width: 100%; height: 100%; object-fit: cover; }
.upload-avatar .cam { position: absolute; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .15s var(--ease); }
.upload-avatar:hover .cam { opacity: 1; }
.upload-avatar .cam .icon { width: 26px; height: 26px; color: #fff; }
.upload-banner { position: relative; height: 120px; border-radius: 12px; overflow: hidden; cursor: pointer; margin-bottom: 16px; }
.upload-banner img { width: 100%; height: 100%; object-fit: cover; }
.upload-banner .cam { position: absolute; inset: 0; background: rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; gap: 8px; color: #fff; font-weight: 500; font-size: 13px; }
.upload-banner .cam .icon { width: 20px; height: 20px; }
.upload-row { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.clear-img { background: none; border: none; color: var(--muted); font-size: 13px; cursor: pointer; text-decoration: underline; }

/* Обложка профиля как картинка */
.cover { background-size: cover; background-position: center; }
.cover.hatch { background: linear-gradient(180deg, var(--panel-2), var(--bg)); }

/* Композер на профиле */
.profile-composer { margin: 0 0 16px; }

/* ===================== Плеер v2 (нативные контролы) ===================== */
#video, #yt-wrap, #embed { width: 100%; height: 100%; display: none; }
#yt-wrap { position: relative; }
#yt-wrap iframe { width: 100%; height: 100%; border: 0; }
.player-block { position: absolute; inset: 0; z-index: 6; background: transparent; }
.q-add.hidden { display: none; }

/* Действия над участником */
.p-row { justify-content: flex-start; }
.p-actions { margin-left: auto; display: flex; gap: 8px; }
.p-actions button { background: var(--panel-3); border: none; color: var(--muted); border-radius: 8px; padding: 4px; cursor: pointer; display: inline-flex; }
.p-actions button:hover { color: var(--text); }
.p-actions button.on { color: var(--accent-2); }
.p-actions .icon { width: 16px; height: 16px; }
.p-tag { font-size: 11px; color: var(--accent-2); border: 1px solid var(--accent); border-radius: 6px; padding: 1px 8px; margin-left: 8px; }
.p-tag.muted { color: var(--muted); border-color: var(--border-2); }

/* Комментарии */
.comments { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 12px; }
.comment { display: flex; gap: 12px; margin-bottom: 12px; }
.comment .c-body { background: var(--panel-2); border-radius: 12px; padding: 8px 12px; min-width: 0; }
.comment .c-name { font-weight: 500; font-size: 13px; }
.comment .c-time { color: var(--muted-2); font-size: 12px; margin-left: 8px; }
.comment .c-text { line-height: 1.4; word-break: break-word; }
.comment-form { display: flex; gap: 8px; margin-top: 8px; }
.comment-form input { flex: 1; }
.comment-del { background: none; border: none; color: var(--muted-2); cursor: pointer; margin-left: auto; align-self: flex-start; }
.comment-del:hover { color: var(--red); }

/* Тултип «кто лайкнул» */
.like-tip { position: absolute; bottom: 100%; left: 0; margin-bottom: 8px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; font-size: 13px; box-shadow: var(--shadow); white-space: nowrap; z-index: 20; max-width: 240px; }
.like-tip .lt-row { padding: 2px 0; }
.post-foot { position: relative; }

/* Меню аккаунта */
.acct { position: relative; }
.acct-menu { position: absolute; right: 0; top: 40px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; z-index: 60; min-width: 180px; padding: 4px; }
.acct-menu button { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: none; border: none; color: var(--text); padding: 8px 12px; line-height: 20px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.acct-menu button:hover { background: var(--panel-2); }
.acct-menu .icon { width: 18px; height: 18px; color: var(--muted); }

/* Кроп изображения */
.crop-stage { position: relative; overflow: hidden; background: #000; border-radius: 12px; margin-bottom: 16px; touch-action: none; }
.crop-stage img { position: absolute; transform-origin: 0 0; user-select: none; -webkit-user-drag: none; max-width: none; }
.crop-stage.avatar-crop { width: 260px; height: 260px; margin: 0 auto 16px; border-radius: 50%; }
.crop-stage.banner-crop { width: 100%; aspect-ratio: 3 / 1; }
.crop-controls { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.crop-controls input[type=range] { flex: 1; }

/* История / комнаты сейчас на профиле */
.hist-item { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.hist-item:last-child { border-bottom: none; }
.hist-title { font-weight: 500; font-size: 14px; }
.hist-sub { color: var(--muted); font-size: 12px; }
.cur-room { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.cur-room .wn-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* Правый блок шапки всегда справа (в т.ч. на профиле) */
.topbar-right { margin-left: auto; }
.muted-hint { color: var(--muted); font-size: 12px; }
.post-image-preview { position: relative; }
.post-image-preview img { max-width: 100%; max-height: 320px; border-radius: 12px; display: block; border: 1px solid var(--border); }
.post-image-preview .clear-img { margin-top: 8px; }

/* ===================== v3: короны, плейлист, настройки ===================== */
.ava-wrap { position: relative; display: inline-block; line-height: 0; }
.crown { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); width: 16px; height: 16px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.6)); }
.crown .icon { width: 100%; height: 100%; }
.crown.owner { color: var(--gold); }
.crown.admin { color: #ffffff; }
.participants-bar { padding-top: 16px; }
.messages .msg .ava-wrap { margin-top: 8px; }
.p-tag.owner { color: var(--gold); border-color: var(--gold); }
.p-tag.admin { color: #fff; border-color: var(--border-2); }

/* Кнопки очереди */
.qc-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border-2); background: transparent; color: var(--text); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.qc-btn:hover { background: var(--panel-2); }
.qc-btn .icon { width: 18px; height: 18px; }
.q-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* Плейлист */
.pl-section { font-size: 12px; font-weight: 500; color: var(--muted-2); margin: 16px 0 8px; }
.pl-item { display: flex; align-items: center; gap: 12px; padding: 12px 12px; border-radius: 10px; border: 1px solid var(--border); margin-bottom: 8px; background: var(--panel-2); }
.pl-item.current { border-color: var(--accent); background: var(--accent-dim); }
.pl-item.played { opacity: .5; }
.pl-num { color: var(--muted-2); width: 18px; text-align: center; font-size: 13px; }
.pl-title { flex: 1; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-badge { font-size: 11px; color: var(--accent-2); border: 1px solid var(--accent); border-radius: 6px; padding: 1px 8px; }
.pl-actions { display: flex; gap: 8px; }
.pl-actions button { background: var(--panel-3); border: none; color: var(--muted); border-radius: 8px; padding: 8px; cursor: pointer; display: inline-flex; }
.pl-actions button:hover { color: var(--text); }
.pl-actions .icon { width: 16px; height: 16px; }
#playlist-body { max-height: 56vh; overflow-y: auto; }

/* ===================== Поиск фильмов (балансер) ===================== */
.bal-search { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bal-search > input { flex: 1; min-width: 160px; background: var(--panel-2); border: 1px solid var(--border); color: var(--text); padding: 12px 16px; border-radius: 10px; }
.bal-search .bal-year { flex: 0 0 76px; min-width: 0; text-align: center; }
.bal-kind { flex: 0 0 auto; padding: 4px; }
.bal-kind button { padding: 8px 16px; }
.bal-sources { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.bal-sources:empty { display: none; }
.bal-src { background: var(--panel-2); border: 1px solid var(--border); color: var(--muted); padding: 8px 12px; border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 500; transition: color .15s var(--ease), background-color .15s var(--ease); }
.bal-src:hover { color: var(--text); }
.bal-src.active { background: var(--panel-3); border-color: var(--border-2); color: var(--text); }
.bal-nav { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.bal-nav .btn { padding: 8px 16px; }
.bal-path { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bal-content { margin-top: 16px; max-height: 46vh; overflow-y: auto; overflow-x: hidden; }
.bal-voices { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.bal-voice { background: var(--panel-2); border: 1px solid var(--border); color: var(--text); padding: 8px 12px; border-radius: 10px; cursor: pointer; font-size: 13px; }
.bal-voice:hover { border-color: var(--border-2); }
.bal-voice.active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent-2); }
.bal-list { display: flex; flex-direction: column; gap: 8px; }
.bal-folder { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--panel-2); border: 1px solid var(--border); color: var(--text); padding: 12px 16px; border-radius: 10px; cursor: pointer; font-weight: 500; }
.bal-folder:hover { background: var(--panel-3); }
.bal-folder span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bal-folder .icon { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }
.bal-folder .icon:last-child { color: var(--muted-2); }
.bal-plays { display: flex; flex-direction: column; gap: 12px; }
.bal-play { background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; }
.bal-play-t { font-weight: 500; margin-bottom: 12px; overflow-wrap: anywhere; word-break: break-word; }
.bal-tr { color: var(--muted); font-weight: 500; font-size: 13px; overflow-wrap: anywhere; }
.bal-qs { display: flex; flex-wrap: wrap; gap: 8px; }
.bal-q { background: var(--panel-3); border: 1px solid var(--border-2); color: var(--text); padding: 8px 16px; border-radius: 8px; cursor: pointer; font-weight: 500; font-size: 13px; transition: border-color .15s var(--ease); }
.bal-q:hover { border-color: var(--muted-2); }
.bal-q.add { background: transparent; border-color: var(--border-2); color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.bal-q.add:hover { color: var(--text); }
.bal-q.add .icon { width: 16px; height: 16px; }

/* Настройки комнаты */
.settings-row { display: flex; align-items: center; gap: 16px; padding: 8px 0; }
.settings-ic { width: 40px; height: 40px; border-radius: 10px; background: var(--panel-2); display: flex; align-items: center; justify-content: center; color: var(--muted); flex-shrink: 0; }
.settings-ic .icon { width: 20px; height: 20px; }
.settings-txt { flex: 1; min-width: 0; }
.settings-title { font-weight: 500; }
.settings-sep { height: 1px; background: var(--border); margin: 16px 0; }

/* ============================ Настройки плеера («Дорожки» в панели очереди) ============================ */
.card.queue { position: relative; }
.settings-menu { position: absolute; bottom: calc(100% + 8px); right: 12px; z-index: 40; min-width: 220px; max-height: 340px; overflow-y: auto; padding: 4px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
.settings-menu .sm-section { font-size: 12px; color: var(--muted-2); padding: 8px 12px 4px; }
.settings-menu .sm-section:first-child { padding-top: 4px; }
.settings-menu .sm-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: left; padding: 8px 12px; border-radius: 8px; background: none; border: none; color: var(--text); font-size: 14px; cursor: pointer; }
.settings-menu .sm-item:hover { background: var(--panel-2); }
.settings-menu .sm-item .sm-check { color: var(--accent); font-weight: 500; }

/* Баннер «на паузе» */
.paused-banner { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); z-index: 5; display: flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 12px; background: rgba(0,0,0,.62); border: 1px solid var(--border); color: #fff; font-size: 15px; font-weight: 500; backdrop-filter: blur(6px); pointer-events: none; text-align: center; }

/* Балансер: оригинальное название и год, тускло */
.bal-dim { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 8px; }
.bal-folder .bal-f-main { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; }
.bal-folder .bal-f-main .bal-dim { margin-left: 0; }

/* Постер в результатах умного поиска (TMDB) */
.bal-poster { width: 34px; height: 50px; object-fit: cover; border-radius: 6px; flex: 0 0 auto; background: var(--hatch); }

/* Индикатор пауза/плей на карточке комнаты */
.rc-status { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); }
.rc-status svg { width: 14px; height: 14px; }
.rc-status.is-play { color: var(--green, #58d68b); }
.rc-status.is-pause { color: var(--accent-2, #a99cf9); }

/* Клик по фильму/серии = включить (лучшее качество) */
.bal-play-go { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2, #1c1c27); color: var(--text); cursor: pointer; font-size: 14px; }
.bal-play-go:hover { background: var(--panel-3); border-color: var(--border-2); }
.bal-play-go svg { width: 16px; height: 16px; color: var(--muted); flex: 0 0 auto; }
.bal-play-go > span { min-width: 0; }

/* ===== Правки UX (батч) ===== */
/* Инпуты без явного type (комментарии), тёмные, как остальные */
input:not([type]) { width: 100%; background: var(--panel-2); border: 1px solid var(--border); color: var(--text); padding: 12px 16px; border-radius: 10px; outline: none; }
input:not([type]):focus { border-color: var(--accent); }

/* Композер: поле ввода на всю ширину карточки */
.composer-row textarea { flex: 1; width: 100%; }

/* Форма комментария, как у постов, кнопка не выделяется */
.comment-form { display: flex; gap: 8px; margin-top: 12px; }
.comment-form input { flex: 1; background: var(--panel-2); }
.comment-form button { border-color: var(--border-2); color: var(--muted); background: transparent; }
.comment-form button:hover { color: var(--text); background: var(--panel-2); }

/* Вертикальные постеры в карточках комнат */
.rc-preview { aspect-ratio: 2 / 3; height: auto; min-height: 0; max-height: 300px; }
.rc-preview img { width: 100%; height: 100%; object-fit: cover; }

/* Круглый аватар на странице профиля */
.profile-header .avatar.xl { border-radius: 50%; }

/* Масштаб текста чата */
.messages { font-size: 100%; }
.messages .m-text { font-size: .95em; }
.messages .m-name { font-size: .92em; }
.messages .m-gif img { max-width: 220px; max-height: 220px; border-radius: 10px; display: block; margin-top: 4px; }

/* Круглая кнопка GIF в чате */
.gif-btn { width: 44px; height: 44px; flex: 0 0 auto; border-radius: 10px; border: 1px solid var(--border); background: var(--panel-2); color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.gif-btn:hover { color: var(--text); background: var(--panel-3); }
.gif-btn svg { width: 18px; height: 18px; }

/* Подсветка выбранного фильма/серии */
.bal-play-go.sel, .bal-q.sel { border-color: var(--accent); background: var(--accent-dim); color: var(--accent-2); }
.bal-play-go.sel svg { color: var(--accent); }

/* Карточка «Выбрано» при создании комнаты */
.cr-chosen { margin-top: 16px; }
.cr-chosen-in { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--accent); border-radius: 12px; background: var(--accent-dim); }
.cr-chosen-in > img { width: 40px; height: 60px; object-fit: cover; border-radius: 8px; flex: 0 0 auto; }
.cr-chosen-in > svg:first-child { width: 22px; height: 22px; color: var(--accent); flex: 0 0 auto; }
.cr-chosen-t { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-chosen-ok { margin-left: auto; color: var(--accent); display: inline-flex; }
.cr-chosen-ok svg { width: 20px; height: 20px; }

/* История просмотров */
.hist-item { padding: 8px 0; border-bottom: 1px solid var(--border); }
.hist-item:last-child { border-bottom: none; }
.hist-title { font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-sub { color: var(--muted); font-size: 12px; }
#history-list { max-height: 60vh; overflow-y: auto; }

/* GIF-пикер в чате */
#tab-chat { position: relative; }
.gif-picker { position: absolute; bottom: 66px; left: 10px; right: 10px; max-height: 320px; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); z-index: 30; overflow: hidden; }
.gif-picker-head { display: flex; gap: 8px; padding: 12px; border-bottom: 1px solid var(--border); }
.gif-picker-head input { flex: 1; }
.gif-picker-head .btn { padding: 8px 12px; }
.gif-results { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 84px; gap: 8px; padding: 8px; align-content: start; }
.gif-cell { border: none; padding: 0; margin: 0; height: 84px; background: var(--panel-2); border-radius: 8px; overflow: hidden; cursor: pointer; }
.gif-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gif-cell:hover { outline: 2px solid var(--muted-2); }
.gif-results .foot-note { grid-column: 1 / -1; padding: 20px; text-align: center; }

/* Ответы в чате комнаты */
.m-head { display: flex; align-items: center; gap: 8px; }
.reply-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; margin: 0 12px 8px; background: var(--panel-2); border-left: 3px solid var(--accent); border-radius: 8px; font-size: 13px; }
.reply-bar b { color: var(--accent-2); }
.reply-bar .rb-x { margin-left: auto; background: none; border: none; color: var(--muted); cursor: pointer; display: inline-flex; }
.reply-bar .rb-x svg, .reply-bar > span + button svg { width: 14px; height: 14px; }
.m-reply { border-left: 3px solid var(--accent); padding: 2px 8px; margin: 2px 0 4px; font-size: .9em; color: var(--muted); background: var(--accent-dim); border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-reply-u { color: var(--accent-2); font-weight: 500; }
.m-reply-btn { background: none; border: none; color: var(--muted-2); cursor: pointer; margin-left: auto; padding: 0 2px; display: inline-flex; opacity: 0; transition: opacity .15s var(--ease); }
.msg:hover .m-reply-btn { opacity: 1; }
.m-reply-btn svg { width: 13px; height: 13px; }

/* Ответы в комментариях */
.c-reply { border-left: 2px solid var(--accent); padding: 1px 8px; margin: 4px 0; font-size: 12px; color: var(--muted); }
.c-reply-u { color: var(--accent-2); font-weight: 500; }
.c-reply-btn { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 12px; padding: 4px 0 0; display: block; }
.c-reply-btn:hover { color: var(--text); }
.c-reply-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; margin-top: 8px; background: var(--panel-2); border-left: 3px solid var(--accent); border-radius: 8px; font-size: 13px; color: var(--muted); }
.c-reply-bar b { color: var(--accent-2); }
.c-reply-bar .rb-x { margin-left: auto; background: none; border: none; color: var(--muted); cursor: pointer; display: inline-flex; }
.c-reply-bar .rb-x svg { width: 14px; height: 14px; }

/* Стабильный масштаб текста между браузерами */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* Ник создателя в карточке комнаты, кликабельный */
.rc-host-link { color: var(--accent-2); cursor: pointer; }
.rc-host-link:hover { text-decoration: underline; }
/* Источник в процессе проверки / пустой */
.bal-src.pending { opacity: .5; }
.bal-src.empty { display: none; }

/* Уведомления */
.notif-badge { position: absolute; top: 0; right: 0; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--red); color: #fff; font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.notif-panel { position: fixed; top: 68px; right: 24px; width: 340px; max-height: 70vh; overflow-y: auto; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); z-index: 200; }
.notif-head { padding: 16px 16px; font-weight: 500; border-bottom: 1px solid var(--border); }
.notif-item { display: flex; gap: 12px; align-items: center; padding: 12px 16px; }
.notif-item:hover { background: var(--panel-2); }
.notif-item.unread { background: var(--accent-dim); }
.notif-txt { min-width: 0; font-size: 14px; line-height: 1.35; }
.notif-time { color: var(--muted); font-size: 12px; margin-top: 2px; }
.notif-empty { padding: 24px; text-align: center; color: var(--muted); }

/* ===================== Личные сообщения ===================== */
.dm-wrap { max-width: 1040px; margin: 0 auto; padding: 20px; display: grid; grid-template-columns: 300px 1fr; gap: 16px; height: calc(100vh - 104px); }
.dm-list { overflow-y: auto; padding: 8px; }
.dm-conv { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; padding: 12px; border: none; background: none; border-radius: 10px; cursor: pointer; color: var(--text); }
.dm-conv:hover { background: var(--panel-2); }
.dm-conv.active { background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--border); }
.dm-conv-body { min-width: 0; flex: 1; }
.dm-conv-top { display: flex; align-items: baseline; gap: 8px; }
.dm-conv-name { font-weight: 500; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-conv-time { font-size: 12px; color: var(--muted-2); flex-shrink: 0; }
.dm-conv-bottom { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.dm-conv-last { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.dm-badge { background: var(--accent-fill); color: #fff; border-radius: 10px; font-size: 11px; font-weight: 600; padding: 0 8px; min-width: 20px; height: 20px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.dm-list-head { font-size: 20px; font-weight: 600; padding: 16px 16px 12px; }
.dm-chat { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.dm-placeholder { margin: auto; color: var(--muted); padding: 32px; text-align: center; }
.dm-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px; border-bottom: 1px solid var(--border); }
.dm-head-name { font-weight: 500; }
.dm-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.dm-msg { display: flex; }
.dm-msg.mine { justify-content: flex-end; }
.dm-bubble { max-width: 70%; padding: 8px 12px; border-radius: 14px; background: var(--panel-2); word-break: break-word; }
.dm-msg.mine .dm-bubble { background: var(--accent-fill); color: #fff; }
.dm-msg-time { font-size: 11px; opacity: .6; margin-left: 8px; }
.dm-gif { max-width: 100%; width: 220px; height: auto; border-radius: 8px; display: block; }
.dm-msg.gif-msg .dm-bubble { padding: 4px; }
.dm-input-row { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }
.dm-input-row input { flex: 1; }

/* ===================== Подарки ===================== */
.gifts-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.gift-item { font-size: 28px; line-height: 1; transition: transform .15s var(--ease); }
.gift-item:hover { transform: translateY(-2px); }
.gift-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; max-height: 56vh; overflow-y: auto; overflow-x: hidden; }
.sticker-cell { min-width: 0; }
.sticker-cell img { max-width: 100%; }
.gift-pick-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.gift-pick-head .gift-cats { flex: 1; margin-bottom: 0; }
.gift-pick-head #gift-refresh { padding: 8px 12px; flex-shrink: 0; }
.gift-cell { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel-2); cursor: pointer; }
.gift-cell:hover { border-color: var(--border-2); background: var(--panel-3); }
.gift-cell .gift-e { font-size: 34px; line-height: 1; }
.gift-cell .gift-n { font-size: 12px; color: var(--muted); }

/* ЛС: онлайн-статус, позиционирование гиф-пикера */
.dm-chat { position: relative; }
.dm-online { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-right: 4px; flex-shrink: 0; }
.dm-head-status { font-size: 12px; color: var(--muted); display: flex; align-items: center; }
.dm-conv-name .dm-online { margin-right: 4px; }

/* ЛС: действия над сообщением, прочитано, стикеры */
.dm-msg { align-items: center; gap: 8px; }
.dm-msg-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .15s var(--ease); }
.dm-msg:hover .dm-msg-actions { opacity: 1; }
.dm-msg.mine .dm-msg-actions { order: -1; }
.dm-msg-actions button { background: none; border: none; color: var(--muted); cursor: pointer; padding: 4px; display: inline-flex; border-radius: 6px; }
.dm-msg-actions button:hover { color: var(--text); background: var(--panel-2); }
.dm-msg-actions svg { width: 14px; height: 14px; }
.dm-read { font-size: 11px; color: var(--muted); padding: 0 16px 8px; display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.dm-read svg { width: 12px; height: 12px; color: var(--accent-2); }
.sticker-cell { border: none; background: none; padding: 8px; border-radius: 10px; cursor: pointer; aspect-ratio: 1; }
.sticker-cell:hover { background: var(--panel-3); }
.sticker-cell img { width: 100%; height: 100%; object-fit: contain; }
.gift-item-img { display: inline-flex; transition: transform .15s var(--ease); }
.gift-item-img img { width: 80%; height: 80%; object-fit: contain; }

/* Каталог подарков: вкладки категорий, шаг отправки, просмотр */
.gift-cats { flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.gift-cats button { padding: 8px 12px; white-space: nowrap; }
.gift-compose { text-align: center; margin-bottom: 12px; }
.gift-chosen-img { width: 120px; height: 120px; object-fit: contain; }
.giftview-msg { margin-top: 16px; padding: 12px 16px; background: var(--panel-2); border-radius: 10px; display: inline-block; max-width: 100%; word-break: break-word; }
.gift-item, .gift-item-img { aspect-ratio: 1; width: 100%; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; border: none; border-radius: 8px; background: var(--panel-2); cursor: pointer; padding: 0; }
.gift-item:hover, .gift-item-img:hover { transform: translateY(-2px); }

/* Просмотр подарка, ровная центрированная колонка */
#giftview-body { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 8px 0 4px; }
#giftview-body img { width: 150px; height: 150px; object-fit: contain; }
#giftview-body .giftview-msg { display: block; text-align: center; margin-top: 0; }
#giftview-body .foot-note { text-align: center; }

/* ===================== Кнопка «+» в мобильной навигации ===================== */
.mnav-fab { display: none; }
.profile-mobile-top { display: none; }

/* ===================== Мобильные доработки: комнаты, создание, комната ===================== */
@media (max-width: 900px) {
  /* Гард от горизонтального переполнения (из-за него «прыгал» масштаб при поиске) */
  html, body { overflow-x: hidden; }
  #app, .page, .rooms-wrap, .create-wrap { max-width: 100%; overflow-x: hidden; }

  /* Круглая кнопка «+» по центру нижней панели */
  .mobile-nav { align-items: center; }
  .mnav-fab {
    display: inline-flex; align-items: center; justify-content: center;
    flex: 0 0 auto; width: 56px; height: 56px; margin: -24px 8px 0; align-self: center;
    border: none; border-radius: 50%; background: var(--accent-fill); color: #fff;
    box-shadow: 0 8px 20px rgba(0,0,0,.35); cursor: pointer;
  }
  .mnav-fab svg { width: 24px; height: 24px; }

  /* Создание, только через «+»/верхнее меню; в списке комнат кнопку прячем */
  .rooms-create-btn { display: none; }
  /* Пустую карточку-подсказку в списке на мобиле убираем, есть «+» */
  .rc-empty { display: none; }

  /* Активные комнаты: постеры компактнее, три в ряд */
  .rooms-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .rc-body { padding: 8px 8px 12px; }
  .rc-title { font-size: 13px; margin-bottom: 4px; line-height: 16px; min-height: 32px; }
  .rc-host, .rc-room-name { font-size: 11px; }
  .rc-host { margin-top: auto; margin-bottom: 8px; }
  .rc-meta { font-size: 11px; margin-bottom: 0; }
  #my-rooms.rooms-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  /* Создание на своей странице, на всю ширину */
  .create-wrap { padding: 16px; }
  .create-wrap .create-card { padding: 16px; }

  /* ---- Комната: минимальная шапка (назад · заголовок+подзаголовок · 2 иконки) ---- */
  .watch-header { gap: 8px; padding: 8px 12px; }
  .watch-back { display: inline-flex; }
  .watch-header .brand { display: none; }
  .watch-header .watch-title { font-size: 15px; }
  .watch-sub { display: block; }
  .watch-header .btn-lbl { display: none; }
  .watch-header .btn { width: 36px; height: 36px; padding: 0; border-radius: 10px; justify-content: center; }
  .watch-header .btn .icon { width: 18px; height: 18px; }
  .watch-header #btn-leave,
  .watch-header #btn-close,
  .watch-header #header-avatar { display: none; }

  /* ---- Только мобила: кнопки управления перенесены JS в ряд вкладок, панель очереди скрыта ---- */
  .card.queue { display: none; }
  .chat-panel { min-width: 0; }
  .chat-tabs { gap: 8px; padding: 2px 8px; overflow-x: auto; scrollbar-width: none; }
  .chat-tabs::-webkit-scrollbar { display: none; }
  .chat-tabs .chat-tab { font-size: 14px; padding: 12px 0; }
  .chat-tabs-sp { flex: 1; }
  .chat-tabs .q-add { flex-shrink: 0; margin: 0; display: inline-flex; align-items: center; gap: 4px; background: var(--panel-2); border: 1px solid var(--border); color: var(--text); font-weight: 500; font-size: 12px; padding: 8px 8px; border-radius: 8px; }
  .chat-tabs .q-add .icon { width: 16px; height: 16px; }
  .chat-tabs .q-add.sync-mobile { width: 32px; height: 32px; padding: 0; border-radius: 50%; justify-content: center; background: var(--panel-2); border-color: var(--border); color: var(--text); }
  .chat-tabs .q-add.sync-mobile .q-lbl { display: none; }
  .chat-tabs .q-add.sync-mobile .icon { width: 18px; height: 18px; }

  /* ---- Чат без «окна»: заподлицо, участники-бар скрыт, сообщения пузырями ---- */
  .chat-panel { background: transparent; border-top: none; }
  .participants-bar { display: none; }
  .chat-input-row .gif-btn { order: -1; }
  .messages .m-body { display: flex; flex-direction: column; align-items: flex-start; }
  .messages .m-text { display: inline-block; background: var(--panel-2); padding: 8px 12px; border-radius: 4px 14px 14px 14px; max-width: 100%; }
  .messages .msg.mine { flex-direction: row-reverse; }
  .messages .msg.mine > a { display: none; }
  .messages .msg.mine .m-body { align-items: flex-end; }
  .messages .msg.mine .m-head { display: none; }
  .messages .msg.mine .m-text { background: var(--accent-fill); color: #fff; border-radius: 14px 4px 14px 14px; }

  .player-box { height: 30vh; height: 30dvh; }

  /* ---- Профиль: шапка (назад + меню) поверх обложки, без топбара ---- */
  body:has(.profile-wrap) .topbar { display: none; }
  .profile-mobile-top { display: flex; align-items: center; justify-content: space-between; position: absolute; top: 0; left: 0; right: 0; z-index: 20; padding: 12px 16px calc(12px + env(safe-area-inset-top, 0px)); }
  .pm-btn { width: 40px; height: 40px; border-radius: 12px; border: none; background: rgba(14,14,15,.5); backdrop-filter: blur(8px); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
  .pm-btn .icon { width: 20px; height: 20px; }
  .pm-menu-wrap { position: relative; }
  #pm-menu-list { position: absolute; right: 0; top: 46px; z-index: 30; }
  .cover { height: 168px; border-radius: 0 0 16px 16px; }
  .profile-wrap { display: flex; flex-direction: column; align-items: stretch; padding-left: 16px; padding-right: 16px; }
  .avatar.xl { width: 96px; height: 96px; border-radius: 50%; }
  .profile-header { margin-top: -44px; }
  .ph-name-row { font-size: 22px; }
  .stats { gap: 12px; justify-content: space-between; }
  .stats .stat { font-size: 13px; }

  /* Подарки / «сейчас смотрит» / история, показываем инлайн (в колонке скрыты были) */
  .profile-full { order: 0; }
  #p-side { display: flex; order: 1; position: static; top: auto; margin-top: 4px; }
  #p-side:empty { display: none; }
  .profile-wrap > div:not(.profile-full) { order: 2; }
  .gift-item { font-size: 30px; }
}

/* ЛС на мобиле: переопределяем ПОСЛЕ базового .dm-wrap (строка ~750), иначе базовый
   grid «300px 1fr» перебивает мобильный «1fr», и чат/список занимают лишь узкую колонку. */
@media (max-width: 900px) {
  .dm-wrap { grid-template-columns: 1fr; max-width: none; margin: 0; gap: 0; padding: 0 0 calc(56px + env(safe-area-inset-bottom, 0px)); height: 100dvh; }
  .dm-list { padding: 0; }
}

/* Мобильные фиксы: без зума при фокусе на поле + скролл меню плеера */
@media (max-width: 900px) {
  /* iOS зумит поле, если шрифт < 16px, задаём 16px всем полям ввода */
  input, textarea, select { font-size: 16px; }
  /* Меню плеера («Плеер»): фиксированная панель снизу, полностью скроллится, не обрезается сверху */
  .settings-menu { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); top: auto; min-width: 0; max-height: 60vh; }
}

/* ===================== Рулетка фильмов ===================== */
.rooms-head-btns { display: flex; gap: 12px; align-items: center; }
.roulette-nav-btn { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; }
.catalog-wrap { max-width: 1320px; margin: 0 auto; padding: 28px 24px 64px; }
.cat-pagehead { margin-bottom: 24px; }
.cat-pagehead h1 { font-size: 30px; letter-spacing: -.01em; }
.cat-pagehead .sub { color: var(--muted); margin-top: 8px; font-size: 15px; }

/* Рулетка: компактный модуль «что посмотреть» */
.roul-card { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 20px; margin-bottom: 36px; }
.roul-card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.roul-card-title { font-size: 17px; font-weight: 500; margin-bottom: 2px; }
.roulette-window { position: relative; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-2); padding: 16px 0; }
.roulette-reel { display: flex; gap: 12px; padding: 0 12px; will-change: transform; }
.roul-item { flex: 0 0 auto; width: 120px; }
.roul-poster { width: 120px; height: 180px; border-radius: 8px; background-size: cover; background-position: center; background-color: var(--panel-2); }
.roul-cap { margin-top: 8px; font-size: 12px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.roul-item.win .roul-poster { outline: 3px solid var(--accent); outline-offset: 1px; }
.roul-item.win .roul-cap { color: var(--text); font-weight: 500; }
.roulette-marker { position: absolute; top: 8px; bottom: 8px; left: 50%; width: 3px; transform: translateX(-50%); background: var(--accent); z-index: 2; border-radius: 3px; pointer-events: none; }
.roulette-marker::before, .roulette-marker::after { content: ''; position: absolute; left: 50%; transform: translateX(-50%); border: 7px solid transparent; }
.roulette-marker::before { top: -9px; border-top-color: var(--accent); }
.roulette-marker::after { bottom: -9px; border-bottom-color: var(--accent); }
.roul-loading { padding: 64px 16px; text-align: center; color: var(--muted); width: 100%; }
.roul-spin-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 160px; font-size: 15px; padding: 12px 24px; flex-shrink: 0; }
.roul-spin-btn:disabled { opacity: .55; cursor: default; }
.roulette-result { margin-top: 16px; }
.roul-res-card { display: flex; gap: 16px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.roul-res-poster { flex: 0 0 auto; width: 120px; height: 180px; border-radius: 8px; background-size: cover; background-position: center; background-color: var(--panel-2); }
.roul-res-info { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.roul-res-title { font-size: 20px; font-weight: 500; }
.roul-res-orig { font-size: 14px; font-weight: 500; color: var(--muted); }
.roul-res-meta { color: var(--muted); margin: 8px 0 12px; }
.roul-res-over { color: var(--muted); font-size: 14px; line-height: 1.45; margin-bottom: 16px; }
.roul-res-info .btn { margin-top: auto; align-self: flex-start; }

/* Тулбар фильтров + сетка постеров */
.catalog-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; position: sticky; top: 64px; z-index: 20; background: var(--bg); padding: 12px 0; }
.cat-selects { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cat-select { background: var(--panel-2); border: 1px solid var(--border); color: var(--text); padding: 8px 12px; line-height: 18px; border-radius: 10px; font-size: 14px; cursor: pointer; outline: none; }
.cat-select:focus { border-color: var(--accent); }
.cat-type button { padding: 8px 16px; }
.catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 20px; }
.cat-card { text-align: left; background: none; border: none; padding: 0; cursor: pointer; color: var(--text); }
.cat-poster { position: relative; aspect-ratio: 2/3; border-radius: 12px; background-size: cover; background-position: center; background-color: var(--panel-2); border: 1px solid var(--border); transition: transform .18s var(--ease), border-color .18s var(--ease); }
.cat-card:hover .cat-poster { transform: translateY(-2px); border-color: var(--border-2); }
.cat-card:active .cat-poster { transform: translateY(-1px); }
.cat-rating { position: absolute; top: 8px; right: 8px; background: rgba(8,8,10,.8); color: #f2c14e; font-size: 12px; font-weight: 500; padding: 4px 8px; border-radius: 6px; font-variant-numeric: tabular-nums; }
.cat-cap { font-weight: 500; font-size: 14px; margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-sub { color: var(--muted); font-size: 12px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.cat-msg { grid-column: 1 / -1; padding: 40px 16px; text-align: center; color: var(--muted); }
.catalog-more { text-align: center; margin-top: 24px; }
.catalog-more .btn { min-width: 180px; justify-content: center; }

@media (max-width: 900px) {
  .catalog-wrap { padding: 16px 16px 40px; }
  .cat-pagehead h1 { font-size: 24px; }
  .roul-card { padding: 16px; margin-bottom: 24px; }
  .roul-spin-btn { width: 100%; }
  .roul-item { width: 104px; }
  .roul-poster { width: 104px; height: 156px; }
  .roul-res-card { flex-direction: column; align-items: center; text-align: center; }
  .roul-res-poster { width: 144px; height: 216px; }
  .roul-res-info { align-items: center; }
  .roul-res-info .btn { align-self: stretch; justify-content: center; }
  .catalog-toolbar { position: static; }
  .catalog-toolbar .cat-type { width: 100%; }
  .cat-selects { width: 100%; }
  .cat-select { flex: 1; min-width: 0; }
  .catalog-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .cat-cap { font-size: 13px; }
}

/* ===================== Карточка фильма (модалка) + отзывы ===================== */
.film-modal { width: 720px; padding: 0; overflow-x: hidden; overflow-y: auto; position: relative; }
.film-modal .modal-x { position: sticky; top: 12px; display: block; width: 32px; height: 32px; margin: 12px 12px -44px auto; align-items: center; justify-content: center; background: rgba(14,14,15,.6); color: #fff; backdrop-filter: blur(4px); z-index: 5; }
.film-modal .modal-x .icon { display: block; margin: auto; }
.film-hero { position: relative; display: flex; gap: 20px; padding: 24px; background-size: cover; background-position: center; background-color: #19191b; }
.film-hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(14,14,15,.62), rgba(14,14,15,.93)); z-index: 0; }
.film-hero > * { position: relative; z-index: 1; }
.film-poster { flex: 0 0 auto; width: 128px; height: 192px; border-radius: 12px; background-size: cover; background-position: center; background-color: var(--panel-2); box-shadow: 0 8px 26px rgba(0,0,0,.5); }
.film-hero-info { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.film-title { font-size: 24px; font-weight: 600; color: #fff; line-height: 1.15; }
.film-orig { color: rgba(255,255,255,.7); font-size: 14px; margin-top: 4px; }
.film-meta { color: rgba(255,255,255,.86); font-size: 13px; margin-top: 8px; }
.film-genres { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.film-genre { background: rgba(255,255,255,.15); color: #fff; font-size: 12px; padding: 4px 8px; border-radius: 6px; }
.film-hero-info .btn { margin-top: auto; align-self: flex-start; }
.film-body { padding: 20px 24px 24px; }
.film-tagline { color: var(--muted); margin-bottom: 8px; }
.film-tagline:empty { display: none; }
.film-overview { color: var(--text); line-height: 1.5; font-size: 15px; }
.film-reviews { margin-top: 24px; border-top: 1px solid var(--border); padding-top: 16px; }
.film-reviews-head { font-size: 18px; font-weight: 500; margin-bottom: 16px; }
.film-review-form { background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin-bottom: 16px; }
.film-rate { display: flex; align-items: center; flex-wrap: wrap; gap: 1px; margin-bottom: 12px; }
.film-rate-lbl { font-size: 13px; color: var(--muted); margin-right: 8px; }
.film-rate .star { background: none; border: none; color: var(--border-2); font-size: 20px; cursor: pointer; padding: 0 1px; line-height: 1; }
.film-rate .star.on, .film-rate .star:hover { color: var(--gold); }
.film-rate-val { font-size: 13px; color: var(--muted); margin-left: 8px; }
.film-review-form textarea { min-height: 64px; }
.film-review-form .btn { margin-top: 12px; }
.film-rev-list { display: flex; flex-direction: column; gap: 16px; }
.film-rev { display: flex; gap: 12px; }
.film-rev .rev-body { min-width: 0; flex: 1; }
.rev-head { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.rev-name { font-weight: 500; color: var(--text); }
.rev-rating { color: var(--gold); font-weight: 500; font-size: 12px; }
.rev-time { color: var(--muted-2); }
.rev-del { background: none; border: none; color: var(--muted-2); cursor: pointer; margin-left: auto; padding: 2px; display: inline-flex; }
.rev-del:hover { color: var(--red); }
.rev-del svg { width: 14px; height: 14px; }
.rev-text { margin-top: 4px; line-height: 1.4; word-break: break-word; }

@media (max-width: 900px) {
  .film-modal { width: 100%; }
  .film-hero { flex-direction: column; align-items: center; text-align: center; padding: 20px 16px; }
  .film-poster { width: 120px; height: 180px; }
  .film-hero-info { align-items: center; }
  .film-hero-info .btn { align-self: stretch; justify-content: center; }
  .film-genres { justify-content: center; }
  .film-title { font-size: 21px; }
  .film-body { padding: 16px; }
}

/* ===================== Страницы документов: обратная связь, правообладателям, соглашение, правила ===================== */
.doc-wrap { max-width: 1040px; margin: 0 auto; padding: 40px 24px 64px; display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 48px; align-items: start; }
.doc-nav { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 2px; }
.doc-nav .label { padding: 0 12px; margin-bottom: 8px; }
.doc { max-width: 720px; min-width: 0; }
.doc h1 { font-size: 32px; line-height: 40px; }
.doc-lead { margin-top: 12px; font-size: 17px; line-height: 26px; color: var(--muted); }
.doc-meta { margin-top: 8px; font-size: 12px; line-height: 16px; color: var(--muted-2); }
.doc section { margin-top: 40px; }
.doc h2 { font-size: 18px; line-height: 24px; margin-bottom: 12px; }
.doc p, .doc li { font-size: 15px; line-height: 24px; }
.doc p + p { margin-top: 12px; }
.doc ul, .doc ol { margin-top: 8px; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.doc li::marker { color: var(--muted-2); }
.doc b { font-weight: 600; }
.doc a:not(.btn) { color: var(--accent-2); text-decoration: underline; text-underline-offset: 2px; }
.doc-missing { color: var(--muted-2); border-bottom: 1px dashed var(--border-2); }
/* Нумерация пунктов «1.1, 1.2» в юридических документах */
.doc-numbered { counter-reset: sec; }
.doc-numbered section { counter-increment: sec; }
.doc-numbered h2::before { content: counter(sec) ". "; color: var(--muted-2); }
.doc-numbered ol.points { counter-reset: pt; list-style: none; padding-left: 0; }
.doc-numbered ol.points > li { counter-increment: pt; position: relative; padding-left: 40px; }
.doc-numbered ol.points > li::before { content: counter(sec) "." counter(pt); position: absolute; left: 0; color: var(--muted-2); font-variant-numeric: tabular-nums; }
/* Форма обратной связи */
.doc-form { margin-top: 24px; padding: 20px; }
.doc-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.doc-form select { width: 100%; height: 44px; padding: 0 12px; }
.doc-form textarea { min-height: 144px; }
.doc-form-foot { display: flex; align-items: center; gap: 16px; }
.doc-error { color: var(--red); font-size: 14px; }
.doc-form h2 { margin-bottom: 8px; }
.doc-footer { max-width: 1040px; margin: 0 auto; padding: 24px; border-top: 1px solid var(--border); color: var(--muted-2); font-size: 12px; }
@media (max-width: 900px) {
  .doc-wrap { grid-template-columns: 1fr; gap: 24px; padding: 20px 16px 48px; }
  .doc-nav { position: static; flex-direction: row; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
  .doc-nav::-webkit-scrollbar { display: none; }
  .doc-nav .label { display: none; }
  .doc-nav .sec-item { width: auto; flex: 0 0 auto; white-space: nowrap; border: 1px solid var(--border); }
  .doc h1 { font-size: 26px; line-height: 32px; }
  .doc-form-row { grid-template-columns: 1fr; gap: 0; }
  .doc-footer { padding: 24px 16px; }
}

/* Картинки в комментариях */
.comment-form .c-img-btn.on { color: var(--accent-2); border-color: var(--accent); background: var(--accent-dim); }
.c-attach { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.c-attach img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.c-attach .clear-img { margin: 0; }
.c-img { display: block; margin-top: 8px; width: fit-content; }
.c-img img { display: block; max-width: min(100%, 280px); max-height: 280px; border-radius: 8px; border: 1px solid var(--border); }
