@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #0a0c11;
  --surface: #11141b;
  --surface-2: #171b24;
  --surface-3: #1e2330;
  --surface-4: #262c3b;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .12);
  --text: #eef1f7;
  --muted: #8a93a8;
  --faint: #5d6579;
  --accent: #7c6cff;
  --accent-2: #4f8cff;
  --grad: linear-gradient(135deg, #8b5cf6 0%, #6366f1 45%, #3b82f6 100%);
  --grad-soft: linear-gradient(135deg, rgba(139, 92, 246, .16), rgba(59, 130, 246, .12));
  --danger: #ff4d5e;
  --danger-soft: rgba(255, 77, 94, .14);
  --ok: #22c55e;
  --ok-soft: rgba(34, 197, 94, .14);
  --warn: #f5a524;
  --warn-soft: rgba(245, 165, 36, .14);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 40px rgba(0, 0, 0, .45);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body { font-size: 14.5px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
body.glow {
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(124, 108, 255, .18), transparent 60%),
    radial-gradient(800px 500px at 110% 0%, rgba(59, 130, 246, .12), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
a { color: #a99dff; text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 12px; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 26px; } h2 { font-size: 20px; } h3 { font-size: 16px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.nowrap { flex-wrap: nowrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 14px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; background: var(--surface-3); padding: 2px 6px; border-radius: 6px; }

/* ---------- Иконки (SVG как маска, цвет = currentColor) ---------- */
.i { display: inline-block; width: 20px; height: 20px; flex: none; background: currentColor;
  -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat; }
.i.sm { width: 16px; height: 16px; } .i.lg { width: 24px; height: 24px; } .i.xl { width: 32px; height: 32px; }

/* ---------- Формы ---------- */
input, select, textarea {
  background: var(--surface-2); color: var(--text); border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); padding: 10px 12px; font: inherit; width: 100%; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124, 108, 255, .2); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--accent); }
input[type=range] { padding: 0; accent-color: var(--accent); background: none; border: 0; box-shadow: none; }
input[type=file] { padding: 8px; }
label.field { display: block; }
label.field > span, .label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12.5px; font-weight: 500; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--surface-3); color: var(--text); border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); padding: 9px 14px; font: inherit; font-weight: 500; cursor: pointer;
  white-space: nowrap; transition: background .15s, transform .05s, border-color .15s; text-decoration: none !important;
}
.btn:hover { background: var(--surface-4); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 6px 20px rgba(99, 102, 241, .35); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { background: var(--danger-soft); border-color: rgba(255, 77, 94, .35); color: #ff8a95; }
.btn.danger:hover { background: rgba(255, 77, 94, .25); }
.btn.danger.solid { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.ok { background: var(--ok-soft); border-color: rgba(34, 197, 94, .35); color: #6ee7a0; }
.btn.ok:hover { background: rgba(34, 197, 94, .25); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn.icon { padding: 8px; }
.btn.block { width: 100%; }
.btn.lg { padding: 13px 20px; font-size: 15.5px; border-radius: 12px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card.glass { background: rgba(17, 20, 27, .72); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.card h3 { display: flex; align-items: center; gap: 8px; }
.center-page { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 20px; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--muted); }
.badge.live { background: var(--danger-soft); color: #ff8a95; }
.badge.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); animation: pulse 1.4s infinite; }
.badge.ok { background: var(--ok-soft); color: #6ee7a0; }
.badge.warn { background: var(--warn-soft); color: #fcc96b; }
.badge.accent { background: rgba(124, 108, 255, .16); color: #b8afff; }
@keyframes pulse { 50% { opacity: .35; } }

/* Переключатель */
.switch { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; cursor: pointer; user-select: none; }
.switch + .switch { border-top: 1px solid var(--line); }
.switch .txt b { display: block; font-weight: 500; }
.switch .txt span { display: block; color: var(--muted); font-size: 12.5px; }
.switch input { display: none; }
.switch .knob { width: 42px; height: 24px; border-radius: 99px; background: var(--surface-4); position: relative; flex: none; transition: .2s; }
.switch .knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.switch input:checked + .knob { background: var(--grad); }
.switch input:checked + .knob::after { left: 21px; }

/* Выбор варианта карточками */
.choice { display: grid; gap: 8px; }
.choice label { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 12px; cursor: pointer; background: var(--surface-2); transition: .15s; }
.choice label:hover { border-color: rgba(124, 108, 255, .5); }
.choice label:has(input:checked) { border-color: var(--accent); background: var(--grad-soft); }
.choice input { margin-top: 3px; }
.choice b { display: block; font-weight: 600; }
.choice span.d { display: block; color: var(--muted); font-size: 12.5px; }
.choice .inline { display: inline-flex; width: auto; padding: 4px 8px; margin: 0 4px; }

.toast-wrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: rgba(30, 35, 48, .95); backdrop-filter: blur(12px); border: 1px solid var(--line-2); padding: 11px 18px; border-radius: 12px; box-shadow: var(--shadow); animation: fadein .2s; font-weight: 500; }
@keyframes fadein { from { opacity: 0; transform: translateY(-6px); } }

.spinner { width: 44px; height: 44px; border: 4px solid var(--surface-4); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }

.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: -.02em; }
.logo .mark { width: 34px; height: 34px; border-radius: 10px; background: var(--grad); display: flex; align-items: center; justify-content: center; color: #fff; box-shadow: 0 6px 18px rgba(99, 102, 241, .4); }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .i { width: 40px; height: 40px; color: var(--faint); margin-bottom: 10px; }

/* ---------- Админка ---------- */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100%; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 20px 14px; border-right: 1px solid var(--line); background: rgba(13, 15, 21, .7); backdrop-filter: blur(20px); display: flex; flex-direction: column; gap: 6px; }
.sidebar .logo { padding: 4px 8px 18px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--muted); cursor: pointer; font-weight: 500; border: 0; background: none; font: inherit; text-align: left; width: 100%; text-decoration: none !important; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--grad-soft); color: var(--text); box-shadow: inset 0 0 0 1px rgba(124, 108, 255, .25); }
.nav-item.active .i { color: #a99dff; }
.sidebar .me { margin-top: auto; padding: 12px; border-radius: 12px; background: var(--surface-2); display: flex; align-items: center; gap: 10px; }
.sidebar .me .nm { font-weight: 600; font-size: 13.5px; }
.main-area { padding: 28px 32px 60px; max-width: 1240px; width: 100%; }
.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--muted); }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: sticky; height: auto; flex-direction: row; overflow-x: auto; padding: 10px; z-index: 20; }
  .sidebar .logo { display: none; }
  .sidebar .me { margin: 0; padding: 0 6px; background: none; }
  .sidebar .me .who { display: none; }
  .nav-item { width: auto; white-space: nowrap; }
  .main-area { padding: 20px 14px 60px; }
}

.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.span2 { grid-column: 1 / -1; }
@media (max-width: 960px) { .grid-2 { grid-template-columns: 1fr; } }

.room-card { display: flex; flex-direction: column; gap: 14px; transition: border-color .15s, transform .15s; }
.room-card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.room-card .top { display: flex; gap: 12px; align-items: flex-start; }
.room-card .ava { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--grad-soft); color: #b8afff; flex: none; }
.room-card .title { font-weight: 700; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-card .meta { display: flex; flex-wrap: wrap; gap: 6px; }
.room-card .actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { color: var(--muted); font-weight: 500; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; }
.table tr:last-child td { border-bottom: 0; }
.progress { height: 6px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: var(--grad); width: 0; transition: width .2s; }
.pb-preview { width: 100%; aspect-ratio: 16/9; background: #000; border-radius: 12px; display: block; }
.copy-box { display: flex; gap: 8px; }
.copy-box input { font-family: ui-monospace, monospace; font-size: 13px; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: 22px; font-weight: 800; }
.stat span { color: var(--muted); font-size: 12.5px; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.dropzone { border: 2px dashed var(--line-2); border-radius: 14px; padding: 26px; text-align: center; color: var(--muted); cursor: pointer; transition: .15s; display: block; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--grad-soft); color: var(--text); }
.dropzone input { display: none; }

.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.emoji-card { text-align: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 8px; }
.emoji-card img { width: 52px; height: 52px; object-fit: contain; display: block; margin: 0 auto 6px; }
.emoji-card code { display: block; font-size: 11.5px; margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; background: none; padding: 0; color: var(--muted); }

/* ---------- Списки участников (общие для админки и комнаты) ---------- */
.section-title { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 8px; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 600; }
.section-title:first-child { margin-top: 0; }
.plist { list-style: none; margin: 0; padding: 0; }
.plist li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.plist li:last-child { border-bottom: 0; }
.plist .nm { flex: 1; min-width: 0; }
.plist .nm > div:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.mini-avatar { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex: none; color: #fff; }
.icons { display: flex; gap: 6px; align-items: center; color: var(--muted); margin-top: 2px; }
.icons .off { color: var(--danger); }
.pctrl { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.pill-btn { display: inline-flex; align-items: center; gap: 4px; padding: 5px 8px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface-3); color: var(--text); cursor: pointer; font: inherit; font-size: 12px; }
.pill-btn:hover { background: var(--surface-4); }
.pill-btn.off { background: var(--danger-soft); border-color: rgba(255, 77, 94, .35); color: #ff8a95; }

/* ---------- Комната ---------- */
.prejoin { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 26px; max-width: 1040px; width: 100%; align-items: center; }
.preview { position: relative; aspect-ratio: 16/9; background: #05060a; border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); }
.preview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.preview .placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 10px; align-items: center; justify-content: center; color: var(--muted); }
.preview .controls { position: absolute; bottom: 14px; left: 0; right: 0; display: flex; gap: 12px; justify-content: center; }
.round { width: 52px; height: 52px; border-radius: 50%; border: 0; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; background: rgba(255, 255, 255, .14); color: #fff; backdrop-filter: blur(10px); transition: .15s; }
.round:hover { background: rgba(255, 255, 255, .22); }
.round.off { background: var(--danger); }
.round:disabled { opacity: .45; cursor: not-allowed; }
.level { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.level > div { height: 100%; width: 0; background: linear-gradient(90deg, #22c55e, #a3e635); transition: width .08s; }
@media (max-width: 800px) { .prejoin { grid-template-columns: 1fr; } }

.meeting { height: 100%; display: flex; flex-direction: column; background: #07080c; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 10px 18px; }
.topbar .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .clock { color: var(--muted); font-variant-numeric: tabular-nums; }
.main { flex: 1; display: flex; min-height: 0; }
.content { flex: 1; display: flex; flex-direction: column; min-width: 0; padding: 4px 12px 8px; gap: 10px; }

.stage { flex: 1; min-height: 0; background: #000; border-radius: var(--radius); position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.stage video { width: 100%; height: 100%; object-fit: contain; }
.stage .label { position: absolute; left: 12px; bottom: 12px; background: rgba(0, 0, 0, .55); backdrop-filter: blur(8px); padding: 5px 10px; border-radius: 8px; font-size: 13px; display: flex; gap: 6px; align-items: center; }

.grid { flex: 1; min-height: 0; display: grid; gap: 10px; align-content: center; justify-content: center; }
.content.with-stage .grid { flex: none; height: 132px; display: flex; overflow-x: auto; justify-content: flex-start; }
.content.with-stage .tile { width: 210px; flex: none; height: 100%; aspect-ratio: auto; }

.tile { position: relative; background: linear-gradient(160deg, #1a1e29, #12151d); border-radius: var(--radius); overflow: hidden; aspect-ratio: 16/9; box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .15s; }
.tile.speaking { box-shadow: inset 0 0 0 3px #4ade80, 0 0 24px rgba(74, 222, 128, .25); }
.tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.tile video.mirror { transform: scaleX(-1); }
.tile .avatar { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.tile .avatar span { width: 30%; max-width: 104px; aspect-ratio: 1; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: clamp(16px, 2.6vw, 36px); font-weight: 700; color: #fff; box-shadow: 0 8px 30px rgba(0, 0, 0, .35); }
.tile .name { position: absolute; left: 10px; bottom: 10px; background: rgba(0, 0, 0, .5); backdrop-filter: blur(8px); padding: 4px 9px; border-radius: 8px; font-size: 13px; display: flex; gap: 6px; align-items: center; max-width: calc(100% - 20px); }
.tile .name b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .name .mic { color: var(--danger); display: flex; }
.tile .hand { position: absolute; top: 10px; left: 10px; width: 34px; height: 34px; }
.tile .net { position: absolute; top: 10px; right: 10px; background: rgba(0, 0, 0, .55); color: #fcc96b; padding: 4px 8px; border-radius: 8px; font-size: 12px; display: flex; gap: 4px; align-items: center; }

.bottombar { display: flex; justify-content: center; align-items: center; gap: 6px; padding: 10px 12px 14px; flex-wrap: wrap; }
.ctrl { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 70px; padding: 6px 6px; background: transparent; border: 0; color: var(--text); border-radius: 12px; cursor: pointer; font: inherit; font-size: 11.5px; position: relative; }
.ctrl .ib { width: 46px; height: 46px; border-radius: 50%; background: var(--surface-3); display: flex; align-items: center; justify-content: center; transition: .15s; }
.ctrl:hover .ib { background: var(--surface-4); }
.ctrl.off .ib { background: var(--danger); color: #fff; }
.ctrl.on .ib { background: var(--grad); color: #fff; }
.ctrl:disabled { opacity: .45; cursor: not-allowed; }
.ctrl .lock { position: absolute; top: 2px; right: 10px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); display: flex; align-items: center; justify-content: center; color: var(--warn); }
.ctrl.leave .ib { background: var(--danger); color: #fff; width: 62px; border-radius: 23px; }
.ctrl .count { position: absolute; top: 0; right: 8px; background: var(--danger); color: #fff; border-radius: 99px; font-size: 10.5px; font-weight: 700; padding: 1px 6px; }
.ctrl-sep { width: 1px; height: 34px; background: var(--line-2); margin: 0 6px; }
@media (max-width: 640px) { .ctrl { min-width: 54px; } .ctrl .t { display: none; } .ctrl-sep { display: none; } }

.side { width: 360px; margin: 4px 12px 8px 0; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.side header { display: flex; align-items: center; gap: 4px; padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--line); }
.side .tabs-mini { display: flex; gap: 4px; flex: 1; }
.side .tabs-mini button { background: none; border: 0; color: var(--muted); padding: 7px 10px; border-radius: 8px; cursor: pointer; font: inherit; font-weight: 600; font-size: 13px; }
.side .tabs-mini button.active { background: var(--surface-3); color: var(--text); }
.side .body { flex: 1; overflow-y: auto; padding: 14px 16px; }
@media (max-width: 760px) { .side { position: fixed; inset: 0; width: auto; z-index: 50; margin: 0; border-radius: 0; } }

.chat-list { display: flex; flex-direction: column; gap: 12px; }
.chat-msg { display: flex; gap: 10px; }
.chat-msg .mini-avatar { width: 30px; height: 30px; font-size: 12px; }
.chat-msg .who { font-size: 12px; color: var(--muted); }
.chat-msg .who b { color: var(--text); font-weight: 600; margin-right: 4px; }
.chat-msg .txt { white-space: pre-wrap; word-wrap: break-word; }
.chat-form { display: flex; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--line); align-items: center; }

.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .65); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal { width: 100%; max-width: 460px; }
.unmute-banner { position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%); z-index: 60; }

/* ---------- Эмодзи ---------- */
.emoji-picker { position: fixed; z-index: 200; background: rgba(23, 27, 36, .97); backdrop-filter: blur(20px); border: 1px solid var(--line-2); border-radius: 16px; width: 344px; max-width: calc(100vw - 16px); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.emoji-picker .ep-tabs { display: flex; gap: 2px; padding: 6px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.emoji-picker .ep-tabs button { flex: none; border: 0; background: none; border-radius: 8px; padding: 5px 7px; cursor: pointer; display: flex; }
.emoji-picker .ep-tabs button.active { background: var(--surface-4); }
.emoji-picker .ep-tabs img { width: 22px; height: 22px; }
.emoji-picker .ep-body { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; padding: 8px; max-height: 260px; overflow-y: auto; }
.emoji-picker .ep-body.big { grid-template-columns: repeat(5, 1fr); }
.emoji-picker .ep-title { grid-column: 1 / -1; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 6px 4px 2px; font-weight: 600; }
.emoji-picker .ep-body button { aspect-ratio: 1; border: 0; background: none; border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 3px; }
.emoji-picker .ep-body button:hover { background: var(--surface-4); transform: scale(1.12); }
.emoji-picker .ep-body img { width: 100%; height: 100%; object-fit: contain; }
.emoji-picker .ep-quick { display: flex; justify-content: space-around; padding: 8px; border-top: 1px solid var(--line); }
.emoji-picker .ep-quick button { border: 0; background: none; cursor: pointer; padding: 4px; border-radius: 10px; }
.emoji-picker .ep-quick button:hover { background: var(--surface-4); transform: scale(1.15); }
.emoji-picker .ep-quick img { width: 30px; height: 30px; display: block; }
img.emoji-inline { height: 1.45em; width: auto; vertical-align: -0.35em; margin: 0 1px; }
.chat-msg .txt.jumbo img.emoji-inline { height: 2.6em; }
.reaction { position: absolute; bottom: 44px; pointer-events: none; animation: floatup 3.6s ease-out forwards; z-index: 5; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .45)); }
.reaction img { width: 54px; height: 54px; object-fit: contain; display: block; }
.reaction .who { display: block; text-align: center; font-size: 11px; background: rgba(0, 0, 0, .55); border-radius: 6px; padding: 1px 6px; margin-top: 2px; white-space: nowrap; }
@keyframes floatup { 0% { transform: translateY(20px) scale(.4); opacity: 0; } 12% { transform: translateY(0) scale(1.15); opacity: 1; } 20% { transform: scale(1); } 80% { opacity: 1; } 100% { transform: translateY(-150px) scale(.95); opacity: 0; } }

/* ---------- Просмотр записи ---------- */
.i.i-download { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 15V3'/%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3C/svg%3E"); }
/* плеер не выше экрана: заголовок остаётся видимым без прокрутки */
.watch-wrap { width: 100%; max-width: clamp(672px, calc((100vh - 285px) * 16 / 9 + 32px), 1112px); margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.watch-top { padding: 14px 0; border-bottom: 1px solid var(--line); background: rgba(10, 12, 17, .6); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 10; }
.watch-top .watch-wrap { justify-content: space-between; }
.watch-main { padding-top: 24px; padding-bottom: 48px; }
.watch-player { position: relative; aspect-ratio: 16 / 9; width: 100%; background: #000; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: 0 24px 70px rgba(0, 0, 0, .55), 0 0 0 1px rgba(124, 108, 255, .06); }
.watch-player video { width: 100%; height: 100%; display: block; object-fit: contain; background: #000; }
.watch-player.skeleton { display: flex; align-items: center; justify-content: center; background: var(--surface); }
.watch-skel-line { height: 16px; border-radius: 8px; background: var(--surface-2); margin-top: 18px; animation: pulse 1.6s infinite; }
.watch-resume { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 18px; border-radius: 14px; background: rgba(10, 12, 17, .72); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--line-2); box-shadow: var(--shadow); }
.watch-resume .btn.ghost { color: var(--muted); }
.watch-vid-error { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 20px; background: rgba(10, 12, 17, .9); color: var(--muted); }
.watch-info { margin-top: 20px; }
.watch-info h1 { color: var(--text); font-size: 24px; line-height: 1.25; margin: 0 0 16px; word-wrap: break-word; }
.watch-meta { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.watch-author { display: flex; align-items: center; gap: 12px; min-width: 0; }
.watch-avatar { width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; flex: none; font-size: 15px; }
.watch-author-name { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; }
.watch-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.watch-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.watch-chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.watch-error { min-height: calc(100% - 64px); }
.watch-error .card { max-width: 420px; width: 100%; text-align: center; padding: 34px 26px; }
.watch-error h2 { margin: 0; }
.watch-error-icon { width: 64px; height: 64px; margin: 0 auto; border-radius: 18px; display: flex; align-items: center; justify-content: center; background: var(--grad-soft); border: 1px solid rgba(124, 108, 255, .3); color: #b8afff; }
@media (max-width: 600px) {
  .watch-main { padding-top: 16px; }
  .watch-player { border-radius: 12px; }
  .watch-info h1 { font-size: 19px; }
  .watch-actions { width: 100%; }
  .watch-actions .btn { flex: 1; }
  .watch-kind { display: none; }
}

/* Загрузка записи поверх плитки/сцены */
.pb-loading { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: center; background: rgba(7, 8, 12, .55); color: var(--muted); font-size: 13px; z-index: 3; pointer-events: none; }
.pb-loading .spinner { width: 34px; height: 34px; border-width: 3px; margin: 0; }
.tile .name, .tile .net, .tile .hand, .stage .label { z-index: 4; }
