/* SPDX-License-Identifier: GPL-3.0-or-later */
/* Osama TV. Sizes are in rem, and 1rem is 1/120 of the screen width (16px on a 1920px TV). */

@font-face { font-family: Inter; src: url(../fonts/Inter-Regular.ttf); font-weight: 400; }
@font-face { font-family: Inter; src: url(../fonts/Inter-Medium.ttf); font-weight: 500; }
@font-face { font-family: Inter; src: url(../fonts/Inter-SemiBold.ttf); font-weight: 600; }
@font-face { font-family: Inter; src: url(../fonts/Inter-Bold.ttf); font-weight: 700; }
@font-face { font-family: Inter; src: url(../fonts/Inter-ExtraBold.ttf); font-weight: 800; }
@font-face { font-family: Inter; src: url(../fonts/Inter-Black.ttf); font-weight: 900; }
@font-face { font-family: 'Bebas Neue'; src: url(../fonts/BebasNeue-Regular.ttf); }

:root {
    --pitch: #141414; --gray900: #141414; --gray800: #1f1f1f; --gray700: #2a2a2a;
    --crimson: #e50914; --red-light: #ff6b6b; --muted: #a3a3a3; --muted2: #b3b3b3; --text: #e5e5e5;
    --gutter: 4rem; --bar: 6rem;
}
#developer-credit { position:absolute; right:var(--gutter); top:calc(var(--bar) - .35rem); font-size:.95rem; color:#b3b3b3; white-space:nowrap; pointer-events:none; }
html { font-size: calc(100vw / 120); background: var(--pitch); }
body { margin: 0; width: 100vw; height: 100vh; overflow: hidden; background: var(--pitch); color: var(--text); font-family: Inter, 'Samsung One', sans-serif; font-size: 1.25rem; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
.muted { color: var(--muted2); }
.layer { position: fixed; inset: 0; }
.vscroll { overflow-y: auto; overflow-x: hidden; scroll-behavior: auto; scrollbar-width: none; }
.vscroll::-webkit-scrollbar, .track::-webkit-scrollbar { display: none; }

/* Generic focus ring; specific controls restyle it below. */
[data-f] { outline: none; border-radius: .3rem; transition: transform .15s ease, background-color .15s, box-shadow .15s; }
[data-f].focus { box-shadow: 0 0 0 .22rem #fff; }

/* ---- Video planes ---- */
#avplayer, #html5player { position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; display: none; background: transparent; }
/* AVPlay renders on the TV video plane. An empty HTML5 video above it can
   obscure the picture while native audio continues, so mount only one backend. */
body.playing.native-playback #avplayer { display: block; }
/* Keep AVPlay's object mounted and full-sized for the native video plane, but
   suppress its browser-painted plug-in marker (a translucent central oval on Tizen 7).
   The hardware video plane is rendered independently of this DOM object's opacity. */
#avplayer { opacity: 0; pointer-events: none; }
body.playing.html5-playback #html5player { display: block; }
html.playing, body.playing { background: transparent; }
body.playing #browse, body.playing #title, body.playing #wizard { visibility: hidden; }
#html5player { object-fit: contain; background: #000; }

/* ---- Top bar ---- */
#browse { z-index: 1; }
#topbar { position: absolute; z-index: 3; top: 0; left: 0; right: 0; height: var(--bar); display: flex; align-items: center; padding: 0 var(--gutter);
    background: linear-gradient(rgba(0,0,0,.78), transparent); transition: background-color .3s; }
body.scrolled #topbar, body:not(.has-hero) #topbar, body.searching #topbar { background-color: var(--gray900); }
.logo { display: flex; align-items: baseline; color: var(--crimson); margin-right: 3rem; }
.logo-osama { font-family: Inter, sans-serif; font-weight: 900; font-size: 3rem; letter-spacing: -.12rem; line-height: 1; }
#tabs { display: flex; gap: 1.2rem; flex: 1; }
.tab { padding: .55rem .9rem; font-size: 1.3rem; font-weight: 500; color: var(--muted2); }
.tab.active { color: #fff; font-weight: 700; }
.tab.focus { background: #fff; color: #000; box-shadow: none; }
.bar-actions { display: flex; gap: .8rem; }
.icon-btn { width: 3.4rem; height: 3.4rem; border-radius: 50%; display: grid; place-items: center; }
.icon-btn svg { width: 1.9rem; height: 1.9rem; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; }
.icon-btn.focus { background: #fff; box-shadow: none; }
.icon-btn.focus svg { stroke: #000; }
#searchbar { position: absolute; z-index: 3; top: var(--bar); left: 0; right: 0; padding: .5rem var(--gutter) 1rem; background: var(--gray900); }
#search { width: 100%; box-sizing: border-box; font: inherit; font-size: 1.5rem; padding: .9rem 1.2rem; color: #fff; background: #0f0f0f; border: .12rem solid #5a5a5a; border-radius: .3rem; }
#search.focus, #search:focus { border-color: #fff; box-shadow: none; }

/* ---- Browse page ---- */
#page { position: absolute; inset: 0; padding-bottom: 4rem; }
body:not(.has-hero) #page { padding-top: calc(var(--bar) + 1.5rem); }
body.searching #page { padding-top: calc(var(--bar) + 6rem); }
#hero { position: relative; height: 78vh; min-height: 35rem; background: var(--gray900); margin-bottom: 1rem; }
.hero-art, .title-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.hero-art.contain, .title-art.contain { object-fit: contain; padding: 6rem 6rem 6rem 50%; box-sizing: border-box; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.9) 0%, transparent 55%), linear-gradient(transparent 55%, var(--pitch) 100%); }
.hero-body { position: absolute; left: var(--gutter); bottom: 9rem; max-width: 48rem; }
.eyebrow { display: flex; align-items: center; gap: .6rem; font-size: .95rem; font-weight: 600; letter-spacing: .2rem; color: var(--muted2); }
.gold { color: #f5c518; }
.badge { background: var(--crimson); color: #fff; font-size: .8rem; font-weight: 700; letter-spacing: .05rem; padding: .1rem .45rem; border-radius: .15rem; }
.hero-title { font-size: 4rem; font-weight: 900; letter-spacing: -.08rem; line-height: 1.05; color: #fff; margin: .6rem 0 .8rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { display: flex; gap: 1rem; color: var(--muted2); font-size: 1.25rem; font-weight: 500; }
.hero-text { margin-top: .9rem; font-size: 1.35rem; line-height: 1.45; color: var(--text); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.buttons { display: flex; gap: 1rem; margin-top: 1.6rem; align-items: center; }
.btn { padding: .8rem 2rem .8rem 1.6rem; border-radius: .3rem; font-size: 1.4rem; font-weight: 700; background: rgba(109,109,110,.7); color: #fff; white-space: nowrap; }
.btn.focus { background: #fff; color: #000; box-shadow: none; transform: scale(1.06); }
.btn[disabled] { opacity: .5; }
.btn.red { background: var(--crimson); }
.btn.red.focus { background: #fff; color: var(--crimson); }
.btn.ghost { background: transparent; color: var(--text); }
.btn.ghost.focus { background: #fff; color: #000; }
.btn.danger { color: var(--red-light); }
.icon-label { display: flex; flex-direction: column; align-items: center; padding: .3rem 1rem; background: transparent; font-size: 1rem; font-weight: 600; color: var(--muted2); }
.icon-label .big { font-size: 2rem; line-height: 1; color: #fff; }
.icon-label.focus .big { color: #000; }

#notices { padding: 0 var(--gutter); }
.notice { margin: 1rem 0 2rem; }
.notice h2 { font-size: 1.9rem; color: #fff; }
.notice p { color: var(--muted); margin-top: .5rem; max-width: 60rem; }
.notice .btn { margin-top: 1.2rem; }

.row { margin-bottom: 1.6rem; }
.row-title { font-size: 1.7rem; font-weight: 700; color: var(--text); padding: 0 var(--gutter); margin-bottom: .2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track { overflow-x: hidden; overflow-y: hidden; scroll-behavior: auto; padding: 1.1rem 0; min-height: 12.2rem; }
.row.wide .track { min-height: 15rem; }
.cards { position: relative; display: flex; gap: .8rem; padding: 0 var(--gutter); padding-left: calc(var(--gutter) + var(--skipped, 0) * var(--step, 20.8rem)); width: max-content; }
.card { position: relative; flex: none; width: 20rem; border-radius: .3rem; }
.row.wide .card { width: 20rem; }
.card.focus { transform: scale(1.055); z-index: 2; box-shadow: none; }
.card.focus .art { box-shadow: 0 0 0 .22rem #fff, 0 .6rem 1.6rem rgba(0,0,0,.7); }
.art { position: relative; aspect-ratio: 16 / 9; border-radius: .3rem; background: var(--gray800); overflow: hidden; }
.row.wide .art { aspect-ratio: 16 / 9; }
.poster { width: 100%; height: 100%; object-fit: cover; object-position: center 22%; }
.art .chlogo { width: 100%; height: 100%; object-fit: contain; padding: 1.2rem; box-sizing: border-box; }
.art-fallback { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: .8rem; color: var(--muted2); font-weight: 600; font-size: 1.1rem; overflow: hidden; }
.badge.corner { position: absolute; top: .45rem; left: .45rem; }
.stripe { position: absolute; left: 0; right: 0; bottom: 0; height: .3rem; background: #5a5a5a; }
.stripe > div { height: 100%; background: var(--crimson); }
.card-text { padding-top: .5rem; }
.card-title { font-size: 1.15rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { font-size: .95rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.epg { height: .22rem; background: #4d4d4d; margin-top: .4rem; }
.epg > div { height: 100%; background: var(--crimson); }

/* ---- Title page ---- */
#title { z-index: 2; background: var(--pitch); }
.title-scroll { position: absolute; inset: 0; padding-bottom: 4rem; }
.title-head { position: relative; min-height: 70vh; }
.title-shade { position: absolute; inset: 0; background: linear-gradient(90deg, var(--pitch) 0%, rgba(0,0,0,.85) 35%, transparent 70%), linear-gradient(transparent 50%, var(--pitch) 100%); }
.title-body { position: relative; padding: 8rem var(--gutter) 3rem; max-width: 52rem; }
.kind { color: var(--crimson); font-size: .95rem; font-weight: 700; letter-spacing: .3rem; }
.resume-line { margin-top: 1.1rem; color: var(--muted2); font-weight: 600; max-width: 22rem; }
.resume-line .stripe { position: relative; margin-top: .5rem; border-radius: .15rem; overflow: hidden; }
.title-body .hero-text { -webkit-line-clamp: 5; }
.episodes { padding: 1rem 0; }
.episodes-head { display: flex; flex-direction: column; align-items: flex-start; padding: 0 var(--gutter); margin-bottom: 1rem; gap: 1rem; }
.episodes-head h2 { font-size: 2rem; color: #fff; }
.seasons, .chips { display: flex; gap: .7rem; flex-wrap: wrap; }
.chip { padding: .5rem 1.1rem; border-radius: 2rem; border: .1rem solid #6d6d6e; background: #242424; font-size: 1.1rem; font-weight: 600; }
.chip.active { border-color: #fff; color: #fff; }
.chip.focus { background: #fff; color: #000; box-shadow: none; }
.episode { display: flex; align-items: center; gap: 1.4rem; padding: 1.3rem var(--gutter); border-bottom: .06rem solid #404040; border-radius: 0; }
.episode.current { background: #2b2b2b; }
.episode.focus { background: #3a3a3a; box-shadow: inset .35rem 0 0 var(--crimson); }
.ep-num { width: 3rem; text-align: center; font-size: 2rem; color: var(--muted2); flex: none; }
.ep-thumb { position: relative; width: 15rem; aspect-ratio: 16 / 9; border-radius: .3rem; overflow: hidden; background: var(--gray800); flex: none; }
.ep-img { width: 100%; height: 100%; object-fit: cover; }
.ep-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 3rem; height: 3rem; border-radius: 50%; border: .12rem solid #fff; background: rgba(0,0,0,.6); display: grid; place-items: center; font-size: 1.2rem; color: #fff; }
.ep-text { flex: 1; min-width: 0; }
.ep-title { display: flex; justify-content: space-between; gap: 1rem; font-size: 1.35rem; font-weight: 700; color: #fff; }
.ep-text p { margin-top: .4rem; font-size: 1.1rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.spinner { width: 3rem; height: 3rem; margin: 2rem auto; border-radius: 50%; border: .3rem solid rgba(255,255,255,.2); border-top-color: var(--crimson); animation: spin 1s linear infinite; }
#title .row { margin-top: 2rem; }
#title .row-title { font-size: 2rem; color: #fff; }

/* ---- Source settings ---- */
#sources { z-index: 3; background: rgba(0,0,0,.75); display: flex; align-items: center; justify-content: center; }
#sources[hidden] { display: none !important; }
.dialog { width: 62rem; max-height: 86vh; overflow-y: auto; box-sizing: border-box; background: var(--gray900); border-radius: .6rem; padding: 2.4rem; scrollbar-width: none; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.dialog-head h2 { font-size: 2.2rem; color: #fff; }
.close { width: 3.2rem; height: 3.2rem; border-radius: 50%; background: #181818; font-size: 1.4rem; }
.close.focus { background: #fff; color: #000; box-shadow: none; }
.source-list { display: flex; flex-direction: column; gap: .6rem; margin: 1.2rem 0; }
.source { display: flex; align-items: center; gap: 1rem; background: var(--gray800); border-radius: .4rem; padding: .4rem; }
.source.active { background: var(--gray700); }
.source-main { flex: 1; display: flex; align-items: center; gap: 1rem; text-align: left; padding: .7rem 1rem; }
.source-main.focus { background: #fff; color: #000; box-shadow: none; }
.source-main.focus .muted { color: #444; }
.radio { font-size: 1.5rem; color: var(--crimson); }
.source-name { font-weight: 600; font-size: 1.3rem; }
.form { display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem; }
.field { display: flex; flex-direction: column; gap: .35rem; font-size: 1rem; color: var(--muted2); }
.field input { font: inherit; font-size: 1.35rem; padding: .8rem 1rem; color: #fff; background: #0f0f0f; border: .12rem solid #4a4a4a; border-radius: .3rem; }
.field input.focus, .field input:focus { border-color: #fff; box-shadow: 0 0 0 .12rem #fff; }
.error { color: var(--red-light); }

/* ---- Cinematic player: one native video plane, lightweight HTML controls ---- */
#player { z-index: 4; background: transparent; color: #fff; }
.player-shade, .player-top, .player-bottom, .player-center { opacity: 0; transition: opacity .16s ease; }
#player.controls .player-shade, #player.controls .player-top, #player.controls .player-bottom, #player.controls .player-center { opacity: 1; }
#player:not(.controls) .player-top [data-f], #player:not(.controls) .player-center [data-f], #player:not(.controls) .player-bottom [data-f] { visibility: hidden; }
.player-shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(rgba(0,0,0,.8),transparent 34%,transparent 58%,rgba(0,0,0,.94)); }
.player-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 1.6rem; padding: 2.3rem var(--gutter); }
.player-title { flex: 1; }
.player-title > div:first-child { font-size: 1.7rem; font-weight: 700; letter-spacing: -.025rem; }
.player-caption { font-size: 1.05rem; margin-top: .4rem; color: #c7c7c7; }
.player-center { position: absolute; left: 50%; top: 47%; transform: translate(-50%,-50%); display: flex; align-items: center; gap: 3rem; }
.player-icon { display: inline-flex; align-items: center; justify-content: center; }
.player-icon svg { width: 2.2rem; height: 2.2rem; }
.pbtn { padding: .8rem 1.2rem; border-radius: .3rem; font-size: 1.15rem; font-weight: 600; background: rgba(32,32,32,.72); }
.pbtn.focus { background: white; color: #141414; box-shadow: 0 0 0 .18rem #fff; }
.transport { width: 5.4rem; height: 5.4rem; padding: 0; border: .12rem solid rgba(255,255,255,.65); border-radius: 50%; background: rgba(0,0,0,.23); display: flex; align-items: center; justify-content: center; }
.transport .player-icon svg { width: 2.8rem; height: 2.8rem; }
.main-transport { width: 7rem; height: 7rem; border-width: .16rem; }
.main-transport .player-icon svg { width: 3.7rem; height: 3.7rem; }
.player-close { padding: .6rem; border-radius: 50%; background: transparent; }
.player-bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 2rem var(--gutter) 2.4rem; }
.player-buttons { display: flex; gap: 1rem; align-items: center; margin-top: 1rem; }
#player-next { margin-left: auto; }
/* Next episode in an episode's last stretch: fills up until the end; OK plays it, Back keeps watching. */
.player-upnext { position: absolute; right: var(--gutter); bottom: 4.5rem; display: flex; align-items: center; overflow: hidden; padding: 1rem 1.8rem; border-radius: .3rem; background: rgba(32,32,32,.85); color: #fff; font-size: 1.3rem; font-weight: 700; box-shadow: 0 0 0 .14rem rgba(255,255,255,.85); }
.player-upnext[hidden], #player.controls .player-upnext { display: none; }
.upnext-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(255,255,255,.32); transition: width 1s linear; }
.upnext-label { position: relative; }
.seek { position: relative; padding: 1.4rem 0 .6rem; cursor: pointer; }
.seek-track { position: relative; height: .28rem; background: rgba(255,255,255,.3); border-radius: .2rem; }
.seek-fill { position: absolute; top: 0; left: 0; height: 100%; background: var(--crimson); }
.seek-handle { position: absolute; top: 50%; width: 1rem; height: 1rem; background: var(--crimson); border-radius: 50%; transform: translate(-50%,-50%); }
.seek.focus { box-shadow: none; }
.seek.focus .seek-track { height: .45rem; }
.seek.focus .seek-handle { width: 1.3rem; height: 1.3rem; box-shadow: 0 0 0 .16rem white; }
.seek-times { display: flex; justify-content: space-between; align-items: center; margin-top: .8rem; font-size: 1.05rem; color: #ddd; font-variant-numeric: tabular-nums; }
.seek-help { font-size: .85rem; color: #aaa; opacity: 0; }
.seek.focus .seek-help { opacity: 1; }
.seek-preview { position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%); padding: .9rem 1.4rem; border: .08rem solid #555; border-radius: .4rem; background: rgba(20,20,20,.95); font-size: 1.2rem; white-space: nowrap; opacity: 0; }
#player.seeking .seek-preview { opacity: 1; }
#player.seeking .player-center { opacity: .25; }
.player-spinner { display: none; position: absolute; left: 50%; top: 47%; width: 3rem; height: 3rem; margin: -1.5rem; border-radius: 50%; border: .25rem solid rgba(255,255,255,.2); border-top-color: var(--crimson); animation: spin 1s linear infinite; }
#player.buffering .player-spinner { display: block; }
#player.buffering .player-center { opacity: 0; pointer-events: none; }
.player-subtitle { position: absolute; left: 10%; right: 10%; bottom: 5rem; text-align: center; font-size: 2rem; white-space: pre-line; text-shadow: 0 0 .4rem #000, 0 0 .2rem #000; }
#player.controls .player-subtitle { bottom: 15rem; }
.player-error { position: absolute; z-index: 5; left: 50%; top: 50%; transform: translate(-50%,-50%); background: #181818; padding: 2.5rem; border: .08rem solid #444; border-radius: .5rem; text-align: center; }
.player-error p { margin-top: 1rem; color: #aaa; }
.player-error .row-buttons { display: flex; justify-content: center; gap: 1rem; margin-top: 1.5rem; }
.player-menu { position: absolute; z-index: 6; right: var(--gutter); bottom: 13rem; width: 28rem; max-height: 55vh; overflow-y: auto; background: #181818; border: .08rem solid #444; border-radius: .4rem; padding: 1.2rem; display: flex; flex-direction: column; gap: .3rem; }
.player-menu h3 { font-size: 1.5rem; margin-bottom: .6rem; }
.menu-item { text-align: left; padding: .8rem 1rem; font-size: 1.15rem; border-radius: .2rem; }
.menu-item.focus { background: white; color: black; }

/* Shared browse/detail visual language; no expensive blur filters or animated posters. */
.btn.primary { background: #fff; color: #141414; }
.btn.primary.focus { background: #e5e5e5; box-shadow: 0 0 0 .2rem #fff; }
.btn.secondary { background: rgba(75,75,75,.8); }
.tab { border-radius: 2rem; padding: .7rem 1.4rem; }
.tab.active { background: #292929; color: white; }
.tab.focus { background: white; color: #141414; }
.logo { margin-right: 2.8rem; }
#tabs { justify-content: center; }
body.has-hero #rows { position: relative; margin-top: -5rem; }
.hero-art { opacity: .8; }
.hero-shade { background: linear-gradient(90deg,#141414 0%,rgba(20,20,20,.8) 24%,rgba(20,20,20,.05) 78%),linear-gradient(transparent 44%,#141414 98%); }
.hero-title { font-size: 3.8rem; line-height: 1.05; }
.hero-text { font-size: 1.2rem; line-height: 1.5; color: #d7d7d7; max-width: 43rem; }
.meta { font-size: 1.05rem; color: #b3b3b3; }
.row-title { font-size: 1.5rem; margin-bottom: .1rem; }
.row { margin-bottom: .8rem; }
.art { background: linear-gradient(135deg,#333,#1b1b1b); }
.art-fallback { font-size: 1.3rem; padding: 1.5rem; color: #d3d3d3; line-height: 1.25; }
.art.has-image .art-fallback { opacity: 0; }
.poster, .chlogo { opacity: 0; }
.poster.ready, .chlogo.ready { opacity: 1; }
.card-caption { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: flex-end; justify-content: space-between; gap: .6rem; padding: 2.2rem .8rem .7rem; background: linear-gradient(transparent,rgba(0,0,0,.88)); color: white; font-size: 1.05rem; font-weight: 700; }
.card-caption > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-quality { flex: none; font-size: .65rem; font-weight: 600; color: #ddd; border: .06rem solid #888; padding: .12rem .25rem; }
.title-head { background: #141414; }
.title-art { opacity: .75; object-position: 70% 20%; }
.title-shade { background: linear-gradient(90deg,#141414 4%,rgba(20,20,20,.91) 30%,transparent 85%),linear-gradient(transparent 42%,#141414 99%); }
.title-body .hero-text { max-width: 43rem; }
.episodes { padding-top: 1rem; }
.episode { margin: 0 var(--gutter); padding: 1.1rem 1.3rem; border-radius: .35rem; }
.episode.focus { background: #303030; box-shadow: inset 0 0 0 .12rem white; }
.episode.current { background: #242424; }
.ep-thumb { width: 14rem; }
.ep-num { font-size: 1.6rem; width: 2rem; }
.ep-title { font-size: 1.2rem; }
.ep-text p { font-size: 1rem; line-height: 1.5; -webkit-line-clamp: 2; }
.episodes-head { flex-direction: row; align-items: center; justify-content: space-between; }
.chip { border-radius: .25rem; }
.detail-back { position: absolute; top: 2rem; left: var(--gutter); z-index: 2; }
@media (prefers-reduced-motion: reduce) { [data-f], .player-top, .player-bottom, .player-center { transition: none; } }

#toast { position: fixed; z-index: 5; left: 50%; bottom: 3rem; transform: translateX(-50%); background: #fff; color: #000; padding: .9rem 1.6rem; border-radius: .3rem; font-weight: 600; }

@keyframes spin { to { transform: rotate(360deg); } }

/* TV-distance navigation, minimal transport, and season browser. */
#tabs { gap: 1.2rem; justify-content: center; }
#tabs .tab { font-size: 1.9rem; padding: .7rem 1.2rem; font-weight: 600; }
.player-buttons { position: fixed; top: 2.4rem; right: var(--gutter); display:flex; gap:1rem; }
.player-buttons .pbtn { border-radius: 2rem; padding: .75rem 1.2rem; background: rgba(25,25,25,.8); font-size:1.2rem; border: .08rem solid #777; }
.player-buttons .pbtn.focus { background:white; color:black; }
.resume-dialog { position:absolute; inset:0; background:rgba(0,0,0,.94); display:flex; align-items:center; justify-content:center; }
.resume-panel { width:38rem; display:flex; flex-direction:column; gap:1.4rem; text-align:center; }
.resume-panel h2 { font-size:2.7rem; } .resume-panel p { color:#aaa; margin-bottom:1rem; }
.series-detail .title-scroll { overflow:hidden; }
.series-detail .title-head { position:absolute; inset:0; min-height:0; }
.series-detail .title-art { width:100%; height:100%; opacity:.48; }
.series-detail .title-shade { background:linear-gradient(90deg,rgba(10,10,10,.96),rgba(10,10,10,.75) 42%,rgba(10,10,10,.86)); }
.series-detail .title-body { width:31%; padding:7rem 3rem 2rem 4rem; max-width:none; }
.series-detail .hero-title { font-size:2.6rem; }
.series-detail .hero-text { font-size:1.15rem; line-height:1.5; -webkit-line-clamp:5; }
.series-detail .buttons { margin:1.2rem 0; }
.series-detail .seasons { display:flex; flex-direction:column; gap:.3rem; margin-top:2rem; }
.series-detail .seasons .chip { text-align:left; padding:.75rem 1rem; border: .1rem solid transparent; background:transparent; font-size:1.35rem; }
.series-detail .seasons .chip.active { border-color:#aaa; background:rgba(255,255,255,.08); }
.series-detail .seasons .chip.focus { border-color:white; background:rgba(255,255,255,.18); color:white; }
.series-detail .episodes { position:absolute; left:39%; right:2rem; top:6rem; bottom:2rem; overflow-y:auto; scrollbar-width:none; padding:0; }
.series-detail .episodes-head { padding:0 1rem; margin-bottom:1rem; }
.series-detail .episodes-head h2 { font-size:1.5rem; }
.series-detail .episode { margin:0; padding:1rem; gap:1.3rem; background:transparent; }
.series-detail .ep-num { display:none; }
.series-detail .ep-thumb { width:18rem; flex:0 0 18rem; }
.series-detail .episode.focus { background:rgba(255,255,255,.07); box-shadow:none; }
.series-detail .episode.focus .ep-thumb { outline:.18rem solid white; }
.series-detail .ep-text p { display:-webkit-box; -webkit-line-clamp:4; -webkit-box-orient:vertical; overflow:hidden; font-size:1.15rem; }

.player-title { max-width:52%; } .player-title > div { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }


#player .resume-dialog [data-f] { visibility:visible; min-height:3.6rem; }
.resume-dialog .btn.focus { background:white; color:#141414; box-shadow:0 0 0 .2rem white; }

.watched-badge { position:absolute; left:.5rem; top:.5rem; background:rgba(0,0,0,.85); padding:.3rem .55rem; border-radius:.2rem; font-size:1rem; color:white; }

.logo { margin-right:1.6rem; flex:none; } .logo-wordmark { width:12rem; height:5.3rem; object-fit:contain; display:block; }

/* Short compositor-only transitions; playback and remote input remain immediate. */
#tabs .tab.active { font-size:2.25rem; font-weight:800; }
#tabs .tab { transition:transform .18s ease,background-color .18s ease,color .18s ease; }
#tabs .tab.focus { transform:scale(1.04); }
.poster, .chlogo, .ep-img, .hero-art, .title-art { transition:opacity .22s ease; }
.player-top { transform:translateY(-.65rem); transition:opacity .2s ease,transform .2s ease; }
.player-bottom { transition:opacity .2s ease; }
.player-bottom .seek { transform:translateY(.65rem); transition:transform .2s ease; }
#player.controls .player-bottom .seek { transform:translateY(0); }
#player.controls .player-top { transform:translateY(0); }
.player-center { transition:opacity .2s ease,transform .2s ease; transform:translate(-50%,-50%) scale(.94); }
#player.controls .player-center { transform:translate(-50%,-50%) scale(1); }
@media (prefers-reduced-motion: reduce) {
    #tabs .tab, .poster, .chlogo, .ep-img, .hero-art, .title-art, .player-top, .player-bottom, .player-center, .player-bottom .seek { transition:none; }
    #tabs .tab.focus { transform:none; }
}

.category-entry { position:absolute; z-index:3; top:calc(var(--bar) + .6rem); left:var(--gutter); max-width:70%; overflow:hidden; text-overflow:ellipsis; font-size:1.2rem; padding:.6rem 1rem; background:rgba(25,25,25,.8); border:.08rem solid #777; }
body.category-filtered #page { padding-top:calc(var(--bar) + 4.5rem); }
#categories { z-index:5; background:rgba(0,0,0,.65); }
.category-panel { position:absolute; inset:0 auto 0 0; width:33rem; max-width:80vw; background:#141414; border-right:.08rem solid #444; padding:2.5rem; box-sizing:border-box; display:flex; flex-direction:column; }
.category-heading { display:flex; align-items:center; justify-content:space-between; gap:1rem; margin-bottom:.8rem; }
.category-heading h2 { font-size:2rem; } .category-close { padding:.65rem; font-size:1.5rem; }
.category-options { margin-top:1.5rem; padding:.4rem; flex:1; min-height:0; }
.category-choice { width:100%; display:flex; justify-content:space-between; gap:1.2rem; padding:1rem; margin-bottom:.45rem; text-align:left; font-size:1.5rem; border-left:.2rem solid transparent; }
.category-choice.active { background:#292929; border-left-color:#e50914; }
.category-choice.focus, .category-close.focus { background:white; color:#141414; box-shadow:none; }
.category-count { opacity:.6; font-size:1.1rem; align-self:center; }

.grid-view { padding-bottom:3rem; }
.category-grid-cards { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:1.5rem 1.2rem; padding:1rem var(--gutter) 2rem; }
.category-grid-cards .card { width:100%; min-width:0; }
.category-grid-cards .card.focus { transform:scale(1.035); }
.grid-pagination { display:flex; justify-content:center; align-items:center; gap:2rem; padding:1rem var(--gutter); }

.grid-heading { position:relative; display:flex; align-items:center; gap:1.5rem; margin:0 var(--gutter) 1rem; }
.grid-heading h2 { font-size:1.7rem; } .grid-sort { margin-left:auto; font-size:1.1rem; }
.grid-sort-menu { position:absolute; right:0; top:100%; z-index:5; padding:.6rem; background:#242424; border:.08rem solid #777; min-width:18rem; display:flex; flex-direction:column; }
.category-grid-cards { display:block; position:relative; padding:0; margin:0 var(--gutter); }
.category-grid-window { position:absolute; left:0; right:0; display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:1.5rem 1.2rem; padding:.5rem 0; }

#phone-remote { z-index:6; background: rgba(0,0,0,.82); display: flex; align-items: center; justify-content: center; }
#phone-remote[hidden] { display: none !important; }
.phone-dialog { width: 78rem; max-height: 90vh; overflow: auto; padding: 2.8rem 3.2rem; }
.phone-dialog .dialog-head { margin-bottom: 2rem; }
.phone-close { display: flex; align-items: center; gap: .7rem; padding: .7rem 1.6rem .7rem 1.2rem; border-radius: 2rem; background: rgba(255,255,255,.14); color: #fff; font-size: 1.4rem; font-weight: 700; }
.phone-close span { font-size: 1.5rem; }
.phone-close.focus { background: #fff; color: #000; box-shadow: none; transform: scale(1.06); }
.phone-pair { display: flex; gap: 3.2rem; align-items: center; }
.phone-qr { flex: none; padding: 1.2rem; background: #fff; border-radius: .8rem; line-height: 0; }
.phone-qr img, .phone-qr canvas { width: 20rem; height: 20rem; }
.phone-steps { flex: 1; min-width: 0; }
.phone-step { display: flex; gap: 1.2rem; align-items: flex-start; margin: 0 0 1.4rem; font-size: 1.6rem; line-height: 1.45; color: #e5e5e5; }
.phone-step b { flex: none; display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--crimson); color: #fff; font-size: 1.3rem; }
.phone-step strong { color: #fff; white-space: nowrap; }
.phone-code { margin: .4rem 0 .8rem 3.8rem; font-size: 4.4rem; font-weight: 800; letter-spacing: .9rem; color: #fff; font-variant-numeric: tabular-nums; }
.phone-steps .muted { margin-left: 3.8rem; }
.phone-steps .buttons, .phone-off .buttons { margin-top: 2rem; }
.phone-steps .buttons { margin-left: 3.8rem; }
.phone-off p { font-size: 1.6rem; line-height: 1.5; margin: 0 0 1rem; }
.phone-note { margin-top: 2.4rem; }
.remote-status { font-weight: 700; }

/* ---- Netflix-style rows: tall posters, Top 10 and the selected title's details ---- */
.row.tall .cards { --step: 14.8rem; }
.row.tall .card { width: 14rem; }
.card.tall .art, .card.top10 .art { aspect-ratio: 2 / 3; }
.card.tall .poster, .card.top10 .poster { object-position: center; }
.row.tall .track, .row.top10 .track { min-height: 23rem; padding: 1.4rem 0; }
.card.tall.focus, .card.top10.focus { transform: scale(1.08); }
.row.top10 .cards { --step: 21.3rem; gap: 1.3rem; }
.card.top10 { width: 20rem; display: flex; align-items: flex-end; }
.card.top10 .art { width: 12.5rem; flex: none; margin-left: -1.6rem; }
.rank { flex: none; width: 9.1rem; font-family: 'Bebas Neue', Inter, sans-serif; font-size: 17rem; line-height: .76; text-align: right; letter-spacing: -1rem; color: #141414; -webkit-text-stroke: .28rem #8c8c8c; }
.card.top10.focus .rank { -webkit-text-stroke-color: #fff; }
.card.top10.focus .art { box-shadow: 0 0 0 .22rem #fff, 0 .6rem 1.6rem rgba(0,0,0,.7); }
.card.top10.focus { box-shadow: none; }
.row-info { display: none; padding: .2rem var(--gutter) .6rem; max-width: 62rem; }
.row.active-row .row-info { display: block; }
.info-title { font-size: 1.6rem; font-weight: 800; color: #fff; }
.row-info .meta { margin-top: .35rem; }
.row-info .meta span + span::before { content: '·'; margin-right: 1rem; color: #777; }
.info-text { margin-top: .45rem; font-size: 1.1rem; line-height: 1.45; color: #cfcfcf; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.grid-view.tall .category-grid-window { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.credits { margin-top: 1.2rem; max-width: 43rem; font-size: 1.05rem; line-height: 1.5; color: #e5e5e5; }
.credits p { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.credits span { color: #8c8c8c; }
.title-body .meta span + span::before, .hero-body .meta span + span::before { content: '·'; margin-right: 1rem; color: #777; }

/* ---- Profiles ---- */
#profiles { z-index: 4; background: #141414; display: flex; align-items: center; justify-content: center; }
#profiles[hidden] { display: none !important; }
.profile-pick, .profile-edit { display: flex; flex-direction: column; align-items: center; }
.profile-pick h1, .profile-edit h1 { font-size: 4rem; font-weight: 600; color: #fff; margin-bottom: 3rem; }
.profile-list { display: flex; gap: 2.4rem; margin-bottom: 4rem; }
.profile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1.2rem; width: 13rem; color: #a3a3a3; font-size: 1.5rem; border-radius: .4rem; }
.profile.focus { box-shadow: none; color: #fff; }
.profile.focus .avatar { box-shadow: 0 0 0 .3rem #fff; transform: scale(1.06); }
.avatar { display: grid; place-items: center; width: 13rem; height: 13rem; border-radius: .5rem; font-size: 6rem; font-weight: 800; color: rgba(255,255,255,.92); transition: transform .15s, box-shadow .15s; }
.avatar.c0 { background: linear-gradient(135deg, #e50914, #7a0a12); }
.avatar.c1 { background: linear-gradient(135deg, #f5b301, #b8640a); }
.avatar.c2 { background: linear-gradient(135deg, #2f80ed, #12407e); }
.avatar.c3 { background: linear-gradient(135deg, #27ae60, #0f5c33); }
.avatar.c4 { background: linear-gradient(135deg, #9b51e0, #4b1d7a); }
.avatar.photo { background-size: cover; background-position: center; }
.avatar.c5 { background: linear-gradient(135deg, #f2994a, #a03b10); }
.avatar.add-avatar { background: transparent; border: .2rem solid #555; color: #8c8c8c; font-weight: 300; box-sizing: border-box; }
.avatar.large { width: 10rem; height: 10rem; font-size: 4.6rem; }
.avatar.small { width: 2.8rem; height: 2.8rem; font-size: 1.4rem; border-radius: .3rem; }
.profile.editing .avatar { opacity: .55; }
.pencil { position: absolute; top: 4.6rem; left: 50%; transform: translateX(-50%); font-size: 3.2rem; color: #fff; }
.btn.outline { background: transparent; border: .12rem solid #8c8c8c; color: #a3a3a3; letter-spacing: .2rem; text-transform: uppercase; font-weight: 600; padding: .8rem 2.4rem; border-radius: 0; }
.btn.outline.focus { background: #fff; color: #141414; border-color: #fff; }
.profile-edit { width: 60rem; align-items: stretch; }
.profile-edit h1 { align-self: flex-start; }
.profile-edit-row { display: flex; align-items: center; gap: 2.4rem; padding: 2rem 0; border-top: .08rem solid #333; border-bottom: .08rem solid #333; }
.profile-edit-row .field { flex: 1; }
.profile-list { flex-wrap: wrap; justify-content: center; max-width: 170rem; }
.avatar { position: relative; }
.cloud-badge { position: absolute; right: .8rem; bottom: .8rem; width: 3.4rem; height: 3.4rem; display: grid; place-items: center; border-radius: 50%; background: rgba(0,0,0,.55); }
.cloud-badge svg { width: 2rem; height: 2rem; fill: #fff; }
.avatar.small .cloud-badge { right: -.5rem; bottom: -.5rem; width: 1.5rem; height: 1.5rem; background: #141414; }
.avatar.small .cloud-badge svg { width: 1rem; height: 1rem; }
.avatar.large .cloud-badge { right: .6rem; bottom: .6rem; }
.add-online .add-avatar svg { width: 6rem; height: 6rem; fill: none; stroke: #8c8c8c; stroke-width: 1.4; }
.profile.add-online.focus .add-avatar svg { stroke: #fff; }
.online-info { flex: 1; }
.online-name { font-size: 2.6rem; font-weight: 700; color: #fff; margin-bottom: .8rem; }
.online-info .muted { font-size: 1.5rem; line-height: 1.5; }
.link-view { width: 96rem; display: flex; flex-direction: column; }
.link-view h1 { font-size: 4rem; font-weight: 600; color: #fff; margin-bottom: 3rem; }
.link-view .phone-code { letter-spacing: .6rem; }
.link-qr-empty { flex: none; width: 22.4rem; height: 22.4rem; display: grid; place-items: center; border-radius: .8rem; background: #222; }
.link-qr-empty svg { width: 9rem; height: 9rem; fill: #444; }
.profile-btn { width: 3.4rem; height: 3.4rem; }
.profile-btn.focus { background: transparent; }
.profile-btn.focus .avatar { box-shadow: 0 0 0 .2rem #fff; }

/* ---- Exit prompt ---- */
#exit { z-index: 7; background: rgba(0,0,0,.86); display: flex; align-items: center; justify-content: center; }
#exit[hidden] { display: none !important; }
.exit-panel { text-align: center; }
.exit-panel h2 { font-size: 2.6rem; font-weight: 600; color: #fff; }
.exit-panel .buttons { justify-content: center; margin-top: 2.4rem; }
.exit-panel .btn { min-width: 12rem; text-align: center; padding-left: 2rem; }

/* ---- Search: keyboard on the left, results on the right ---- */
#searchbar { top: var(--bar); bottom: 0; right: auto; width: 31rem; padding: 1.5rem 2rem 2rem var(--gutter); box-sizing: border-box; display: flex; flex-direction: column; gap: 1.2rem; }
#search { font-size: 1.8rem; font-weight: 600; padding: .8rem 1rem; background: transparent; border: 0; border-bottom: .12rem solid #5a5a5a; border-radius: 0; }
.keys { display: grid; grid-template-columns: repeat(6, 1fr); gap: .35rem; }
.key { height: 3.6rem; font-size: 1.5rem; font-weight: 600; color: #ddd; background: #262626; border-radius: .2rem; text-transform: lowercase; }
.key.wide-key { grid-column: span 3; font-size: 1.15rem; }
.key.focus { background: #fff; color: #141414; box-shadow: none; }
.search-hint { font-size: 1rem; color: #8c8c8c; }
body.searching #page { padding-top: calc(var(--bar) + 1.5rem); left: 31rem; }
body.searching #page .cards { padding-left: calc(1.5rem + var(--skipped, 0) * var(--step, 20.8rem)); }
body.searching #page .row-title, body.searching #page .row-info { padding-left: 1.5rem; }

/* ---- Brand intro ---- */
#intro { position: fixed; z-index: 9; inset: 0; display: grid; place-items: center; background: radial-gradient(circle at 50% 50%, #2b0407 0%, #000 55%); pointer-events: none; animation: intro-out .5s ease 1.9s forwards; }
#intro img { width: 34rem; animation: intro-in 1.9s cubic-bezier(.2,.7,.2,1) forwards; }
@keyframes intro-in { 0% { opacity: 0; transform: scale(.72); } 35% { opacity: 1; transform: scale(1); } 75% { opacity: 1; transform: scale(1.04); } 100% { opacity: 0; transform: scale(1.9); } }
@keyframes intro-out { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #intro { display: none; } .avatar { transition: none; } }
.ep-label { font-size: .85rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted2); margin-bottom: .2rem; }
.switch { display: flex; align-items: center; gap: 1rem; margin-top: 2.4rem; padding: .6rem 1.2rem; border-radius: .4rem; background: transparent; color: #a3a3a3; font-size: 1.2rem; font-weight: 500; }
.switch.focus { color: #fff; box-shadow: 0 0 0 .15rem #fff; }
.switch-track { position: relative; width: 3.2rem; height: 1.8rem; border-radius: 1rem; background: #4d4d4d; transition: background .2s; flex: none; }
.switch-knob { position: absolute; top: .2rem; left: .2rem; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch[aria-checked="true"] .switch-track { background: var(--crimson); }
.switch[aria-checked="true"] .switch-knob { transform: translateX(1.4rem); }

/* Remove hidden transport layers from TV compositing, including focus borders. */
#player:not(.controls) .player-top,#player:not(.controls) .player-bottom,#player:not(.controls) .player-center,#player:not(.controls) .player-shade{visibility:hidden;pointer-events:none}
#player.buffering .player-center{visibility:hidden;pointer-events:none}
.player-spinner[hidden]{display:none!important;visibility:hidden}
#exit .btn:not(.focus){background:#303030;color:#ddd;transform:none}
#exit .btn.focus{background:#fff;color:#141414;box-shadow:0 0 0 .22rem #e50914;transform:scale(1.06)}

.exit-note { margin-top: 1rem; font-size: 1.5rem; color: rgba(255,255,255,.7); }
.link-view .remote-status { margin: 0 0 0 3.8rem; }
