/* Кинюшня — веб. Тот же облик, что в приложении: тёмный кинозал,
   стекло на элементах управления, цвет темы в акцентах. */

:root, [data-theme="cinema"] {
  --bg: #07070a; --surface: #131318; --surface2: #1c1c23;
  --accent: #ffb443; --accent2: #ff7a3d;
  --primary: #fff; --on-primary: #000;
  --primary-bg: #fff;
  --glass: rgba(255,255,255,.14); --tint: 235,235,245;
  --selected: #fff; --on-selected: #000; --tab: rgba(255,255,255,.14);
  --glow: transparent;
}
[data-theme="black"] {
  --bg: #000; --surface: #0d0d0d; --surface2: #171717;
  --accent: #ededed; --accent2: #8a8a8a;
  --glow: transparent;
}
[data-theme="pink"] {
  --bg: #2a0820; --surface: #3b0e2f; --surface2: #4c143d;
  --accent: #ff5cad; --accent2: #ff9bd2;
  --on-primary: #fff; --primary-bg: linear-gradient(135deg, #ff5cad, #ff9bd2);
  --glass: rgba(255,123,192,.22); --tint: 255,214,236;
  --selected: #ff5cad; --on-selected: #fff; --tab: rgba(255,92,173,.4);
  --glow: #ff3d9a;
}
[data-theme="bunny"] {
  --bg: #2e2440; --surface: #3b3052; --surface2: #4a3e63;
  --accent: #ffb8cb; --accent2: #ffe8a6;
  --on-primary: #3a2440; --primary-bg: linear-gradient(135deg, #ffb8cb, #ffe8a6);
  --glass: rgba(255,230,241,.22); --tint: 255,241,247;
  --selected: #ffb8cb; --on-selected: #3a2440; --tab: rgba(255,184,203,.4);
  --glow: #b9a4ff;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: #f7f7fa;
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  transition: background .6s;
  overflow-x: hidden;
}
body::before {
  /* Свечение темы — розовые и лавандовые пятна. */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(60vw 60vw at 10% -10%, color-mix(in srgb, var(--glow) 38%, transparent), transparent 70%),
    radial-gradient(70vw 70vw at 100% 110%, color-mix(in srgb, var(--glow) 28%, transparent), transparent 70%);
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
input { font: inherit; color: inherit; }
img { display: block; }
.t2 { color: rgba(var(--tint), .72); }
.t3 { color: rgba(var(--tint), .48); }

#app { position: relative; z-index: 1; min-height: 100%; }
.page { padding-bottom: 120px; animation: pageIn .35s ease; }
@keyframes pageIn { from { opacity: 0; transform: translateY(12px); } }
.wrap { max-width: 1400px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 48px); }

/* --- навигация --- */
.nav {
  position: fixed; z-index: 50; left: 50%; bottom: 14px; transform: translateX(-50%);
  display: flex; gap: 4px; padding: 6px; border-radius: 32px;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 10px 40px rgba(0,0,0,.35);
}
.nav a {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  min-width: 70px; padding: 8px 14px; border-radius: 26px;
  color: rgba(var(--tint), .48); font-size: 11px; transition: background .25s, color .25s;
}
.nav a svg { width: 24px; height: 24px; }
.nav a.on { background: var(--tab); color: #fff; }
@media (min-width: 900px) {
  .nav { top: 18px; bottom: auto; flex-direction: row; }
  .nav a { flex-direction: row; gap: 8px; font-size: 14px; padding: 8px 16px; }
  .nav a svg { width: 20px; height: 20px; }
  .page { padding-top: 0; padding-bottom: 60px; }
}

/* --- кнопки и стекло --- */
.glass {
  background: var(--glass);
  border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; padding: 0 24px; border-radius: 16px; font-weight: 700;
  transition: transform .15s ease, filter .2s;
}
.btn:active { transform: scale(.96); }
.btn:hover { filter: brightness(1.08); }
.btn svg { width: 22px; height: 22px; }
.btn.primary { background: var(--primary-bg); color: var(--on-primary); }
.btn.ghost { background: var(--glass); border: 1px solid rgba(255,255,255,.18); backdrop-filter: blur(16px); }
.circle {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: var(--glass); border: 1px solid rgba(255,255,255,.18); backdrop-filter: blur(16px);
  transition: transform .15s;
}
.circle:active { transform: scale(.92); }
.circle svg { width: 24px; height: 24px; }
.chip {
  flex: none; padding: 9px 16px; border-radius: 99px; font-size: 13px; font-weight: 500;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); white-space: nowrap;
  transition: background .2s, color .2s;
}
.chip.on { background: var(--selected); color: var(--on-selected); border-color: transparent; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.chips::-webkit-scrollbar { display: none; }
.field {
  width: 100%; height: 54px; padding: 0 18px; border-radius: 18px; outline: none;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.15);
  transition: border-color .2s;
}
.field:focus { border-color: rgba(255,255,255,.5); }

