/* KoteFilm — темна кінематографічна тема */
:root {
  --bg: #0b0d12;
  --surface: #151923;
  --surface-2: #1d2230;
  --surface-3: #262c3d;
  --line: rgba(255, 255, 255, .07);
  --text: #f4f5f8;
  --muted: #8d95a8;
  --accent: #ff6a3d;
  --gold: #ffc24b;
  --grad: linear-gradient(135deg, #ffb347 0%, #ff6a3d 45%, #ff4e6a 100%);
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; overflow-x: hidden; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
button:active { transform: scale(.97); }
.hidden { display: none !important; }

/* ───────── шапка ───────── */
.top { position: sticky; top: 0; z-index: 10; padding: 10px 16px 12px;
  background: rgba(11, 13, 18, .82); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line); }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.brand { display: flex; align-items: center; gap: 8px; }
.brand:active { transform: none; }
.logo { width: 30px; height: 30px; filter: drop-shadow(0 4px 10px rgba(255, 106, 61, .35)); }
.wordmark { font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.wordmark b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.search { position: relative; }
.search-ico { position: absolute; left: 12px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { width: 100%; padding: 11px 14px 11px 38px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font-size: 16px; outline: none; transition: border-color .2s, background .2s; }
.search input:focus { border-color: rgba(255, 106, 61, .55); background: var(--surface-2); }
.search input::placeholder { color: var(--muted); }

main { padding: 6px 16px calc(36px + var(--safe-b)); }
h2 { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 750; letter-spacing: -.01em; margin: 22px 0 12px; }
h2::before { content: ""; width: 4px; height: 18px; border-radius: 2px; background: var(--grad); }
.muted { color: var(--muted); }
.center { text-align: center; padding: 36px 0; }

/* ───────── постери ───────── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(106px, 1fr)); gap: 14px 12px; }
.card { text-align: left; display: block; min-width: 0; }
.poster { position: relative; aspect-ratio: 2/3; border-radius: var(--radius-sm); overflow: hidden;
  background: linear-gradient(160deg, var(--surface-2), var(--surface)); box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
.poster img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s; }
.card:active .poster img { transform: scale(1.04); }
.poster::after { content: ""; position: absolute; inset: 55% 0 0; background: linear-gradient(transparent, rgba(0, 0, 0, .55)); pointer-events: none; }
.badge { position: absolute; top: 6px; left: 6px; z-index: 1; padding: 2px 7px; border-radius: 7px;
  background: rgba(10, 12, 18, .72); backdrop-filter: blur(6px); color: var(--gold); font-size: 11px; font-weight: 700; }
.type-tag { position: absolute; top: 6px; right: 6px; z-index: 1; padding: 2px 6px; border-radius: 6px;
  background: rgba(255, 106, 61, .9); color: #fff; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.card .name { font-size: 13px; font-weight: 600; margin-top: 7px; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; line-height: 1.3; }
.card .year { font-size: 12px; color: var(--muted); margin-top: 2px; }

.hrow { display: flex; gap: 12px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 6px; scroll-snap-type: x proximity; scrollbar-width: none; }
.hrow::-webkit-scrollbar { display: none; }
.hcard { flex: none; width: 112px; scroll-snap-align: start; }
.hcard.wide { width: 220px; }
.hcard.wide .poster { aspect-ratio: 16/9; }
.pbar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; height: 4px; background: rgba(255, 255, 255, .18); }
.pbar i { display: block; height: 100%; background: var(--grad); border-radius: 0 2px 2px 0; }
.ep-tag { position: absolute; left: 10px; bottom: 12px; z-index: 1; font-size: 12px; font-weight: 750; color: #fff; text-shadow: 0 1px 4px rgba(0, 0, 0, .8); }

/* ───────── сторінка фільму ───────── */
.backdrop { position: relative; margin: -6px -16px 0; height: 220px; background: var(--surface) center 25% / cover no-repeat; }
.backdrop::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11, 13, 18, .1) 0%, rgba(11, 13, 18, .55) 55%, var(--bg) 100%); }
.hero { position: relative; z-index: 1; display: flex; gap: 14px; align-items: flex-end; margin-top: -92px; }
.hero .poster { width: 112px; flex: none; border: 1px solid var(--line); box-shadow: var(--shadow); }
.hero .info { min-width: 0; padding-bottom: 2px; }
.hero h1 { font-size: 23px; line-height: 1.15; margin: 0 0 4px; font-weight: 800; letter-spacing: -.02em; }
.orig { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { padding: 3px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; color: #cfd4df; }
.pill.rate { color: var(--gold); font-weight: 700; }
.no-backdrop .hero { margin-top: 14px; }

.watch { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  margin: 18px 0 0; padding: 15px; border-radius: var(--radius); background: var(--grad); color: #fff;
  font-weight: 750; font-size: 16px; letter-spacing: .01em; box-shadow: 0 10px 26px rgba(255, 78, 106, .35); overflow: hidden; }
.watch::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .25) 50%, transparent 70%);
  transform: translateX(-100%); }
