:root {
  --bg: #161719;
  --panel: #202124;
  --panel-2: #2a2b2f;
  --panel-3: #34363b;
  --card: var(--panel);
  --ok: var(--acc);
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .12);
  --ink: #ededef;
  --muted: #a3a5ab;
  --faint: #6f7178;
  --acc: #3dd9c1;
  --acc-2: #5fe6d1;
  --acc-ink: #04221d;
  --acc-soft: rgba(61, 217, 193, .14);
  --warn: #f0c35a;
  --err: #ff7676;

  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 24px;

  --font: 'Golos Text', system-ui, sans-serif;
  --serif: var(--font);
  --gutter: 16px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 15px/1.5 var(--font); overflow-x: clip; min-height: 100dvh;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--acc); color: var(--acc-ink); }

.mono { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.hidden { display: none !important; }

/* Кнопки и поля */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 44px; padding: 0 18px; border-radius: 22px;
  background: var(--acc); color: var(--acc-ink); font-weight: 700; white-space: nowrap;
  transition: background .2s, transform .12s, opacity .2s;
}
.btn:hover { background: var(--acc-2); }
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.ghost { background: var(--panel-2); color: var(--ink); }
.btn.ghost:hover { background: var(--panel-3); }
.btn.sm { height: 36px; padding: 0 14px; border-radius: 18px; font-size: 13.5px; }
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; position: relative;
  height: 36px; padding: 0 14px; border-radius: 18px; flex: none;
  background: rgba(32, 33, 36, .86); color: var(--ink); font-weight: 600; font-size: 13.5px; white-space: nowrap;
  border: 1px solid var(--line); transition: background .2s, transform .12s;
}
.pill:hover { background: var(--panel-2); }
.pill:active { transform: scale(.96); }
.pill .dot { position: absolute; top: -2px; right: -2px; width: 10px; height: 10px; border-radius: 50%; background: var(--acc); border: 2px solid var(--bg); }
.icon-btn {
  width: 40px; height: 40px; border-radius: 20px; display: grid; place-items: center; flex: none;
  color: var(--muted); transition: background .2s, color .2s, transform .12s;
}
.icon-btn:hover { background: var(--panel-2); color: var(--ink); }
.icon-btn:active { transform: scale(.93); }
.icon-btn svg { width: 20px; height: 20px; }
.text-btn { color: var(--muted); font-size: 14px; font-weight: 600; padding: 6px 0; }
.text-btn:hover { color: var(--acc); }

.field {
  width: 100%; height: 44px; padding: 0 16px; border-radius: 22px;
  background: var(--panel-2); border: 1px solid transparent; outline: none;
  transition: border-color .2s, background .2s;
}
.field::placeholder { color: var(--faint); }
.field:focus { border-color: var(--acc); background: var(--panel); }

.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 19px; letter-spacing: -.02em; }
.brand svg { width: 26px; height: 26px; color: var(--acc); }

.label { font-size: 12.5px; color: var(--faint); margin: 0 0 8px; font-weight: 600; }
.note { font-size: 13.5px; color: var(--faint); margin: 10px 0 0; }
.err { color: var(--err); font-size: 14px; margin: 10px 0 0; }

.list { display: grid; gap: 6px; }
.row { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: var(--r-sm); background: var(--panel); transition: background .2s; min-width: 0; }
a.row:hover { background: var(--panel-2); }
.row .thumb { width: 64px; height: 40px; border-radius: 9px; background: var(--panel-2) center/cover; flex: none; }
.row .info { flex: 1; min-width: 0; display: block; }
.row .info b { display: block; font-size: 14.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .info span { display: block; font-size: 12.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row > .mono { font-size: 12.5px; color: var(--faint); padding-right: 6px; }

.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--ink); background: var(--panel-3) !important; flex: none; }

.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--panel-3); border-top-color: var(--acc); animation: spin .8s linear infinite; margin: 28px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(10px); } }

