/* VIBE CINEMA — ITV uslubida, qizil / oq / qora */
:root {
  --bg: #141414;
  --surface: #1e1e1e;
  --surface-2: #272727;
  --surface-3: #313131;
  --line: rgba(255, 255, 255, .07);
  --text: #ffffff;
  --text-2: #d6d6d8;
  --muted: #8e8e93;
  --accent: #e50914;
  --accent-hover: #ff1a25;
  --accent-soft: rgba(229, 9, 20, .14);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --top-inset: calc(max(env(safe-area-inset-top, 0px), var(--tg-safe-area-inset-top, 0px)) + var(--tg-content-safe-area-inset-top, 0px));
  --bottom-inset: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
  --plyr-color-main: var(--accent);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); overflow-x: hidden; }
body {
  font: 15px/1.45 "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
img { display: block; max-width: 100%; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

/* ── Yuqori panel ── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + var(--top-inset)) 16px 10px;
  background: rgba(20, 20, 20, .92);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; letter-spacing: 1px; color: var(--accent); }
.logo > span:not(.logo-mark) { color: var(--text); }
.logo-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); display: grid; place-items: center; }
.logo-mark svg { width: 13px; height: 13px; fill: #fff; stroke: none; margin-left: 2px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn, .chip-btn {
  width: 40px; height: 40px; border-radius: 10px; background: var(--surface-2);
  display: grid; place-items: center; transition: background .15s;
}
.icon-btn svg { width: 20px; height: 20px; }
.chip-btn { font-size: 13px; font-weight: 700; letter-spacing: .5px; }
.icon-btn:active, .chip-btn:active { background: var(--surface-3); }
.close-btn:active { background: var(--accent); }

.view { padding-bottom: calc(84px + var(--bottom-inset)); min-height: 70vh; }

/* ── Pastki menyu (ITV: faqat ikonkalar, faol bo'limda nomi bilan) ── */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: space-around; align-items: center;
  padding: 8px 10px calc(8px + var(--bottom-inset));
  background: rgba(20, 20, 20, .96);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  display: flex; align-items: center; gap: 7px; height: 42px; padding: 0 14px; border-radius: 21px;
  color: var(--muted); font-size: 13px; font-weight: 600; transition: background .2s, color .2s;
}
.tabbar a span { display: none; }
.tabbar a.active { color: var(--text); background: var(--surface-2); }
.tabbar a.active span { display: inline; }
.tabbar a.active svg { stroke: var(--accent); }

/* ── Bosh banner (ITV: chetlari ko'rinib turadigan kartochkalar) ── */
.hero { padding-top: 6px; }
.hero-track {
  display: flex; gap: 10px; padding: 0 16px; overflow-x: auto;
  scroll-snap-type: x mandatory; scroll-padding: 0 16px; scrollbar-width: none;
}
.hero-track::-webkit-scrollbar { display: none; }
.hero-slide {
  position: relative; flex: 0 0 calc(100% - 22px); scroll-snap-align: center;
  aspect-ratio: 3 / 4; max-height: 64vh; border-radius: var(--radius-lg); overflow: hidden; background: var(--surface);
}
.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center top; }
.hero-slide::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, .92) 0%, rgba(0, 0, 0, .55) 35%, rgba(0, 0, 0, 0) 65%);
}
.hero-info { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 0 18px 20px; }
.hero-title { font-size: 28px; line-height: 1.1; font-weight: 700; margin: 10px 0 8px; letter-spacing: -.3px; }
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: var(--text-2); font-size: 14px; font-weight: 500; }
.hero-desc { margin-top: 10px; color: var(--text-2); font-size: 14px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero-dots { position: absolute; right: 18px; top: 16px; z-index: 3; display: flex; gap: 5px; }
.hero-dots i { width: 6px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .4); transition: .25s; }
.hero-dots i.on { width: 18px; background: #fff; }
.hero-cta { display: flex; gap: 10px; padding: 12px 16px 0; }
.hero-cta .btn { flex: 1; }

.rating-pill { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--text); }
.rating-pill b { color: var(--accent); font-weight: 800; }

