<style>
*{margin:0;padding:0;box-sizing:border-box}
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;overflow-x:hidden;-webkit-font-smoothing:antialiased;overflow-y:hidden}
.tv-portal{background:#0a0a0f;color:#fff;padding:0!important;margin:0;min-height:100vh;overflow:hidden}
.tv-portal~footer,.tv-portal~.modern-footer,footer.modern-footer{display:none!important}
body:has(.desk-layout){overflow:hidden}
body:has(.desk-layout) footer{display:none!important}

/* MOBILE LAYOUT */
.mobile-layout{display:block;padding-bottom:40px;max-width:100vw;overflow-x:hidden;padding-top:55px;margin-top:0}
.m-player-sticky{position:sticky;top:55px;z-index:100;background:#000;border-bottom:2px solid #00d4ff;width:100%;max-width:100vw;margin-top:0;margin-bottom:55px}

.m-player{width:100%;aspect-ratio:16/9;max-height:250px;background:#000;display:flex;align-items:center;justify-content:center;position:relative;box-shadow:0 4px 20px rgba(0,212,255,0.15)}
.m-player video,.m-player iframe{width:100%;height:100%;object-fit:contain}
/* Theater mode overrides for mobile player */
.m-player-sticky.theater-mode{position:fixed!important;top:0!important;left:0!important;right:0!important;bottom:0!important;width:100vw!important;height:100vh!important;z-index:99999!important}
.m-player-sticky.theater-mode .m-player{max-height:100vh!important;height:100vh!important;aspect-ratio:auto!important}
.m-placeholder{text-align:center;color:#8b8b9e;padding:20px}
.m-play-icon{width:70px;height:70px;background:linear-gradient(135deg,#1a1a2e,#16213e);border:3px solid #00d4ff;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:28px;margin:0 auto 12px;color:#00d4ff;box-shadow:0 4px 20px rgba(0,212,255,0.3)}
.m-placeholder p{font-size:13px;font-weight:500}

/* MOBILE THEATER CONTROLS */
.m-theater-ctrl{position:absolute;inset:0;display:none;flex-direction:column;justify-content:space-between;background:linear-gradient(180deg,rgba(0,0,0,0.9) 0%,transparent 15%,transparent 85%,rgba(0,0,0,0.9) 100%);z-index:10;pointer-events:none;opacity:0;transition:opacity 0.3s ease;border-radius:0}
.m-theater-ctrl.show{opacity:1;pointer-events:all}
.m-theater-ctrl.hide{opacity:0;pointer-events:none}
.m-tc-top{display:flex;align-items:center;justify-content:space-between;padding:20px 25px;gap:12px}
.m-tc-title{flex:1;font-size:18px;font-weight:700;color:#fff;text-shadow:0 2px 8px rgba(0,0,0,0.9);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.m-tc-exit{height:45px;padding:0 20px;background:rgba(255,68,68,0.95);border:none;border-radius:10px;color:#fff;font-size:14px;font-weight:700;cursor:pointer;pointer-events:all;backdrop-filter:blur(15px);box-shadow:0 4px 15px rgba(255,68,68,0.4);transition:all 0.2s;flex-shrink:0;touch-action:manipulation}
.m-tc-exit:active{transform:scale(0.95);background:rgba(255,68,68,1)}
.m-tc-bottom{display:flex;align-items:center;gap:10px;padding:20px 25px;flex-wrap:wrap}
.m-tc-spacer{flex:1}

/* MOBILE REGULAR CONTROLS */
.m-controls{display:flex;align-items:center;gap:6px;padding:10px 12px;background:linear-gradient(180deg,#05050a 0%,#0f0f15 100%);border-top:1px solid #1a1a1f;box-shadow:0 -4px 15px rgba(0,212,255,0.1)}
.m-controls button{min-width:38px;height:38px;background:#141420;border:1px solid #1a1a1f;border-radius:8px;color:#fff;cursor:pointer;font-size:14px;flex-shrink:0;transition:all .2s;padding:0 8px}
.m-controls button:active{background:#00d4ff;color:#000;border-color:#00d4ff;transform:scale(0.95)}
.m-now{flex:1;font-size:12px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:0 8px;color:#00d4ff}
.theater-toggle{background:linear-gradient(135deg,#7b2cbf,#5a189a)!important;border-color:#7b2cbf!important;font-weight:600}

/* MOBILE TABS */
.m-tabs{display:flex;gap:8px;padding:12px 16px;background:#05050a;border-bottom:1px solid #1a1a1f;position:relative;z-index:99;width:100%;max-width:100vw;margin-top:0}
.m-tab{flex:1;min-height:50px;background:#141420;border:1px solid #1a1a1f;border-radius:10px;color:#fff;cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;transition:all .2s;touch-action:manipulation}
.m-tab span{font-size:20px}
.m-tab small{font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:0.5px}
.m-tab.active{background:linear-gradient(135deg,#00d4ff,#0096c7);color:#000;border-color:#00d4ff;transform:translateY(-2px);box-shadow:0 4px 12px rgba(0,212,255,0.4)}

.m-panels{padding:12px 16px 12px 16px;width:100%;max-width:100vw;overflow-x:hidden}
.m-panel{display:none}
.m-panel.active{display:block}
.m-group{margin-bottom:10px;background:#0f0f15;border-radius:10px;overflow:hidden;border:1px solid #1a1a1f;width:100%;max-width:100%}
.m-group-btn{width:100%;background:#141420;border:none;border-bottom:1px solid #1a1a1f;color:#fff;padding:12px 14px;display:flex;align-items:center;justify-content:space-between;cursor:pointer;font-size:12px;font-weight:700;text-align:left;letter-spacing:0.5px;touch-action:manipulation}
.m-group-btn:active{background:#1a1a25}
.m-group-right{display:flex;align-items:center;gap:8px}
.m-badge{background:linear-gradient(135deg,#7b2cbf,#5a189a);color:#fff;padding:3px 8px;border-radius:10px;font-size:10px;font-weight:700}
.m-arrow{font-size:10px;color:#00d4ff;transition:transform .2s}
.m-list{display:none;padding:8px;visibility:hidden}
.m-list.loaded{visibility:visible}
.m-ad{position:fixed;bottom:0;left:0;right:0;height:35px;background:linear-gradient(90deg,#7b2cbf,#00d4ff,#7b2cbf);overflow:hidden;z-index:200;border-top:2px solid #00d4ff}
.m-ad-txt{white-space:nowrap;animation:scroll 40s linear infinite;padding:8px 0;font-size:11px;font-weight:700;color:#fff;text-shadow:0 2px 4px rgba(0,0,0,0.5)}
@keyframes scroll{from{transform:translateX(0)}to{transform:translateX(-50%)}}

/* CHANNEL CARD */
.ch-card{display:flex;align-items:center;gap:10px;padding:8px;background:#0f0f15;border:1px solid #1a1a1f;border-radius:8px;margin-bottom:8px;cursor:pointer;transition:all .2s;width:100%;max-width:100%;touch-action:manipulation}
.ch-card:active{background:#1a1a25;transform:scale(0.98)}
.ch-card.on{border-color:#00d4ff;background:linear-gradient(135deg,#141425,#1a1a30);box-shadow:0 0 0 2px rgba(0,212,255,0.2),0 4px 12px rgba(0,212,255,0.3)}
.ch-card img{width:50px;height:35px;object-fit:cover;border-radius:6px;opacity:0;transition:opacity .3s;background:#1a1a1f;border:1px solid #1a1a1f;flex-shrink:0}
.ch-card img.loaded{opacity:1}
.ch-txt{flex:1;min-width:0;overflow:hidden}
.ch-n{font-size:13px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#fff;letter-spacing:0.3px}
.ch-m{font-size:10px;color:#8b8b9e;margin-top:2px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* DESKTOP LAYOUT */
.desk-layout{position:fixed;top:80px;left:0;right:0;bottom:0;display:flex;transition:background 0.3s;overflow:hidden;background:#0a0a0f}
.desk-side{width:280px;background:#05050a;border-right:1px solid #1a1a1f;display:flex;flex-direction:column;overflow:hidden;transition:all 0.3s;height:100%}
.desk-head{padding:14px;background:#0f0f15;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #1a1a1f;flex-shrink:0}
.desk-head h6{margin:0;font-size:11px;font-weight:700;letter-spacing:1px;color:#00d4ff}
.desk-head button{width:26px;height:26px;background:transparent;border:1px solid #1a1a1f;border-radius:5px;color:#fff;cursor:pointer;margin-left:4px;font-size:11px;transition:all .2s}
.desk-head button:hover{background:#1a1a25;border-color:#00d4ff}
.desk-body{flex:1;overflow-y:auto;padding:10px}
.desk-body::-webkit-scrollbar{width:4px}
.desk-body::-webkit-scrollbar-thumb{background:#1a1a1f;border-radius:2px}
.desk-body::-webkit-scrollbar-thumb:hover{background:#2a2a3f}
.d-group{margin-bottom:8px}
.d-group-btn{width:100%;background:#141420;border:1px solid #1a1a1f;border-radius:6px;color:#fff;padding:9px 10px;display:flex;align-items:center;justify-content:space-between;cursor:pointer;font-size:11px;font-weight:600;text-align:left;transition:all .2s}
.d-group-btn:hover{background:#1a1a25;border-color:#00d4ff}
.d-badge{background:#7b2cbf;color:#fff;padding:2px 7px;border-radius:9px;font-size:9px}
.d-list{display:none;margin-top:6px;padding-left:4px;visibility:hidden}
.d-list.loaded{visibility:visible}
.desk-main{flex:1;display:flex;flex-direction:column;min-width:0;transition:padding 0.3s;height:100%}
.desk-bar{padding:10px 16px;background:#05050a;border-bottom:1px solid #1a1a1f;transition:all 0.3s;flex-shrink:0}
.desk-search{position:relative;max-width:500px}
.desk-search input{width:100%;height:38px;background:#141420;border:1px solid #1a1a1f;border-radius:6px;color:#fff;padding:0 12px;font-size:13px;transition:all .2s}
.desk-search input:focus{outline:none;border-color:#00d4ff;box-shadow:0 0 0 3px rgba(0,212,255,0.1)}
.desk-results{position:absolute;top:100%;left:0;right:0;background:#141420;border:1px solid #1a1a1f;border-radius:6px;margin-top:4px;max-height:280px;overflow-y:auto;display:none;z-index:50;box-shadow:0 8px 20px rgba(0,0,0,.6)}
.desk-results::-webkit-scrollbar{width:4px}
.desk-results::-webkit-scrollbar-thumb{background:#1a1a1f;border-radius:2px}
.sr-item{display:flex;align-items:center;gap:8px;padding:8px;cursor:pointer;border-bottom:1px solid #1a1a1f;transition:all .2s}
.sr-item:hover{background:#1a1a25}
.sr-item img{width:45px;height:30px;object-fit:cover;border-radius:4px}
.sr-n{font-size:12px;font-weight:600}
.sr-m{font-size:10px;color:#8b8b9e;margin-top:1px}
.sr-none{padding:16px;text-align:center;color:#8b8b9e;font-size:12px}
.desk-player-wrap{flex:1;display:flex;flex-direction:column;padding:10px 10px 10px;min-height:0;position:relative;transition:all 0.3s;padding-bottom:0!important}
.desk-player{flex:1;background:#000;border-radius:8px;overflow:hidden;position:relative;display:flex;align-items:center;justify-content:center;min-height:500px;height:100%;box-shadow:0 4px 20px rgba(0,212,255,0.15)}
.desk-player video,.desk-player iframe{width:100%;height:100%;object-fit:contain}
.d-placeholder{text-align:center;color:#666}
.d-icon{width:70px;height:70px;background:linear-gradient(135deg,#1a1a2e,#16213e);border:3px solid #00d4ff;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:28px;margin:0 auto 12px;color:#00d4ff;box-shadow:0 4px 20px rgba(0,212,255,0.3)}
.d-placeholder h4{font-size:18px;margin-bottom:6px;color:#fff}

/* DESKTOP THEATER CONTROLS */
.d-theater-ctrl{position:absolute;inset:0;display:none;flex-direction:column;justify-content:space-between;background:linear-gradient(180deg,rgba(0,0,0,0.95) 0%,transparent 12%,transparent 88%,rgba(0,0,0,0.95) 100%);z-index:10;pointer-events:none;opacity:0;transition:opacity 0.3s ease;border-radius:8px}
.d-theater-ctrl.show{opacity:1;pointer-events:all}
.d-theater-ctrl.hide{opacity:0;pointer-events:none}
.d-tc-top{display:flex;align-items:center;justify-content:space-between;padding:30px 40px}
.d-tc-title{flex:1;font-size:26px;font-weight:700;color:#fff;text-shadow:0 3px 10px rgba(0,0,0,0.95)}
.d-tc-exit{height:52px;padding:0 28px;background:rgba(255,68,68,0.95);border:none;border-radius:12px;color:#fff;font-size:15px;font-weight:700;cursor:pointer;pointer-events:all;transition:all .2s;backdrop-filter:blur(20px);box-shadow:0 4px 20px rgba(255,68,68,0.5)}
.d-tc-exit:hover{background:#ff4444;transform:scale(1.05)}
.d-tc-bottom{display:flex;align-items:center;gap:14px;padding:30px 40px;flex-wrap:wrap}
.d-tc-spacer{flex:1}
.tc-btn{height:52px;padding:0 24px;background:rgba(20,20,32,0.95);border:2px solid #00d4ff;border-radius:12px;color:#fff;font-size:15px;font-weight:600;cursor:pointer;pointer-events:all;backdrop-filter:blur(20px);transition:all .2s;white-space:nowrap}
.tc-btn:hover{background:#00d4ff;color:#000;transform:translateY(-2px);box-shadow:0 4px 20px rgba(0,212,255,0.6)}

/* THEATER MODE ENHANCEMENTS FOR DESKTOP */
.desk-layout.theater-mode{position:fixed!important;top:0!important;left:0!important;right:0!important;bottom:0!important;width:100vw!important;height:100vh!important;z-index:99999!important;margin:0!important;padding:0!important;background:#000!important}
.desk-layout.theater-mode .desk-player-wrap{height:100vh!important;max-height:100vh!important;width:100vw!important;padding:0!important;flex:1!important;display:flex!important}
.desk-layout.theater-mode .desk-player{max-height:100vh!important;height:100vh!important;width:100vw!important;border-radius:0!important;flex:1!important;min-height:100vh!important}
.desk-layout.theater-mode .desk-player video,
.desk-layout.theater-mode .desk-player iframe{width:100vw!important;height:100vh!important;max-width:100vw!important;max-height:100vh!important;object-fit:contain!important}
.desk-layout.theater-mode .desk-side,
.desk-layout.theater-mode .desk-bar,
.desk-layout.theater-mode .desk-ctrl{display:none!important}
.desk-layout.theater-mode .d-theater-ctrl{border-radius:0!important}

/* DESKTOP REGULAR CONTROLS */
.desk-ctrl{display:flex;align-items:center;justify-content:space-between;background:linear-gradient(135deg,#0f0f15,#141420);border-radius:0;padding:10px;margin:0;gap:8px;transition:all 0.3s;box-shadow:0 -2px 10px rgba(0,212,255,0.1);flex-shrink:0}
.desk-ctrl>div{display:flex;gap:5px}
.desk-ctrl button{width:38px;height:38px;background:#141420;border:1px solid #1a1a1f;border-radius:6px;color:#fff;cursor:pointer;font-size:14px;transition:all .2s}
.desk-ctrl button:hover{background:#1a1a25;border-color:#00d4ff;transform:translateY(-1px)}
#dNow{flex:1;text-align:center;font-size:12px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:0 10px;color:#00d4ff}

/* FLOATING ADVERTISEMENT */
.float-ad{position:fixed;z-index:150;display:none;animation:floatIn 0.5s ease-out}
.float-ad.show{display:block}
.float-ad.top-right{top:80px;right:20px}
.float-ad.top-left{top:80px;left:20px}
.float-ad.bottom-right{bottom:60px;right:20px}
.float-ad.bottom-left{bottom:60px;left:20px}
.float-ad-content{background:linear-gradient(135deg,#7b2cbf,#5a189a);padding:14px 20px;border-radius:12px;box-shadow:0 8px 30px rgba(123,44,191,0.5);display:flex;align-items:center;gap:12px;border:2px solid #00d4ff;backdrop-filter:blur(10px);max-width:320px}
.float-ad-text{color:#fff;font-size:13px;font-weight:600;line-height:1.4;text-shadow:0 2px 4px rgba(0,0,0,0.3)}
.float-ad-close{width:28px;height:28px;background:rgba(255,255,255,0.2);border:none;border-radius:50%;color:#fff;font-size:16px;font-weight:700;cursor:pointer;transition:all .2s;flex-shrink:0}
.float-ad-close:hover{background:rgba(255,68,68,0.9);transform:scale(1.1)}
@keyframes floatIn{from{opacity:0;transform:translateY(-20px)}to{opacity:1;transform:translateY(0)}}

/* PERCENTAGE LOADER - User Friendly */
.mini-load{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);background:rgba(0,0,0,.95);width:120px;height:120px;border-radius:12px;display:none;flex-direction:column;align-items:center;justify-content:center;z-index:999;pointer-events:none;border:2px solid #00d4ff;box-shadow:0 8px 25px rgba(0,212,255,0.6);transition:opacity 0.2s ease,transform 0.2s ease;backdrop-filter:blur(10px)}
.mini-spin{width:30px;height:30px;border:3px solid #1a1a1f;border-top-color:#00d4ff;border-radius:50%;animation:spin .6s linear infinite;margin-bottom:8px}
.mini-percentage{color:#00d4ff;font-size:16px;font-weight:700;margin-bottom:4px;text-shadow:0 2px 4px rgba(0,0,0,0.8)}
.mini-text{color:#fff;font-size:11px;font-weight:500;text-align:center;opacity:0.8;text-shadow:0 1px 2px rgba(0,0,0,0.8)}
@keyframes spin{to{transform:rotate(360deg)}}
@keyframes fadeInOut{
    0%{opacity:0;transform:translateY(-10px)}
    20%{opacity:1;transform:translateY(0)}
    80%{opacity:1;transform:translateY(0)}
    100%{opacity:0;transform:translateY(-10px)}
}

/* RESPONSIVE - MOBILE FIRST */
.desk-layout{display:none!important}
.mobile-layout{display:block!important}

@media(min-width:992px){
    .mobile-layout{display:none!important}
    .desk-layout{display:flex!important;position:fixed!important;top:80px!important;left:0!important;right:0!important;bottom:0!important}
}

/* Force hide desktop on mobile */
@media(max-width:991px){
    .desk-layout *{display:none!important}
}
@media(max-width:575px){
    .m-player{max-height:220px}
    .m-player-sticky{top:55px}
    .m-tabs{padding:10px 12px;gap:6px}
    .mobile-layout{padding-top:0;margin-top:0}
    .m-controls{padding:8px 10px;gap:5px}
    .m-controls button{min-width:34px;height:34px;font-size:13px}
    .m-tc-top{padding:15px 18px;gap:8px}
    .m-tc-title{font-size:15px}
    .m-tc-exit{height:40px;padding:0 14px;font-size:12px}
    .m-tc-bottom{padding:15px 18px;gap:6px}
    .tc-btn{height:44px;padding:0 14px;font-size:13px}
    .float-ad-content{padding:12px 16px;max-width:280px}
    .float-ad-text{font-size:12px}
    .float-ad.top-right,.float-ad.top-left{top:60px}
    .float-ad.bottom-right,.float-ad.bottom-left{bottom:50px}
}

</style>
