/* Панель плеера v2: одна строка управления над видео, серии сеткой с диапазонами, поиск озвучек,
   на телефоне озвучки свёрнуты под видео. Поверх cinema.css, логика — player-experience.js. */
.cinema-player .cinema-top{gap:12px;padding:12px 14px 12px 20px}
.cinema-now{display:flex;align-items:baseline;gap:10px;min-width:0}
.cinema-now .cinema-current{overflow:hidden;font-size:15px;font-weight:700;text-overflow:ellipsis;white-space:nowrap}
.cinema-voice-now{overflow:hidden;color:var(--muted);font-size:13px;text-overflow:ellipsis;white-space:nowrap}
.cinema-voice-now:not(:empty):before{content:'·';margin-right:8px}
.cinema-top-actions{display:flex;align-items:center;gap:8px;flex:0 0 auto}
.cinema-step{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:38px;min-width:38px;padding:0 10px;border:1px solid var(--line);border-radius:11px;background:transparent;color:var(--text);font:inherit;font-size:13px;font-weight:600;cursor:pointer;transition:background .18s,border-color .18s,transform .18s,opacity .18s}
.cinema-step svg{width:16px;height:16px;flex:0 0 auto}
.cinema-step:hover:not(:disabled){border-color:#ff725b80;background:#ff725b14}
.cinema-step:active:not(:disabled){transform:scale(.96)}
.cinema-step:disabled{opacity:.38;cursor:default}
#cinemaNext{padding:0 12px 0 14px;border-color:#ff725b66;background:#ff725b1a}
.cinema-screen-label{display:none!important}
/* боковая панель: прокрутка внутри, высота — по видео */
@media(min-width:761px){
 /* contain:size: панель не растягивает строку, а занимает высоту видео; лишнее прокручивается внутри */
 .cinema-player .cinema-layout{grid-template-rows:auto auto}
 .cinema-player .cinema-sidebar{grid-column:2;grid-row:1;contain:size;align-self:stretch;min-height:0;max-height:none;overflow:hidden}
 .cinema-player .cinema-bottom{grid-column:1/-1;grid-row:2;border-top:1px solid var(--line)}
 .cinema-side-body{display:flex;flex-direction:column;min-height:0;flex:1}
 #cinemaVoices:not([hidden]),#cinemaSources:not([hidden]){min-height:0;flex:1;overflow:auto;scrollbar-width:thin;scrollbar-color:#ff725b55 transparent;margin-right:-8px;padding-right:8px}
 .cinema-side-toggle{display:none!important}
}
.cinema-search{position:sticky;top:0;z-index:1;display:flex;align-items:center;gap:8px;margin:10px 0 6px;padding:0 10px;height:38px;border:1px solid var(--line);border-radius:10px;background:var(--panel,#16161a);color:var(--muted)}
.cinema-search[hidden]{display:none}
.cinema-search svg{width:15px;height:15px;flex:0 0 auto}
.cinema-search input{flex:1;min-width:0;height:100%;margin:0;padding:0!important;border:0!important;border-radius:0;background:transparent!important;box-shadow:none!important;color:var(--text);font:inherit;font-size:13px;outline:none}
.cinema-search:focus-within{border-color:#ff725b88}
.cinema-player .cinema-voice{min-height:40px;transition:background .16s,border-color .16s,transform .16s}
.cinema-player .cinema-voice:active{transform:scale(.985)}
.cinema-player .cinema-voice[hidden],.cinema-voice-group[hidden]{display:none}
/* серии */
#cinemaEmbeddedEpisodes{padding:16px 20px 18px}
.cinema-episode-caption{flex-wrap:wrap;row-gap:8px}
.cinema-episode-caption strong{font-size:14px}
.cinema-episode-caption span{font-size:12px}
.cinema-ranges{display:flex;gap:6px;margin-left:auto;overflow-x:auto;scrollbar-width:none}
.cinema-ranges[hidden]{display:none}
.cinema-ranges::-webkit-scrollbar{display:none}
.cinema-ranges button{flex:0 0 auto;height:30px;padding:0 10px;border:1px solid var(--line);border-radius:999px;background:transparent;color:var(--muted);font:inherit;font-size:12px;cursor:pointer;transition:background .16s,color .16s,border-color .16s}
.cinema-ranges button[aria-pressed=true]{border-color:transparent;background:#ff725b22;color:var(--text);font-weight:600}
.cinema-player #cinemaEmbeddedRail.stream-episode-rail,.cinema-player .stream-episode-rail{display:grid;grid-template-columns:repeat(auto-fill,minmax(46px,1fr));gap:8px;max-height:none;overflow:visible;padding:2px 0 0}
.cinema-player .stream-episode-rail button{min-width:0;width:100%;height:40px;border-radius:10px;font-size:13px;font-variant-numeric:tabular-nums}
.cinema-player .stream-episode-rail button[aria-pressed=true]{animation:cinema-pick .28s cubic-bezier(.2,.8,.2,1)}
@keyframes cinema-pick{from{transform:scale(.9)}}
/* телефон: видео → серии → свёрнутые озвучки */
@media(max-width:760px){
 .cinema-player .cinema-top{padding:10px 10px 10px 14px}
 .cinema-now{flex-direction:column;align-items:flex-start;gap:2px}
 .cinema-now .cinema-dot{display:none}
 .cinema-voice-now:not(:empty):before{display:none}
 .cinema-voice-now{font-size:12px}
 #cinemaNext span{display:none}
 #cinemaNext{padding:0 10px}
 .cinema-mode span{display:none}
 .cinema-player .cinema-sidebar{order:2;padding:0;border-top:0}
 .cinema-player .cinema-bottom{order:3;border-top:1px solid var(--line)}
 .cinema-side-toggle{display:flex;align-items:center;gap:8px;width:100%;min-height:52px;padding:0 14px;border:0;border-top:1px solid var(--line);background:transparent;color:var(--text);font:inherit;font-size:14px;font-weight:600;text-align:left;cursor:pointer}
 .cinema-side-toggle b{flex:1;overflow:hidden;color:var(--muted);font-weight:500;text-overflow:ellipsis;white-space:nowrap;text-align:right}
 .cinema-side-toggle svg{width:18px;height:18px;flex:0 0 auto;transition:transform .2s}
 .cinema-player .cinema-side-body{display:none}
 .cinema-side-toggle{border:1px solid var(--line)!important;border-radius:12px;width:calc(100% - 28px);margin:12px 14px;min-height:50px;background:#ffffff08}
 .cinema-side-toggle b{color:var(--text);font-weight:600}
 .cinema-side-toggle svg{transform:rotate(-90deg)}
 #cinemaEmbeddedEpisodes{padding:14px}
 .cinema-player .stream-episode-rail{grid-template-columns:repeat(auto-fill,minmax(44px,1fr));gap:7px}
}
@keyframes cinema-open{from{opacity:0;transform:translateY(-4px)}}
@media(prefers-reduced-motion:reduce){.cinema-player .stream-episode-rail button[aria-pressed=true],.cinema-player.cinema-side-open .cinema-side-body{animation:none}}
/* Anime4K — компактный блок внизу панели: заголовок, переключатель и одна строка подсказки */
.cinema-player .anime4k-panel{flex:0 0 auto;margin-top:8px;padding-top:12px}
.cinema-player .anime4k-panel>small{display:none}
.cinema-player .anime4k-panel .upscale-heading strong{font-size:13px}
.cinema-player .anime4k-panel p{margin:6px 0 0;font-size:11.5px;line-height:1.4}
.cinema-player .anime4k-panel #anime4kSource{justify-content:flex-start;margin-top:6px;padding:0;font-size:12.5px;text-align:left}
/* шторка выбора озвучки на телефоне */
.cinema-sheet{position:fixed;inset:auto 0 0 0;width:100%;max-width:none;max-height:82dvh;margin:0;padding:0;border:0;border-radius:18px 18px 0 0;background:var(--panel,#16161a);color:var(--text);display:none;flex-direction:column;overflow:hidden}
.cinema-sheet[open]{display:flex;animation:cinema-sheet-in .24s cubic-bezier(.22,1,.36,1)}
.cinema-sheet::backdrop{background:#000a;backdrop-filter:blur(3px)}
@keyframes cinema-sheet-in{from{transform:translateY(40px);opacity:.4}}
.cinema-sheet-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 14px 10px 18px;border-bottom:1px solid var(--line)}
.cinema-sheet-head strong{font-size:16px}
.cinema-sheet-body{overflow:auto;padding:4px 16px calc(16px + env(safe-area-inset-bottom));overscroll-behavior:contain}
.cinema-sheet .cinema-side-body{display:block!important}
.cinema-sheet #cinemaVoices:not([hidden]),.cinema-sheet #cinemaSources:not([hidden]){max-height:none;overflow:visible}
.cinema-sheet .cinema-voice{min-height:48px}
.cinema-sheet #cinemaVoiceList,.cinema-sheet #cinemaSourceList{max-height:none!important;overflow:visible!important}
@media(prefers-reduced-motion:reduce){.cinema-sheet[open]{animation:none}}
/* Выбор серии одной строкой: «Серия №», лента номеров со стрелками, «В просмотренное», колокольчик */
.ep-bar{display:flex;align-items:center;gap:10px;min-width:0;padding:8px 8px 8px 14px;border:1px solid var(--line);border-radius:16px;background:linear-gradient(180deg,#ffffff08,#ffffff03)}
.ep-bar[hidden]{display:none}
.ep-jump{flex:0 0 auto;margin:0}
.ep-jump label{display:flex;align-items:center;gap:10px;margin:0;color:var(--muted);font-size:13px;font-weight:600;white-space:nowrap}
.ep-jump label span{border-bottom:1px dashed #ffffff40;padding-bottom:1px}
.ep-jump input{width:64px;height:38px;margin:0;padding:0 8px!important;border:1px solid transparent!important;border-radius:12px;background:#ffffff12!important;color:var(--text);font:inherit;font-size:15px;font-weight:700;text-align:center;font-variant-numeric:tabular-nums;box-shadow:none!important;outline:none;transition:background .18s,border-color .18s,width .25s cubic-bezier(.22,1,.36,1)}
.ep-jump input::placeholder{color:#ffffff55}
.ep-jump input:focus{width:78px;border-color:#ff725b88!important;background:#ff725b14!important}
.ep-track{display:flex;align-items:center;gap:10px;flex:1;min-width:0;padding-left:12px;border-left:1px solid var(--line)}
.ep-track-label{flex:0 0 auto;color:var(--muted);font-size:13px;font-weight:600}
.ep-viewport{flex:1;min-width:0;position:relative;overflow:hidden}
.ep-viewport:before,.ep-viewport:after{content:'';position:absolute;top:0;bottom:0;z-index:1;width:28px;pointer-events:none;transition:opacity .2s}
.ep-viewport:before{left:0;background:linear-gradient(90deg,var(--panel,#16161a),transparent)}
.ep-viewport:after{right:0;background:linear-gradient(270deg,var(--panel,#16161a),transparent)}
.ep-bar:has([data-ep-step="-1"]:disabled) .ep-viewport:before,.ep-bar:has([data-ep-step="1"]:disabled) .ep-viewport:after{opacity:0}
html body .cinema-player .ep-bar .ep-rail,html body .ep-bar .ep-rail{display:flex!important;flex-wrap:nowrap!important;gap:4px;width:100%;max-height:none;margin:0;padding:2px 0!important;overflow-x:auto!important;overflow-y:hidden!important;scroll-snap-type:x proximity;scrollbar-width:none;overscroll-behavior-x:contain}
.ep-bar .ep-rail::-webkit-scrollbar{display:none}
html body .ep-bar .ep-rail button{position:relative;flex:0 0 auto;width:auto!important;min-width:46px;height:40px;padding:0 12px;border:0!important;border-radius:12px;background:transparent!important;color:#c9ced8;font:inherit;font-size:15px;font-weight:600;font-variant-numeric:tabular-nums;scroll-snap-align:center;cursor:pointer;box-shadow:none!important;transition:background .18s,color .18s,transform .18s}
html body .ep-bar .ep-rail button:hover{background:#ffffff0f!important;color:var(--text)}
html body .ep-bar .ep-rail button[aria-pressed=true]{background:var(--accent,#ff725b)!important;color:#141416;font-weight:800;box-shadow:0 6px 18px #ff725b40!important;animation:cinema-pick .28s cubic-bezier(.2,.8,.2,1)}
html body .ep-bar .ep-rail button.is-watched:not([aria-pressed=true]){color:#8a8f9b}
html body .ep-bar .ep-rail button.is-watched:after{content:'';position:absolute;left:50%;top:auto;right:auto;bottom:4px;width:4px;height:4px;margin-left:-2px;border-radius:50%;background:#5fe08f}
html body .ep-bar .ep-rail button[aria-pressed=true].is-watched:after{background:#141416}
html body .ep-bar .ep-rail button[hidden]{display:none}
.ep-arrows{display:flex;gap:2px;flex:0 0 auto;padding-left:6px;border-left:1px solid var(--line)}
.ep-arrow,.ep-bell{display:grid;place-items:center;width:38px;height:38px;padding:0;border:0;border-radius:11px;background:transparent;color:var(--text);cursor:pointer;transition:background .18s,opacity .18s,transform .18s}
.ep-arrow svg,.ep-bell svg,.ep-mark svg{width:20px;height:20px}
.ep-arrow:hover:not(:disabled),.ep-bell:hover{background:#ffffff12}
.ep-arrow:active:not(:disabled),.ep-bell:active,.ep-mark:active{transform:scale(.94)}
.ep-arrow:disabled{opacity:.3;cursor:default}
.ep-bar.is-short .ep-arrows{display:none}
.ep-mark{display:inline-flex;align-items:center;gap:8px;flex:0 0 auto;height:40px;padding:0 14px;border:0;border-radius:12px;background:transparent;color:var(--text);font:inherit;font-size:14px;font-weight:600;white-space:nowrap;cursor:pointer;transition:background .18s,color .18s}
.ep-mark:hover:not(:disabled){background:#ffffff0f}
.ep-mark[aria-pressed=true]{color:#8fe8b0;background:#5fe08f14}
.ep-mark:disabled{opacity:.4}
.ep-bell{flex:0 0 auto;width:44px;height:44px;border:1px solid var(--line);border-radius:13px;background:#ffffff08}
.ep-bell[hidden]{display:none}
.ep-bell[aria-pressed=true]{border-color:#ff725b66;background:#ff725b1f;color:var(--accent,#ff725b)}
.ep-bell[aria-pressed=true] svg{fill:currentColor}
/* старые элементы, которые заменила строка: подпись, диапазоны, поиск AniLiberty */
#cinemaEmbeddedEpisodes:has(.ep-bar) .cinema-episode-caption,#cinemaEmbeddedEpisodes:has(.ep-bar) .cinema-ranges{display:none!important}
.stream-episodes:has(.ep-bar)>label,#streamControls:has(.ep-bar) #streamWatched{display:none!important}
#cinemaEmbeddedEpisodes:has(.ep-bar){padding:14px 16px}
@media(max-width:760px){
 .ep-bar{flex-wrap:wrap;gap:8px;padding:8px}
 .ep-track{order:-1;flex:1 1 100%;padding-left:0;border-left:0}
 .ep-track-label{display:none}
 .ep-jump label span{display:none}
 .ep-jump input{width:72px}
 .ep-arrows{display:none}
 .ep-mark{flex:1;justify-content:center;background:#ffffff08}
 .ep-viewport:before,.ep-viewport:after{width:18px}
}
@media(prefers-reduced-motion:reduce){html body .ep-bar .ep-rail button[aria-pressed=true]{animation:none}}