/* ── Belgilar ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 9px; border-radius: 6px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  background: var(--accent); color: #fff;
}
.badge.dark { background: rgba(0, 0, 0, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.badge.outline { background: transparent; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .5); }

/* ── Tugmalar ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 50px; padding: 0 20px; border-radius: 10px; font-weight: 600; font-size: 16px;
  background: var(--surface-2); color: var(--text); transition: transform .1s, background .15s, opacity .2s;
}
.btn:active { transform: scale(.98); }
.btn svg { width: 20px; height: 20px; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:active { background: var(--accent-hover); }
.btn.block { width: 100%; }
.btn.square { width: 50px; padding: 0; flex: 0 0 50px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.play svg { fill: currentColor; stroke: none; }

/* ── Janr tugmachalari ── */
.chips { display: flex; gap: 8px; padding: 18px 16px 0; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; height: 38px; display: inline-flex; align-items: center; padding: 0 16px; border-radius: 10px; background: var(--surface-2); font-size: 14px; font-weight: 500; white-space: nowrap; }
.chip:active { background: var(--accent); }

/* ── Qatorlar ── */
.row { margin-top: 28px; }
.row-head { display: inline-flex; align-items: center; gap: 4px; padding: 0 16px 12px; }
.row-head h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.2px; }
.row-head svg { width: 20px; height: 20px; stroke-width: 2.4; }
.row-track { display: flex; gap: 10px; padding: 0 16px; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding: 0 16px; scrollbar-width: none; }
.row-track::-webkit-scrollbar { display: none; }
.row-track .card { flex: 0 0 calc((100% - 20px) / 2.25); max-width: 190px; scroll-snap-align: start; }

/* ── Poster kartochkasi ── */
.card { position: relative; display: block; min-width: 0; }
.poster { position: relative; aspect-ratio: 2 / 3; border-radius: var(--radius); overflow: hidden; background: var(--surface); transition: transform .15s; }
.card:active .poster { transform: scale(.97); }
.poster img { width: 100%; height: 100%; object-fit: cover; }
.poster .ph { position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; text-align: center; font-weight: 700; font-size: 15px; line-height: 1.2; color: rgba(255, 255, 255, .92); }
.poster .tl, .poster .br, .poster .bl { position: absolute; z-index: 2; }
.poster .bl { left: 8px; bottom: 8px; }
.poster .br { right: 8px; bottom: 8px; }
.poster .tl { left: 8px; top: 8px; }
.poster .age { display: inline-grid; place-items: center; min-width: 36px; height: 26px; padding: 0 7px; border-radius: 7px; background: rgba(30, 30, 30, .78); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); font-size: 12.5px; font-weight: 600; }
.poster .bl .badge { height: 20px; font-size: 10px; padding: 0 8px; border-radius: 10px; }
.poster .lock { width: 28px; height: 28px; border-radius: 8px; background: rgba(0, 0, 0, .6); display: grid; place-items: center; }
.poster .lock svg { width: 14px; height: 14px; stroke: #fff; }
.card-title { margin-top: 8px; font-size: 15px; font-weight: 600; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { margin-top: 2px; font-size: 13px; font-weight: 500; color: var(--muted); }
.card-sub.paid { color: var(--accent); }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 10px; padding: 0 16px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, 1fr); } .row-track .card { flex-basis: calc((100% - 30px) / 3.3); } }
@media (min-width: 860px) {
  .grid { grid-template-columns: repeat(5, 1fr); }
  .row-track .card { flex-basis: calc((100% - 50px) / 5.3); }
  .hero-slide { flex-basis: calc(100% - 80px); aspect-ratio: 16 / 7; }
  .hero-info { max-width: 640px; padding: 0 32px 30px; }
  .hero-title { font-size: 38px; }
  .hero-cta { max-width: 420px; }
}

.page-title { font-size: 26px; font-weight: 700; letter-spacing: -.3px; margin: 14px 16px 16px; }
.section-title { font-size: 20px; font-weight: 700; margin: 28px 16px 12px; }