.toast {
  position: fixed; left: 50%; top: calc(58px + var(--safe-t)); z-index: 40;
  transform: translate(-50%, -10px); opacity: 0; pointer-events: none;
  padding: 9px 14px; border-radius: 18px; background: var(--panel-2); border: 1px solid var(--line);
  font-size: 13.5px; max-width: calc(100vw - 32px); box-shadow: 0 12px 30px rgba(0,0,0,.45);
  transition: transform .3s var(--ease), opacity .2s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ===== Главная ===== */
.home { min-height: 100dvh; display: flex; flex-direction: column; padding: 0 var(--gutter); }
.home-nav, .home-main, .home-foot { width: 100%; max-width: 520px; margin: 0 auto; }
.home-nav { height: 64px; display: flex; align-items: center; }
.home-main { flex: 1; padding: 12vh 0 40px; }
.home-main h1 { font-weight: 800; font-size: clamp(36px, 10vw, 52px); line-height: 1.03; letter-spacing: -.035em; margin: 0; }
.home-main h1 em { font-style: normal; color: var(--acc); }
.home-main .lead { color: var(--muted); margin: 14px 0 28px; font-size: 16px; }
.start { display: flex; gap: 8px; }
.start .field { flex: 1; min-width: 0; height: 52px; border-radius: 26px; font-size: 16px; padding: 0 20px; }
.start .btn { height: 52px; border-radius: 26px; padding: 0 22px; }
#joinToggle, #join { margin-top: 12px; }
.recent { margin-top: 48px; }
.home-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 20px 0 calc(20px + var(--safe-b)); border-top: 1px solid var(--line); color: var(--faint); font-size: 13px; }
.home-foot a { color: var(--muted); }
.home-foot a:hover { color: var(--acc); }

/* Для страницы проверки связи */
.wrap { max-width: 720px; margin: 0 auto; padding: 0 var(--gutter); }
.nav { height: 64px; display: flex; align-items: center; }

/* ===== Зал: видео на весь экран, лица справа ===== */
.room { position: fixed; inset: 0; background: #000; overflow: hidden; }
.stage { position: absolute; inset: 0; }
.stage iframe, .stage video, .stage .player { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.stage video { object-fit: contain; }
.empty-stage { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px 80px 24px 24px; background: radial-gradient(ellipse at 50% 55%, rgba(61,217,193,.12), transparent 60%), var(--bg); }
.empty-stage h2 { font-size: 26px; font-weight: 800; letter-spacing: -.03em; margin: 0 0 6px; }
.empty-stage p { margin: 0 auto 18px; color: var(--muted); max-width: 280px; font-size: 14.5px; }
.stage-overlay { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; text-align: center; padding: 20px 80px 20px 20px; background: rgba(12,12,14,.78); }
.stage-overlay p { margin: 12px auto 0; font-size: 14px; color: var(--muted); max-width: 300px; }
.stage-hint { position: absolute; left: 50%; top: calc(64px + var(--safe-t)); transform: translateX(-50%); z-index: 6; width: max-content; max-width: calc(100vw - 32px); padding: 9px 14px; border-radius: 18px; background: var(--panel-2); font-size: 13px; pointer-events: none; animation: fadeIn .3s; }

/* Поверх видео: события проходят к плееру везде, кроме самих кнопок */
.ov, .faces { position: absolute; z-index: 5; pointer-events: none; }
.ov > *, .faces > * { pointer-events: auto; }

.top-ov { left: 0; right: 0; top: 0; padding: calc(12px + var(--safe-t)) 12px 12px; display: flex; align-items: center; gap: 10px;
  background: linear-gradient(180deg, rgba(0,0,0,.55), transparent); }
.rt { flex: 1; min-width: 0; text-align: center; pointer-events: none; }
.rt b { display: block; font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: auto; cursor: text; text-shadow: 0 1px 8px rgba(0,0,0,.5); }
.rt > span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.conn-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); flex: none; }
.conn-dot.on { background: var(--acc); }
.conn-dot.bad { background: var(--warn); }

