:root {
  --bg: #fbeae0;
  --bg-2: #fff5ef;
  --card: #f6e2df;
  --card-2: #fdf0ee;
  --white: #ffffff;
  --accent: #ec8088;
  --accent-soft: #f5b8bd;
  --accent-deep: #d9646e;
  --sand: #f8ddb9;
  --sand-deep: #e9c38e;
  --ink: #2b1a1e;
  --ink-2: #74605f;
  --ink-3: #a8928f;
  --line: rgba(43, 26, 30, .08);
  --surface: #ffffff;
  --idle: var(--accent-soft);
  --veil: rgba(43, 26, 30, .35);
  --shadow: rgba(43, 26, 30, .35);
  --danger: #d8505c;
  --ok: #52b36b;
  --radius: 28px;
  --dock-h: 76px;
  /* Безопасные зоны: env() браузера и то, что сообщает Telegram (app.js
     кладёт tg.safeAreaInset в --sa-*, а его кнопки поверх страницы на весь
     экран — tg.contentSafeAreaInset — в --csa-*). --kb — сколько экрана снизу
     закрывает клавиатура, если окно под неё не ужалось само. */
  --sa-top: 0px; --sa-bottom: 0px; --sa-left: 0px; --sa-right: 0px;
  --csa-top: 0px; --csa-bottom: 0px; --csa-left: 0px; --csa-right: 0px;
  --kb: 0px;
  --safe-t: calc(max(env(safe-area-inset-top, 0px), var(--sa-top)) + var(--csa-top));
  --safe-b: calc(max(env(safe-area-inset-bottom, 0px), var(--sa-bottom)) + var(--csa-bottom));
  --safe-l: calc(max(env(safe-area-inset-left, 0px), var(--sa-left)) + var(--csa-left));
  --safe-r: calc(max(env(safe-area-inset-right, 0px), var(--sa-right)) + var(--csa-right));
  --head: "Unbounded", "Manrope", system-ui, sans-serif;
  --body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
/* Светлая — нейтральнее розовой, акцент тот же. */
:root[data-theme="light"] {
  --bg: #f6f3f1; --bg-2: #ffffff; --card: #efe9e6; --card-2: #f7f3f1; --surface: #ffffff;
  --accent: #e8707b; --accent-soft: #f4b9be; --accent-deep: #cf5561;
  --sand: #f3e4cf; --sand-deep: #e2c59c;
  --ink: #221a1c; --ink-2: #6f6567; --ink-3: #a79d9f; --line: rgba(34, 26, 28, .08);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #151013; --bg-2: #1b1418; --card: #261c21; --card-2: #2f242a; --surface: #211a1e;
  --accent: #ee7d88; --accent-soft: #5e3640; --accent-deep: #f39aa3;
  --sand: #3a2c22; --sand-deep: #8a6a45;
  --ink: #f5eaec; --ink-2: #bcaab0; --ink-3: #85747a; --line: rgba(255, 255, 255, .09);
  --idle: #7b5a62; --veil: rgba(0, 0, 0, .55); --shadow: rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.35;
  min-height: 100vh;
  overscroll-behavior-y: none;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
input, select, textarea { font: inherit; color: inherit; }

#app { max-width: 520px; margin: 0 auto; padding: calc(12px + var(--safe-t)) 16px calc(var(--dock-h) + 28px + var(--safe-b) + var(--kb)); }

/* ── Шапка ─────────────────────────────────────────────── */
.top { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.avatars { display: flex; flex: none; }
.ava {
  position: relative; width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent-soft); color: var(--white);
  display: grid; place-items: center; font-family: var(--head); font-size: 17px;
  border: 3px solid var(--bg); overflow: visible;
}
.ava img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.ava + .ava { margin-left: -12px; background: var(--sand); color: var(--ink); }
.ava .badge {
  position: absolute; right: -6px; bottom: -4px; font-size: 16px; line-height: 1;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.15));
}
.pill {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px;
  border-radius: 999px; background: var(--surface); font-weight: 700; white-space: nowrap;
}
.pill.status { flex: 1; min-width: 0; color: var(--accent-deep); overflow: hidden; text-overflow: ellipsis; }
.pill.status span { overflow: hidden; text-overflow: ellipsis; }
.pill.count { background: var(--accent); color: var(--white); padding: 0 14px; font-variant-numeric: tabular-nums; }
.pill.count i { font-style: normal; opacity: .6; margin: 0 2px; }

/* ── Общие карточки ────────────────────────────────────── */
.tab { display: none; animation: fade .25s ease; }
.tab.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.card { background: var(--card); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }
.card.white { background: var(--surface); }
.card.sand { background: var(--sand); }
.card.accent { background: var(--accent); color: var(--white); }
.h1 { font-family: var(--head); font-weight: 800; font-size: 30px; line-height: 1.05; margin: 6px 2px 16px; letter-spacing: -.01em; }
.h2 { font-family: var(--head); font-weight: 700; font-size: 19px; line-height: 1.15; margin: 0 0 4px; }
.cap { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-deep); margin: 22px 4px 10px; display: flex; align-items: center; gap: 8px; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.grid2 .card { margin: 0; }
.big-num { font-family: var(--head); font-weight: 800; font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums; }
.icon-bubble { width: 48px; height: 48px; border-radius: 16px; background: var(--card-2); display: grid; place-items: center; flex: none; font-size: 22px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; padding: 0 22px; border-radius: 999px; font-weight: 800;
  background: var(--accent); color: var(--white); transition: transform .12s ease, filter .12s;
}
.btn:active { transform: scale(.97); filter: brightness(.95); }
.btn.soft { background: var(--card-2); color: var(--accent-deep); }
.btn.ghost { background: transparent; color: var(--accent-deep); }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ── Таймер ────────────────────────────────────────────── */
.timer-wrap { position: relative; margin: 4px auto 6px; width: 100%; max-width: 360px; }
.timer-wrap svg { display: block; width: 100%; height: auto; overflow: visible; }
.seg-bg { fill: var(--accent-soft); stroke: var(--accent-soft); }
.seg-fill { fill: var(--accent); stroke: var(--accent); transition: d .6s ease; }
.seg-bg, .seg-fill { stroke-width: 14; stroke-linejoin: round; }
.seg-val { font-family: var(--head); font-weight: 700; font-size: 25px; text-anchor: middle; fill: var(--ink); font-variant-numeric: tabular-nums; }
.seg-lab { font-family: var(--body); font-weight: 600; font-size: 12.5px; text-anchor: middle; fill: var(--ink-2); }
.seg-val.on, .seg-lab.on { fill: var(--white); }
.seg-lab.on { opacity: .85; }
.hub { fill: var(--bg-2); }

.together { text-align: center; margin: 2px 0 16px; }
.together .big-num { font-size: 54px; color: var(--accent-deep); }
.together .muted { font-weight: 700; margin-top: 2px; }
.progress { height: 10px; border-radius: 999px; background: var(--card); overflow: hidden; margin: 10px 0 6px; }
.progress > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; min-width: 10px; transition: width .6s ease; }

