/* Pixel-accurate skin geometry is taken directly from the user's 6 approved images.
   Only dynamic real-provider information, remote focus, dialogs and video are HTML layers.
   Avoid expensive blur / visual filters to protect MSX TV browsers. */
:root{color-scheme:dark;--ink:#fff;--bg:#100922;--panel:#1a1034;--edge:#9862ce;--pink:#dc70ff;--focus:#b731ed}
*{box-sizing:border-box}html,body{width:100%;height:100%;margin:0;background:#080515;overflow:hidden;color:var(--ink);font-family:Arial,'Segoe UI',sans-serif;-webkit-user-select:none;user-select:none}button,input{font:inherit}button{border:0;color:white;cursor:pointer}input{-webkit-user-select:text;user-select:text}button:focus-visible,input:focus-visible{outline:2px solid #edacff;outline-offset:1px}#stage{position:relative;width:100%;height:100dvh;overflow:hidden;background:#0b071e}.reference{position:absolute;inset:0;width:100%;height:100%;object-fit:fill;pointer-events:none}.dynamic{position:absolute;inset:0;z-index:3;pointer-events:none}.dynamic>*{pointer-events:auto}.status{position:absolute;right:1.9%;top:12.7%;padding:.22em .5em;font-size:clamp(9px,.78vw,16px);background:#170c34e8;border:1px solid #aa5af1;border-radius:4px;z-index:8;max-width:55%;line-height:1.3;display:none}.status.show{display:block}.status.alert{color:#ffe9aa;border-color:#d89967}.focus-frame{position:absolute;z-index:5;border:2px solid #f0a6ff;border-radius:9px;box-shadow:0 0 13px #b72cff,inset 0 0 7px #c653f680;pointer-events:none;display:none}.focus-frame.show{display:block}.dialog[hidden],.keyboard[hidden],.video-area[hidden],.info-area[hidden],.video-message[hidden]{display:none!important}
.video-area{position:absolute;z-index:4;left:2.5%;top:13.6%;width:95%;height:76%;background:#06040b;border-radius:6px;overflow:hidden}.video-area video{width:100%;height:100%;display:block;background:black;object-fit:contain}.video-area.drawer-video{left:35.6%;width:61.9%}.video-message{position:absolute;left:8%;right:8%;top:44%;text-align:center;background:#2c1746ef;border:1px solid #c377f7;padding:1.5%;font-size:clamp(14px,1.3vw,28px)}
.info-area{position:absolute;z-index:6;bottom:11.2%;left:4%;right:4%;height:19%;min-height:95px;background:linear-gradient(175deg,#382455f5,#130c2df9);border:2px solid #9d67c5;border-radius:16px;box-shadow:0 0 13px #9b3cd6;color:white;display:grid;grid-template-columns:33% 33% 34%;align-items:center;padding:1.1%;font-size:clamp(11px,1.25vw,26px)}.info-area.drawer-info{left:37%;right:3%;bottom:12.2%;height:16.5%;min-height:78px}.info-area .now-col{border-left:2px solid #9a57c1;padding:1% 5%;min-width:0}.info-area .now-col strong{font-size:1.2em;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.info-area .now-col small{color:#d4bce3;font-size:.8em}.info-area .now-col em{font-style:normal;color:#dc8dff;font-size:.85em}.info-area .bar{height:8px;display:block;width:80%;background:#443456;border-radius:10px;overflow:hidden;margin-top:5px}.info-area .bar i{height:100%;display:block;background:linear-gradient(90deg,#8d1eda,#eb69ff)}
/* only after a real M3U has been loaded: cover example names while preserving original frame around the panels */
.live-panel{position:absolute;background:linear-gradient(145deg,#1a102de8,#1b1032f8);border:1px solid #8057a5;border-radius:10px;color:#fff;overflow:hidden;padding:1%;font-size:clamp(12px,1.15vw,25px)}.live-panel header{height:12%;font-size:1.02em;font-weight:bold;color:#ead7ff;border-bottom:1px solid #714696;margin-bottom:1.4%;white-space:nowrap;overflow:hidden}.live-panel button{display:flex;align-items:center;width:100%;height:10.3%;min-height:0;gap:.5em;text-align:left;padding:.25em .35em;background:transparent;border:1px solid transparent;border-bottom-color:#4a366468;border-radius:5px;line-height:1.15;overflow:hidden}.live-panel button.selected{background:linear-gradient(180deg,#a527f0,#641797);border-color:#e7adff;box-shadow:0 0 8px #b72ff0}.live-panel button strong{font-size:1.02em;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.live-panel button small{display:block;color:#d7bee9;font-size:.73em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.live-panel .count{margin-left:auto;font-size:.8em}.live-panel .channel-no{font-size:.85em;color:#e1c9ef;min-width:2.1em}.live-panel .logo{flex-shrink:0;width:clamp(24px,2.4vw,48px);height:clamp(21px,2.1vw,42px);border-radius:4px;display:flex;align-items:center;justify-content:center;text-align:center;font-size:.78em;font-weight:900;background:linear-gradient(130deg,#2745ac,#12255c);overflow:hidden}.live-panel .logo img{max-width:100%;max-height:100%;object-fit:contain}.live-panel .chantext{min-width:0;flex:1}.live-panel .hd{font-size:.65em;border:1px solid #e5cbf0;border-radius:4px;padding:0 .2em}.guide-categories{left:2.9%;top:14.1%;width:26.3%;height:70.2%}.guide-channels{left:30.5%;top:14.1%;width:30.7%;height:70.2%}.guide-detail{left:63%;top:51.9%;width:33.9%;height:33%;display:flex;flex-direction:column;font-size:clamp(12px,1.18vw,24px)}.guide-detail strong{font-size:1.28em}.guide-detail small{font-size:.82em;color:#decbe7}.guide-detail em{font-size:.82em;color:#dd8bff;font-style:normal}.guide-detail .bar{display:block;width:86%;height:8px;background:#49365c;margin:3% 0}.guide-detail .bar i{display:block;background:#bd41ff;height:100%}.drawer-channels{left:3%;top:17.8%;width:31.4%;height:72%;z-index:7}.epg-live{left:3.3%;top:19.7%;width:93.3%;height:70%;font-size:clamp(11px,1vw,21px)}.epg-live .epg-head{display:grid;grid-template-columns:28% repeat(4,18%);gap:0;height:11%;align-items:center;text-align:center;color:#dec2f1}.epg-live .epg-line{height:10.8%;display:grid;grid-template-columns:28% repeat(4,18%);gap:.3%;align-items:stretch}.epg-live .epg-line span,.epg-live .epg-line button{min-width:0;display:flex;align-items:center;padding:0 2%;background:#2a1c41;border:1px solid #74569f;border-radius:5px;text-align:left;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:1em}.epg-live .epg-line .on{background:linear-gradient(#ac3ee9,#632399);border-color:#e6aeff}.epg-live .epg-head span:first-child{text-align:left}.epg-live .epg-line .title{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.live-top{position:absolute;right:1.6%;top:2%;z-index:7;padding:.5em 1em;border-radius:30px;color:#fff;background:#170c31;border:1px solid #9b5ed3;font-size:clamp(12px,1.03vw,22px)}
/* contextual menus, live settings and provider editor: all within the identical purple visual vocabulary */
.dialog{position:absolute;z-index:20;inset:10% 8%;border-radius:20px;border:2px solid #cc7ff5;background:linear-gradient(155deg,#261343f7,#100a29fe 63%,#270f46f7);box-shadow:0 0 22px #a92cf18c,inset 0 1px #d796ff8c;padding:2.5% 3%;overflow:hidden;display:flex;flex-direction:column;gap:1.3%;font-size:clamp(13px,1.3vw,27px)}.dialog>h2{font-size:1.5em;margin:0;border-bottom:1px solid #8854c9;padding-bottom:1%}.dialog>.dialog-body{display:flex;flex:1;min-height:0;gap:3%}.dialog-list{width:33%;display:flex;flex-direction:column;overflow:auto;gap:1%}.dialog-list button{padding:3% 5%;text-align:left;background:#28173f;border:1px solid #724f9e;border-radius:7px}.dialog-list button.selected{border-color:#ebaeff;background:linear-gradient(#a32fe4,#59148d);box-shadow:0 0 9px #b23ff1}.dialog-main{flex:1;overflow:auto;display:flex;flex-direction:column;gap:1.2%}.dialog-row{display:grid;grid-template-columns:32% 1fr;gap:2%;align-items:center;min-height:12%;font-size:.96em}.dialog-row input{width:100%;min-width:0;height:100%;min-height:31px;max-height:66px;border:1px solid #8a5ec0;border-radius:8px;color:white;background:linear-gradient(#3c2b58,#1c1439);padding:1% 2%}.dialog-row input:focus{border-color:#f3b8ff}.dialog-controls{margin-top:auto;display:flex;gap:1%;flex-wrap:wrap}.dialog-controls button{flex:1;min-width:11%;padding:1.3% .7%;background:linear-gradient(#4e2c76,#29143e);border:1px solid #8654bf;border-radius:9px}.dialog-controls .primary{background:linear-gradient(#c435f8,#8321c2);border-color:#e9adff;box-shadow:0 0 9px #aa37fa}.dialog-note{font-size:.78em;color:#cdbce3;line-height:1.4}.dialog-toggle{border-radius:26px;border:1px solid #9c6cc9;background:#38244a;padding:.2em .8em;text-align:center}.dialog-toggle.on{background:#b13beb;border-color:#e3b2fa}.dialog-footer{margin-top:auto;font-size:.77em;color:#b6a2d4}.dialog .grid-rows{overflow:auto}.dialog .grid-rows button{display:flex;justify-content:space-between;width:100%;padding:1.8% 2%;text-align:left;border-bottom:1px solid #5e3f8f;background:#221436}.dialog .grid-rows button.selected{background:#7d21b4}
.keyboard{position:absolute;z-index:40;inset:20% 14% 12%;border:2px solid #c986f1;border-radius:18px;background:#160b31f9;box-shadow:0 0 25px #b52cff;color:white;padding:2%;display:flex;flex-direction:column;gap:2%}.keyboard .value{min-height:16%;border:1px solid #704b9a;border-radius:8px;background:#2f1d52;padding:1%;font-size:clamp(15px,1.5vw,34px);overflow:hidden;word-break:break-all}.keyboard .keys{flex:1;display:grid;grid-template-columns:repeat(10,1fr);grid-template-rows:repeat(5,1fr);gap:1%}.keyboard button{border:1px solid #6c4c9c;border-radius:7px;background:#302047;font-size:clamp(12px,1.15vw,26px)}.keyboard button.selected{background:#9d28e2;box-shadow:0 0 10px #ad3ffd}.toast{position:absolute;z-index:45;bottom:11%;left:50%;transform:translateX(-50%);background:#20103dec;border:1px solid #ce87fa;border-radius:9px;padding:1% 2%;box-shadow:0 0 13px #9b30d4;font-size:clamp(14px,1.15vw,25px);max-width:85%;text-align:center}.menu-overlay{position:absolute;left:6%;top:13%;width:38%;height:74%;background:linear-gradient(#261342f6,#100924f9);border:2px solid #ab6cea;border-radius:12px;padding:2%;display:flex;flex-direction:column;gap:.9%;font-size:clamp(12px,1.25vw,26px);overflow:auto}.menu-overlay button{padding:2%;text-align:left;border-bottom:1px solid #553577;background:#271644;min-height:10%;flex-shrink:0}.menu-overlay button.selected{background:#a42ee4;border:1px solid #ecb4ff;box-shadow:0 0 8px #b93aed}
@media(max-width:800px){.live-panel{font-size:11px}.dialog{font-size:12px}.info-area{font-size:11px;min-height:60px}.dialog-row{min-height:30px}.menu-overlay{font-size:12px}}@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
.dialog .is-focused,.keyboard .is-focused{outline:2px solid #f4b3ff!important;box-shadow:0 0 12px #ad36f6;background:#6d1b9b!important}

.video-area.guide-video{left:63.5%;top:14.6%;width:32.7%;height:36.8%;border-radius:8px;border:1px solid #805fc4}.real-clock{position:absolute;z-index:9;right:2.2%;top:1.2%;height:10%;display:flex;align-items:center;gap:1em;padding:0 1em;background:linear-gradient(90deg,#1d0e37,#120b27);color:#fff;border-radius:14px;border:1px solid #7f42b7;font-size:clamp(12px,1.1vw,24px)}.real-clock span{font-size:.9em;color:#e2cbef}.real-clock span:first-letter{color:#5ef38d}.real-clock b{font-size:1.3em}.real-clock small{font-size:.84em;color:#d8c7e8}

/* Clean KBC Purple: no screenshot in the live interface. */
#stage{background:radial-gradient(ellipse at 85% 5%,#51137a55,transparent 48%),radial-gradient(ellipse at 5% 95%,#3a155b77,transparent 50%),linear-gradient(125deg,#130b25,#090615 65%,#170c2b)}
.reference{display:none!important}.app-header{position:absolute;inset:2% 3% auto;height:9%;display:flex;align-items:center;border-bottom:1px solid #9050ba;box-shadow:0 9px 20px -16px #c35aff;color:#f8edff}.brand{font-size:clamp(24px,2.8vw,54px);font-weight:900;font-style:italic;letter-spacing:-.04em;text-shadow:0 0 18px #a738e5}.brand span{font-size:.7em;margin-left:.35em;padding:.1em .35em;border:1px solid #b35cf0;border-radius:8px;background:linear-gradient(#9b27ce,#482067)}.app-header h1{font-size:clamp(16px,1.55vw,32px);margin-left:3%;letter-spacing:.1em;font-weight:600;max-width:42%}.app-footer{position:absolute;z-index:10;left:3%;right:3%;bottom:2%;height:7%;display:flex;align-items:center;justify-content:space-between;gap:1%;padding:0 1.3%;border:1px solid #784698;border-radius:12px;background:linear-gradient(#251337,#140c25);font-size:clamp(12px,1.05vw,22px);color:#ddc4ec}.app-footer button{background:transparent;padding:.6em;border-radius:8px;color:#f3dcff}.app-footer button:hover{background:#7735a4}.live-panel{background:linear-gradient(145deg,#231334,#120c22);box-shadow:0 0 20px #40135755,inset 0 1px #c58dff22}.drawer-channels{top:14%;height:74%}.nav-list{left:3%;top:14%;width:29%;height:72%}.nav-list button{height:10%;margin-bottom:1%}.screen-detail{left:34%;top:14%;width:63%;height:72%;padding:2.5%;font-size:clamp(14px,1.4vw,28px)}.screen-detail h2{margin-top:0;color:#f5ddff}.screen-detail>button{height:auto;min-height:3em;margin-top:2em;padding:1em;border:1px solid #ac6cd7;background:#44215e}.setting-preview{display:flex;justify-content:space-between;gap:5%;border-bottom:1px solid #5a3679;padding:.6em 0;font-size:.85em}.setting-preview b{color:#d995ff}.empty-playback{display:none;position:absolute;inset:28% 15%;align-items:center;justify-content:center;flex-direction:column;gap:1em;color:#be9acb}.empty-playback strong{font-size:4vw;color:#e4c2f5}.empty-playback span{font-size:1.4vw}#stage[data-view="watch"][data-playing="no"] .empty-playback{display:flex}.program-list{left:3%;top:14%;width:94%;height:72%}.program-list .program-head,.program-list>button{display:grid;grid-template-columns:30% 36% 34%;text-align:left;gap:1%;padding:0 1%}.program-head{height:7%;color:#c9a7df;font-size:.85em}.program-list>button{height:9%;margin-bottom:.5%;border-bottom-color:#5a3679}.program-list>button>span{min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.program-list strong{font-size:.95em}.program-list small{display:block}.real-clock{right:3%;top:2%;height:8%;font-size:clamp(11px,1vw,22px)}.status{top:10.5%}.dialog{background:linear-gradient(145deg,#29143f,#110b21 70%,#291440)}

/* VIPlay: supplied brand assets, fullscreen playback, infobar-integrated controls. */
.brand-filters{position:absolute;pointer-events:none}.brand{display:flex;align-items:center;font-style:normal;letter-spacing:normal;text-shadow:none;font-size:inherit}.brand .viplay-wordmark,.empty-playback .viplay-wordmark{display:block;position:relative;overflow:hidden;width:18vw;height:4.35vw;min-width:140px;min-height:34px}.viplay-wordmark img{position:absolute;width:126.8%;height:auto;max-width:none;left:-14.2%;top:-97.4%;filter:url(#viplay-cutout)}.empty-playback .viplay-wordmark{width:45vw;height:10.86vw}.viplay-symbol{position:relative;display:block;overflow:hidden;flex-shrink:0;width:3.7vw;height:3.7vw;min-width:34px;min-height:34px}.viplay-symbol img{position:absolute;width:178%;height:178%;max-width:none;left:-38%;top:-38%;filter:url(#viplay-cutout)}
#stage[data-view="watch"],#stage[data-view="drawer"]{background:#000}#stage[data-view="watch"] .app-header,#stage[data-view="watch"] .app-footer,#stage[data-view="drawer"] .app-header,#stage[data-view="drawer"] .app-footer{display:none}#stage[data-view="watch"] .video-area,#stage[data-view="drawer"] .video-area{inset:0;width:100%;height:100%;border:0;border-radius:0;box-shadow:none;background:#000}#stage[data-view="watch"] .video-area video,#stage[data-view="drawer"] .video-area video{width:100%;height:100%;object-fit:contain}
#stage[data-view="watch"] .info-area,#stage[data-view="drawer"] .info-area{bottom:3%;height:auto;min-height:0;padding:1% 1.3% .5%;grid-template-columns:28% 38% 34%;row-gap:.7em;border-width:1px;border-radius:14px;box-shadow:0 5px 24px #0008;background:linear-gradient(145deg,#2b1a42ee,#110b20f5)}#stage[data-view="watch"] .info-area{left:3%;right:3%}#stage[data-view="drawer"] .info-area{left:36.5%;right:2.5%;font-size:clamp(11px,1vw,22px)}.info-channel{display:flex;align-items:center;gap:.6em}.info-channel>div{min-width:0}.info-area .now-col{min-width:0}.info-area .now-col strong{font-size:1.1em;overflow:hidden;text-overflow:ellipsis}.info-hints{grid-column:1/-1;display:flex;justify-content:space-between;gap:.5em;align-items:center;border-top:1px solid #a66bd54d;padding-top:.4em}.info-hints button{display:flex;align-items:center;gap:.5em;background:transparent;border:1px solid transparent;border-radius:6px;padding:.25em .35em;color:#e3cdee;font-size:.72em;white-space:nowrap}.info-hints button:focus,.info-hints button:hover{border-color:#c880fa;background:#6d2d9577}.info-hints kbd{font-family:inherit;font-size:1em;font-weight:bold;color:#fff;padding:.12em .45em;border:1px solid #c084e6;border-radius:5px;background:#562b70}.info-hints span{font-size:1em}#stage[data-view="drawer"] .drawer-channels{top:3%;bottom:3%;height:auto;background:linear-gradient(145deg,#231334f5,#120c22f5)}#stage[data-view="watch"] .real-clock,#stage[data-view="drawer"] .real-clock{top:2%;right:2.5%;height:auto;min-height:3.1em;padding:.65em 1em;border-color:#8154a355;background:#150d24d9;border-radius:10px}#stage[data-view="watch"] .status,#stage[data-view="drawer"] .status{top:11%;right:2.5%;max-width:55%}
@media(max-width:900px){#stage[data-view="drawer"] .info-hints{flex-wrap:wrap;justify-content:flex-start}.info-hints button{font-size:.8em;gap:.25em}}
.brand .viplay-wordmark{margin:0;padding:0;border:0;border-radius:0;background:none;font-size:inherit}

/* Keep the channel drawer above fullscreen video; infobar and clock remain independent. */
#stage[data-view="drawer"] .dynamic{z-index:7}

/* VIPlay 7: transparent picons, contextual provider forms, category drawer. */
.live-panel .logo,.info-logo{background:none!important;border:0;box-shadow:none}
.info-logo{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:4.2vw;height:4.2vw;min-width:32px;min-height:32px;overflow:hidden}
.info-logo img{width:100%;height:100%;object-fit:contain}
#stage[data-view="watch"][data-info="hidden"] .real-clock{display:none!important}
.drawer-heading{display:flex;align-items:center;justify-content:space-between;gap:.3em}
.drawer-heading>span{flex:1;min-width:0;text-align:center;overflow:hidden;text-overflow:ellipsis}
.drawer-heading small{display:block;font-size:.7em;font-weight:normal;margin-top:.2em}
.live-panel .drawer-heading>button{width:2em;height:2em;flex-shrink:0;justify-content:center;border:1px solid #8057a5;background:#28163b}
.dialog .dialog-controls button{background:linear-gradient(#4e2c76,#29143e);border-color:#8654bf;box-shadow:none}
.dialog .dialog-controls button.is-focused{background:linear-gradient(#a32fe4,#59148d)!important;border-color:#ebaeff;box-shadow:0 0 9px #b23ff1}

/* VIPlay 8: settings in-place, focused preview and native AVPlay surface. */
.settings-detail>.setting-preview{display:flex;justify-content:space-between;align-items:center;gap:2%;height:10%;min-height:2em;margin:.6% 0;padding:.6em;border-radius:6px;font-size:.85em;background:transparent;border:1px solid transparent;border-bottom-color:#5a3679}
.settings-help{display:block;margin-top:1.2em;color:#d7bee9;font-size:.7em}
.video-area.preview-focused{outline:3px solid #edacff;outline-offset:3px;box-shadow:0 0 15px #b72ff0}
.native-video{position:absolute;z-index:4;pointer-events:none}
#stage[data-native="yes"] .video-area,#stage[data-native="yes"] .video-area video{background:transparent}
#stage[data-native="yes"] .video-area video{visibility:hidden}
#stage[data-native="yes"] .dynamic{z-index:5}

/* VIPlay 9: favorite and provider-declared catchup badges. */
.channel-badges{display:flex;align-items:center;justify-content:flex-end;gap:.35em;flex-shrink:0}
.favorite-mark{color:#ffe083;font-size:1em;line-height:1}
.archive-mark{border:1px solid #ba8fe0;border-radius:4px;padding:.2em .3em;color:#f0dcff;background:#492566;font-size:.58em;white-space:nowrap}
#stage[data-view="guide"] .app-footer,#stage[data-view="favorites"] .app-footer{font-size:clamp(10px,.92vw,20px)}
