/* Alright TV v6 — app same-to-same */
:root { --bg: #000; --card: #1a1a20; --text: #fff; --muted: #9a9aa3; --yellow: #f5b50a; --yellow2: #ffd23e; }
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { height: 100%; background: #000; overflow: hidden; }
body { height: 100%; background: #000; color: var(--text); font-family: 'Segoe UI', system-ui, sans-serif; display: flex; justify-content: center; overflow: hidden; }
.phone { width: 100%; max-width: 430px; height: 100dvh; background: #000; position: relative; overflow-y: auto; overflow-x: hidden; padding-bottom: 90px; }
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { display: block; }
::-webkit-scrollbar { width: 0; height: 0; }
.empty { color: var(--muted); text-align: center; padding: 60px 20px; font-size: 14px; }
.spinner { position: absolute; top: 50%; left: 50%; width: 46px; height: 46px; margin: -23px; z-index: 6; border: 4px solid rgba(255,255,255,.2); border-top-color: var(--yellow); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.chip { padding: 9px 20px; border-radius: 24px; font-size: 13px; font-weight: 600; border: 1px solid #333; color: #d7d7de; background: #101014; white-space: nowrap; }
.chip.active { border-color: var(--yellow); color: var(--yellow); font-weight: 800; }

/* TOPBAR — app jaisa: [Alright TV!] [search........] [Renew] ek line, barabar alignment */
.sticky-head { position: sticky; top: 0; z-index: 40; background: #000; }
#topbar { padding: 10px 10px 8px; display: flex; align-items: center; gap: 8px; }
.search-pill-wrap { flex: 1; min-width: 0; }
.search-pill { display: flex; align-items: center; gap: 7px; background: #1e1e24; border-radius: 18px; padding: 9px 12px; cursor: pointer; }
.search-pill .search-ph { color: #8e8e96; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* teeno ek jaisi height me — brand + renew chhote taaki search ko jagah mile */
.brand-btn, .renew-btn { flex: 0 0 auto; height: 38px; display: inline-flex; align-items: center; justify-content: center; background: var(--yellow); color: #000; font-weight: 900; font-size: 12px; padding: 0 13px; border-radius: 14px; white-space: nowrap; }
.search-pill { height: 38px; }
/* search btn ko title jaise border me — ALRIGHT!TV SPECIALS / genre pills jaisa */
.search-pill.title-bordered { border: 1px solid #333; background: #101014; }
.search-pill.title-bordered:focus-within { border-color: var(--yellow); }
.renew-btn { flex: 0 0 auto; background: var(--yellow); color: #000; font-weight: 900; font-size: 15px; padding: 11px 26px; border-radius: 14px; }

/* TABS — Popular / Vertical Films / Curated For You / Global */
#tabs-row { display: flex; gap: 22px; padding: 6px 16px 0; overflow-x: auto; background: #000; }
.tab { flex: 0 0 auto; font-size: 15px; font-weight: 600; color: #8e8e96; padding: 8px 2px 10px; position: relative; }
.tab.active { color: #fff; font-weight: 800; }
.tab.active::after { content: ''; position: absolute; left: 50%; transform: translateX(-50%); bottom: 2px; width: 26px; height: 3px; border-radius: 3px; background: var(--yellow); }

/* HERO — Popular spotlight */
#hero-wrap { padding: 12px 14px 4px; }
.hero-card { position: relative; border-radius: 18px; overflow: hidden; background: var(--card); aspect-ratio: 3/4; max-height: 480px; cursor: pointer; border: 1px solid rgba(255,255,255,.08); }
.hero-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .3s ease; }
.hero-grad { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.25), transparent 30%, transparent 55%, rgba(0,0,0,.85)); }
.new-badge { position: absolute; top: 10px; left: 10px; z-index: 2; background: rgba(0,0,0,.65); color: #fff; font-size: 11px; font-weight: 800; padding: 5px 10px; border-radius: 12px; letter-spacing: .5px; }
.new-badge.sm { font-size: 9px; padding: 3px 8px; }
.hero-title { position: absolute; left: 14px; right: 14px; bottom: 30px; z-index: 2; font-size: 26px; font-weight: 900; letter-spacing: 1px; text-shadow: 0 2px 12px rgba(0,0,0,.9); }
.hero-dots { position: absolute; left: 0; right: 0; bottom: 10px; z-index: 2; display: flex; gap: 6px; justify-content: center; }
.hdot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.4); }
.hdot.on { background: var(--yellow); width: 20px; border-radius: 5px; }
/* episode travel-arrow — down: uper se niche tak, up: niche se uper tak */
.ep-arrow { position: absolute; left: 0; right: 0; top: 0; bottom: 0; z-index: 7; pointer-events: none; }
.ep-arrow span { position: absolute; left: 50%; font-size: 34px; color: var(--yellow); text-shadow: 0 2px 14px rgba(0,0,0,.9); opacity: 0; }
.ep-arrow.go-down span { animation: arrowDown .9s ease forwards; }
.ep-arrow.go-up span { animation: arrowUp .9s ease forwards; }
.ep-arrow.go-next span { animation: arrowNext .9s ease forwards; }
.ep-arrow.go-prev span { animation: arrowPrev .9s ease forwards; }
@keyframes arrowDown { 0% { opacity: 0; top: 6%; transform: translateX(-50%) scale(.7); } 25% { opacity: 1; } 100% { opacity: 0; top: 88%; transform: translateX(-50%) scale(1.15); } }
@keyframes arrowUp { 0% { opacity: 0; top: 88%; transform: translateX(-50%) scale(.7); } 25% { opacity: 1; } 100% { opacity: 0; top: 6%; transform: translateX(-50%) scale(1.15); } }
@keyframes arrowNext { 0% { opacity: 0; left: 86%; top: 50%; transform: translateY(-50%) scale(.7); } 25% { opacity: 1; } 100% { opacity: 0; left: 8%; top: 50%; transform: translateY(-50%) scale(1.15); } }
@keyframes arrowPrev { 0% { opacity: 0; left: 8%; top: 50%; transform: translateY(-50%) scale(.7); } 25% { opacity: 1; } 100% { opacity: 0; left: 86%; top: 50%; transform: translateY(-50%) scale(1.15); } }

/* SECTIONS */
.home-sec { margin-top: 6px; }
.sec-title { font-size: 20px; font-weight: 800; padding: 14px 16px 10px; }
.sec-count { font-size: 13px; font-weight: 700; color: var(--muted); }
.special-pill { display: inline-block; margin: 12px 0 0 16px; padding: 7px 16px; border-radius: 12px; border: 1px solid #444; color: var(--yellow); font-size: 13px; font-weight: 900; letter-spacing: 2px; }
.pills-row { display: flex; gap: 10px; padding: 0 16px 12px; overflow-x: auto; }
.rail { display: flex; gap: 12px; padding: 0 16px 8px; overflow-x: auto; scroll-snap-type: x mandatory; }
.rail-card { flex: 0 0 128px; scroll-snap-align: start; cursor: pointer; }
.rail-poster { position: relative; aspect-ratio: 2/3; border-radius: 12px; overflow: hidden; background: var(--card); border: 1px solid rgba(255,255,255,.07); }
.rail-poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.rail-name { font-size: 12px; font-weight: 700; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* EXPLORE — Curated bade cards */
.explore-col { display: flex; flex-direction: column; gap: 18px; padding: 0 16px 10px; }
.explore-card { cursor: pointer; }
.explore-banner { position: relative; border-radius: 16px; overflow: hidden; aspect-ratio: 16/9; background: var(--card); border: 1px solid rgba(255,255,255,.08); }
.explore-banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.explore-grad { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,.75)); }
.explore-watch { position: absolute; top: 10px; right: 12px; font-size: 10px; font-weight: 900; letter-spacing: 1px; color: #fff; text-shadow: 0 1px 6px #000; }
.explore-title { font-size: 18px; font-weight: 900; margin: 10px 2px 8px; }
.explore-genres { display: flex; gap: 8px; flex-wrap: wrap; }
.g-pill { font-size: 12px; font-weight: 600; color: #d7d7de; border: 1px solid #333; background: #101014; border-radius: 12px; padding: 7px 14px; }

/* COMING SOON */
.coming-date { display: flex; align-items: center; gap: 12px; padding: 6px 16px 10px; color: #cfcfd6; font-size: 14px; font-weight: 600; }
.coming-line { flex: 1; height: 1px; background: #2a2a32; }
.rail-card.coming { flex-basis: 200px; }
.remind-btn { position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 2; background: #fff; color: #000; font-size: 13px; font-weight: 800; padding: 10px; border-radius: 12px; }
.remind-btn:disabled { opacity: .7; }

/* RANKED — Best Shows 1,2 */
.rail-card.ranked { flex-basis: 170px; }
.rank-n { position: absolute; left: 2px; bottom: -8px; z-index: 2; font-size: 84px; font-weight: 900; color: transparent; -webkit-text-stroke: 2px #fff; line-height: 1; text-shadow: 0 2px 10px rgba(0,0,0,.6); }

/* CONTINUE */
.play-ov { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.92); color: #000; font-size: 16px; display: grid; place-items: center; z-index: 2; }
.prog { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,.25); z-index: 2; }
.prog span { display: block; height: 100%; background: var(--yellow); }

/* ALL SHOWS GRID (search results) */
.shows-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 0 12px 12px; }
.show-card { cursor: pointer; }
.show-poster { position: relative; aspect-ratio: 2/3; border-radius: 12px; overflow: hidden; background: var(--card); }
.show-poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.show-name { font-size: 12px; font-weight: 700; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vbadge { position: absolute; left: 4px; bottom: 4px; z-index: 2; background: rgba(0,0,0,.7); color: #ffd23e; font-size: 9px; font-weight: 800; padding: 2px 6px; border-radius: 10px; }
.epbadge { position: absolute; top: 4px; right: 4px; z-index: 2; background: rgba(0,0,0,.7); color: #fff; font-size: 9px; font-weight: 800; padding: 2px 6px; border-radius: 10px; }

/* LOAD MORE */
.load-area { text-align: center; padding: 16px; }
.load-btn { background: var(--yellow); color: #000; font-weight: 800; font-size: 14px; padding: 12px 36px; border-radius: 12px; }
.load-btn:disabled { opacity: .5; }

/* BOTTOM NAV */
#bottomnav { position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%); width: min(420px, calc(100% - 28px)); z-index: 60; display: flex; background: rgba(20,20,24,.92); backdrop-filter: blur(14px); border: 1px solid rgba(255,255,255,.08); border-radius: 30px; padding: 8px; transition: transform .3s ease, opacity .3s ease; }
#bottomnav.hide { transform: translateX(-50%) translateY(calc(100% + 40px)); opacity: 0; pointer-events: none; }
.bn-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 22px; color: #8e8e96; font-size: 11px; font-weight: 600; }
.bn-item.active { background: rgba(245,181,10,.14); color: var(--yellow); }
.bn-ico { font-size: 20px; }

/* SEARCH — upar fixed full-screen overlay (neeche nahi, home ke upar) */
#search-ov { position: fixed; inset: 0; z-index: 95; background: #000; max-width: 430px; margin: 0 auto; display: flex; flex-direction: column; overflow: hidden; }
.search-top { display: flex; gap: 10px; align-items: center; padding: 12px 14px; background: #000; z-index: 5; }
.circle-btn { width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.08); display: grid; place-items: center; color: #fff; flex: 0 0 auto; }
.circle-btn.sm { width: 32px; height: 32px; font-size: 14px; }
.search-pill.static { cursor: default; flex: 1; }
.search-pill input { flex: 1; background: none; border: none; outline: none; color: #fff; font-size: 14px; min-width: 0; }
#search-body { flex: 1; overflow-y: auto; padding-bottom: 30px; }

/* PLAYER */
#player { position: fixed; inset: 0; z-index: 100; background: #000; max-width: 430px; margin: 0 auto; }
.reel-stage { position: relative; width: 100%; height: 100dvh; background: #000; overflow: hidden; }
#video { width: 100%; height: 100%; object-fit: cover; background: #000; }
.reel-gradient { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(0,0,0,.45), transparent 25%, transparent 55%, rgba(0,0,0,.75)); }
.player-ui { position: absolute; inset: 0; z-index: 5; transition: opacity .35s ease; }
.player-ui.hide { opacity: 0; pointer-events: none; }
.circle-btn.back { position: absolute; top: 14px; left: 14px; background: rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.2); }
.big-play { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 84px; height: 84px; border-radius: 50%; background: rgba(255,255,255,.92); color: #000; font-size: 30px; display: grid; place-items: center; z-index: 6; }
.side-actions { position: absolute; right: 8px; bottom: 150px; display: flex; flex-direction: column; gap: 12px; }
.side-btn { display: flex; flex-direction: column; align-items: center; gap: 1px; color: #fff; }
.side-ico { font-size: 24px; text-shadow: 0 2px 8px rgba(0,0,0,.6); }
.side-n { font-size: 10px; font-weight: 700; }
.reel-bottom { position: absolute; left: 14px; right: 90px; bottom: 18px; }
.reel-logo { height: 26px; margin-bottom: 6px; }
.reel-ep { font-size: 11px; font-weight: 800; color: var(--yellow2); letter-spacing: 1px; }
.reel-title { font-size: 17px; font-weight: 800; margin: 2px 0 10px; text-shadow: 0 2px 10px rgba(0,0,0,.8); line-height: 1.2; }
.watchnow { width: 100%; background: rgba(255,255,255,.22); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.25); color: #fff; font-size: 14px; font-weight: 700; padding: 12px; border-radius: 10px; }
.ep-sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 20; max-height: 62dvh; overflow-y: auto; background: #14141a; border-radius: 20px 20px 0 0; padding-bottom: 26px; }
#profile-sheet { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: min(430px, 100%); z-index: 120; max-height: 62dvh; overflow-y: auto; background: #14141a; border-radius: 20px 20px 0 0; padding-bottom: 26px; }
.sheet-grab { width: 44px; height: 5px; border-radius: 5px; background: #333; margin: 10px auto; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 18px 12px; font-weight: 800; font-size: 16px; }
.sheet-btns { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
#sheet-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-right: 8px; }
.dl-all-btn { background: var(--yellow); color: #000; font-size: 13px; font-weight: 900; padding: 8px 16px; border-radius: 999px; }
.season-tabs { display: flex; gap: 8px; padding: 0 18px 12px; overflow-x: auto; }
.stab { flex: 0 0 auto; padding: 7px 16px; border-radius: 999px; font-size: 13px; font-weight: 700; background: #22222a; color: #9a9aa3; }
.stab.active { background: var(--yellow); color: #000; }
.ep-list { display: flex; flex-direction: column; gap: 8px; padding: 0 14px; }
.ep-row { display: flex; align-items: center; gap: 12px; background: #1e1e26; border-radius: 12px; padding: 10px 12px; text-align: left; width: 100%; }
.ep-row.active { outline: 2px solid var(--yellow); }
.ep-info { flex: 1; }
.ep-t { font-size: 13px; font-weight: 700; }
.ep-s { font-size: 11px; color: var(--muted); margin-top: 2px; }

.toast { position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%); z-index: 300; background: #22222c; color: #fff; font-size: 13px; padding: 11px 22px; border-radius: 999px; box-shadow: 0 8px 30px rgba(0,0,0,.5); }

/* DOWNLOAD quality dialog */
#dl-sheet { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: min(430px, 100%); z-index: 130; }
.dl-sub { padding: 0 18px 12px; color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-scope { display: flex; gap: 8px; padding: 0 14px 12px; overflow-x: auto; }
/* queue progress */
.dl-prog { padding: 6px 14px 4px; }
.dl-bar-wrap { height: 12px; border-radius: 8px; background: #22222a; overflow: hidden; }
.dl-bar { height: 100%; width: 0%; border-radius: 8px; background: linear-gradient(90deg, var(--yellow), var(--yellow2)); transition: width .5s ease; }
.dl-prog-txt { margin-top: 10px; font-size: 13px; color: #d7d7de; font-weight: 600; }
.dl-opts { display: flex; flex-direction: column; gap: 10px; padding: 0 14px; }
.dl-opt { display: flex; align-items: center; gap: 14px; background: #1e1e26; border: 1px solid #333; border-radius: 14px; padding: 13px 16px; text-align: left; width: 100%; }
.dl-opt:active { border-color: var(--yellow); }
.dl-q { font-size: 16px; font-weight: 900; color: var(--yellow); flex: 0 0 auto; min-width: 96px; }
.dl-s { font-size: 12px; color: var(--muted); }

/* REEL ANIMATIONS */
@keyframes reelInUp { from { opacity: 0; transform: translateY(60px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes reelInDown { from { opacity: 0; transform: translateY(-60px) scale(.96); } to { opacity: 1; transform: none; } }
.reel-slide-up { animation: reelInUp .38s ease-out forwards; }
.reel-slide-down { animation: reelInDown .38s ease-out forwards; }

/* FOR YOU */
#foryou { position: fixed; inset: 0; z-index: 90; background: #000; max-width: 430px; margin: 0 auto; display: flex; flex-direction: column; }
.fy-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; background: #000; position: sticky; top: 0; z-index: 5; }
.fy-title { font-size: 17px; font-weight: 800; }
#fy-reels { flex: 1; overflow-y: auto; scroll-snap-type: y mandatory; }
.fy-reel { position: relative; height: calc(100dvh - 66px); scroll-snap-align: start; scroll-snap-stop: always; background: #000; overflow: hidden; }
.fy-video { width: 100%; height: 100%; object-fit: cover; background: #111; }
.fy-grad { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(0,0,0,.4), transparent 25%, transparent 55%, rgba(0,0,0,.8)); }
.fy-side { position: absolute; right: 10px; bottom: 150px; display: flex; flex-direction: column; gap: 16px; z-index: 4; }
.fy-bottom { position: absolute; left: 14px; right: 84px; bottom: 16px; z-index: 4; }
.fy-views { font-size: 12px; font-weight: 800; color: var(--yellow2); }
.fy-title2 { font-size: 18px; font-weight: 900; margin: 2px 0 10px; text-shadow: 0 2px 10px rgba(0,0,0,.8); }
.fy-watch { width: 100%; background: rgba(255,255,255,.22); border: 1px solid rgba(255,255,255,.25); color: #fff; font-size: 14px; font-weight: 700; padding: 12px; border-radius: 10px; }
.fy-spin { position: absolute; top: 50%; left: 50%; width: 44px; height: 44px; margin: -22px; border: 4px solid rgba(255,255,255,.2); border-top-color: var(--yellow); border-radius: 50%; animation: spin .8s linear infinite; }
.fy-reel.active .fy-video { box-shadow: 0 0 0 1px rgba(245,181,10,.35); }
.fy-reel { animation: reelInUp .35s ease; }