/* ── Кнопка «Скучаю» ───────────────────────────────────── */
.miss {
  position: relative; width: 100%; border-radius: var(--radius); background: var(--accent); color: var(--white);
  padding: 20px 22px; display: flex; align-items: center; gap: 16px; text-align: left; margin-bottom: 14px;
  box-shadow: 0 10px 24px -12px rgba(217, 100, 110, .7); transition: transform .12s ease;
  overflow: hidden;
}
.miss:active { transform: scale(.98); }
.miss .heart { width: 58px; height: 58px; border-radius: 50%; background: rgba(255,255,255,.22); display: grid; place-items: center; flex: none; }
.miss .heart svg { width: 30px; height: 30px; }
.miss .t { font-family: var(--head); font-weight: 700; font-size: 22px; }
.miss .s { opacity: .85; font-weight: 600; font-size: 13.5px; margin-top: 2px; }
.miss.pulse .heart { animation: beat .45s ease; }
@keyframes beat { 0% { transform: scale(1); } 35% { transform: scale(1.25); } 100% { transform: scale(1); } }
.fly { position: fixed; pointer-events: none; z-index: 50; font-size: 22px; animation: fly 1.1s ease-out forwards; }
@keyframes fly { from { opacity: 1; transform: translate(0,0) scale(.8); } to { opacity: 0; transform: translate(var(--dx), -160px) scale(1.4); } }