.faces { right: calc(12px + var(--safe-r)); top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: flex-end; gap: 14px; }
.face { display: flex; align-items: center; gap: 8px; max-width: 76vw; }
.face .av {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: rgba(42, 43, 47, .9); border: 1px solid var(--line-2); font-weight: 700; font-size: 15px; color: var(--ink);
  transition: box-shadow .25s;
}
.face.me .av { background: var(--ink); color: var(--bg); border-color: transparent; }
.face.talk .av { box-shadow: 0 0 0 2px #000, 0 0 0 4px var(--acc); }
.face .av.invite { background: transparent; border: 1.5px dashed rgba(255,255,255,.35); color: var(--muted); font-size: 20px; font-weight: 500; }
.face .av.invite:hover { border-color: var(--acc); color: var(--acc); }
.face .av.more { font-size: 13px; color: var(--muted); }
.bub {
  padding: 7px 12px; border-radius: 16px 16px 4px 16px; background: var(--panel-2); border: 1px solid var(--line);
  font-size: 13.5px; line-height: 1.35; max-width: 220px; animation: slideIn .25s var(--ease);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
}

.bottom-ov { left: 0; right: 0; bottom: 0; padding: 40px 12px calc(12px + var(--safe-b)); background: linear-gradient(0deg, rgba(0,0,0,.75), rgba(0,0,0,.4) 60%, transparent); }
.np { padding: 0 4px; margin-bottom: 8px; min-width: 0; }
.np b { display: block; font-size: 21px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np > span { display: flex; gap: 8px; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.sync { display: inline-flex; align-items: center; gap: 5px; flex: none; color: var(--acc); font-weight: 600; }
.sync i { width: 6px; height: 6px; border-radius: 50%; background: var(--acc); }
.sync.lag { color: var(--warn); }
.sync.lag i { background: var(--warn); }
.prog { display: flex; align-items: center; gap: 10px; padding: 4px 4px 10px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.prog .bar { flex: 1; height: 18px; display: flex; align-items: center; cursor: pointer; position: relative; }
.prog .bar::before { content: ''; position: absolute; left: 0; right: 0; height: 3px; border-radius: 3px; background: rgba(255,255,255,.22); }
.prog .bar i { position: relative; height: 3px; border-radius: 3px; background: var(--acc); width: 0; }
.prog .bar i::after { content: ''; position: absolute; right: -6px; top: -4.5px; width: 12px; height: 12px; border-radius: 50%; background: var(--acc); }
.say { display: flex; gap: 8px; align-items: center; }
.say .field { flex: 1; min-width: 0; background: rgba(42, 43, 47, .92); }
.say .btn { flex: none; }
.say .pill { height: 44px; border-radius: 22px; padding: 0 16px; }

/* Телефон боком и широкий экран: всё компактно, низ свободен для полосы плеера */
@media (orientation: landscape) {
  .top-ov { padding-right: calc(12px + var(--safe-r)); }
  .bottom-ov { left: auto; right: calc(12px + var(--safe-r)); top: calc(12px + var(--safe-t)); bottom: auto; padding: 0; background: none; width: min(46vw, 420px); }
  .bottom-ov .np, .bottom-ov .prog { display: none; }
  .top-ov { padding-right: calc(min(46vw, 420px) + 24px); }
  .faces { top: auto; bottom: 64px; transform: none; gap: 10px; }
  .face .av { width: 40px; height: 40px; font-size: 14px; }
  .say .field { height: 36px; }
  .say .btn, .say .pill { height: 36px; }
  .rt { text-align: left; }
  .empty-stage, .stage-overlay { padding-right: 90px; }
}

/* ===== Шторка ===== */
.sheet-back { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.55); opacity: 0; transition: opacity .25s; }
.sheet-back.open { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; max-height: 88dvh; display: flex; flex-direction: column;
  background: var(--bg); border-radius: var(--r-lg) var(--r-lg) 0 0; border-top: 1px solid var(--line);
  transform: translateY(100%); transition: transform .35s var(--ease);
}
.sheet.open { transform: none; }
.sheet .grab { width: 40px; height: 4px; border-radius: 4px; background: var(--panel-3); margin: 8px auto 0; flex: none; }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 8px 8px 0 var(--gutter); flex: none; }
.sheet-head h3 { flex: 1; min-width: 0; margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-tabs { display: flex; gap: 4px; padding: 10px var(--gutter) 0; flex: none; overflow-x: auto; scrollbar-width: none; }
.sheet-body { flex: 1; overflow-y: auto; padding: 14px var(--gutter) calc(20px + var(--safe-b)); overscroll-behavior: contain; }
@media (min-width: 720px) {
  .sheet { left: 50%; right: auto; top: 50%; bottom: auto; width: min(600px, calc(100vw - 40px)); max-height: 84dvh; border-radius: var(--r-lg); border: 1px solid var(--line); transform: translate(-50%, -47%); opacity: 0; pointer-events: none; transition: transform .3s var(--ease), opacity .2s; }
  .sheet.open { transform: translate(-50%, -50%); opacity: 1; pointer-events: auto; }
  .sheet .grab { display: none; }
  .sheet-head { padding-top: 14px; }
}
.tab { height: 34px; padding: 0 14px; border-radius: 17px; color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap; background: var(--panel); transition: color .2s, background .2s; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { background: var(--acc); color: var(--acc-ink); }

.msgs { display: flex; flex-direction: column; gap: 12px; padding-bottom: 8px; }
.msg { display: flex; gap: 10px; animation: fadeIn .2s; }
.msg .body { min-width: 0; }
.msg .who { display: flex; gap: 8px; align-items: baseline; font-size: 13px; font-weight: 700; }
.msg .who time { font-size: 11.5px; font-weight: 400; color: var(--faint); }
.msg .text { overflow-wrap: anywhere; }
.msg.sys { justify-content: center; font-size: 12.5px; color: var(--faint); }
.empty-note { color: var(--faint); font-size: 14px; text-align: center; padding: 28px 0; }
.sheet-say { position: sticky; bottom: calc(-20px - var(--safe-b)); display: flex; gap: 8px; padding: 10px 0 0; background: var(--bg); }
.sheet-say .field { flex: 1; min-width: 0; }

.input-row { display: flex; gap: 8px; }
.input-row .field { flex: 1; min-width: 0; }
.stack { display: grid; gap: 10px; }
.tag { font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 10px; background: rgba(22,23,25,.88); }

.preview { margin-top: 14px; border-radius: var(--r-md); overflow: hidden; background: var(--panel); animation: fadeIn .25s; }
.preview .pv-img { aspect-ratio: 16 / 9; background: var(--panel-2) center/cover; position: relative; }
.preview .pv-img .tag { position: absolute; left: 10px; top: 10px; }
.preview .pv-body { padding: 12px 14px 14px; }
.preview .pv-body b { display: block; font-weight: 700; }
.preview .pv-body span { font-size: 13px; color: var(--faint); }
.preview .pv-actions { display: flex; gap: 8px; margin-top: 12px; }
.preview .pv-actions .btn { flex: 1; }

.posters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 10px; margin-top: 14px; }
@media (min-width: 560px) { .posters { grid-template-columns: repeat(4, 1fr); } }
.poster { text-align: left; min-width: 0; animation: fadeIn .3s both; }
.poster .pimg { position: relative; aspect-ratio: 2 / 3; border-radius: 12px; background: var(--panel-2) center/cover; overflow: hidden; transition: transform .2s var(--ease); }
.poster:hover .pimg { transform: translateY(-2px); }
.poster .noimg { position: absolute; inset: 0; display: grid; place-items: center; padding: 8px; text-align: center; font-size: 12.5px; font-weight: 700; color: var(--faint); }
.poster .rating { position: absolute; right: 5px; top: 5px; font-size: 11px; font-weight: 700; padding: 3px 6px; border-radius: 8px; background: var(--acc); color: var(--acc-ink); }
.poster b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; font-weight: 700; line-height: 1.25; margin-top: 6px; }
.poster span { font-size: 12px; color: var(--faint); }

.movie { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: start; }
.movie .pimg { aspect-ratio: 2 / 3; border-radius: 12px; background: var(--panel-2) center/cover; }
.movie h4 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.movie .meta { color: var(--faint); font-size: 13px; margin-top: 4px; }
.movie p { color: var(--muted); font-size: 13.5px; margin: 8px 0 0; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.sheet-body .label { margin-top: 18px; }
.streams { display: grid; gap: 6px; }
.stream { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 14px; border-radius: var(--r-sm); background: var(--panel); }
.stream .info { flex: 1; min-width: 0; }
.stream .info b { display: block; font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stream .info span { font-size: 12.5px; color: var(--faint); }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--panel); }
.switch b { display: block; font-weight: 700; font-size: 14.5px; }
.switch span { font-size: 12.5px; color: var(--faint); }
.toggle { width: 46px; height: 28px; border-radius: 14px; background: var(--panel-3); position: relative; flex: none; transition: background .2s; }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--muted); transition: transform .25s var(--ease), background .2s; }
.toggle[aria-checked="true"] { background: var(--acc); }
.toggle[aria-checked="true"]::after { transform: translateX(18px); background: var(--acc-ink); }