/* --- шапка главной --- */
.hero { position: relative; height: min(78vh, 760px); min-height: 520px; overflow: hidden; }
.hero .bg { position: absolute; inset: 0; background-size: cover; background-position: center 20%; transition: opacity .8s; animation: kb 18s ease-in-out infinite alternate; }
@keyframes kb { from { transform: scale(1.04); } to { transform: scale(1.14); } }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 30%, color-mix(in srgb, var(--bg) 45%, transparent) 55%, color-mix(in srgb, var(--bg) 92%, transparent) 85%, var(--bg)); }
.hero .side { position: absolute; inset: 0; background: linear-gradient(90deg, color-mix(in srgb, var(--bg) 70%, transparent), transparent 60%); z-index: 1; }
.hero .info { position: absolute; z-index: 2; left: 0; right: 0; bottom: 48px; }
.hero .kind { color: var(--accent); font-weight: 700; letter-spacing: 2px; font-size: 12px; }
.hero h1 { font-size: clamp(34px, 5vw, 64px); line-height: 1.02; margin: 10px 0; font-weight: 900; letter-spacing: -1.5px; max-width: 760px; }
.hero .logo { max-height: 120px; max-width: min(420px, 80vw); object-fit: contain; object-position: left bottom; margin: 10px 0; }
.hero .desc { max-width: 560px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero .actions { display: flex; gap: 12px; margin-top: 20px; align-items: center; }
.dots { display: flex; gap: 6px; }
.dots i { width: 6px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.35); transition: width .3s, background .3s; }
.dots i.on { width: 20px; background: #fff; }
.meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* --- ряды --- */
.row { margin-top: 26px; position: relative; }
.row h2 { font-size: 22px; margin: 0 0 10px; letter-spacing: -.3px; display: flex; align-items: center; }
.row h2 a { margin-left: auto; font-size: 13px; font-weight: 500; color: rgba(var(--tint), .72); }
.strip { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; padding: 6px 2px 10px; scroll-behavior: smooth; }
.strip::-webkit-scrollbar { display: none; }
.strip > * { scroll-snap-align: start; flex: none; }
.arrow { position: absolute; top: 50%; z-index: 3; display: none; }
@media (hover: hover) {
  .row:hover .arrow { display: grid; }
}
.arrow.l { left: -20px; } .arrow.r { right: -20px; }

.poster { width: 150px; transition: transform .2s; }
.poster:hover { transform: translateY(-4px); }
.poster .pic { position: relative; aspect-ratio: 2/3; border-radius: 14px; overflow: hidden; background: linear-gradient(var(--surface2), var(--surface)); border: 1px solid rgba(255,255,255,.08); }
.poster .pic img { width: 100%; height: 100%; object-fit: cover; }
.poster .name { margin-top: 7px; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.poster .sub { font-size: 11px; }
.badge {
  position: absolute; top: 7px; left: 7px; display: flex; align-items: center; gap: 4px;
  padding: 2px 6px; border-radius: 8px; font-size: 11px; font-weight: 700;
  background: rgba(0,0,0,.55); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.18);
}
.badge i { width: 6px; height: 6px; border-radius: 50%; background: #34d27b; }
.badge.mid i { background: #b8b8c4; } .badge.low i { background: #ff6b6b; }
.prog { position: absolute; left: 8px; right: 8px; bottom: 7px; height: 3px; border-radius: 2px; background: rgba(255,255,255,.35); overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--accent); }

.wide { width: 300px; }
.wide .pic { aspect-ratio: 16/9; position: relative; border-radius: 14px; overflow: hidden; background: var(--surface); }
.wide .pic img { width: 100%; height: 100%; object-fit: cover; }
.wide .pic::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 40%, rgba(0,0,0,.85)); }
.wide .cap { position: absolute; z-index: 1; left: 12px; right: 12px; bottom: 10px; font-weight: 600; }