.watch:not(:disabled)::after { animation: shine 2.8s ease-in-out 1s infinite; }
@keyframes shine { 0%, 60% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.watch:disabled { background: var(--surface-2); color: var(--muted); box-shadow: none; }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.act { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 11px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); font-size: 14px; font-weight: 600; color: #d6dae3; transition: background .2s, color .2s, border-color .2s; }
.act.on { color: var(--accent); border-color: rgba(255, 106, 61, .45); background: rgba(255, 106, 61, .12); }

.overview { margin: 16px 0 4px; font-size: 14px; line-height: 1.55; color: #c7ccd7; }
.overview.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.tabs { display: flex; gap: 4px; margin: 20px 0 14px; padding: 4px; border-radius: 13px; background: var(--surface); border: 1px solid var(--line); }
.tab { flex: 1; padding: 9px; border-radius: 10px; font-weight: 650; font-size: 14px; color: var(--muted); transition: background .2s, color .2s; }
.tab.active { background: var(--surface-3); color: var(--text); }

.label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin: 14px 0 8px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
  font-size: 13px; font-weight: 600; color: #cfd4df; white-space: nowrap; transition: all .2s; }
.chip.active { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 6px 16px rgba(255, 78, 106, .3); }

.list { display: flex; flex-direction: column; gap: 6px; }
.row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 13px 14px;
  border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 600; overflow-wrap: anywhere; }
.row .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.row .go { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255, 106, 61, .14); color: var(--accent); font-size: 12px; }
.row.episode { padding: 10px 12px; }
.ep { flex: none; min-width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  background: var(--surface-3); color: #dfe3ea; font-size: 13px; font-weight: 750; }
.row-bar { position: relative; height: 3px; margin-top: 7px; border-radius: 2px; overflow: hidden; background: var(--surface-3); }
.row.watched .title { color: var(--muted); }
.row.watched .ep { background: rgba(255, 106, 61, .14); color: var(--accent); }
.row.watched .go { background: transparent; }
.crumbs { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.back { color: var(--accent); font-weight: 600; padding: 4px 0; }

/* акордеон сезонів */
.accordion { display: flex; flex-direction: column; gap: 8px; }
.season { border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); overflow: hidden; transition: border-color .2s; }
.season.open { border-color: rgba(255, 106, 61, .35); }
.season-head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 15px 16px; text-align: left; font-weight: 700; font-size: 15px; }
.season-head:active { transform: none; background: var(--surface-2); }
.season-head .grow { flex: 1; min-width: 0; }
.season-head .chev { color: var(--muted); font-size: 22px; line-height: 1; transition: transform .25s; }
.season.open .season-head .chev { transform: rotate(90deg); color: var(--accent); }
.season .tag { font-size: 11px; font-weight: 700; color: var(--accent); background: rgba(255, 106, 61, .12); padding: 2px 8px; border-radius: 999px; }
.season-body { display: none; padding: 0 10px 10px; }
.season.open .season-body { display: block; animation: drop .25s ease-out; }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.season-body .row { background: var(--surface-2); }
.season-body .chip:not(.active) { background: var(--surface-2); }

.tip { font-size: 13px; color: var(--muted); padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px dashed var(--line); margin-bottom: 10px; }

/* завантаження */
.spinner { width: 30px; height: 30px; margin: 34px auto; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 25%, var(--accent) 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
  animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { border-radius: var(--radius-sm); background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%);
  background-size: 200% 100%; animation: sk 1.2s linear infinite; }