/* ── Настроение ────────────────────────────────────────── */
.mood-card { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.mood-card .emo { font-size: 38px; line-height: 1.1; height: 44px; display: flex; align-items: center; }
.emo-add { width: 42px; height: 42px; border-radius: 50%; border: 2px dashed var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-family: var(--head); font-size: 24px; line-height: 1; }
.mood-card .who { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.mood-card .lab { font-weight: 800; }
.mood-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.mood-opt { background: var(--card-2); border-radius: 20px; padding: 14px; display: flex; align-items: center; gap: 10px; font-weight: 700; }
.mood-opt .e { font-size: 26px; }
.mood-opt.sel { background: var(--accent); color: var(--white); }

/* ── Питомец ───────────────────────────────────────────── */
.pet { display: flex; gap: 16px; align-items: center; }
.pet-sprite { flex: none; width: 118px; height: 132px; display: grid; place-items: end center; position: relative; }
.pet-sprite svg { image-rendering: pixelated; animation: bob 2.4s ease-in-out infinite; transform-origin: 50% 100%; }
.pet-sprite.happy svg { animation: hop 1.2s ease-in-out infinite; }
.pet-sprite.sad svg { filter: grayscale(.55) brightness(.97); animation: sway 3.6s ease-in-out infinite; }
.pet-sprite .shadow { position: absolute; bottom: -4px; left: 50%; width: 64px; height: 8px; margin-left: -32px; border-radius: 50%; background: rgba(43,26,30,.10); }
@keyframes bob { 0%,100% { transform: translateY(0) scaleY(1); } 50% { transform: translateY(-2px) scaleY(1.03); } }
@keyframes hop { 0%,100% { transform: translateY(0); } 40% { transform: translateY(-10px); } 55% { transform: translateY(0) scaleY(.94); } }
@keyframes sway { 0%,100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } }
.pet-hearts { position: absolute; top: 0; right: 4px; font-size: 16px; animation: floaty 2.4s ease-in-out infinite; }
@keyframes floaty { 0%,100% { transform: translateY(0); opacity: .9; } 50% { transform: translateY(-6px); opacity: .6; } }
.pet .name { font-family: var(--head); font-weight: 700; font-size: 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; background: var(--card-2); font-weight: 700; font-size: 13px; color: var(--ink-2); }
.chip.on { background: var(--ok); color: var(--white); }
.chip.fire { background: var(--sand); color: var(--ink); }

/* ── Списки и даты ─────────────────────────────────────── */
.list .item { display: flex; align-items: center; gap: 14px; background: var(--card); border-radius: 24px; padding: 14px 16px; margin-bottom: 8px; width: 100%; text-align: left; }
.list .item .t { font-weight: 800; }
.list .item .s { color: var(--ink-2); font-size: 13.5px; margin-top: 1px; }
.list .item .when { font-weight: 800; color: var(--accent-deep); white-space: nowrap; text-align: right; font-size: 14px; }
.list .item .when.today { color: var(--white); background: var(--accent); padding: 5px 10px; border-radius: 999px; }
.chev { color: var(--ink-3); font-size: 20px; }

/* ── Статистика ────────────────────────────────────────── */
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; height: 170px; margin: 8px 0 8px; }
.bar { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.bar .col { width: 100%; border-radius: 999px; background: var(--accent-soft); min-height: 14px; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; }
.bar .col .me { background: var(--accent); }
.bar .col .pa { background: var(--sand-deep); }
.bar.top .col { box-shadow: 0 0 0 3px rgba(236,128,136,.25); }
.days7 { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; text-align: center; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.days7 .top { color: var(--accent-deep); }
.legend { display: flex; gap: 14px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.moodline { display: grid; grid-template-columns: 50px repeat(14, minmax(0, 1fr)); gap: 1px; align-items: center; font-size: 14px; text-align: center; }
.moodline > span { overflow: hidden; }
.moodline .who { font-size: 12px; font-weight: 800; color: var(--ink-2); text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.moodline .d { font-size: 10.5px; color: var(--ink-3); font-weight: 700; }
.moodline .x { color: var(--ink-3); font-size: 12px; }

/* ── Приглашение ───────────────────────────────────────── */
.invite { text-align: center; }
.invite .code { font-family: var(--head); font-weight: 800; font-size: 44px; letter-spacing: .12em; color: var(--accent); margin: 8px 0 14px; }
.invite .cap { justify-content: center; margin-top: 4px; }
.field { display: flex; gap: 8px; margin-top: 10px; }
/* Тонкая рамка: иначе белое поле на белой шторке не видно, куда нажимать.
   При фокусе её заменяет розовая обводка из .input:focus. */
.input { flex: 1; min-width: 0; height: 52px; border-radius: 18px; border: 0; background: var(--surface); padding: 0 16px; font-weight: 700; font-size: 16px; outline: none; box-shadow: inset 0 0 0 1px var(--line); }
.input:focus { box-shadow: 0 0 0 2px var(--accent-soft); }
.input.code-in { text-transform: uppercase; letter-spacing: .2em; font-family: var(--head); }
.input.code-in::placeholder { text-transform: none; letter-spacing: normal; font-family: var(--body); color: var(--ink-3); }
.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Нижняя панель ─────────────────────────────────────── */
.dock {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(12px + var(--safe-b));
  width: min(488px, calc(100% - 32px)); height: var(--dock-h); background: var(--surface);
  border-radius: 999px; display: flex; align-items: center; justify-content: space-around; padding: 0 8px;
  box-shadow: 0 12px 30px -14px var(--shadow); z-index: 20;
}
.dock button { width: 64px; height: 56px; border-radius: 22px; display: grid; place-items: center; color: var(--idle); transition: background .15s, color .15s; }
.dock button svg { width: 28px; height: 28px; }
.dock button.on { background: var(--card); color: var(--accent); }

/* ── Шторка ────────────────────────────────────────────── */
.veil { position: fixed; inset: 0; background: var(--veil); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 40; }
.veil.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 50%; bottom: var(--kb); width: min(520px, 100%); transform: translate(-50%, 105%);
  background: var(--bg-2); border-radius: 30px 30px 0 0; padding: 10px 18px calc(22px + var(--safe-b));
  transition: transform .28s cubic-bezier(.2,.8,.2,1); z-index: 41; overflow-y: auto;
  /* Над клавиатурой и не выше кнопок Telegram, когда приложение на весь экран. */
  max-height: calc(min(86vh, 100vh - var(--safe-t) - 12px) - var(--kb));
}
.sheet { visibility: hidden; }
.sheet.open { transform: translate(-50%, 0); visibility: visible; }
.sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 14px; }
.sheet .h2 { margin-bottom: 14px; }
.sheet .actions { display: flex; gap: 10px; margin-top: 16px; }
.sheet .actions .btn { flex: 1; }
/* Светлая тема: шторка белая — поля в ней чуть темнее. В розовой так не
   делаем: там --card-2 почти сливается со шторкой. */
:root[data-theme="light"] .sheet .input { background: var(--card-2); }
.opt-list { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { height: 42px; padding: 0 16px; border-radius: 999px; background: var(--card); font-weight: 700; }
.opt.sel { background: var(--accent); color: var(--white); }

.toast { position: fixed; left: 50%; top: calc(14px + var(--safe-t)); transform: translate(-50%, calc(-100% - 24px)); visibility: hidden; background: var(--ink); color: var(--bg-2); padding: 12px 18px; border-radius: 16px; font-weight: 700; z-index: 60; transition: transform .25s, visibility .25s; max-width: calc(100% - 32px); text-align: center; }
.toast.show { transform: translate(-50%, 0); visibility: visible; }

.empty { text-align: center; padding: 40px 12px; color: var(--ink-2); }
.skeleton { height: 120px; border-radius: var(--radius); background: linear-gradient(90deg, var(--card) 0%, var(--card-2) 50%, var(--card) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; margin-bottom: 14px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ══ Кино вдвоём ════════════════════════════════════════════════════════ */
.dock button { width: 56px; }

.cin-hero { position: relative; overflow: hidden; border-radius: var(--radius); padding: 18px; margin-bottom: 14px; color: #fff;
  background: radial-gradient(120% 140% at 0% 0%, #4a2a38 0%, #23151b 55%, #150d11 100%); }
.cin-hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%;
  background: radial-gradient(circle, rgba(236,128,136,.45), transparent 70%); pointer-events: none; }
.cin-hero-top { display: flex; gap: 14px; align-items: center; }
.cin-pop { font-size: 34px; width: 56px; height: 56px; border-radius: 18px; background: rgba(255,255,255,.08); display: grid; place-items: center; flex: none; }
.cin-hero-t { font-family: var(--head); font-weight: 700; font-size: 17px; line-height: 1.2; }
.cin-hero-s { opacity: .8; font-weight: 600; font-size: 13.5px; margin-top: 4px; display: flex; align-items: center; gap: 6px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #8d7c80; flex: none; }
.st-watching { background: #52d273 !important; }
.st-buffering { background: #f5c548 !important; }
.st-lobby { background: #7fb2ff !important; }
.st-away, .st-offline { background: #8d7c80 !important; }
.cin-now { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; margin-top: 14px; padding: 10px; border-radius: 20px; background: rgba(255,255,255,.08); color: #fff; }
.cin-now-poster { width: 76px; aspect-ratio: 16/9; border-radius: 12px; background: #000 center/cover; display: grid; place-items: center; flex: none; color: #fff; }
.cin-now-poster svg { width: 22px; height: 22px; filter: drop-shadow(0 1px 3px rgba(0,0,0,.6)); }
.cin-now-l { display: block; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-soft); }
.cin-now-t { display: block; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cin-now-s { display: block; font-size: 12.5px; opacity: .75; font-weight: 600; }
.cin-now-go { background: var(--accent); padding: 9px 14px; border-radius: 999px; font-weight: 800; font-size: 13.5px; flex: none; }
.cin-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.cin-actions .btn { flex: 1; height: 46px; padding: 0 10px; font-size: 14px; min-width: 130px; white-space: nowrap; }
.cin-file { cursor: pointer; }
.cin-up { margin-top: 14px; background: var(--surface); border-radius: 18px; padding: 12px 14px; }
.cin-up-t { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cin-empty { text-align: center; line-height: 1.5; }
.cin-item { display: flex; gap: 12px; align-items: center; background: var(--card); border-radius: 22px; padding: 10px; margin-bottom: 8px; cursor: pointer; }
.cin-item.error { opacity: .8; }
.cin-poster { position: relative; width: 112px; aspect-ratio: 16/9; border-radius: 14px; flex: none; display: grid; place-items: center; font-size: 26px;
  background: linear-gradient(135deg, #4a2a38, #1c1216) center/cover; overflow: hidden; }
.cin-play { position: absolute; right: 6px; bottom: 6px; width: 28px; height: 28px; border-radius: 50%; background: rgba(236,128,136,.95); color: #fff; display: grid; place-items: center; }
.cin-play svg { width: 16px; height: 16px; }
.cin-t { font-weight: 800; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cin-s { color: var(--ink-2); font-size: 13px; font-weight: 600; margin-top: 3px; }
.cin-note { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }
.cin-badge { display: inline-block; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 999px; margin-right: 6px; vertical-align: 2px; }
.cin-more { width: 36px; height: 36px; border-radius: 50%; font-size: 20px; color: var(--ink-2); flex: none; }

/* ── зал ───────────────────────────────────────────────── */
body.in-theater { overflow: hidden; }
body.in-theater .dock { display: none; }
.theater { position: fixed; inset: 0 0 var(--kb) 0; z-index: 35; display: none; flex-direction: column; background: #0d0a0b; color: #fff; overflow: hidden; }
.theater.open { display: flex; }
.th-top { display: flex; align-items: center; gap: 10px; padding: calc(10px + var(--safe-t)) calc(12px + var(--safe-r)) 10px calc(12px + var(--safe-l)); flex: none; }
.th-round { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.1); display: grid; place-items: center; flex: none; color: #fff; }
.th-title { flex: 1; min-width: 0; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-people { display: flex; flex: none; }
.th-ava { position: relative; width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 14px; border: 2px solid #0d0a0b; }
.th-ava + .th-ava { margin-left: -8px; background: var(--sand-deep); }
.th-ava img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.th-ava i { position: absolute; right: -2px; bottom: -2px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid #0d0a0b; background: #8d7c80; }
.th-invite { height: 34px; padding: 0 12px; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 800; font-size: 13px; flex: none; }

.th-stage { position: relative; width: 100%; aspect-ratio: 16/9; background: #000; flex: none; overflow: hidden; }
.th-stage video, .th-stage #thYT, .th-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.th-stage video { object-fit: contain; }
.th-stage video::cue { background: rgba(0,0,0,.55); font-family: var(--body); font-size: 17px; }
.th-float { position: absolute; inset: 0; pointer-events: none; z-index: 4; overflow: hidden; }
.th-float span { position: absolute; bottom: 8%; animation: rise 2.6s cubic-bezier(.2,.7,.3,1) forwards; filter: drop-shadow(0 2px 6px rgba(0,0,0,.4)); }
@keyframes rise { 0% { transform: translateY(0) scale(.6); opacity: 0; } 12% { opacity: 1; transform: translateY(-10px) scale(1.1); } 100% { transform: translateY(-260px) scale(1); opacity: 0; } }
.th-controls { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; justify-content: flex-end; transition: opacity .25s;
  background: linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(0,0,0,.7) 100%); }
.th-controls.hide { opacity: 0; }
.th-controls.hide * { pointer-events: none; }
.th-big { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 70px; height: 70px; border-radius: 50%;
  background: rgba(236,128,136,.92); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 26px rgba(0,0,0,.4); }
.th-big:active { transform: translate(-50%, -50%) scale(.94); }
.th-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px 10px; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.th-seek { flex: 1; -webkit-appearance: none; appearance: none; height: 5px; border-radius: 999px; outline: none;
  background: linear-gradient(90deg, var(--accent) var(--p, 0%), rgba(255,255,255,.28) var(--p, 0%)); }
.th-seek::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.th-seek::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: #fff; }
.th-cc { height: 26px; padding: 0 7px; border-radius: 7px; border: 1.5px solid rgba(255,255,255,.7); color: #fff; font-size: 11px; font-weight: 800; }
.th-cc.on { background: #fff; color: #000; }
.th-count { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; font-family: var(--head); font-weight: 800; font-size: 110px;
  color: #fff; background: rgba(0,0,0,.45); text-shadow: 0 6px 30px rgba(236,128,136,.8); pointer-events: none; }
.th-count.pop { animation: pop .8s ease-out; }
@keyframes pop { 0% { transform: scale(1.6); opacity: 0; } 30% { transform: scale(1); opacity: 1; } 100% { transform: scale(.9); opacity: .9; } }
.th-spin { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; pointer-events: none; }
.th-spin i { width: 46px; height: 46px; border-radius: 50%; border: 4px solid rgba(255,255,255,.25); border-top-color: var(--accent); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.th-join { position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: rgba(10,6,8,.62); text-align: center; padding: 16px; }
.th-join.yt { background: none; pointer-events: none; justify-content: flex-start; padding-top: 12px; }
.th-join-btn { display: inline-flex; align-items: center; gap: 10px; height: 56px; padding: 0 26px; border-radius: 999px; background: var(--accent); color: #fff;
  font-weight: 800; font-size: 17px; box-shadow: 0 10px 30px rgba(236,128,136,.45); }
.th-join-btn span { font-size: 18px; }
.th-sub { font-size: 13px; opacity: .85; font-weight: 600; max-width: 280px; }
.th-hint { background: rgba(0,0,0,.72); padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: 13px; }
/* Подсказка для YouTube: пульсирующее кольцо вокруг его кнопки ▶ по центру. */
.th-ring { position: absolute; left: 50%; top: 50%; width: 96px; height: 96px; margin: -48px 0 0 -48px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.95); box-shadow: 0 0 0 4px rgba(236,128,136,.6); animation: ring 1.4s ease-out infinite; }
@keyframes ring { 0% { transform: scale(.85); opacity: 1; } 100% { transform: scale(1.35); opacity: 0; } }
.th-note { display: none; margin: 12px 12px 0; padding: 11px 14px; border-radius: 16px; background: var(--accent); color: #fff;
  font-weight: 800; font-size: 14px; line-height: 1.35; text-align: center; flex: none; animation: nudge 1.4s ease-in-out infinite; }
.th-note.show { display: block; }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.theater.fs .th-note { display: none; }
.th-err { font-weight: 700; font-size: 15px; max-width: 300px; line-height: 1.4; }
.th-toast { position: absolute; top: 10px; left: 50%; transform: translate(-50%, -8px); z-index: 7; max-width: calc(100% - 24px); background: rgba(0,0,0,.72);
  padding: 7px 14px; border-radius: 999px; font-weight: 700; font-size: 13px; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.th-toast.show { opacity: 1; transform: translate(-50%, 0); }
.th-exitfs { display: none; position: absolute; top: calc(10px + var(--safe-t)); right: calc(12px + var(--safe-r)); z-index: 8; width: 38px; height: 38px;
  border-radius: 50%; background: rgba(0,0,0,.5); color: #fff; place-items: center; }

.th-reacts { display: flex; justify-content: center; gap: 8px; padding: 12px 12px 6px; flex: none; }
.th-reacts button { width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.08); font-size: 23px; transition: transform .1s; }
.th-reacts button:active { transform: scale(1.25); }
.th-chat { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 4px 12px calc(12px + var(--safe-b)); }
.th-msgs { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 6px 2px; }
.th-msg { align-self: flex-start; max-width: 82%; padding: 8px 12px; border-radius: 18px 18px 18px 6px; background: rgba(255,255,255,.09); font-size: 14.5px; line-height: 1.35; overflow-wrap: anywhere; }
.th-msg b { display: block; font-size: 11.5px; opacity: .6; margin-bottom: 1px; }
.th-msg.me { align-self: flex-end; background: var(--accent); border-radius: 18px 18px 6px 18px; }
.th-msg.me b { display: none; }
.th-empty { margin: auto; opacity: .45; font-size: 13px; text-align: center; max-width: 240px; }
.th-input { display: flex; gap: 8px; padding-top: 8px; }
.th-input input { flex: 1; min-width: 0; height: 46px; border-radius: 999px; border: 0; padding: 0 16px; background: rgba(255,255,255,.1); color: #fff; font-size: 15px; outline: none; }
.th-input input::placeholder { color: rgba(255,255,255,.45); }
.th-input button { width: 46px; height: 46px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; }

/* На весь экран и телефон боком: только видео, реакции — колонкой справа. */
.theater.fs .th-top, .theater.fs .th-chat { display: none; }
.theater.fs .th-stage { position: fixed; inset: 0; aspect-ratio: auto; z-index: 1; }
.theater.fs .th-exitfs { display: grid; }
.theater.fs .th-reacts { position: fixed; left: 0; right: 0; bottom: calc(22px + var(--safe-b)); z-index: 9; padding: 0; }
.theater.fs .th-reacts button { width: 42px; height: 42px; font-size: 21px; background: rgba(255,255,255,.1); }
@media (orientation: landscape) {
  .theater.fs .th-reacts { left: auto; right: calc(10px + var(--safe-r)); bottom: auto; top: 50%; transform: translateY(-50%); flex-direction: column; }
  .theater.fs .th-reacts button { width: 40px; height: 40px; font-size: 20px; background: rgba(0,0,0,.35); }
}
@media (orientation: landscape) and (max-height: 520px) {
  .theater.open .th-top, .theater.open .th-chat { display: none; }
  .theater.open .th-stage { position: fixed; inset: 0; aspect-ratio: auto; z-index: 1; }
  .theater.open .th-reacts { position: fixed; right: calc(10px + var(--safe-r)); top: 50%; transform: translateY(-50%); flex-direction: column; z-index: 9; padding: 0; }
  .theater.open .th-reacts button { width: 40px; height: 40px; font-size: 20px; background: rgba(0,0,0,.35); }
}
/* Компьютер: видео слева, реакции и чат справа. */
@media (min-width: 900px) {
  .theater.open:not(.fs) { display: grid; grid-template-columns: 1fr 340px; grid-template-rows: auto auto auto 1fr; }
  .theater.open:not(.fs) .th-top { grid-column: 1 / -1; }
  .theater.open:not(.fs) .th-stage { grid-column: 1; grid-row: 2 / 5; align-self: start; }
  .theater.open:not(.fs) .th-note { grid-column: 2; grid-row: 2; }
  .theater.open:not(.fs) .th-reacts { grid-column: 2; grid-row: 3; }
  .theater.open:not(.fs) .th-chat { grid-column: 2; grid-row: 4; }
}

/* ══ Главная: жесты, вопрос дня, записка, питомец ══════════════════════ */
[hidden] { display: none !important; }
.gest-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0 6px; }
.gest-row.dim { opacity: .6; }
.gest { position: relative; background: var(--surface); border-radius: 20px; padding: 11px 4px 10px; display: flex; flex-direction: column; align-items: center; gap: 4px; transition: transform .12s; }
.gest:active { transform: scale(.95); }
.gest .ge { font-size: 25px; line-height: 1.1; }
.gest .gl { font-size: 11.5px; font-weight: 800; line-height: 1.15; color: var(--ink-2); text-align: center; min-height: 2.3em; display: flex; align-items: center; }
.gest .gc { position: absolute; top: 5px; right: 5px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; display: none; place-items: center; font-variant-numeric: tabular-nums; }
.gest .gc.on { display: grid; }
.gest.pulse .ge { animation: beat .45s ease; }
.recv { text-align: center; font-size: 13px; font-weight: 700; color: var(--ink-2); margin: 4px 0 14px; }
.recv:empty { display: none; }

.banner { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--surface); border-radius: 22px; padding: 14px 16px; margin-bottom: 14px; box-shadow: inset 0 0 0 2px var(--accent-soft); }
.banner .bi { font-size: 28px; }

.card.white .input, .card.white textarea.input { background: var(--card-2); }
textarea.input.area { display: block; width: 100%; height: auto; min-height: 76px; padding: 12px 16px; resize: none; line-height: 1.4; font-weight: 600; }
.qtag { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-deep); }
.qtext { font-family: var(--head); font-weight: 700; font-size: 18px; line-height: 1.25; margin: 6px 0 12px; }
.bubble { padding: 10px 14px; border-radius: 18px; margin-top: 8px; font-size: 14.5px; line-height: 1.4; overflow-wrap: anywhere; white-space: pre-wrap; }
.bubble b { display: block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; opacity: .7; margin-bottom: 2px; white-space: normal; }
.bubble.me { background: var(--accent); color: #fff; border-radius: 18px 18px 6px 18px; margin-left: 28px; }
.bubble.pa { background: var(--sand); color: var(--ink); border-radius: 18px 18px 18px 6px; margin-right: 28px; }
.bubble.wait { background: var(--card-2); color: var(--ink-2); font-weight: 700; font-size: 13px; }
.link { color: var(--accent-deep); font-weight: 800; font-size: 13.5px; padding: 6px 0; }

.card.note { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--sand); }
.card.note.empty-note { background: var(--card); }
.note .ni { font-size: 26px; flex: none; }
.note-t { display: block; font-weight: 800; font-size: 16px; white-space: pre-wrap; overflow-wrap: anywhere; margin-bottom: 3px; }

.pet[role="button"] { cursor: pointer; }
.pet-sprite.sleep svg { animation: breathe 3.4s ease-in-out infinite; filter: brightness(.94); }
@keyframes breathe { 0%,100% { transform: scaleY(1); } 50% { transform: scaleY(1.04); } }
.pet-deco { position: absolute; top: 0; right: 4px; font-size: 16px; animation: floaty 2.4s ease-in-out infinite; }
.pet-deco.zz { font-size: 18px; animation-duration: 3.2s; }
.chip.coin { background: #fff1c2; color: #7a5b00; }
:root[data-theme="dark"] .chip.coin { background: #3d3217; color: #f3d27a; }

.homeadd { display: flex; align-items: center; gap: 12px; }
.homeadd .ha-ico { font-size: 30px; flex: none; }
.homeadd .btn { height: 40px; padding: 0 14px; font-size: 14px; flex: none; }
.x { width: 32px; height: 32px; border-radius: 50%; color: var(--ink-3); font-size: 22px; line-height: 1; flex: none; display: grid; place-items: center; }
.x:active { background: var(--card-2); }

/* ── общие мелочи ─────────────────────────────────────── */
.btn.danger { background: var(--danger); }
.btn.sm { height: 36px; padding: 0 12px; font-size: 13px; }
.row.wrap { flex-wrap: wrap; gap: 8px; }
.tab .btn.wide { margin-bottom: 12px; }
.seg { display: flex; background: var(--card); border-radius: 999px; padding: 4px; gap: 4px; margin: 0 0 14px; }
.seg button { flex: 1; min-width: 0; height: 38px; border-radius: 999px; font-weight: 800; font-size: 13.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 8px; }
.seg button.on { background: var(--surface); color: var(--accent-deep); box-shadow: 0 2px 8px -4px var(--shadow); }
.emoji-pick { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.emoji-pick button { width: 44px; height: 44px; border-radius: 14px; background: var(--card); font-size: 22px; }
.emoji-pick button.sel { background: var(--surface); box-shadow: inset 0 0 0 2px var(--accent); }
.how { margin: 0 6px 12px; line-height: 1.45; }

/* ── профиль: темы, уведомления, виджет ──────────────── */
.themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.theme-opt { background: var(--surface); border-radius: 20px; padding: 12px 8px; display: flex; flex-direction: column; align-items: center; gap: 8px; font-weight: 800; font-size: 13px; box-shadow: inset 0 0 0 2px transparent; }
.theme-opt.sel { box-shadow: inset 0 0 0 2px var(--accent); color: var(--accent-deep); }
.sw { display: flex; width: 58px; height: 36px; border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 1px var(--line); }
.sw i { flex: 1; }
.sw-pink i:nth-child(1) { background: #fbeae0; } .sw-pink i:nth-child(2) { background: #ec8088; } .sw-pink i:nth-child(3) { background: #f8ddb9; }
.sw-light i:nth-child(1) { background: #ffffff; } .sw-light i:nth-child(2) { background: #e8707b; } .sw-light i:nth-child(3) { background: #efe9e6; }
.sw-dark i:nth-child(1) { background: #151013; } .sw-dark i:nth-child(2) { background: #ee7d88; } .sw-dark i:nth-child(3) { background: #2f242a; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.set-row .t { font-weight: 800; }
.set-row .s { font-size: 13px; color: var(--ink-2); margin-top: 1px; }
.switch { position: relative; width: 50px; height: 30px; border-radius: 15px; background: var(--card); flex: none; transition: background .15s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch.on { background: var(--ok); }
.switch.on i { transform: translateX(20px); }
.quiet { display: flex; align-items: center; gap: 8px; font-weight: 700; margin: 10px 0 4px; }
.input.sel { height: 44px; flex: 1; padding: 0 12px; }
.warn { background: var(--sand); border-radius: 16px; padding: 12px 14px; font-size: 13.5px; font-weight: 700; margin-top: 12px; line-height: 1.4; }
.steps { padding-left: 22px; margin: 12px 0; }
.steps li { margin-bottom: 8px; line-height: 1.45; font-size: 14px; }
.linkbox { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; background: var(--card); border-radius: 14px; padding: 10px 12px; word-break: break-all; margin: 8px 0 10px; -webkit-user-select: all; user-select: all; }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; background: var(--card); padding: 1px 5px; border-radius: 6px; }

/* ══ Лента ════════════════════════════════════════════════════════════ */
.feed-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.feed-head .h1 { margin-bottom: 10px; }
.btn.add { height: 42px; padding: 0 16px; font-size: 14px; flex: none; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.ph { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--card); }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph .has-cap { position: absolute; right: 6px; bottom: 6px; width: 8px; height: 8px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px rgba(0,0,0,.2); }
.otd { padding: 16px; }
.otd-t { font-weight: 800; }
.otd-row { display: flex; gap: 10px; overflow-x: auto; margin-top: 10px; scrollbar-width: none; }
.otd-row::-webkit-scrollbar { display: none; }
.otd-ph { flex: none; width: 112px; text-align: left; color: inherit; }
.otd-ph img { width: 112px; height: 112px; border-radius: 16px; object-fit: cover; display: block; }
.otd-ph span { display: block; font-size: 12px; font-weight: 700; margin-top: 4px; opacity: .9; }
.feed-empty { text-align: center; padding: 26px 18px; }
.feed-empty .fe-ico { font-size: 48px; }
.feed-empty .h2 { margin: 8px 0 6px; }
.feed-empty .btn { margin-top: 14px; }
.feed-tip { text-align: center; margin: 16px 0 0; }
.up-prev { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 12px; }
.up-prev img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; display: block; }
.up-prev span { display: grid; place-items: center; background: var(--card); border-radius: 12px; font-weight: 800; aspect-ratio: 1; }
.up-prog { margin-top: 12px; }

.viewer { position: fixed; inset: 0; z-index: 38; display: none; flex-direction: column; background: #000; color: #fff; }
.viewer.open { display: flex; }
body.in-viewer { overflow: hidden; }
body.in-viewer .dock { display: none; }
.v-top { display: flex; align-items: center; gap: 10px; padding: calc(10px + var(--safe-t)) calc(12px + var(--safe-r)) 10px calc(12px + var(--safe-l)); flex: none; }
.v-btn { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.12); font-size: 22px; color: #fff; display: grid; place-items: center; flex: none; }
.v-meta { flex: 1; min-width: 0; text-align: center; }
.v-meta b { display: block; }
.v-meta span { font-size: 12px; opacity: .7; }
.v-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.v-stage img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.v-cap { padding: 12px 16px calc(16px + var(--safe-b)); font-weight: 700; text-align: center; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; flex: none; }
.v-nav { position: absolute; top: 50%; width: 44px; height: 44px; margin-top: -22px; border-radius: 50%; background: rgba(255,255,255,.14); font-size: 28px; color: #fff; display: grid; place-items: center; }
.v-nav.prev { left: 10px; }
.v-nav.next { right: 10px; }

/* ══ Вместе ═══════════════════════════════════════════════════════════ */
.subhead { display: flex; align-items: center; gap: 10px; margin: 2px 0 14px; }
.subhead .h1 { margin: 0; min-width: 0; font-size: 26px; overflow-wrap: anywhere; }
.subhead .back { width: 42px; height: 42px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; flex: none; color: var(--ink); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { background: var(--surface); border-radius: 24px; padding: 16px; text-align: left; display: flex; flex-direction: column; gap: 3px; min-height: 124px; transition: transform .12s; }
.tile:active { transform: scale(.98); }
.tile:last-child:nth-child(odd) { grid-column: 1 / -1; min-height: 0; }
.tile .te { font-size: 28px; line-height: 1.1; }
.tile .tt { font-family: var(--head); font-weight: 700; font-size: 16px; margin-top: 8px; }
.tile .ts { font-size: 12.5px; font-weight: 700; color: var(--ink-2); line-height: 1.3; }
.tile.hot { box-shadow: inset 0 0 0 2px var(--accent); }
.tile.hot .ts { color: var(--accent-deep); }

.qh-d { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.qh-q { font-weight: 800; margin: 4px 0 2px; }

.chips-scroll { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 12px; padding: 0 16px 4px; scrollbar-width: none; }
.chips-scroll::-webkit-scrollbar { display: none; }
.lchip { flex: none; height: 40px; padding: 0 14px; border-radius: 999px; background: var(--surface); font-weight: 800; font-size: 14px; white-space: nowrap; }
.lchip.on { background: var(--accent); color: #fff; }
.lchip i { font-style: normal; font-size: 12px; background: rgba(0,0,0,.08); border-radius: 999px; padding: 1px 7px; margin-left: 4px; }
.lchip.on i { background: rgba(255,255,255,.25); }
.lchip.add { width: 40px; padding: 0; font-size: 20px; color: var(--accent-deep); }
.lcard .field .btn { width: 52px; padding: 0; font-size: 22px; flex: none; }
.litems { margin-top: 10px; }
.li { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.li:last-child { border-bottom: 0; }
.li .grow { overflow-wrap: anywhere; font-weight: 600; }
.cb { width: 28px; height: 28px; border-radius: 9px; box-shadow: inset 0 0 0 2px var(--accent-soft); display: grid; place-items: center; color: #fff; font-weight: 900; flex: none; }
.li.done .cb { background: var(--ok); box-shadow: none; }
.li.done .grow { text-decoration: line-through; color: var(--ink-3); }
.li-empty { padding: 14px 4px 4px; text-align: center; }

.hint { margin: 0 4px 10px; }
.wishes { display: flex; flex-direction: column; gap: 8px; }
.wish { background: var(--surface); border-radius: 20px; padding: 14px; display: flex; align-items: center; gap: 10px; }
.wish .t { font-weight: 800; overflow-wrap: anywhere; }
.wish .s { font-size: 13px; color: var(--ink-2); margin-top: 2px; overflow-wrap: anywhere; }
.wish.taken { box-shadow: inset 0 0 0 2px var(--sand-deep); }
.wlink { color: var(--accent-deep); font-weight: 800; font-size: 13px; margin-top: 4px; }
.take { height: 36px; padding: 0 12px; border-radius: 999px; background: var(--card); font-weight: 800; font-size: 13px; white-space: nowrap; flex: none; }
.take.on { background: var(--sand); }
.more { width: 32px; height: 32px; border-radius: 50%; color: var(--ink-2); font-size: 18px; flex: none; }

.env { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--surface); border-radius: 22px; padding: 14px 16px; margin-bottom: 8px; }
.env .env-i { font-size: 26px; flex: none; }
.env b { display: block; overflow-wrap: anywhere; }
.env .s { display: block; font-size: 13px; color: var(--ink-2); font-weight: 600; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* «От меня»: сокращаем срок, а «прочитано / ещё запечатано» видно всегда.
   Промежуток — через gap: пробел в начале отдельного блока браузер съедает. */
.env.out .s { display: flex; gap: .25em; min-width: 0; }
.env.out .s-when { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.env.out .s-st { flex: none; white-space: nowrap; }
.env.ready { background: linear-gradient(135deg, var(--accent) 0%, #d9646e 100%); color: #fff; }
.env.ready .s { color: rgba(255,255,255,.85); }
.env-go { background: rgba(255,255,255,.22); padding: 7px 12px; border-radius: 999px; font-weight: 800; font-size: 13px; flex: none; }
.env.locked { opacity: .75; }
.letter { background: #fffaf3; color: #3b2a22; border-radius: 20px; padding: 22px 20px; font-size: 16px; line-height: 1.6; box-shadow: 0 10px 30px -18px rgba(59, 42, 34, .45); }
.letter .l-seal { text-align: center; font-size: 34px; }
.letter .l-title { font-family: var(--head); font-weight: 700; font-size: 19px; text-align: center; margin: 6px 0 14px; }
.letter .l-body { overflow-wrap: anywhere; }
.letter .l-sign { text-align: right; font-weight: 800; margin-top: 16px; font-style: italic; }

.game .g-h { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.game .g-e { font-size: 30px; line-height: 1; }
.game .h2 { margin: 0 0 2px; }
.g-note { background: var(--card-2); border-radius: 16px; padding: 10px 12px; font-weight: 700; font-size: 13.5px; margin: 0 0 10px; }
.g-hist { margin-top: 4px; }
.g-row { display: flex; justify-content: space-between; gap: 10px; width: 100%; padding: 10px 4px; border-top: 1px solid var(--line); font-size: 14px; font-weight: 700; text-align: left; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tod { border-radius: 20px; padding: 18px; margin-bottom: 12px; background: var(--sand); }
.tod.dare { background: var(--accent); color: #fff; }
.tod-k { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; opacity: .8; }
.tod-t { font-family: var(--head); font-weight: 700; font-size: 17px; line-height: 1.3; margin-top: 6px; }
.qopt { display: block; width: 100%; text-align: left; background: var(--card-2); border-radius: 18px; padding: 14px 16px; margin-top: 8px; font-weight: 700; font-size: 15px; line-height: 1.3; }
.qopt.sel { background: var(--accent); color: #fff; }
.ll { background: var(--card-2); border-radius: 18px; padding: 12px 14px; margin-bottom: 10px; }
.ll-h { font-size: 15px; margin-bottom: 8px; }
.ll-bar { display: grid; grid-template-columns: minmax(0, 150px) 1fr; gap: 8px; align-items: center; font-size: 12.5px; font-weight: 700; margin: 5px 0; }
/* Название языка не обрезаем: длинное переносится на вторую строку. */
.ll-bar span { overflow-wrap: anywhere; line-height: 1.2; }
.ll-bar i { display: block; height: 8px; border-radius: 999px; background: var(--card); overflow: hidden; }
.ll-bar i b { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.ll-tip { font-size: 13px; margin-top: 8px; line-height: 1.45; }
.result { text-align: center; }
.result .big-num { font-size: 52px; margin-top: 6px; }
.rq .t { font-weight: 800; margin-bottom: 4px; }
.rq .s { font-size: 14px; margin-top: 2px; }
.rq .ok { color: var(--ok); font-weight: 800; }
.rq .bad { color: var(--accent-deep); font-weight: 700; }

.shop-top { display: flex; gap: 14px; align-items: center; }
.shop-top .pet-sprite { width: 112px; height: 124px; }
.coins { font-family: var(--head); font-weight: 800; font-size: 28px; }
.shop { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.shop-it { background: var(--surface); border-radius: 20px; padding: 10px 6px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.shop-it .sp { height: 66px; display: flex; align-items: flex-end; justify-content: center; }
.shop-it .sp svg { image-rendering: pixelated; }
.shop-it .st { font-size: 12px; font-weight: 800; line-height: 1.2; }
.shop-it .sb { font-size: 12px; font-weight: 800; color: var(--accent-deep); background: var(--card-2); padding: 3px 9px; border-radius: 999px; }
.shop-it.owned .sb { color: var(--ok); }
.shop-it.worn { box-shadow: inset 0 0 0 2px var(--accent); }
.shop-it.worn .sb { background: var(--accent); color: #fff; }
.ach { display: flex; flex-direction: column; gap: 8px; }
.ach-it { display: flex; gap: 12px; align-items: center; background: var(--surface); border-radius: 18px; padding: 12px 14px; opacity: .62; filter: grayscale(.7); }
.ach-it.got { opacity: 1; filter: none; }
.ach-it .ae { font-size: 24px; width: 34px; text-align: center; flex: none; }
.ach-it b { display: block; font-size: 14px; }
.ach-it .s { display: block; font-size: 12.5px; color: var(--ink-2); }
.ach-it .ar { font-weight: 800; font-size: 13px; color: var(--accent-deep); white-space: nowrap; }
.ach-it.got .ar { color: var(--ok); font-size: 18px; }

.card-prev { margin: 0 0 14px; border-radius: 24px; overflow: hidden; background: var(--card); aspect-ratio: 1080 / 1350; }
.card-prev img { width: 100%; height: 100%; display: block; }
.skeleton.tall { height: 100%; margin: 0; border-radius: 0; }

@media (max-width: 360px) {
  .gest .gl { font-size: 10.5px; }
  .shop { grid-template-columns: repeat(2, 1fr); }
}
/* Совсем узкий телефон: колонку названий сужаем, чтобы полоске осталось место. */
@media (max-width: 340px) {
  .ll-bar { grid-template-columns: minmax(0, 120px) 1fr; }
}

/* ── правки после просмотра ───────────────────────────── */
.ci { display: inline-block; width: .95em; height: .95em; border-radius: 50%; vertical-align: -.13em;
  background: radial-gradient(circle at 34% 30%, #fff4b8 0 16%, #f7c948 38%, #e3a300 72%, #b98000 100%);
  box-shadow: inset 0 0 0 .09em #c48a00; }
.icon-bubble.pet-ico svg { image-rendering: pixelated; }
.quiet-btn { color: var(--ink-3); font-size: 14px; height: 44px; }
.otd.one { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; }
.otd.one img { width: 96px; height: 96px; border-radius: 16px; object-fit: cover; flex: none; }
.otd.one .otd-t, .otd.one .otd-y, .otd.one .otd-c { display: block; }
.otd.one .otd-y { font-family: var(--head); font-weight: 700; font-size: 20px; margin-top: 4px; }
.otd.one .otd-c { font-size: 13.5px; font-weight: 600; opacity: .9; margin-top: 4px; overflow-wrap: anywhere; }
:root[data-theme="dark"] .dock button.on { background: var(--card-2); }

/* ── где мы ──────────────────────────────────────────── */
.card.place { display: block; width: 100%; text-align: left; }
.pl-km { font-family: var(--head); font-weight: 700; font-size: 17px; margin: 8px 0 12px; }
.pl-km b { font-size: 32px; color: var(--accent-deep); font-weight: 800; }
.pl-km.same { font-size: 20px; }
.pl-route { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 14.5px; }
/* Обрезается только название города (.pl-n) — с многоточием; точка и её
   ободок остаются целыми, а город партнёра не теряет начало. */
.pl-end { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 42%; }
.pl-end.r { justify-content: flex-end; }
.pl-n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-end i { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.pl-line { flex: 1; min-width: 20px; border-top: 2px dashed var(--accent-soft); }
.pl-who { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; color: var(--ink-3); margin: 2px 18px 0; }
.pl-time { margin-top: 10px; }
.pl-one { font-size: 16px; margin: 8px 0 4px; }
.city-list { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.city-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left; background: var(--surface); border-radius: 16px; padding: 12px 14px; }
.city-opt span { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.city-wait { padding: 10px 4px; }

/* ══ 1.3: реакции, сердечки от партнёра, питомец, клавиатура ═══════════ */
/* Реакции на ответы вопроса дня (главная и история в us.js): под ответом
   партнёра — свои кнопки, под своим ответом — плашка «Имя: 😂». */
.react-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 28px 0 0; }
.react-btn { width: 44px; height: 36px; border-radius: 999px; background: var(--card-2); font-size: 18px; line-height: 1;
  display: inline-grid; place-items: center; transition: transform .12s ease, background .15s, box-shadow .15s; }
.react-btn:active { transform: scale(1.15); }
.react-btn.on { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.react-got { position: relative; z-index: 1; width: fit-content; max-width: calc(100% - 40px); margin: -8px 12px 0 auto;
  padding: 4px 10px; border-radius: 999px; background: var(--surface); color: var(--ink-2); font-size: 12.5px; font-weight: 800;
  line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; box-shadow: 0 3px 10px -4px var(--shadow), 0 0 0 1px var(--line); }

/* Жесты от партнёра: плашка сверху и «дождь» из значков. */
.heart-banner { position: fixed; left: 50%; top: calc(10px + var(--safe-t)); z-index: 55; width: min(488px, calc(100% - 24px));
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 8px 12px 14px; border-radius: 22px; background: var(--surface);
  box-shadow: 0 14px 34px -14px var(--shadow), inset 0 0 0 2px var(--accent-soft);
  transform: translate(-50%, calc(-100% - 30px)); visibility: hidden; transition: transform .32s cubic-bezier(.2,.8,.2,1), visibility .32s; }
.heart-banner.show { transform: translate(-50%, 0); visibility: visible; }
.heart-banner .hb-e { font-size: 34px; line-height: 1; flex: none; margin-top: 4px; }
.heart-banner.show .hb-e { animation: beat .6s ease 2; }
.heart-banner .hb-t { font-weight: 700; font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; margin: 2px 0 8px; }
.heart-banner .btn { padding: 0 16px; }
.heart-banner .x { margin-top: -2px; }
.fly.fall { font-size: 26px; animation: fall 2s cubic-bezier(.35,.1,.6,1) forwards; opacity: 0; }
@keyframes fall {
  0% { opacity: 0; transform: translate(0, -30px) scale(.7) rotate(0deg); }
  12% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), 62vh) scale(1.25) rotate(var(--rot, 0deg)); }
}

/* «Обнять» на карточке грустного настроения партнёра. */
.mood-card .hug-btn { margin-top: 4px; }

/* «Спасти серию за монеты» — ледяная кнопка во всю ширину карточки питомца,
   отдельной строкой под ним. */
.pet { flex-wrap: wrap; }
.btn.save-streak { flex: 1 0 100%; height: 44px; margin-top: -2px; font-size: 14px; background: #dff1fb; color: #1d6a93; }
:root[data-theme="dark"] .btn.save-streak { background: #1c3341; color: #a6dbf7; }

/* Погладить питомца: прыжок и реплика в облачке. */
.pet-sprite[data-act] { cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.pet-sprite.petted svg { animation: pet-hop .6s cubic-bezier(.3,.7,.4,1); }
@keyframes pet-hop {
  0% { transform: translateY(0) scale(1); }
  20% { transform: translateY(0) scale(1.06, .9); }
  50% { transform: translateY(-16px) scale(.96, 1.05); }
  80% { transform: translateY(0) scale(1.04, .95); }
  100% { transform: translateY(0) scale(1); }
}
.pet-bubble { position: absolute; left: -2px; bottom: calc(100% - 22px); z-index: 6; width: max-content; max-width: min(220px, 64vw);
  padding: 8px 12px; border-radius: 16px 16px 16px 4px; background: var(--surface); color: var(--ink);
  font-size: 13px; font-weight: 700; line-height: 1.3; text-align: left; white-space: normal; pointer-events: none;
  box-shadow: 0 8px 22px -10px var(--shadow), inset 0 0 0 1.5px var(--accent-soft);
  transform-origin: 12px 100%; animation: bubble-in .25s cubic-bezier(.2,.8,.2,1); transition: opacity .3s; }
.pet-bubble.out { opacity: 0; }
@keyframes bubble-in { from { opacity: 0; transform: translateY(6px) scale(.85); } to { opacity: 1; transform: none; } }

/* Клавиатура открыта (телефон, поле в фокусе): нижняя панель не заслоняет
   поле, в зале реакции уступают место чату. Подъём шторки и зала — --kb. */
body.kb-open .dock { display: none; }
body.kb-open .theater:not(.fs) .th-reacts { display: none; }
.sheet { transition: transform .28s cubic-bezier(.2,.8,.2,1), bottom .2s ease; }

/* На весь экран у Telegram сверху его кнопки: подсказки и время в зале — ниже. */
.theater.fs .th-toast { top: calc(10px + var(--safe-t)); }
.theater.fs .th-join.yt { padding-top: calc(12px + var(--safe-t)); }
.theater.fs .th-bar { padding-left: calc(12px + var(--safe-l)); padding-right: calc(12px + var(--safe-r)); }

/* ── встреча ─────────────────────────────────────────── */
.card.meet { display: block; width: 100%; text-align: left; background: linear-gradient(135deg, var(--accent) 0%, #d9646e 100%); color: #fff; }
.card.meet.empty { display: flex; align-items: center; gap: 12px; background: var(--card); color: var(--ink); }
.meet .mi { font-size: 24px; }
.meet-top { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.meet-top b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
.meet-when { font-size: 12.5px; font-weight: 700; opacity: .9; white-space: nowrap; }
.meet-cd { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }
.meet-cd > div { background: rgba(255,255,255,.18); border-radius: 16px; padding: 10px 2px 8px; }
.meet-cd i { display: block; font-style: normal; font-family: var(--head); font-weight: 800; font-size: 28px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.meet-cd span { font-size: 11.5px; font-weight: 700; opacity: .85; }
.card.meet.soon .meet-cd > div:last-child { animation: beat 1s ease-in-out infinite; }
.card.meet.now { text-align: center; }
.meet-big { font-family: var(--head); font-weight: 800; font-size: 32px; margin: 6px 0; }
.two-in { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.two-in .input { width: 100%; }