/* ── Janrlar sahifasi ── */
.genre-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 0 16px; }
.genre-tile {
  position: relative; height: 76px; border-radius: var(--radius); overflow: hidden;
  display: flex; align-items: flex-end; padding: 12px 14px; font-weight: 600; font-size: 16px;
  background: var(--surface);
}
.genre-tile::before { content: ""; position: absolute; right: -24px; top: -24px; width: 86px; height: 86px; border-radius: 50%; background: radial-gradient(circle, var(--g, var(--accent)) 0%, transparent 70%); opacity: .55; }
.genre-tile span { position: relative; }
.genre-tile:active { background: var(--surface-2); }

/* ── Kino sahifasi (ITV) ── */
.movie-hero { position: relative; min-height: 58vh; display: flex; align-items: flex-end; overflow: hidden; }
.movie-hero .bg { position: absolute; inset: 0; background-size: cover; background-position: center 20%; }
.movie-hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, var(--bg) 0%, rgba(20, 20, 20, .75) 32%, rgba(20, 20, 20, .15) 70%, rgba(20, 20, 20, .35) 100%);
}
.movie-top { position: relative; z-index: 2; width: 100%; padding: 0 16px 6px; }
.movie-top h1 { margin: 10px 0 10px; font-size: 30px; line-height: 1.1; font-weight: 700; letter-spacing: -.4px; }
.movie-top .orig { color: var(--muted); font-size: 14px; margin: -4px 0 10px; }
.movie-ratings { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 16px; font-size: 15px; }
.movie-ratings .dot { color: var(--muted); }
.movie-actions { display: flex; gap: 10px; }
.movie-actions .btn.grow { flex: 1; }
.notice { margin-top: 12px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface); color: var(--text-2); font-size: 14px; line-height: 1.4; }
.notice.red { background: var(--accent-soft); color: #ffb3b6; }

.movie-info { display: flex; gap: 16px; padding: 26px 16px 0; align-items: flex-start; }
.movie-info .poster { width: 120px; flex: 0 0 120px; }
.movie-info .text { min-width: 0; flex: 1; }
.meta-line { display: flex; flex-wrap: wrap; gap: 4px 10px; color: var(--muted); font-size: 13.5px; margin-bottom: 10px; }
.desc { color: var(--text); font-size: 15px; line-height: 1.5; white-space: pre-line; }
.desc.clamp { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.more-link { color: var(--accent); font-size: 14px; font-weight: 600; margin-top: 6px; display: inline-block; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; padding: 18px 16px 0; margin: 0; font-size: 14.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--text); }
@media (max-width: 420px) {
  .movie-info .poster { display: none; }
}

/* ── Player ── */
.player-page { background: #000; min-height: 100vh; }
.player-wrap { position: relative; background: #000; }
.player-wrap video { width: 100%; aspect-ratio: 16 / 9; background: #000; }
.player-wrap .plyr { --plyr-video-background: #000; }
.player-wrap .plyr video { object-fit: var(--fit, contain); transform: scale(var(--zoom, 1)); transition: transform .2s; }
.player-wrap .plyr--fullscreen-active video,
.player-wrap .plyr--fullscreen-fallback video { aspect-ratio: auto; height: 100%; }
.plyr__control.fit-btn svg { width: 18px; height: 18px; }
.player-info { padding: 16px; }
.player-info h1 { margin: 0 0 6px; font-size: 20px; font-weight: 700; }
.player-info .meta { color: var(--muted); font-size: 14px; }
.fit-bar { display: flex; gap: 8px; padding: 0 16px 10px; flex-wrap: wrap; }
.fit-bar button { height: 36px; padding: 0 13px; border-radius: 9px; background: var(--surface-2); font-size: 13.5px; font-weight: 500; }
.fit-bar button.on { background: var(--accent); }
.resume { margin: 0 16px 12px; }
.audio-menu {
  position: absolute; right: 10px; bottom: 58px; z-index: 30; min-width: 170px; max-height: 60%; overflow: auto;
  padding: 6px; border-radius: 12px; background: rgba(30, 30, 30, .97); box-shadow: 0 8px 30px rgba(0, 0, 0, .5);
}
.audio-menu .am-title { padding: 6px 10px 8px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.audio-menu button { display: block; width: 100%; text-align: left; padding: 10px; border-radius: 8px; font-size: 14px; }
.audio-menu button.on { background: var(--accent); }
.player-wrap .plyr__captions { font-size: clamp(14px, 4.2vw, 26px); }
@media (max-width: 520px) {
  .player-wrap .plyr__controls [data-plyr="rewind"],
  .player-wrap .plyr__controls [data-plyr="fast-forward"],
  .player-wrap .plyr__controls [data-plyr="pip"],
  .player-wrap .plyr__controls [data-plyr="airplay"],
  .player-wrap .plyr__controls .plyr__volume { display: none; }
  .player-wrap .plyr__controls { padding-left: 6px; padding-right: 6px; gap: 0; }
  .player-wrap .plyr__control { padding: 6px; }
}
body.playing .tabbar { display: none; }
body.playing .view { padding-bottom: 0; }

/* ── Qidiruv ── */
.search-box { position: sticky; top: calc(60px + var(--top-inset)); z-index: 10; padding: 8px 16px 12px; background: var(--bg); }
.search-box label { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px; border-radius: 12px; background: var(--surface-2); }
.search-box label:focus-within { box-shadow: inset 0 0 0 1.5px var(--accent); }
.search-box input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--text); font-size: 16px; }
.search-box input::placeholder { color: var(--muted); }
.search-box svg { color: var(--muted); }
.hint { color: var(--muted); text-align: center; padding: 40px 24px; }
.hint .big { font-size: 42px; margin-bottom: 8px; }

/* ── Profil ── */
.profile-card { margin: 12px 16px 0; padding: 20px; border-radius: var(--radius-lg); background: var(--surface); }
.profile-card h2 { margin: 0 0 4px; font-size: 20px; font-weight: 700; }
.profile-card .sub { color: var(--muted); font-size: 14px; margin-bottom: 14px; }

/* ── Pastdan chiqadigan oyna ── */
.sheet-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .6); }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 85vh; overflow: auto;
  padding: 10px 16px calc(18px + var(--bottom-inset));
  border-radius: 20px 20px 0 0; background: var(--surface); animation: up .22s ease-out;
}
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--surface-3); margin: 0 auto 16px; }
.sheet h3 { margin: 0 0 4px; font-size: 20px; font-weight: 700; }
.sheet .sub { color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.pay-opt { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; margin-bottom: 10px; border-radius: var(--radius); background: var(--surface-2); text-align: left; }
.pay-opt .logo-box { width: 46px; height: 32px; border-radius: 7px; display: grid; place-items: center; font-weight: 800; font-size: 12px; color: #fff; }
.pay-opt .grow { flex: 1; }
.pay-opt small { display: block; color: var(--muted); font-size: 12.5px; }
.months { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.months button { padding: 12px 6px; border-radius: 10px; background: var(--surface-2); font-size: 13px; color: var(--muted); }
.months button.on { box-shadow: inset 0 0 0 1.5px var(--accent); background: var(--accent-soft); color: var(--text); }
.months b { display: block; font-size: 15px; color: var(--text); }

/* ── Turli ── */
.toast { position: fixed; left: 50%; bottom: calc(96px + var(--bottom-inset)); z-index: 60; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 12px; background: var(--surface-3); box-shadow: 0 8px 30px rgba(0, 0, 0, .5); font-size: 14px; font-weight: 500; text-align: center; animation: up .2s; }
.skeleton { background: linear-gradient(90deg, var(--surface), var(--surface-2), var(--surface)); background-size: 200% 100%; animation: sh 1.2s infinite; border-radius: var(--radius); }
@keyframes sh { to { background-position: -200% 0; } }
.sk-hero { margin: 6px 16px 0; aspect-ratio: 3 / 4; max-height: 64vh; border-radius: var(--radius-lg); }
.sk-row { display: flex; gap: 10px; padding: 0 16px; margin-top: 28px; }
.sk-row div { flex: 0 0 44%; aspect-ratio: 2 / 3; }
.center { display: grid; place-items: center; min-height: 50vh; padding: 24px; text-align: center; color: var(--muted); }
.spinner { width: 34px; height: 34px; border: 3px solid var(--surface-3); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.load-more { display: flex; margin: 22px auto 0; }