@keyframes sk { to { background-position: -200% 0; } }

/* ───────── плеєр ───────── */
.player { position: fixed; inset: 0; z-index: 30; background: #000; display: flex; flex-direction: column; }
.player-bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; color: #fff;
  background: linear-gradient(180deg, rgba(0, 0, 0, .8), transparent); }
.player-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; }
.player select { background: rgba(255, 255, 255, .12); color: #fff; border: 1px solid rgba(255, 255, 255, .15); border-radius: 9px; padding: 6px 10px; font-size: 13px; }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; font-size: 16px; }
.player video { flex: 1; width: 100%; min-height: 0; background: #000; }
.player-msg { color: #cfd4df; text-align: center; padding: 10px 16px calc(12px + var(--safe-b)); font-size: 13px; min-height: 22px; }

.toast { position: fixed; left: 16px; right: 16px; bottom: calc(20px + var(--safe-b)); z-index: 40; padding: 13px 15px;
  border-radius: var(--radius); background: rgba(30, 34, 46, .96); border: 1px solid var(--line); color: #fff; font-size: 14px;
  box-shadow: var(--shadow); backdrop-filter: blur(10px); }

.fade-in { animation: fade .25s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* компактні ряди бібліотеки */
.sec { margin-top: 18px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.sec-head h2 { margin: 0; font-size: 16px; }
.sec-head h2::before { height: 15px; }
.more { flex: none; font-size: 13px; font-weight: 650; color: var(--accent); padding: 4px 2px; }
.hrow { gap: 10px; }
.hcard { width: 88px; }
.hcard .poster { border-radius: 9px; }
.hcard .name { font-size: 12px; -webkit-line-clamp: 1; margin-top: 5px; }
.hcard .year { font-size: 11px; }
.hcard .ep-tag { font-size: 11px; left: 6px; bottom: 8px; }
.hcard .pbar { height: 3px; }
.more-card { flex: none; width: 88px; aspect-ratio: 2/3; border-radius: 9px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px; background: var(--surface); border: 1px dashed rgba(255, 106, 61, .4); color: var(--accent); }
.more-card span { font-size: 20px; font-weight: 800; }
.more-card small { font-size: 11px; color: var(--muted); }
.grid.dense { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 12px 10px; }
.grid.dense .name { font-size: 12px; -webkit-line-clamp: 1; }
.grid.dense .year { font-size: 11px; }
.count { margin-left: 2px; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 700; }
.hrow { scroll-padding-left: 16px; scroll-padding-right: 16px; }
.grid.dense { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 12px 8px; }

/* ───────── рекомендації ───────── */
.sec-head h2 { min-width: 0; }
.sec-head h2 .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feats { gap: 12px; }
.feat { position: relative; flex: none; width: 250px; aspect-ratio: 16/9; border-radius: 14px; overflow: hidden;
  background: var(--surface); box-shadow: 0 10px 24px rgba(0, 0, 0, .4); scroll-snap-align: start; text-align: left; }
.feat-img { position: absolute; inset: 0; background: center / cover no-repeat; transition: transform .4s; }
.feat:active .feat-img { transform: scale(1.04); }
.feat::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, rgba(8, 10, 14, .92) 100%); }
.feat-info { position: absolute; left: 12px; right: 12px; bottom: 10px; z-index: 1; }
.feat-title { font-size: 15px; font-weight: 750; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feat-meta { font-size: 12px; color: #d3d8e2; margin-top: 3px; }
.feat.skeleton { box-shadow: none; }

.themes { gap: 10px; }
.theme { position: relative; flex: none; width: 128px; height: 78px; border-radius: 14px; overflow: hidden; padding: 10px 12px;
  display: flex; flex-direction: column; justify-content: space-between; text-align: left; color: #fff;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .35); scroll-snap-align: start; }
.theme::after { content: ""; position: absolute; right: -18px; bottom: -18px; width: 70px; height: 70px; border-radius: 50%; background: rgba(255, 255, 255, .14); }
.t-emoji { font-size: 22px; line-height: 1; }
.t-title { position: relative; z-index: 1; font-size: 13px; font-weight: 750; line-height: 1.15; text-shadow: 0 1px 6px rgba(0, 0, 0, .35); }

.theme-hero { position: relative; display: flex; align-items: center; gap: 14px; margin: 14px 0 16px; padding: 22px 18px;
  border-radius: 18px; overflow: hidden; color: #fff; box-shadow: var(--shadow); }
.theme-hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.theme-hero .t-emoji { font-size: 40px; }
.th-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; opacity: .85; }
.th-title { font-size: 24px; font-weight: 800; letter-spacing: -.02em; text-shadow: 0 2px 10px rgba(0, 0, 0, .25); }

/* ───────── нижні вкладки ───────── */
main { padding-bottom: calc(92px + var(--safe-b)); }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-around;
  padding: 8px 8px calc(8px + var(--safe-b)); background: rgba(13, 15, 21, .9);
  backdrop-filter: saturate(160%) blur(16px); -webkit-backdrop-filter: saturate(160%) blur(16px); border-top: 1px solid var(--line); }
.tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 0;
  color: var(--muted); font-size: 11px; font-weight: 650; transition: color .2s; }
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; transition: transform .2s; }
.tabbar button.active { color: var(--accent); }
.tabbar button.active svg { fill: rgba(255, 106, 61, .18); transform: translateY(-1px); }
.tabbar button:active { transform: scale(.94); }

.theme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.theme.big { width: auto; height: 104px; padding: 14px; }
.theme.big .t-emoji { font-size: 28px; }
.theme.big .t-title { font-size: 15px; }

.seg { margin-top: 4px; }
.seg .tab .n { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 3px; border-radius: 999px;
  background: rgba(255, 255, 255, .08); font-size: 11px; line-height: 17px; }
.seg .tab.active .n { background: rgba(255, 106, 61, .2); color: var(--accent); }
.empty { text-align: center; color: var(--muted); padding: 44px 24px; font-size: 14px; line-height: 1.5; }
.e-ico { font-size: 34px; margin-bottom: 10px; opacity: .8; }
.seg .tab { white-space: nowrap; font-size: 13px; padding: 9px 4px; }

/* завантаження */
.icon-btn.dl svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn.dl.off { opacity: .35; }
.icon-btn.dl.busy { background: var(--grad); }

/* екран «підписка закінчилась» */
.paywall { text-align: center; padding: 48px 8px 24px; }
.paywall .pw-ico { font-size: 54px; margin-bottom: 8px; }
.paywall h1 { font-size: 24px; font-weight: 800; margin: 0 0 12px; letter-spacing: -.02em; }
.paywall p { color: #c7ccd7; font-size: 15px; line-height: 1.5; margin: 0 0 12px; }
.paywall .watch { margin-top: 22px; }

.fs-btn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--surface); border: 1px solid var(--line); color: #d6dae3; }
.fs-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fs-btn.on { color: var(--accent); border-color: rgba(255, 106, 61, .45); }
/* у повноекранному режимі Telegram малює свої кнопки зверху — відсуваємо шапку */
body.tg-fs .top { padding-top: calc(10px + var(--top-pad, 0px)); }

/* ───────── повноекранний плеєр ───────── */
.player.immersive { background: #000; }
.player.immersive .player-bar { position: absolute; top: 0; left: 0; right: 0; z-index: 3;
  transition: opacity .3s; }
.player.immersive .player-msg { position: absolute; left: 0; right: 0; bottom: 48px; z-index: 3; pointer-events: none; }
.player.immersive .player-msg button { pointer-events: auto; }
.player.immersive video { height: 100%; flex: 1; }
.player.immersive.idle .player-bar { opacity: 0; pointer-events: none; }
/* Android не дав повернути екран — повертаємо плеєр самі */
.player.rotated { inset: auto; top: 0; left: 100%; transform-origin: top left; transform: rotate(90deg); }

/* «заповнити» — лише в повноекранному режимі */
.fill-btn { display: none; }
.player.immersive .fill-btn { display: grid; }
.player.immersive.fill video { object-fit: cover; }
.player.immersive.fill .fill-btn { background: var(--grad); }
/* кнопки Telegram (Назад, ⋮) у повноекранному режимі — не перекриваємо їх своєю панеллю */
.player.immersive .player-bar { padding-left: calc(12px + var(--tg-content-safe-area-inset-left, 0px) + var(--tg-safe-area-inset-left, 0px));
  padding-right: calc(12px + var(--tg-content-safe-area-inset-right, 0px) + var(--tg-safe-area-inset-right, 0px)); }
body.tg-fs .player:not(.immersive) { padding-top: var(--top-pad, 0px); }

.player.immersive video { transition: transform .25s ease; }
.player.immersive.zoom video { object-fit: cover; transform: scale(1.22); }
.player.immersive.zoom .fill-btn { background: linear-gradient(135deg, #ffc24b, #ff4e6a); box-shadow: 0 0 0 2px rgba(255,255,255,.35); }
.player.immersive { overflow: hidden; }

.guide-tip { display: flex; gap: 12px; align-items: flex-start; margin: 14px 0 4px; padding: 13px 12px 13px 14px; border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(255,179,71,.14), rgba(255,78,106,.14)); border: 1px solid rgba(255,106,61,.35); }
.gt-ico { font-size: 24px; line-height: 1; }
.gt-txt { flex: 1; font-size: 13.5px; line-height: 1.45; color: #e6e9ef; }
.gt-x { flex: none; width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,.08); color: var(--muted); font-size: 12px; }

.chip.bad { opacity: .55; border-style: dashed; }
.chip.more-src { color: var(--muted); border-style: dashed; }

.label-hint { text-transform: none; letter-spacing: 0; font-weight: 500; color: #6f778a; }
.pill.lang { color: #cfe0ff; }

/* відступи під кнопки Telegram — лише коли Telegram справді в повноекранному режимі */
body.tg-fs .player.immersive .player-bar { padding-top: calc(10px + var(--top-pad, 0px)); }

/* комп'ютер: у повному екрані плеєра жодних відступів під Telegram */
body.desktop .player.rotated { transform: none; left: 0; top: 0; inset: 0; width: auto !important; height: auto !important; }

.player select:disabled { opacity: .6; -webkit-appearance: none; appearance: none; padding-right: 10px; }

/* ───────── плеєр: заставка, наступна серія, перемотка, кімната ───────── */
.player { position: fixed; }
.skip-intro { position: absolute; right: 16px; bottom: 70px; z-index: 4; padding: 10px 16px; border-radius: 12px;
  background: rgba(20, 22, 30, .85); border: 1px solid rgba(255,255,255,.25); color: #fff; font-weight: 700; font-size: 14px; backdrop-filter: blur(8px); }
.next-card { position: absolute; right: 16px; bottom: 70px; z-index: 5; width: 250px; padding: 14px; border-radius: 16px;
  background: rgba(16, 18, 26, .92); border: 1px solid rgba(255,106,61,.4); color: #fff; box-shadow: 0 12px 30px rgba(0,0,0,.5); backdrop-filter: blur(10px); }
.nc-t { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.nc-n { font-size: 15px; font-weight: 700; margin: 4px 0 12px; }
.nc-b { display: flex; gap: 8px; }
.nc-go { flex: 1; padding: 10px; border-radius: 10px; background: var(--grad); color: #fff; font-weight: 750; }
.nc-x { padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.1); color: #ddd; font-size: 13px; }
.seek-bubble { position: absolute; top: 50%; z-index: 4; transform: translateY(-50%); padding: 14px 18px; border-radius: 999px;
  background: rgba(0,0,0,.55); color: #fff; font-weight: 800; font-size: 18px; pointer-events: none; }
.seek-bubble.l { left: 12%; } .seek-bubble.r { right: 12%; }
.room-bar { position: absolute; left: 50%; top: 64px; transform: translateX(-50%); z-index: 4; padding: 6px 14px; border-radius: 999px;
  background: rgba(255,106,61,.9); color: #fff; font-size: 12.5px; font-weight: 700; white-space: nowrap; max-width: 90%; overflow: hidden; text-overflow: ellipsis; }
body.tg-fs .room-bar { top: calc(64px + var(--top-pad, 0px)); }
.icon-btn.dl.on { background: var(--grad); }

/* ───────── дії на сторінці фільму: 3 кнопки ───────── */
.actions { grid-template-columns: 1fr 1fr 1fr; }
.act { font-size: 13px; padding: 11px 6px; }

/* ───────── фільтри ───────── */
.filters { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.filters .label { margin: 10px 0 6px; }
.filters .chips { flex-wrap: nowrap; }
.filter-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 13px; margin: 6px 0 4px;
  border-radius: var(--radius); background: var(--surface); border: 1px solid rgba(255,106,61,.35); color: var(--text); font-weight: 700; }

/* ───────── модальне вікно (поділитися / разом) ───────── */
.sheet-bg { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 520px; padding: 18px 16px calc(18px + var(--safe-b)); border-radius: 20px 20px 0 0; background: var(--surface);
  border: 1px solid var(--line); animation: up .2s ease-out; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet h3 { margin: 0 0 6px; font-size: 18px; }
.sheet p { margin: 0 0 14px; color: #c7ccd7; font-size: 14px; line-height: 1.45; }
.sheet .watch { margin-top: 8px; }
.sheet .act { width: 100%; margin-top: 8px; }

.together-btn { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-top: 8px; padding: 12px;
  border-radius: 12px; background: rgba(255,106,61,.1); border: 1px solid rgba(255,106,61,.4); color: #ffb08f; font-weight: 700; font-size: 14px; }

/* помітна картка процесу: «Отримую посилання…», «Перевіряю джерело…», «Пробую Джерело N…» */
.toast.busy { left: 50%; right: auto; top: 50%; bottom: auto; transform: translate(-50%, -50%); width: min(320px, calc(100vw - 48px));
  display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 22px 20px; text-align: center;
  font-size: 16px; font-weight: 700; background: rgba(18, 20, 28, .96); border: 1.5px solid rgba(255,106,61,.7);
  box-shadow: 0 0 0 6px rgba(255,106,61,.12), 0 20px 50px rgba(0,0,0,.6); animation: pop .2s ease-out; z-index: 60; }
.t-spin { width: 38px; height: 38px; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 20%, #ff6a3d 70%, #ffb347 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px)); animation: spin .8s linear infinite; }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -46%) scale(.96); } to { opacity: 1; transform: translate(-50%, -50%); } }

.top-actions { display: flex; gap: 8px; }
.gt-btns { display: flex; gap: 8px; margin-top: 10px; }
.gt-yes { padding: 8px 16px; border-radius: 10px; background: var(--grad); color: #fff; font-weight: 700; font-size: 13px; }
.gt-no { padding: 8px 12px; border-radius: 10px; background: rgba(255,255,255,.08); color: #cfd4df; font-size: 13px; }

.steps { margin: 4px 0 12px; padding-left: 22px; color: #e6e9ef; font-size: 15px; line-height: 1.5; }
.steps li { margin: 6px 0; }

.gt-later { margin-top: 10px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.mini-ico { display: inline-grid; place-items: center; width: 22px; height: 22px; margin: 0 2px; vertical-align: middle;
  border-radius: 7px; background: var(--surface); border: 1px solid var(--line); }
.mini-ico svg, .fs-btn svg { width: 14px; height: 14px; fill: none; stroke: #d6dae3; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fs-btn svg { width: 18px; height: 18px; stroke: currentColor; }
.fs-btn.pulse { animation: pulse 1s ease-in-out 3; border-color: var(--accent); color: var(--accent); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,106,61,.6); } 50% { box-shadow: 0 0 0 8px rgba(255,106,61,0); } }


/* підказка під час першого відтворення */
.coach { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 8; display: flex; align-items: center; gap: 14px;
  max-width: 300px; padding: 16px 18px; border-radius: 16px; background: rgba(16,18,26,.9); border: 1.5px solid rgba(255,106,61,.7);
  color: #fff; font-size: 15px; line-height: 1.4; box-shadow: 0 12px 40px rgba(0,0,0,.6); animation: pop .25s ease-out; transition: opacity .4s; }
.coach.gone { opacity: 0; }
.coach-ico { font-size: 30px; color: #ffb347; }
@keyframes rot { 0%, 30% { transform: rotate(0); } 60%, 100% { transform: rotate(90deg); } }

.icon-btn.pulse { animation: pulse 1s ease-in-out 5; background: var(--grad); }

.pill.rate .votes { color: #b7a87a; font-weight: 500; }

.panel-top { margin-top: 18px; }