/* Вход в зал */
.gate { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: var(--gutter); background: var(--bg); }
.gate-card { width: min(400px, 100%); animation: fadeIn .3s; }
.gate-card h2 { margin: 26px 0 6px; font-size: 30px; font-weight: 800; letter-spacing: -.035em; line-height: 1.1; }
.gate-card p { margin: 0 0 20px; color: var(--muted); }
.gate-card .btn { width: 100%; margin-top: 10px; height: 52px; border-radius: 26px; }
.gate-card .field { height: 52px; border-radius: 26px; font-size: 16px; padding: 0 20px; }
.gate-card .pv { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: var(--r-sm); background: var(--panel); margin-bottom: 16px; }
.gate-card .pv .thumb { width: 64px; height: 40px; border-radius: 9px; background: var(--panel-2) center/cover; flex: none; }
.gate-card .pv b { display: block; font-size: 14px; }
.gate-card .pv span { font-size: 12.5px; color: var(--faint); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Вертикально: видео полосой по центру, родные кнопки плеера ничем не закрыты */
.room { background: var(--bg); }
@media (orientation: portrait) {
  .stage { top: calc(46% - 28.125vw); bottom: auto; height: 56.25vw; }
  .empty-stage { position: fixed; z-index: 1; }
  .faces { top: calc(78px + var(--safe-t)); transform: none; }
  .bottom-ov { background: linear-gradient(0deg, var(--bg) 70%, transparent); }
  .top-ov { background: none; }
}

/* Название и переключатель языка */
.brand { font-weight: 800; font-size: 20px; letter-spacing: -.03em; }
.home-nav { justify-content: space-between; }
.lang { display: inline-flex; padding: 3px; gap: 2px; border-radius: 18px; background: var(--panel); }
.lang button { height: 30px; min-width: 40px; padding: 0 10px; border-radius: 15px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.lang button:hover { color: var(--ink); }
.lang button[aria-pressed="true"] { background: var(--panel-3); color: var(--ink); }
.sheet-body .lang { margin-bottom: 4px; }

/* Клавиатура: страница не сжимается, над клавиатурой поднимается только панель ввода */
.empty-stage, .stage-overlay { padding-left: 64px; padding-right: 64px; }
.room { transform: translateY(var(--vv-top, 0px)); }
.bottom-ov { transform: translateY(calc(-1 * var(--kb-room, 0px))); transition: transform .15s ease-out; }
.sheet { bottom: var(--kb, 0px); max-height: calc(var(--vv-h, 100dvh) * .88); }
html.kb .faces { opacity: 0; pointer-events: none; transition: opacity .15s; }
@media (orientation: landscape) {
  .bottom-ov { transform: none; }
  .empty-stage, .stage-overlay { padding-left: 90px; padding-right: 90px; }
}

/* Без запаздывания: панель едет вместе с клавиатурой */
.bottom-ov { transition: none; }
html.vk .room { transform: none; }
html.vk .bottom-ov { transform: translateY(calc(-1 * env(keyboard-inset-height, 0px))); }
html.vk .sheet { bottom: env(keyboard-inset-height, 0px); max-height: calc((100dvh - env(keyboard-inset-height, 0px)) * .88); }
html.vk .home-foot { padding-bottom: calc(20px + env(keyboard-inset-height, 0px)); }
@media (orientation: landscape) { html.vk .bottom-ov { transform: none; } }
html.in-room, html.in-room body { overflow: hidden; overscroll-behavior: none; height: 100%; }
html.vk .gate { padding-bottom: calc(16px + env(keyboard-inset-height, 0px)); }

/* Нижние кнопки висят отдельно, без общей подложки */
.bottom-ov, html .bottom-ov { background: none; padding-top: 0; }
.np.hidden { display: none; }

/* Клавиатура открыта: видео поднимается под шапку, название прячется, поле ниже видео */
@media (orientation: portrait) {
  .stage { transition: top .2s var(--ease); }
  html.kb .stage { top: calc(72px + var(--safe-t)); }
  html.kb .np { display: none; }
}

/* Боком: режим просмотра, только видео и лица с сообщениями */
@media (orientation: landscape) {
  .top-ov, .bottom-ov, .stage-hint { display: none !important; }
  .faces { top: 50%; bottom: auto; transform: translateY(-50%); gap: 8px; }
  .face .av { width: 34px; height: 34px; font-size: 12px; opacity: .55; transition: opacity .2s; }
  .face.talk .av { opacity: 1; }
  .face:has(.invite), .face:has(.more) { display: none; }
  .bub { font-size: 12.5px; max-width: 260px; }
}

/* ===== Новинки ===== */
.news { margin-top: 44px; }
.news-head h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.news-tabs { padding: 10px 0 0; }
.news-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 12px; margin-top: 16px; }
@media (min-width: 480px) { .news-grid { grid-template-columns: repeat(3, 1fr); } }
.ncard { display: flex; flex-direction: column; gap: 4px; min-width: 0; animation: fadeIn .3s both; }
.ncard .pimg { position: relative; aspect-ratio: 2 / 3; border-radius: 14px; background: var(--panel-2) center/cover; overflow: hidden; margin-bottom: 4px; }
.ncard .pimg .noimg { position: absolute; inset: 0; display: grid; place-items: center; padding: 10px; text-align: center; font-weight: 700; font-size: 13px; color: var(--faint); }
.ncard .pimg .rating { position: absolute; right: 6px; top: 6px; font-size: 11.5px; font-weight: 800; padding: 3px 7px; border-radius: 9px; background: var(--acc); color: var(--acc-ink); }
.ncard > b { font-size: 14px; font-weight: 700; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ncard > span { font-size: 12.5px; }
.ncard .btn { margin-top: 6px; height: 36px; }
.provs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.prov { display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px 3px 3px; border-radius: 10px; background: var(--panel); font-size: 11px; color: var(--muted); }
.prov img { width: 20px; height: 20px; border-radius: 6px; }
.prov span { padding-left: 4px; font-weight: 600; color: var(--ink); }
.noprov { margin: 4px 0 0; font-size: 11.5px; color: var(--faint); line-height: 1.35; }
.news-foot { margin: 18px 0 0; font-size: 12px; color: var(--faint); }
.news-foot b { color: var(--muted); }

/* Карточка платного фильма в зале */
.film-card { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; background: var(--bg); }
.fc-bg { position: absolute; inset: -30px; background: center/cover; filter: blur(28px) brightness(.45); }
.fc-in { position: relative; text-align: center; padding: 16px 64px; max-width: 560px; }
.fc-in b { display: block; font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.fc-in p { margin: 6px 0 12px; font-size: 13px; color: var(--muted); }
.fc-provs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.fc-provs a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 5px 5px; border-radius: 16px; background: rgba(32,33,36,.9); font-size: 13px; font-weight: 600; }
.fc-provs img { width: 24px; height: 24px; border-radius: 7px; }
.fc-provs small { color: var(--muted); font-weight: 500; }

/* Вкладка «Бесплатно»: кадры 16:9 */
.news-grid.wide { grid-template-columns: repeat(2, 1fr); }
.news-grid.wide .ncard .pimg { aspect-ratio: 16 / 9; border-radius: 12px; }
