:root{color-scheme:dark;--bg:#070707;--surface:rgba(18,18,19,.82);--border:rgba(255,255,255,.12);--text:#f4f4f5;--muted:#a6a6ab;--radius:14px}*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;background:var(--bg);color:var(--text);font:14px -apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif}button,input,select{font:inherit}button{cursor:pointer;background:rgba(255,255,255,.08);color:var(--text);border:1px solid var(--border);border-radius:10px;padding:10px 13px;transition:background .18s,border-color .18s}button:hover,button.active{background:rgba(255,255,255,.2);border-color:rgba(255,255,255,.25)}button:disabled{opacity:.4;cursor:not-allowed}input,select{background:#1c1c1e;color:#fff;border:1px solid var(--border);border-radius:10px;padding:11px;min-width:0}input:focus,select:focus,button:focus-visible{outline:2px solid #bbb;outline-offset:2px}.hidden,[hidden]{display:none!important}header{height:58px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 18px;background:rgba(12,12,13,.95);border-bottom:1px solid var(--border);position:relative;z-index:5}.brand{display:flex;align-items:center;gap:10px;white-space:nowrap;font-size:16px;font-weight:700;letter-spacing:.02em}.brand b{color:#d6d6d9}.mark{background:#f2f2f2;color:#0a0a0a;padding:7px 9px;border-radius:10px;font-weight:900}nav{display:flex;gap:7px;overflow-x:auto;scrollbar-width:none}nav::-webkit-scrollbar{display:none}nav button{white-space:nowrap;padding:8px 12px}.immersive-main{height:calc(100dvh - 58px);min-height:320px}.stage,.player{width:100%;height:100%;min-height:0}.player{position:relative;overflow:hidden;background:#000;isolation:isolate}.player video{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;background:#000;z-index:0}.player #empty{position:absolute;inset:0;display:grid;place-items:center;text-align:center;padding:28px;color:#929296;pointer-events:none;font-size:clamp(14px,2vw,20px);z-index:1}.player-gradient{position:absolute;inset:0;background:linear-gradient(180deg,rgba(0,0,0,.46),transparent 19%,transparent 62%,rgba(0,0,0,.82));pointer-events:none;z-index:2}.player-ui{transition:opacity .28s ease,transform .28s ease,visibility .28s}.player-top{position:absolute;z-index:4;left:18px;right:18px;top:16px;display:flex;align-items:center;justify-content:space-between;pointer-events:none}.live-chip{padding:7px 10px;border:1px solid rgba(255,255,255,.17);background:rgba(0,0,0,.48);border-radius:8px;font-size:11px;font-weight:700;letter-spacing:.07em}.player-brand{color:rgba(255,255,255,.78);font-size:11px;letter-spacing:.16em}.player-controls{position:absolute;bottom:0;left:0;right:0;z-index:6;padding:20px 22px max(18px,env(safe-area-inset-bottom));background:linear-gradient(0deg,rgba(0,0,0,.92),rgba(0,0,0,.62) 66%,transparent)}.player-info{display:flex;flex-direction:column;gap:5px;min-width:0;margin-bottom:14px}.player-info strong{font-size:clamp(18px,2.3vw,26px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.player-info #message{font-size:12px;color:#bcbcc1;max-width:min(780px,85%);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.control-row{display:flex;align-items:center;gap:9px}.icon-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-width:42px;height:42px;padding:0 12px;font-size:20px;background:rgba(34,34,36,.6);border:1px solid rgba(255,255,255,.12);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px)}.control-caption{font-size:12px}.control-spacer{flex:1}#volumeSlider{width:110px;padding:0;accent-color:#eee;background:transparent;border:0}#favorite{font-size:25px}.channel-panel{position:absolute;z-index:8;top:0;right:0;bottom:0;width:min(380px,37vw);display:flex;flex-direction:column;gap:10px;padding:22px 14px max(16px,env(safe-area-inset-bottom));background:rgba(13,13,15,.83);border-left:1px solid rgba(255,255,255,.12);backdrop-filter:blur(28px);-webkit-backdrop-filter:blur(28px);transform:translateX(103%);visibility:hidden;pointer-events:none;box-shadow:-16px 0 55px rgba(0,0,0,.35)}.channels-open .channel-panel{transform:translateX(0);visibility:visible;pointer-events:auto}.channels-open .player-controls{right:min(380px,37vw)}.panel-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}.heading{font-size:19px;font-weight:700}.panel-heading #count{color:var(--muted);font-size:11px;margin-top:5px}.panel-heading .icon-button{min-width:34px;height:34px;font-size:14px}.channel-panel #search{width:100%;flex:none;background:rgba(255,255,255,.08)}#items{flex:1;min-height:0;overflow:auto;scrollbar-width:none;overscroll-behavior:contain}#items::-webkit-scrollbar,.dialog::-webkit-scrollbar{display:none}.folder{border-bottom:1px solid rgba(255,255,255,.07);margin-bottom:3px}.folder-head{width:100%;display:flex;align-items:center;gap:7px;padding:11px 6px;background:transparent;border:0;text-align:left;font-size:12px}.folder-title{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.folder-count{color:#a9a9ae;font-size:11px}.folder-content{padding:2px 0 8px}.item{display:flex;align-items:center;text-align:left;width:100%;gap:10px;padding:8px;margin-bottom:5px;background:rgba(255,255,255,.055);border:1px solid transparent;border-radius:10px}.item:hover{background:rgba(255,255,255,.15)}.item img,.item .fallback{width:42px;height:42px;flex:0 0 42px;object-fit:contain;border-radius:7px;background:rgba(255,255,255,.07)}.item .fallback{display:grid;place-items:center}.item>span:last-child{min-width:0;overflow:hidden;text-overflow:ellipsis}.item small{display:block;color:#929298;font-size:10px;margin-top:4px}.folder-pager{display:flex;justify-content:center;align-items:center;gap:8px;padding:8px}.folder-pager button{padding:5px 12px}.ui-idle:not(.channels-open) .player-top,.ui-idle:not(.channels-open) .player-controls{opacity:0;visibility:hidden;pointer-events:none;transform:translateY(12px)}.ui-idle{cursor:none}.channels-open{cursor:default}.modal{position:fixed;inset:0;z-index:30;display:grid;place-items:center;background:rgba(0,0,0,.78);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);padding:16px}.dialog{position:relative;width:min(100%,1040px);max-height:90dvh;overflow:auto;scrollbar-width:none;background:#151516;border:1px solid #38383a;border-radius:18px;padding:24px;box-shadow:0 22px 90px #000}.dialog h2,.dialog h3{margin-top:12px}.dialog .close{position:sticky;top:0;float:right;font-size:24px;padding:2px 12px;z-index:1}.dialog input{margin:4px 0}.sourceform,.row,.controls,.category-admin{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:8px 0}.sourceform input{flex:1 1 200px}.sourceform select{flex:1 1 140px}.row{justify-content:space-between;padding:10px 0;border-bottom:1px solid var(--border)}.row>span:first-child{flex:1;min-width:150px}.controls button{font-size:12px;padding:7px 9px}.admin-search{display:flex;flex-direction:column;gap:7px;margin:16px 0}.admin-search input{width:100%}.help,#adminMsg,#searchStatus{color:var(--muted);font-size:12px}details{margin:18px 0;padding:12px;border:1px solid var(--border);border-radius:12px}summary{cursor:pointer}.category-admin input{flex:1}#login{display:flex;flex-direction:column;gap:10px;max-width:460px}#login input{width:100%}@media(max-width:760px){header{height:52px;padding:7px 10px}.brand{font-size:13px;gap:6px}.mark{padding:6px}.brand>span:last-child{display:none}nav button{padding:7px 9px;font-size:12px}.immersive-main{height:calc(100dvh - 52px);min-height:300px}.player-top{top:12px;left:12px;right:12px}.player-controls{padding:14px 10px max(12px,env(safe-area-inset-bottom))}.player-info{margin-bottom:9px}.player-info strong{font-size:18px}.player-info #message{font-size:11px;max-width:100%}.control-row{gap:5px}.icon-button{min-width:35px;height:37px;padding:0 7px;font-size:17px}.control-caption{display:none}#volumeSlider{width:60px}.channel-panel{width:min(86vw,360px);padding:15px 11px max(12px,env(safe-area-inset-bottom))}.channels-open .player-controls{right:0;z-index:7;padding-right:calc(min(86vw,360px) + 4px)}.channels-open .control-row{flex-wrap:wrap}.channels-open .player-info{max-width:100px}.channels-open .control-row>*:not(#channelsToggle){display:none}.channels-open #channelsToggle{margin-left:auto}.dialog{padding:15px}}@media(max-width:760px) and (orientation:landscape){.channel-panel{width:min(42vw,340px)}.channels-open .player-controls{padding-right:calc(min(42vw,340px) + 6px)}.player-info{margin-bottom:5px}.player-controls{padding-top:7px}.icon-button{height:32px}}@media(prefers-reduced-motion:reduce){.player-ui,button{transition:none!important}}

/* v2.1: uniform favorite button and tap-to-hide overlay */
#favorite{font-size:19px!important;min-width:42px;width:42px;height:42px;padding:0!important;line-height:1;font-weight:400;flex:0 0 42px}
@media(max-width:760px){#favorite{font-size:18px!important;min-width:35px;width:35px;height:37px;flex-basis:35px}}
.player.ui-idle .player-gradient{opacity:0;transition:opacity .28s ease}

/* Fullscreen overlay: channels remain in the same fullscreen stacking context. */
.player:fullscreen,.player:-webkit-full-screen{
  width:100vw!important;height:100dvh!important;min-height:0!important;
  background:#000;overflow:hidden;
}
.player:fullscreen .channel-panel,.player:-webkit-full-screen .channel-panel{
  z-index:12;
}
.player:fullscreen .player-controls,.player:-webkit-full-screen .player-controls{
  z-index:10;
}
html.cplus-fullscreen,body.cplus-fullscreen{
  overflow:hidden!important;width:100%;height:100%;
}
.player.pseudo-fullscreen{
  position:fixed!important;inset:0!important;
  width:100vw!important;height:100dvh!important;
  min-height:0!important;max-height:none!important;
  z-index:1000!important;border-radius:0!important;
  background:#000;
}
.player.pseudo-fullscreen .channel-panel{z-index:12}
.player.pseudo-fullscreen .player-controls{z-index:10}
.player.fullscreen-active .channel-panel{height:100%}

/* Favorito: solo icono, sin texto ni desbordamiento */
#favorite{font-size:23px!important;line-height:1!important;min-width:40px!important;width:40px!important;max-width:40px!important;flex:0 0 40px!important;white-space:nowrap!important;overflow:hidden!important;text-align:center!important;padding:0!important;}

/* iOS stability: prevent flickering of composited translucent UI layers. */
@supports (-webkit-touch-callout:none){
 .player-ui{transition:none!important;}
 .player-gradient{transition:none!important;}
 .channel-panel,.player-controls,.player-top{ -webkit-backface-visibility:hidden;backface-visibility:hidden; }
 .channel-panel{backdrop-filter:none!important;-webkit-backdrop-filter:none!important;background:rgba(13,13,15,.95)!important;}
 .icon-button{backdrop-filter:none!important;-webkit-backdrop-filter:none!important;}
 .player.pseudo-fullscreen{height:100%!important;height:100dvh!important;}
 .player video{transform:none!important;-webkit-transform:none!important;}
}
#pipToggle{font-size:21px;min-width:40px;width:40px;flex:0 0 40px}
@media(max-width:760px){#pipToggle{min-width:35px;width:35px;flex-basis:35px}}

/* V6: stable video compositing and overlay on iOS. */
@supports (-webkit-touch-callout:none){
 .player video{backface-visibility:hidden;-webkit-backface-visibility:hidden;will-change:auto;}
 .player-gradient,.player-ui{transition:none!important;animation:none!important;}
 .channel-panel,.icon-button{backdrop-filter:none!important;-webkit-backdrop-filter:none!important;}
}

/* C+ IPTV 2.1 - channel navigation and folders */
.folder-head{font-size:17px!important;font-weight:750!important;min-height:57px;gap:12px!important}
.folder-title{font-size:17px;font-weight:750;letter-spacing:.005em}
.folder-icon{font-size:21px;min-width:25px;color:#91b6ff;font-weight:800;text-align:center}
.folder-count{font-size:13px!important}
#channelNumber{width:64px;min-width:52px;text-align:center;font-weight:800;font-size:15px;padding:8px 5px;height:42px;background:rgba(32,33,36,.8)}
#channelPrev,#channelNext{font-size:25px;font-weight:800}
@media(max-width:760px){#channelNumber{width:47px;min-width:44px;font-size:12px;height:37px}#channelPrev,#channelNext{min-width:30px;padding:0 5px}.folder-title{font-size:16px}.control-row{flex-wrap:wrap}}

/* C+ IPTV 2.2 — channel navigation controls */
#channelPrev,#channelNext{width:44px;min-width:44px;height:42px;padding:0;border-radius:11px;background:rgba(22,23,26,.84);border:1px solid rgba(255,255,255,.17);transition:background .18s,border-color .18s,transform .12s}
#channelPrev:hover,#channelNext:hover,#channelPrev:focus-visible,#channelNext:focus-visible{background:#292b30;border-color:rgba(255,255,255,.4)}
#channelPrev:active,#channelNext:active{transform:scale(.94)}
.channel-nav-svg{width:24px;height:24px;fill:#f5f5f7;stroke:#f5f5f7;stroke-width:1.1;stroke-linejoin:round;pointer-events:none}
#channelNumber{width:67px;min-width:57px;height:42px;border-radius:11px;font-size:16px;font-weight:800;letter-spacing:.045em;text-align:center;background:rgba(22,23,26,.84);border:1px solid rgba(255,255,255,.17);font-variant-numeric:tabular-nums}
#channelNumber.number-pending{border-color:#b3c8f8;box-shadow:0 0 0 2px rgba(122,163,255,.17)}
@media(max-width:760px){#channelPrev,#channelNext{width:36px;min-width:36px;height:37px}#channelNumber{width:50px;min-width:50px;height:37px;font-size:13px}.channel-nav-svg{width:20px;height:20px}}