.top10 { display: flex; align-items: flex-end; width: 175px; }
.top10 .num { font-size: 140px; font-weight: 900; line-height: .8; letter-spacing: -10px; margin-right: -22px;
  background: linear-gradient(rgba(255,255,255,.45), rgba(255,255,255,.04)); -webkit-background-clip: text; color: transparent; }
.top10 .poster { width: 120px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 18px 14px; }
.grid .poster { width: auto; }

/* --- плашка «Зайка выбирает» --- */
.pickbar { display: flex; align-items: center; gap: 14px; margin-top: 18px; padding: 14px 18px; border-radius: 22px; cursor: pointer;
  background: color-mix(in srgb, var(--accent) 16%, transparent); border: 1px solid rgba(255,255,255,.16); transition: transform .2s; }
.pickbar:hover { transform: translateY(-2px); }
.pickbar .ico { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: var(--on-primary); flex: none; }
.pickbar b { display: block; font-size: 16px; }
.pickbar .said { color: var(--accent); }

/* --- карточка фильма --- */
.title-hero { position: relative; min-height: 640px; display: flex; align-items: flex-end; }
.title-hero .bg { position: absolute; inset: 0; background-size: cover; background-position: center 25%; }
.title-hero::after { content: ""; position: absolute; inset: 0; background:
  linear-gradient(90deg, color-mix(in srgb, var(--bg) 90%, transparent) 0, color-mix(in srgb, var(--bg) 40%, transparent) 55%, transparent),
  linear-gradient(transparent 50%, var(--bg)); }
.title-hero .wrap { position: relative; z-index: 1; width: 100%; padding-bottom: 30px; }
.title-hero h1 { font-size: clamp(32px, 4.5vw, 58px); margin: 0 0 12px; font-weight: 900; letter-spacing: -1px; max-width: 760px; line-height: 1.05; }
.title-hero .tag { font-size: 18px; font-weight: 600; margin: 4px 0 10px; }
.title-hero .over { max-width: 680px; }
.acts { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 22px; }
.acts .small { font-size: 13px; color: rgba(var(--tint),.72); text-decoration: underline; text-underline-offset: 3px; }
.facts { display: grid; grid-template-columns: 110px 1fr; gap: 4px 12px; max-width: 680px; margin-top: 16px; font-size: 14px; }
.back { position: fixed; top: 16px; left: 16px; z-index: 40; }
@media (min-width: 900px) { .back { top: 18px; left: 24px; } }

.episodes { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.ep { display: flex; gap: 12px; padding: 8px; border-radius: 16px; cursor: pointer; transition: background .2s; }
.ep:hover { background: rgba(255,255,255,.06); }
.ep .still { position: relative; width: 150px; aspect-ratio: 16/9; border-radius: 12px; overflow: hidden; background: var(--surface2); flex: none; }
.ep .still img { width: 100%; height: 100%; object-fit: cover; }
.ep b { display: block; }
.ep p { margin: 2px 0 0; font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cast { width: 96px; text-align: center; font-size: 12px; }
.cast img, .cast .ph { width: 80px; height: 80px; margin: 0 auto 6px; border-radius: 50%; object-fit: cover; background: var(--surface2); }

/* --- шторка (выбор раздачи, «зайка выбирает») --- */
.sheet-bg { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.55); backdrop-filter: blur(4px); animation: fade .2s; display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 900px) { .sheet-bg { align-items: center; } }
@keyframes fade { from { opacity: 0; } }
.sheet { width: min(720px, 100%); max-height: 88vh; overflow: auto; background: var(--surface); border-radius: 28px 28px 0 0; padding: 14px 22px 28px; animation: up .3s cubic-bezier(.2,.8,.2,1); }
@media (min-width: 900px) { .sheet { border-radius: 28px; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet .handle { width: 38px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.25); margin: 0 auto 14px; }
.sheet h3 { font-size: 24px; margin: 0 0 4px; }
.rel { display: flex; gap: 10px; align-items: center; padding: 12px; border-radius: 16px; cursor: pointer; transition: background .15s; }
.rel:hover { background: rgba(255,255,255,.06); }
.rel.best { background: color-mix(in srgb, var(--accent) 16%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent); }
.rel .bestlbl { display: inline-block; padding: 3px 8px; border-radius: 8px; font-size: 11px; font-weight: 700; color: var(--on-primary); background: linear-gradient(90deg, var(--accent), var(--accent2)); margin-bottom: 6px; }
.rel .voices { font-weight: 600; font-size: 16px; }
.rel .ttl { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.rel .seeds { margin-left: auto; text-align: right; font-weight: 700; white-space: nowrap; }
.good { color: #34d27b; } .mid { color: #ffc53d; } .bad { color: #ff6b6b; }

/* --- вход --- */
.login { min-height: 100vh; display: grid; place-items: center; position: relative; overflow: hidden; }
.wall { position: absolute; inset: -20%; transform: rotate(-10deg); display: flex; flex-direction: column; gap: 12px; opacity: .55; }
.wall .line { display: flex; gap: 12px; width: max-content; animation: slide 90s linear infinite; }
.wall .line:nth-child(even) { animation-direction: reverse; }
.wall img { width: 120px; aspect-ratio: 2/3; border-radius: 12px; object-fit: cover; }
@keyframes slide { to { transform: translateX(-50%); } }
.login::after { content: ""; position: absolute; inset: 0; background: linear-gradient(color-mix(in srgb, var(--bg) 55%, transparent), color-mix(in srgb, var(--bg) 92%, transparent)); }
.login .card { position: relative; z-index: 1; width: min(440px, 92vw); padding: 26px; border-radius: 28px; text-align: center;
  background: color-mix(in srgb, var(--bg) 80%, transparent); border: 1px solid rgba(255,255,255,.16); backdrop-filter: blur(20px); }
.brand { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 18px; }
.brand .ico { width: 58px; height: 58px; border-radius: 18px; background: linear-gradient(135deg, var(--accent), var(--accent2)); display: grid; place-items: center; }
.brand span { font-size: 38px; font-weight: 900; letter-spacing: -1.4px; }
.cells { display: flex; gap: 8px; justify-content: center; margin: 18px 0 12px; }
.cells { position: relative; cursor: text; }
.cells span { width: 48px; height: 58px; display: grid; place-items: center; font: 700 26px/1 ui-monospace, monospace; border-radius: 14px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.15); }
.cells span.active { border: 2px solid #fff; }
.code-real { position: absolute; inset: 0; opacity: 0; width: 100%; font-size: 16px; }
.err { color: #ff6b6b; margin-top: 10px; }
.code { font: 700 44px/1 ui-monospace, monospace; letter-spacing: 10px; margin: 18px 0; }

/* --- профиль --- */
.pro-head { text-align: center; padding: 60px 0 26px; background: linear-gradient(color-mix(in srgb, var(--accent) 28%, transparent), transparent); }
.avatar { width: 96px; height: 96px; border-radius: 50%; margin: 0 auto 12px; display: grid; place-items: center; font-size: 42px; font-weight: 900; color: var(--on-primary); background: linear-gradient(135deg, var(--accent), var(--accent2)); }
.group { max-width: 640px; margin: 14px auto 0; border-radius: 22px; padding: 6px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); }
.item { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 16px; cursor: pointer; }
.item:hover { background: rgba(255,255,255,.05); }
.themes { display: flex; justify-content: space-evenly; padding: 10px; }
.swatch { text-align: center; font-size: 13px; cursor: pointer; }
.swatch .c { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 6px; border: 3px solid transparent; }
.swatch.on .c { border-color: #fff; }

/* --- плеер --- */
.player { position: fixed; inset: 0; z-index: 100; background: #000; cursor: none; }
.player.ui { cursor: default; }
.player video { width: 100%; height: 100%; object-fit: contain; }
.player.fill video { object-fit: cover; }
.player .shade { position: absolute; inset: 0; background: linear-gradient(rgba(0,0,0,.7), transparent 25%, transparent 70%, rgba(0,0,0,.8)); opacity: 0; transition: opacity .3s; pointer-events: none; }
.player.ui .shade { opacity: 1; }
.player .top, .player .bottom, .player .mid { position: absolute; left: 0; right: 0; opacity: 0; transition: opacity .3s; pointer-events: none; }
.player.ui .top, .player.ui .bottom, .player.ui .mid { opacity: 1; pointer-events: auto; }
.player .top { top: 0; display: flex; align-items: center; gap: 14px; padding: 18px 24px; }
.player .top .ttl { flex: 1; min-width: 0; }
.player .top .ttl b { font-size: 20px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player .mid { top: 50%; transform: translateY(-50%); display: flex; justify-content: center; gap: 40px; align-items: center; }
.player .mid .big { width: 88px; height: 88px; }
.player .mid .big svg { width: 46px; height: 46px; }
.player .bottom { bottom: 0; padding: 0 24px 22px; }
.scrub { position: relative; height: 34px; cursor: pointer; display: flex; align-items: center; }
.scrub .track { position: relative; width: 100%; height: 4px; border-radius: 2px; background: rgba(255,255,255,.2); overflow: hidden; transition: height .15s; }
.scrub:hover .track { height: 8px; }
.scrub .buf { position: absolute; inset: 0 auto 0 0; background: rgba(255,255,255,.3); }
.scrub .cur { position: absolute; inset: 0 auto 0 0; background: #fff; }
.scrub .thumb { position: absolute; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: #fff; }
.scrub .tip { position: absolute; bottom: 34px; transform: translateX(-50%); padding: 3px 9px; border-radius: 9px; background: rgba(0,0,0,.7); font-weight: 700; font-size: 13px; display: none; }
.scrub:hover .tip { display: block; }
.times { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.times .sp { flex: 1; }
.player .center-msg { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.spinner { width: 52px; height: 52px; border: 3px solid rgba(255,255,255,.25); border-top-color: #fff; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hint { padding: 8px 18px; border-radius: 99px; background: rgba(0,0,0,.6); font-weight: 600; font-size: 18px; }
.subs-line { position: absolute; left: 0; right: 0; bottom: 60px; text-align: center; font-size: clamp(18px, 2.4vw, 30px); text-shadow: 0 0 8px #000, 0 0 2px #000; pointer-events: none; white-space: pre-line; }
.player.ui .subs-line { bottom: 130px; }
.menu { position: absolute; right: 24px; top: 78px; width: 300px; max-height: 70vh; overflow: auto; padding: 8px; border-radius: 18px; background: rgba(20,20,26,.92); backdrop-filter: blur(16px); border: 1px solid rgba(255,255,255,.14); }
.menu h4 { margin: 8px 10px; font-size: 15px; }
.menu .opt { padding: 10px 12px; border-radius: 12px; cursor: pointer; display: flex; justify-content: space-between; }
.menu .opt:hover { background: rgba(255,255,255,.08); }
.menu .opt.on { color: var(--accent); }

/* --- зайка --- */
.bunny { position: relative; display: inline-block; cursor: pointer; user-select: none; }
.bunny svg { width: 100%; height: 100%; overflow: visible; transform-origin: 50% 95%; animation: sway 3.2s ease-in-out infinite; }
@keyframes sway { 0%,100% { transform: rotate(-2.4deg); } 50% { transform: rotate(2.4deg); } }
.bunny .ear { transform-box: fill-box; transform-origin: 50% 90%; animation: ear 3.2s ease-in-out infinite; }
.bunny .ear.r { animation-direction: reverse; }
@keyframes ear { 0%,100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
.bunny.jump svg { animation: jump .55s cubic-bezier(.3,1.6,.5,1); }
@keyframes jump { 0% { transform: scale(1.15, .82); } 40% { transform: translateY(-35%) scale(.92, 1.08); } 100% { transform: none; } }
.bunny.spin svg { animation: flip .7s ease-in-out; }
@keyframes flip { to { transform: rotate(360deg); } }
.bunny.sleep svg { animation: none; transform: rotate(8deg); }
.bunny .bubble { position: absolute; left: 50%; bottom: 108%; transform: translateX(-50%) scale(.6); opacity: 0; white-space: nowrap; padding: 5px 11px; border-radius: 14px;
  background: #fffdf8; color: #3a2440; font-size: 13px; font-weight: 600; pointer-events: none; transition: transform .3s cubic-bezier(.3,1.6,.5,1), opacity .2s; z-index: 5; }
.bunny .bubble.on { transform: translateX(-50%) scale(1); opacity: 1; }
.bunny .heart { position: absolute; left: 50%; top: 40%; width: 16px; height: 16px; pointer-events: none; animation: heart 1s ease-out forwards; }
@keyframes heart { to { transform: translate(var(--dx), var(--dy)) scale(.6); opacity: 0; } }

.empty { text-align: center; padding: 70px 20px; }
.skel { background: linear-gradient(100deg, var(--surface) 30%, rgba(255,255,255,.06) 50%, var(--surface) 70%); background-size: 300% 100%; animation: shimmer 1.3s linear infinite; border-radius: 14px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.toast { position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%); z-index: 200; padding: 10px 18px; border-radius: 14px; background: rgba(20,20,26,.95); border: 1px solid rgba(255,255,255,.15); animation: up .3s; }
.meta .badge, .acts .badge { position: static; }

/* --- ТВ --- */
.tv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.tv-tile {
  position: relative; padding: 14px 12px 12px; border-radius: 18px; cursor: pointer;
  background: var(--surface); border: 1px solid rgba(255,255,255,.06);
  transition: transform .18s, background .18s; outline: none;
}
.tv-tile:hover, .tv-tile:focus-visible { transform: translateY(-3px); background: var(--surface2); }
.tv-tile:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.tv-name { font-weight: 650; margin-top: 10px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tv-sub { font-size: 12px; margin-top: 2px; }
.tv-star { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 50%; font-size: 17px; color: rgba(var(--tint), .35); }
.tv-star:hover { color: rgba(var(--tint), .8); }
.tv-star.on { color: var(--accent); }
.tv-logo {
  position: relative; display: grid; place-items: center; overflow: hidden; border-radius: 14px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 30%, var(--surface2)), var(--surface2));
}
.tv-logo span { font-weight: 800; letter-spacing: .5px; color: rgba(255,255,255,.85); }
.tv-logo img { position: absolute; inset: 12%; width: 76%; height: 76%; object-fit: contain; }
.tv-logo.has { background: rgba(255,255,255,.92); }
.tv-logo.has span { display: none; }
.tv-logo.md { aspect-ratio: 16/10; }
.tv-logo.md span { font-size: 26px; }
.tv-logo.sm { width: 52px; height: 38px; border-radius: 10px; flex: none; }
.tv-logo.sm span { font-size: 13px; }
.tv-logo.xs { width: 40px; height: 28px; border-radius: 7px; flex: none; }
.tv-logo.xs span { font-size: 11px; }
.tv-last {
  display: flex; align-items: center; gap: 12px; text-align: left; margin-bottom: 14px;
  padding: 10px 16px 10px 10px; border-radius: 18px; background: var(--glass); backdrop-filter: blur(20px);
}
.tv-last svg { width: 26px; height: 26px; margin-left: 10px; }
.tv-live { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 99px; background: #e5323e; font-size: 12px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; }
.tv-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: livePulse 1.4s ease-in-out infinite; }
@keyframes livePulse { 50% { opacity: .25; } }
.tv-player .top .tv-cur-logo { display: flex; }
.tv-side {
  position: absolute; top: 84px; right: 16px; bottom: 16px; width: 300px; overflow-y: auto;
  padding: 8px; border-radius: 20px; background: rgba(12,12,16,.78); backdrop-filter: blur(24px);
  transform: translateX(340px); transition: transform .3s ease; scrollbar-width: thin;
}
.tv-player.side .tv-side { transform: none; }
.tv-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border-radius: 12px; text-align: left; }
.tv-row span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-row:hover { background: rgba(255,255,255,.08); }
.tv-row.on { background: var(--selected); color: var(--on-selected); }
@media (max-width: 700px) {
  .tv-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
  .tv-player .top .tv-cur-logo, .tv-player .tv-live { display: none; }
  .tv-side { width: auto; left: 16px; top: auto; height: 50%; transform: translateY(110%); }
}
.tv-player.failed .mid { display: none; }

/* --- Вместе --- */
.rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.room-card { position: relative; display: block; height: 140px; border-radius: 22px; overflow: hidden; background: var(--surface); transition: transform .18s; }
.room-card:hover { transform: translateY(-3px); }
.room-card .bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: .45; }
.room-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, color-mix(in srgb, var(--bg) 92%, transparent), color-mix(in srgb, var(--bg) 35%, transparent)); }
.room-card .in { position: relative; z-index: 1; padding: 18px; }
.room-card b { font-size: 20px; display: block; margin-bottom: 4px; }
.accent { color: var(--accent); }
.online { color: #3ddc84; font-size: 12px; }
.avatars { display: flex; }
.avatars .av { position: relative; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; border: 2px solid var(--bg); margin-left: -8px; }
.avatars .av:first-child { margin-left: 0; }
.avatars .av i { position: absolute; right: -2px; bottom: -2px; width: 10px; height: 10px; border-radius: 50%; background: #3ddc84; border: 2px solid var(--bg); }
.now-card { position: relative; margin: 18px 0; min-height: 260px; border-radius: 24px; overflow: hidden; background: var(--surface) center/cover; display: flex; align-items: flex-end; }
.now-card::before { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 20%, rgba(0,0,0,.88)); }
.now-card .in { position: relative; padding: 22px; }
.now-card.empty { flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; }
.now-card.empty::before { display: none; }
.live-dot { color: #ff5a5f; }
.room-chat .msgs { display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow-y: auto; }
.bubble { align-self: flex-start; max-width: 80%; padding: 8px 12px; border-radius: 16px; background: rgba(28,28,34,.85); display: flex; flex-direction: column; }
.bubble b { color: var(--accent); font-size: 12px; }
.bubble.mine { align-self: flex-end; background: color-mix(in srgb, var(--accent) 85%, transparent); color: #000; }
.room-badge { display: inline-block; margin: 6px 0 10px; padding: 7px 14px; border-radius: 99px; background: var(--glass); font-size: 13px; }

.room-ov { position: absolute; inset: 0; pointer-events: none; }
.room-ov > * { pointer-events: auto; }
.room-ov .fly { position: absolute; right: 0; bottom: 70px; width: 240px; height: 70vh; pointer-events: none; }
.fly-e { position: absolute; bottom: 0; display: flex; flex-direction: column; align-items: center; animation: flyUp 2.6s ease-out forwards; }
.fly-e span { font-size: 40px; }
.fly-e small { font-size: 11px; background: rgba(0,0,0,.5); padding: 0 6px; border-radius: 99px; }
@keyframes flyUp { from { transform: translateY(0) scale(.8); opacity: 1; } to { transform: translateY(-60vh) scale(1.4); opacity: 0; } }
.room-toasts { position: absolute; left: 24px; top: 90px; display: flex; flex-direction: column; gap: 6px; max-width: 320px; }
.room-side { position: absolute; right: 22px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: center; gap: 12px; opacity: 0; transition: opacity .3s; pointer-events: none; }
.player.ui .room-side { opacity: 1; pointer-events: auto; }
.room-side .online { background: rgba(0,0,0,.6); padding: 4px 10px; border-radius: 99px; color: #fff; }
.room-side .emo { display: flex; flex-direction: column; gap: 2px; background: rgba(0,0,0,.55); border-radius: 99px; padding: 6px 4px; }
.room-ov .emo button { font-size: 22px; padding: 4px; border-radius: 50%; transition: transform .15s; }
.room-ov .emo button:hover { transform: scale(1.3); }
.room-panel { position: absolute; top: 16px; right: 16px; bottom: 16px; width: 340px; padding: 14px; border-radius: 22px; background: rgba(16,16,20,.9); backdrop-filter: blur(24px);
  display: flex; flex-direction: column; gap: 10px; transform: translateX(380px); transition: transform .3s; }
.room-ov.chat .room-panel { transform: none; }
.room-ov.chat .room-side { display: none; }
.room-panel .msgs { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.room-panel .emo { display: flex; gap: 2px; }
@media (max-width: 700px) {
  .room-panel { width: auto; left: 16px; top: 40%; }
  .rooms { grid-template-columns: 1fr; }
}

/* Телепрограмма */
.tv-prog { height: 3px; margin-top: 6px; border-radius: 2px; background: rgba(255,255,255,.15); overflow: hidden; }
.tv-prog i { display: block; height: 100%; background: var(--accent); }
.tv-tile .tv-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-now { position: absolute; left: 50%; bottom: 48px; transform: translateX(-50%); width: min(520px, calc(100% - 40px));
  padding: 12px 16px; border-radius: 18px; background: rgba(0,0,0,.7); opacity: 0; transition: opacity .3s; pointer-events: none; }
.player.ui .tv-now { opacity: 1; }
.tv-now b { display: block; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-player.sched .tv-sched { transform: none; }
.tv-sched { position: absolute; top: 84px; right: 16px; bottom: 16px; width: 360px; overflow-y: auto; padding: 8px; border-radius: 20px;
  background: rgba(12,12,16,.85); backdrop-filter: blur(24px); transform: translateX(400px); transition: transform .3s ease; }
@media (max-width: 700px) { .tv-sched { width: auto; left: 16px; top: auto; height: 50%; transform: translateY(110%); } }
.tv-prow { display: flex; gap: 12px; padding: 8px 10px; border-radius: 12px; }
.tv-prow .time { color: var(--accent); font-weight: 600; min-width: 44px; }
.tv-prow.past { opacity: .5; }
.tv-prow.on { background: var(--selected); color: var(--on-selected); }
.tv-prow.on .time { color: inherit; }
.tv-prow small { display: block; opacity: .75; margin-top: 2px; }

/* --- iPhone: «чёлка», скруглённые углы и полоска «Домой» --- */
@supports (padding: env(safe-area-inset-top)) {
  .nav { bottom: calc(14px + env(safe-area-inset-bottom)); }
  .page { padding-bottom: calc(120px + env(safe-area-inset-bottom)); }
  .wrap { padding-left: max(clamp(16px, 4vw, 48px), env(safe-area-inset-left)); padding-right: max(clamp(16px, 4vw, 48px), env(safe-area-inset-right)); }
  .player .top { padding-top: max(18px, env(safe-area-inset-top)); padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right)); }
  .player .bottom { padding-bottom: max(22px, env(safe-area-inset-bottom)); padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right)); }
  .circle.back { top: max(14px, env(safe-area-inset-top)); }
}
@media (max-width: 899px) {
  /* В PWA на телефоне контент начинается под строкой состояния. */
  @supports (padding: env(safe-area-inset-top)) {
    #app > .page > .wrap:first-child { padding-top: max(20px, env(safe-area-inset-top)) !important; }
  }
}
/* Без выделения текста и «синих вспышек» при тапах — как в приложении. */
.nav, .chip, .btn, .circle, .tv-tile, .poster { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
html { -webkit-text-size-adjust: 100%; overscroll-behavior-y: none; }
