/* ===================== RESET / BASE ===================== */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{
  font-family:'Inter',system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
  background:#0a0a0c;
  color:#fff;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  line-height:1.4;
  overflow-x:hidden;
  min-height:100vh;
}
button{font:inherit;color:inherit;background:none;border:0;cursor:pointer}
input{font:inherit;color:inherit}
a{color:inherit;text-decoration:none}
img{display:block;max-width:100%}
select{font:inherit;color:inherit;background:none;border:0;cursor:pointer}
::selection{background:#FFD000;color:#000}
[hidden]{display:none!important}

/* ===================== VARIABLES ===================== */
:root{
  --bg:#0a0a0c;
  --bg-2:#0f0f12;
  --surface:#15151a;
  --surface-2:#1c1c22;
  --surface-3:#25252d;
  --border:#26262e;
  --border-2:#34343e;
  --text:#fff;
  --text-2:#b8b8c0;
  --text-3:#7a7a85;
  --text-4:#4a4a55;
  --accent:#FFD000;
  --accent-2:#ffe040;
  --accent-soft:rgba(255,208,0,.12);
  --live:#ff3b3b;
  --live-soft:rgba(255,59,59,.18);
  --shadow-1:0 4px 20px rgba(0,0,0,.5);
  --shadow-2:0 12px 40px rgba(0,0,0,.6);
  --radius:10px;
  --radius-sm:6px;
  --header-h:64px;
  --pills-h:54px;
  --ease:cubic-bezier(.22,1,.36,1);
}

/* ===================== UTIL ===================== */
.hidden{display:none!important}
.container{max-width:1600px;margin:0 auto;padding:0 28px}
@media(max-width:680px){.container{padding:0 14px}}

/* ===================== HEADER ===================== */
.header{
  position:sticky;top:0;left:0;right:0;z-index:50;
  width:100%;
  background:linear-gradient(180deg,rgba(10,10,12,.95) 0%,rgba(10,10,12,.85) 100%);
  backdrop-filter:saturate(160%) blur(14px);
  -webkit-backdrop-filter:saturate(160%) blur(14px);
  border-bottom:1px solid var(--border);
  transition:box-shadow .3s var(--ease);
}
.header.scrolled{box-shadow:0 4px 30px rgba(0,0,0,.6)}
.header-inner{
  height:var(--header-h);
  display:flex;align-items:center;gap:24px;
  padding:0 28px;
  max-width:1600px;margin:0 auto;
}
@media(max-width:680px){.header-inner{padding:0 14px;gap:12px}}

.brand{display:flex;align-items:center;gap:10px;flex-shrink:0}
.brand-logo{height:38px;width:auto;border-radius:6px}
.brand-text{display:flex;flex-direction:column;line-height:1}
.brand-name{
  font-family:'Rajdhani',sans-serif;
  font-weight:700;
  font-size:1.35rem;
  letter-spacing:.04em;
  text-transform:uppercase;
}
.brand-name em{font-style:normal;color:var(--accent)}
.brand-sub{font-size:.6rem;color:var(--text-3);letter-spacing:.18em;text-transform:uppercase;margin-top:4px}
@media(max-width:680px){.brand-text{display:none}}

.search{
  position:relative;flex:1;max-width:520px;margin:0 auto;
  display:flex;align-items:center;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:999px;
  height:40px;
  padding:0 14px;
  transition:border-color .2s,box-shadow .2s,background .2s;
}
.search:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft);background:var(--surface-2)}
.search-icon{color:var(--text-3);flex-shrink:0}
.search:focus-within .search-icon{color:var(--accent)}
.search input{
  flex:1;background:transparent;border:0;outline:0;
  padding:0 10px;font-size:.9rem;
  color:var(--text);
}
.search input::placeholder{color:var(--text-3)}
.search-clear{
  width:22px;height:22px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  background:var(--surface-3);color:var(--text-2);
  transition:background .2s,color .2s;
}
.search-clear:hover{background:var(--accent);color:#000}
@media(max-width:680px){.search{max-width:none;margin:0}}

.header-right{display:flex;align-items:center;gap:8px;flex-shrink:0}
.live-badge{
  display:flex;align-items:center;gap:8px;
  padding:7px 12px;
  background:var(--live-soft);
  border:1px solid rgba(255,59,59,.3);
  border-radius:999px;
  font-size:.72rem;font-weight:700;letter-spacing:.1em;
}
.live-dot{
  width:8px;height:8px;border-radius:50%;
  background:var(--live);
  box-shadow:0 0 0 0 var(--live);
  animation:pulse 1.6s ease-in-out infinite;
}
.live-text{color:#ff8a8a}
.live-count{color:#fff;background:rgba(255,255,255,.08);padding:2px 8px;border-radius:999px;font-size:.65rem}
@keyframes pulse{
  0%,100%{box-shadow:0 0 0 0 rgba(255,59,59,.6);opacity:1}
  50%{box-shadow:0 0 0 8px rgba(255,59,59,0);opacity:.5}
}
@media(max-width:560px){.live-text,.live-count{display:none}.live-badge{padding:7px 9px}}

.icon-btn{
  position:relative;
  width:40px;height:40px;
  border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  color:var(--text-2);
  background:var(--surface);
  border:1px solid var(--border);
  transition:all .2s var(--ease);
}
.icon-btn:hover{color:var(--accent);border-color:var(--accent);transform:translateY(-1px)}
.icon-btn.active{color:var(--accent);border-color:var(--accent);background:var(--accent-soft)}
.icon-btn .badge{
  position:absolute;top:-3px;right:-3px;
  min-width:18px;height:18px;padding:0 5px;
  background:var(--accent);color:#000;
  border-radius:999px;
  font-size:.65rem;font-weight:800;
  display:flex;align-items:center;justify-content:center;
}

/* Channels toggle button — hidden on desktop, shown on mobile */
.player-channels-btn{display:none}

/* Pills */
.pills{
  display:flex;align-items:center;gap:8px;
  height:var(--pills-h);
  padding:0 28px;
  max-width:1600px;margin:0 auto;
  overflow-x:auto;
  scrollbar-width:none;
  -ms-overflow-style:none;
}
.pills::-webkit-scrollbar{display:none}
.pill{
  display:inline-flex;align-items:center;gap:8px;
  padding:8px 16px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:999px;
  color:var(--text-2);
  font-size:.82rem;font-weight:600;
  white-space:nowrap;
  transition:all .2s var(--ease);
}
.pill:hover{color:var(--text);background:var(--surface-2);border-color:var(--border-2)}
.pill.active{
  color:#000;
  background:var(--accent);
  border-color:var(--accent);
  box-shadow:0 4px 14px rgba(255,208,0,.25);
}
.pill-count{
  font-size:.65rem;font-weight:700;
  padding:2px 7px;
  background:rgba(255,255,255,.08);
  border-radius:999px;
  color:var(--text-3);
}
.pill.active .pill-count{background:rgba(0,0,0,.18);color:#000}
@media(max-width:680px){.pills{padding:0 14px;gap:6px}.pill{padding:7px 12px;font-size:.76rem}}

/* ===================== HERO ===================== */
.hero{
  position:relative;
  height:min(62vh,540px);
  min-height:380px;
  overflow:hidden;
  background:#0a0a0c;
}
@media(max-width:680px){
  .hero{height:auto;min-height:0;max-height:none;padding:18px 0 22px}
  .hero-content{justify-content:flex-start;padding-top:8px}
  .hero-logo-wrap{margin-bottom:10px;gap:14px}
  .hero-logo{width:64px;max-height:64px;padding:6px 8px}
  .hero-desc{font-size:.8rem;margin-bottom:16px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
  .hero-actions .btn{padding:9px 16px;font-size:.82rem}
  .hero-dots{position:relative;bottom:auto;left:auto;margin-top:14px}
}
.hero-bg{
  position:absolute;inset:0;
  background-size:cover;background-position:center;
  filter:blur(40px) saturate(1.3) brightness(.5);
  transform:scale(1.15);
  transition:opacity .8s var(--ease),background-image 1s var(--ease);
  opacity:0;
}
.hero-bg.loaded{opacity:1}
.hero-gradient{
  position:absolute;inset:0;
  background:
    linear-gradient(90deg,rgba(10,10,12,.95) 0%,rgba(10,10,12,.7) 40%,rgba(10,10,12,.2) 100%),
    linear-gradient(0deg,rgba(10,10,12,1) 0%,rgba(10,10,12,0) 50%),
    linear-gradient(180deg,rgba(10,10,12,.3) 0%,rgba(10,10,12,0) 30%);
}
.hero-content{
  position:relative;z-index:2;
  height:100%;
  max-width:1600px;margin:0 auto;
  padding:0 28px;
  display:flex;flex-direction:column;justify-content:center;
}
@media(max-width:680px){.hero-content{padding:0 14px}}
.hero-meta{display:flex;align-items:center;gap:12px;margin-bottom:18px}
.hero-tag{
  display:inline-block;
  padding:5px 11px;
  background:var(--accent);
  color:#000;
  font-size:.65rem;font-weight:900;letter-spacing:.18em;
  border-radius:4px;
}
.hero-cat{
  padding:5px 11px;
  background:rgba(255,255,255,.1);
  border:1px solid rgba(255,255,255,.18);
  color:var(--text-2);
  font-size:.65rem;font-weight:700;letter-spacing:.14em;text-transform:uppercase;
  border-radius:4px;
  backdrop-filter:blur(8px);
}
.hero-logo-wrap{
  display:flex;align-items:center;gap:24px;
  margin-bottom:16px;
  max-width:680px;
}
.hero-logo{
  width:clamp(80px,12vw,140px);height:auto;
  max-height:120px;object-fit:contain;
  background:rgba(255,255,255,.95);
  padding:8px 12px;border-radius:8px;
  flex-shrink:0;
}
.hero-title{
  font-family:'Rajdhani',sans-serif;
  font-size:clamp(2rem,5.5vw,3.8rem);
  font-weight:700;line-height:1;
  text-transform:uppercase;letter-spacing:.01em;
  text-shadow:0 4px 24px rgba(0,0,0,.6);
}
.hero-desc{
  max-width:600px;
  color:var(--text-2);
  font-size:clamp(.85rem,1.4vw,1.05rem);
  margin-bottom:28px;
}
.hero-actions{display:flex;gap:12px;flex-wrap:wrap}
.btn{
  display:inline-flex;align-items:center;gap:8px;
  padding:11px 22px;
  border-radius:8px;
  font-size:.88rem;font-weight:700;letter-spacing:.04em;
  transition:all .2s var(--ease);
  border:1px solid transparent;
}
.btn-primary{background:var(--accent);color:#000;box-shadow:0 6px 20px rgba(255,208,0,.25)}
.btn-primary:hover{background:var(--accent-2);transform:translateY(-1px);box-shadow:0 10px 26px rgba(255,208,0,.35)}
.btn-ghost{background:rgba(255,255,255,.1);color:#fff;border-color:rgba(255,255,255,.2);backdrop-filter:blur(8px)}
.btn-ghost:hover{background:rgba(255,255,255,.18);border-color:rgba(255,255,255,.3)}
.btn-ghost.active{color:var(--accent);border-color:var(--accent);background:var(--accent-soft)}

.hero-dots{
  display:flex;gap:6px;
  position:absolute;bottom:24px;left:28px;
}
@media(max-width:680px){.hero-dots{left:14px;bottom:14px}}
.hero-dots button{
  width:24px;height:3px;border-radius:2px;
  background:rgba(255,255,255,.25);
  transition:background .2s,width .3s var(--ease);
}
.hero-dots button.active{background:var(--accent);width:36px}

/* ===================== MAIN / GRID ===================== */
.main{padding:32px 0 80px}
@media(max-width:680px){.main{padding:18px 0 60px}}

/* ===================== FAVORITES ROW ===================== */
.fav-section{
  padding:32px 0 4px;
  background:linear-gradient(180deg,rgba(255,208,0,.04) 0%,rgba(255,208,0,0) 100%);
  border-bottom:1px solid var(--border);
}
.section-pill{
  background:var(--accent-soft);
  color:var(--accent);
  padding:3px 10px;
  border-radius:999px;
  font-size:.7rem;font-weight:800;
  letter-spacing:.05em;
}
.section-link{
  display:inline-flex;align-items:center;gap:6px;
  padding:7px 14px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:999px;
  color:var(--text-2);
  font-size:.78rem;font-weight:600;
  transition:all .2s var(--ease);
}
.section-link:hover{color:var(--accent);border-color:var(--accent);background:var(--accent-soft)}
.fav-row{
  display:flex;gap:14px;
  overflow-x:auto;overflow-y:visible;
  padding:6px 0 14px;
  margin:0 -28px;
  padding-left:28px;padding-right:28px;
  scroll-snap-type:x proximity;
  scrollbar-width:thin;
}
.fav-row::-webkit-scrollbar{height:6px}
.fav-row::-webkit-scrollbar-thumb{background:var(--border-2);border-radius:3px}
.fav-row .card{
  flex:0 0 240px;
  min-width:240px;
  scroll-snap-align:start;
}
@media(max-width:540px){
  .fav-row{margin:0 -14px;padding-left:14px;padding-right:14px;gap:10px}
  .fav-row .card{flex:0 0 200px;min-width:200px}
}
.section-head{
  display:flex;align-items:center;justify-content:space-between;
  margin-bottom:22px;
  gap:16px;flex-wrap:wrap;
}
.section-title{
  font-family:'Rajdhani',sans-serif;
  font-size:1.6rem;font-weight:700;
  text-transform:uppercase;letter-spacing:.04em;
  display:flex;align-items:center;gap:10px;
}
.section-title::before{
  content:"";width:4px;height:22px;background:var(--accent);border-radius:2px;
}
.section-meta{display:flex;align-items:center;gap:16px;color:var(--text-3);font-size:.82rem}
.sort label{display:flex;align-items:center;gap:8px;color:var(--text-3);font-size:.78rem}
.sort select{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:6px;
  padding:6px 10px;
  color:var(--text-2);
  font-size:.78rem;
  transition:all .2s;
}
.sort select:hover{border-color:var(--border-2)}
.sort select:focus{outline:0;border-color:var(--accent)}

.grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(180px,1fr));
  gap:16px;
}
@media(max-width:540px){.grid{grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:12px}}

.card{
  --cat:#52525b;
  position:relative;
  aspect-ratio:16/9;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  overflow:hidden;
  cursor:pointer;
  display:flex;flex-direction:column;
  transition:transform .25s var(--ease),border-color .25s,box-shadow .25s;
}
.card:hover{
  transform:translateY(-3px) scale(1.02);
  border-color:var(--cat);
  box-shadow:0 10px 30px rgba(0,0,0,.5),0 0 0 1px var(--cat);
  z-index:1;
}
.card-accent{
  height:3px;
  background:var(--cat);
  flex-shrink:0;
}
.card-body{
  flex:1;display:flex;flex-direction:column;min-height:0;
}
.card-logo-wrap{
  flex:1;
  display:flex;align-items:center;justify-content:center;
  padding:10px;
  min-height:0;
  background:linear-gradient(180deg,var(--surface) 0%,var(--bg-2) 100%);
  position:relative;
}
.card-initials{
  font-family:'Rajdhani',sans-serif;
  font-weight:700;
  font-size:clamp(1.2rem,3vw,1.8rem);
  letter-spacing:.05em;
  color:var(--cat);
  opacity:.25;
  position:absolute;inset:0;
  display:flex;align-items:center;justify-content:center;
  pointer-events:none;
  text-transform:uppercase;
}
.card-logo{
  max-width:100%;max-height:100%;
  object-fit:contain;
  filter:drop-shadow(0 2px 4px rgba(0,0,0,.4));
  transition:transform .25s var(--ease),opacity .25s;
  opacity:0;
  position:relative;z-index:1;
}
.card-logo.loaded{opacity:1}
.card:hover .card-logo.loaded{transform:scale(1.06)}
.card-name{
  padding:6px 10px 8px;
  font-size:.72rem;font-weight:600;
  color:var(--text-2);
  text-align:center;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  background:var(--bg-2);
  border-top:1px solid var(--border);
  position:relative;z-index:1;
}
.card-overlay{
  position:absolute;inset:0;
  background:linear-gradient(0deg,rgba(0,0,0,.92) 0%,rgba(0,0,0,.4) 50%,rgba(0,0,0,0) 100%);
  display:flex;flex-direction:column;justify-content:space-between;
  padding:10px;
  opacity:0;
  transition:opacity .25s var(--ease);
  pointer-events:none;
  z-index:2;
}
.card:hover .card-overlay{opacity:1}
.card-play{
  align-self:flex-end;
  width:36px;height:36px;
  display:flex;align-items:center;justify-content:center;
  background:var(--cat);
  color:#fff;
  border-radius:50%;
  box-shadow:0 4px 12px rgba(0,0,0,.4);
}
.card-cat{
  font-size:.65rem;font-weight:700;
  letter-spacing:.12em;text-transform:uppercase;
  color:#fff;
  text-shadow:0 1px 2px rgba(0,0,0,.6);
  align-self:flex-start;
  background:rgba(0,0,0,.55);
  padding:3px 7px;
  border-radius:4px;
  backdrop-filter:blur(4px);
}
.card-live{
  position:absolute;top:11px;right:8px;
  display:flex;align-items:center;gap:5px;
  padding:3px 7px;
  background:rgba(0,0,0,.6);
  border:1px solid rgba(255,59,59,.4);
  border-radius:4px;
  font-size:.6rem;font-weight:800;letter-spacing:.08em;
  color:#ff8a8a;
  backdrop-filter:blur(4px);
  z-index:3;
}
.card-live::before{
  content:"";width:5px;height:5px;border-radius:50%;
  background:var(--live);
  animation:pulse 1.6s ease-in-out infinite;
}
.card-fav{
  position:absolute;top:8px;left:8px;
  width:28px;height:28px;
  display:flex;align-items:center;justify-content:center;
  background:rgba(0,0,0,.6);
  border-radius:50%;
  color:var(--text-2);
  opacity:0;
  transition:all .2s;
  backdrop-filter:blur(4px);
  z-index:3;
}
.card:hover .card-fav{opacity:1}
.card-fav:hover{color:var(--accent);transform:scale(1.1)}
.card-fav.active{color:var(--accent);opacity:1}

/* Skeleton */
.card.skeleton{
  background:linear-gradient(90deg,var(--surface) 0%,var(--surface-2) 50%,var(--surface) 100%);
  background-size:200% 100%;
  animation:shimmer 1.4s linear infinite;
  border-color:var(--border);
  cursor:default;
}
.card.skeleton:hover{transform:none;border-color:var(--border);box-shadow:none}
@keyframes shimmer{0%{background-position:200% 0}100%{background-position:-200% 0}}

/* Empty */
.empty{
  text-align:center;
  padding:80px 20px;
  color:var(--text-3);
}
.empty-icon{color:var(--text-4);margin-bottom:16px;display:flex;justify-content:center}
.empty h3{font-size:1.2rem;color:var(--text-2);margin-bottom:6px}
.empty p{font-size:.9rem}

.grid-sentinel{height:1px;margin-top:20px}

/* ===================== FAVORITES DRAWER ===================== */
.drawer-scrim{
  position:fixed;left:0;top:0;width:100vw;height:100vh;height:100dvh;z-index:90;
  background:rgba(0,0,0,.6);
  backdrop-filter:blur(4px);
  animation:fadeIn .2s var(--ease);
}
.drawer{
  position:fixed;top:0;right:0;bottom:0;z-index:91;
  width:100vw;max-width:420px;
  background:var(--bg-2);
  border-left:1px solid var(--border);
  box-shadow:var(--shadow-2);
  display:flex;flex-direction:column;
  animation:slideIn .3s var(--ease);
}
@keyframes slideIn{from{transform:translateX(100%)}to{transform:translateX(0)}}
@keyframes fadeIn{from{opacity:0}to{opacity:1}}
.drawer-head{
  display:flex;align-items:center;justify-content:space-between;
  padding:18px 20px;
  border-bottom:1px solid var(--border);
}
.drawer-head h3{font-size:1.05rem;font-weight:700}
.drawer-body{flex:1;overflow-y:auto;padding:14px}
.drawer-empty{
  text-align:center;padding:60px 20px;color:var(--text-3);font-size:.9rem;
}
.drawer-item{
  display:flex;align-items:center;gap:12px;
  padding:10px;border-radius:8px;
  cursor:pointer;
  transition:background .2s;
}
.drawer-item:hover{background:var(--surface)}
.drawer-item img{width:64px;height:36px;object-fit:contain;background:#fff;border-radius:4px;flex-shrink:0}
.drawer-item .di-name{font-size:.85rem;font-weight:600;flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.drawer-item .di-cat{font-size:.65rem;color:var(--text-3);text-transform:uppercase;letter-spacing:.1em}

/* ===================== PLAYER MODAL ===================== */
.player{
  position:fixed;left:0;top:0;width:100vw;height:100vh;height:100dvh;
  z-index:100;
  background:#000;
  display:flex;flex-direction:column;
  overflow:hidden;
  animation:fadeIn .2s var(--ease);
}
.player-head{
  display:flex;align-items:center;justify-content:space-between;
  padding:12px 20px;
  background:linear-gradient(180deg,rgba(0,0,0,.9),rgba(0,0,0,.6));
  border-bottom:1px solid rgba(255,255,255,.05);
  gap:16px;
}
.player-info{display:flex;align-items:center;gap:12px;min-width:0;flex:1}
.player-logo{
  width:48px;height:32px;object-fit:contain;
  background:#fff;border-radius:4px;flex-shrink:0;
}
.player-name{font-weight:700;font-size:.95rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.player-cat{font-size:.7rem;color:var(--text-3);text-transform:uppercase;letter-spacing:.1em;margin-top:2px}
.player-meta{display:flex;align-items:center;gap:6px;margin-top:3px}
.quality-badge{
  display:inline-flex;align-items:center;
  font-size:.6rem;font-weight:900;letter-spacing:.1em;
  padding:1px 6px;
  background:linear-gradient(180deg,#FFD000,#ffb800);
  color:#000;
  border-radius:3px;
  line-height:1.5;
  box-shadow:0 0 8px rgba(255,208,0,.35);
}
.player-actions{display:flex;align-items:center;gap:6px;flex-shrink:0}
.player-actions .icon-btn{background:rgba(255,255,255,.08);border-color:rgba(255,255,255,.1);width:36px;height:36px}
.player-actions .icon-btn:hover{background:rgba(255,255,255,.16);border-color:rgba(255,255,255,.2);color:#fff;transform:none}

.player-body{
  flex:1;display:flex;min-height:0;
}
@media(max-width:900px){.player-body{flex-direction:column}}

.player-stage{
  flex:1;position:relative;
  display:flex;align-items:center;justify-content:center;
  background:#000;min-height:0;
}
.player-stage video{
  width:100%;height:100%;
  max-height:100%;
  object-fit:contain;
  background:#000;
}
.player-overlay{
  position:absolute;inset:0;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:16px;
  background:rgba(0,0,0,.6);
  color:#fff;
  z-index:2;
  pointer-events:none;
}
.player-overlay.hidden{display:none}
.player-spinner{
  width:48px;height:48px;
  border:3px solid rgba(255,255,255,.15);
  border-top-color:var(--accent);
  border-radius:50%;
  animation:spin .9s linear infinite;
}
@keyframes spin{to{transform:rotate(360deg)}}
.player-error{
  position:absolute;inset:0;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:12px;
  text-align:center;padding:24px;
  color:#fff;background:rgba(0,0,0,.85);
  z-index:3;
}
.player-error.hidden{display:none}
.player-error h4{font-size:1.2rem;margin-top:4px}
.player-error p{color:var(--text-2);max-width:420px;font-size:.9rem;margin-bottom:8px}

/* Desktop: overlay the bottom controls bar across the full player width.
   Without this, .player-controls becomes a 3rd flex column to the right of
   .player-side because .player-body is a horizontal flex on desktop. */
.player-controls{
  position:absolute;left:0;right:0;bottom:0;z-index:5;
  padding:14px 20px;
  background:linear-gradient(0deg,rgba(0,0,0,.85) 0%,rgba(0,0,0,0) 100%);
  display:flex;flex-direction:column;gap:10px;
  transition:opacity .3s,transform .3s;
  pointer-events:auto;
}
.player.ui-hidden .player-controls{opacity:0;transform:translateY(100%);pointer-events:none}
.player-progress{
  width:100%;height:3px;background:rgba(255,255,255,.2);border-radius:2px;overflow:hidden;
}
.player-progress-bar{height:100%;background:var(--accent);width:0;transition:width .25s linear}
.player-ctrl-row{display:flex;align-items:center;justify-content:space-between;gap:8px}
.player-ctrl-time{font-size:.72rem;color:var(--text-2);font-variant-numeric:tabular-nums}
.player-ctrl-actions{display:flex;align-items:center;gap:6px}
.player-ctrl-actions .icon-btn{width:36px;height:36px;background:rgba(255,255,255,.08);border-color:rgba(255,255,255,.1)}
.player-vol{
  -webkit-appearance:none;appearance:none;
  width:90px;height:4px;background:rgba(255,255,255,.25);
  border-radius:2px;outline:none;cursor:pointer;
  margin:0 4px;
}
.player-vol::-webkit-slider-thumb{
  -webkit-appearance:none;appearance:none;
  width:14px;height:14px;border-radius:50%;
  background:#fff;border:none;cursor:pointer;
}
.player-vol::-moz-range-thumb{
  width:14px;height:14px;border-radius:50%;
  background:#fff;border:none;cursor:pointer;
}
.player-vol:hover{background:rgba(255,255,255,.4)}

.player-side{
  width:320px;
  background:#0f0f12;
  border-left:1px solid var(--border);
  display:flex;flex-direction:column;
  flex-shrink:0;
}
@media(max-width:900px){.player-side{width:100%;max-height:35vh;border-left:0;border-top:1px solid var(--border)}}
.player-side h4{
  padding:14px 18px;font-size:.85rem;font-weight:700;
  border-bottom:1px solid var(--border);
  color:var(--text-2);
}
.player-side h4 span{color:var(--accent)}
.side-list{flex:1;overflow-y:auto;padding:10px}
.side-item{
  display:flex;align-items:center;gap:10px;
  padding:8px;border-radius:6px;cursor:pointer;
  transition:background .2s;
}
.side-item:hover{background:var(--surface)}
.side-item.active{background:var(--accent-soft);outline:1px solid var(--accent)}
.side-item img{width:60px;height:34px;object-fit:contain;background:#fff;border-radius:4px;flex-shrink:0}
.side-item .si-name{font-size:.82rem;font-weight:600;flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* ===================== FOOTER ===================== */
.footer{
  background:#0a0a0c;
  border-top:1px solid var(--border);
  padding:40px 0 0;
  color:var(--text-3);
}
.footer-inner{
  max-width:1600px;margin:0 auto;padding:0 28px 30px;
  display:flex;justify-content:space-between;gap:40px;flex-wrap:wrap;
}
.footer-brand{display:flex;align-items:center;gap:14px;max-width:380px}
.footer-brand img,.footer-brand svg{height:48px;width:auto;border-radius:6px}
.footer-logo{flex-shrink:0}
.footer-brand p{font-size:.82rem;line-height:1.5}
.footer-meta{text-align:right;font-size:.78rem;line-height:1.6}
.footer-stats{color:var(--accent);font-weight:600;margin-top:6px}
.footer-bottom{
  text-align:center;font-size:.7rem;letter-spacing:.1em;
  padding:16px;border-top:1px solid var(--border);
  color:var(--text-4);
}
@media(max-width:680px){
  .footer-inner{padding:0 14px 24px;gap:24px}
  .footer-brand,.footer-meta{text-align:center;flex-direction:column;align-items:center;max-width:none}
}

/* ===================== TOAST ===================== */
.toast{
  position:fixed;bottom:24px;left:50%;transform:translateX(-50%);
  z-index:200;
  background:var(--surface-2);
  border:1px solid var(--border-2);
  color:#fff;
  padding:12px 20px;
  border-radius:8px;
  font-size:.85rem;font-weight:600;
  box-shadow:var(--shadow-2);
  animation:toastIn .3s var(--ease);
}
@keyframes toastIn{from{opacity:0;transform:translate(-50%,12px)}to{opacity:1;transform:translate(-50%,0)}}

/* ===================== CATEGORIES PAGE ===================== */
.cat-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(260px,1fr));
  gap:12px;
}
.cat-card{
  display:flex;align-items:center;gap:14px;
  padding:14px 16px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  text-decoration:none;color:inherit;
  transition:transform .2s var(--ease),border-color .2s,background .2s;
  min-width:0;
}
.cat-card:hover{
  transform:translateY(-2px);
  border-color:var(--accent);
  background:var(--surface-2);
}
.cat-card-icon{
  width:44px;height:44px;flex-shrink:0;
  display:flex;align-items:center;justify-content:center;
  background:var(--cat,#FFD000);
  color:#0a0a0c;
  border-radius:10px;
  font-family:'Rajdhani',sans-serif;
  font-weight:700;
  font-size:1.3rem;
  box-shadow:0 2px 8px rgba(0,0,0,.3);
}
.cat-card-letter{line-height:1}
.cat-card-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.cat-card-name{
  font-weight:700;font-size:.95rem;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.cat-card-count{
  font-size:.72rem;color:var(--text-3);
  font-weight:600;letter-spacing:.02em;
}
.cat-card-arrow{color:var(--text-4);flex-shrink:0;width:18px;height:18px}
.cat-card:hover .cat-card-arrow{color:var(--accent)}

.cat-loading,.cat-error{
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:14px;padding:60px 20px;text-align:center;color:var(--text-3);
}
.cat-loading .player-spinner{width:36px;height:36px;border-width:3px}
.cat-error p{font-size:.9rem}

@media(max-width:768px){
  .cat-grid{grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:10px}
  .cat-card{padding:12px;gap:10px;border-radius:8px}
  .cat-card-icon{width:36px;height:36px;border-radius:8px;font-size:1.05rem}
  .cat-card-name{font-size:.82rem}
  .cat-card-count{font-size:.65rem}
  .cat-card-arrow{width:16px;height:16px}
}


/* ===================== SCROLLBAR ===================== */
::-webkit-scrollbar{width:10px;height:10px}
::-webkit-scrollbar-track{background:#0a0a0c}
::-webkit-scrollbar-thumb{background:#25252d;border-radius:5px;border:2px solid #0a0a0c}
::-webkit-scrollbar-thumb:hover{background:#34343e}

/* ===================== MOBILE / RESPONSIVE (TV APP PATTERN) =====================
   Reference: Netflix, YouTube TV, Pluto TV, Tubi mobile web.
   Principles:
   1. Compact sticky header — logo + search-icon + live-count + favorites
   2. Full-bleed hero, short height on mobile, no description text
   3. Horizontal-scroll category pills (touch-friendly)
   4. Grid uses 2 columns on phone, 3 on small tablet
   5. Fullscreen player with auto-hide header, swipe down to close
   6. Bottom tab bar with Home / Search / Favorites / Categories
   7. Safe-area insets for notched devices
   8. 44px+ touch targets everywhere
   ===================================================================== */

/* Global mobile polish (all sizes) */
html{-webkit-text-size-adjust:100%;touch-action:manipulation;overflow-x:hidden}
body{-webkit-tap-highlight-color:transparent;overscroll-behavior-y:contain;overflow-x:hidden}
img,svg,video{max-width:100%}
button,a{-webkit-tap-highlight-color:transparent}

@media(max-width:768px){
  :root{
    --header-h:52px;
    --pills-h:46px;
    --bottom-nav-h:56px;
  }
  body{padding-bottom:var(--bottom-nav-h)}
  .container,.header-inner,.pills,.footer-inner{
    padding-left:max(12px,env(safe-area-inset-left));
    padding-right:max(12px,env(safe-area-inset-right));
  }

  /* ---------- HEADER (compact, logo + actions only) ---------- */
  .header{width:100%;max-width:100vw;overflow:hidden}
  .header-inner{
    display:flex;align-items:center;
    height:var(--header-h);
    padding-left:max(10px,env(safe-area-inset-left));
    padding-right:max(10px,env(safe-area-inset-right));
    max-width:none;margin:0;
  }
  .brand{flex-shrink:0;display:flex;align-items:center;gap:6px}
  .brand-logo{height:24px;width:auto}
  .brand-text{display:none}
  .header-right{flex-shrink:0;margin-left:auto}
  .search{
    height:36px;width:180px;max-width:180px;min-width:0;
    margin:0 auto 0 -40px;
    background:transparent;border:0;
    padding:0;
  }
  .search-icon{position:absolute;left:10px;top:50%;transform:translateY(-50%);pointer-events:none;z-index:2;width:16px;height:16px}
  .search input{
    height:36px;width:100%;min-width:0;
    padding:0 12px 0 34px;
    font-size:16px; /* prevent iOS zoom */
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:999px;
  }
  .search-clear{width:28px;height:28px}
  .header-right{gap:4px;flex-shrink:0}
  .live-badge{padding:5px 8px;font-size:.62rem}
  .live-dot{width:6px;height:6px}
  .live-text,.live-count{display:none}
  .icon-btn{width:38px;height:38px;flex-shrink:0}
  .icon-btn .badge{min-width:16px;height:16px;font-size:.6rem;top:-2px;right:-2px}
  .brand{flex-shrink:0}

  /* ---------- PILLS (horizontal scroll, sticky under header) ---------- */
  .pills{height:var(--pills-h);gap:6px;padding-top:6px;padding-bottom:6px}
  .pill{padding:6px 12px;font-size:.74rem;min-height:34px}
  .pill-count{font-size:.6rem;padding:1px 6px}

  /* ---------- HERO (compact, full-bleed) ---------- */
  .hero{
    height:auto;min-height:0;max-height:none;
    padding:14px 0 16px;
  }
  .hero-content{padding-top:6px;padding-bottom:6px;justify-content:flex-start}
  .hero-meta{gap:6px;margin-bottom:10px}
  .hero-tag,.hero-cat{font-size:.58rem;padding:3px 8px;letter-spacing:.1em}
  .hero-logo-wrap{gap:10px;margin-bottom:8px;align-items:center}
  .hero-logo{width:48px;height:48px;padding:5px 6px;max-height:48px}
  .hero-title{font-size:1.6rem;line-height:1.05}
  .hero-desc{
    font-size:.78rem;margin-bottom:12px;line-height:1.35;
    display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;
    overflow:hidden;
  }
  .hero-actions{gap:8px}
  .hero-actions .btn{
    padding:8px 14px;font-size:.78rem;min-height:36px;
  }
  .hero-dots{position:relative;bottom:auto;left:auto;margin-top:10px}

  /* ---------- FAVORITES SECTION (mobile) ---------- */
  .fav-section{padding:18px 0 4px}
  .fav-row{margin:0 -12px;padding:6px 12px 12px;gap:10px}
  .fav-row .card{flex:0 0 140px;min-width:140px}
  .section-head{margin-bottom:14px;gap:10px}
  .section-title{font-size:1.15rem}
  .section-link{padding:5px 10px;font-size:.7rem}

  /* ---------- MAIN / GRID (2 columns on phone) ---------- */
  .main{padding:18px 0 24px}
  .grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
  }
  .card{border-radius:8px}
  .card-name{font-size:.66rem;padding:5px 6px 6px}
  .card-live{font-size:.55rem;padding:2px 5px;top:6px;right:6px}
  .card-fav{width:24px;height:24px;top:5px;left:5px}
  .card-cat{font-size:.55rem;padding:2px 5px}

  /* Section meta (count + sort) */
  .section-meta{font-size:.72rem;gap:8px}
  .sort label{font-size:.68rem;gap:5px}
  .sort select{padding:5px 8px;font-size:.78rem}

  /* ---------- EMPTY / FOOTER ---------- */
  .empty{padding:50px 16px}
  .empty h3{font-size:1rem}
  .empty p{font-size:.8rem}
  .footer{padding:24px 0 0}
  .footer-inner{padding:0 12px 18px;gap:18px;flex-direction:column}
  .footer-brand,.footer-meta{text-align:center;flex-direction:column;align-items:center;max-width:none}
  .footer-brand img,.footer-brand svg{height:36px}
  .footer-bottom{padding:12px;font-size:.65rem}

  /* ---------- TOAST ---------- */
  .toast{
    bottom:calc(var(--bottom-nav-h) + 12px + env(safe-area-inset-bottom));
    left:12px;right:12px;transform:none;
    font-size:.78rem;padding:10px 14px;text-align:center;
  }

  /* ---------- DRAWER (favorites — full screen on phone) ---------- */
  .drawer{width:100vw;max-width:100vw;border-left:0}
  .drawer-head{padding:14px 16px}
  .drawer-head h3{font-size:.95rem}
  .drawer-body{padding:10px}
  .drawer-item{padding:8px;gap:10px}
  .drawer-item img{width:54px;height:30px}
  .drawer-item .di-name{font-size:.8rem}

  /* ---------- BOTTOM TAB BAR (Netflix/YouTube pattern) ---------- */
  .bottom-nav{
    position:fixed;left:0;right:0;bottom:0;z-index:60;
    height:calc(var(--bottom-nav-h) + env(safe-area-inset-bottom));
    padding-bottom:env(safe-area-inset-bottom);
    background:rgba(10,10,12,.92);
    backdrop-filter:saturate(160%) blur(16px);
    -webkit-backdrop-filter:saturate(160%) blur(16px);
    border-top:1px solid var(--border);
    display:grid;grid-template-columns:repeat(4,1fr);
  }
  .bottom-nav button{
    display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
    color:var(--text-3);font-size:.6rem;font-weight:600;letter-spacing:.04em;
    background:none;border:0;padding:6px 0;cursor:pointer;
    transition:color .2s;
  }
  .bottom-nav button.active{color:var(--accent)}
  .bottom-nav svg{width:22px;height:22px}

  /* Hide bottom nav when player is open */
  body.player-open .bottom-nav{display:none}
  body.player-open{padding-bottom:0}

  /* ---------- PLAYER (fullscreen, compact header, auto-hide) ---------- */
  .player{
    left:0;right:0;top:0;bottom:0;
    width:100vw;height:100vh;height:100dvh;
  }
  .player-head{
    position:absolute;top:0;left:0;right:0;z-index:5;
    padding:max(8px,env(safe-area-inset-top)) 12px 8px;
    min-height:0;gap:8px;
    background:linear-gradient(180deg,rgba(0,0,0,.85) 0%,rgba(0,0,0,0) 100%);
    border-bottom:0;
    transition:opacity .3s,transform .3s;
  }
  .player.ui-hidden .player-head{opacity:0;transform:translateY(-100%);pointer-events:none}
  .player-logo{width:36px;height:24px}
  .player-name{font-size:.82rem}
  .player-cat{font-size:.6rem;letter-spacing:.08em;margin-top:1px}
  .quality-badge{font-size:.55rem;padding:1px 5px}
  .player-actions{gap:4px}
  .player-actions .icon-btn{width:38px;height:38px;background:rgba(0,0,0,.5);border-color:rgba(255,255,255,.1)}
  .player-actions .icon-btn:active{transform:scale(.95)}
  .player-channels-btn{display:flex}

  .player-body{
    position:absolute;inset:0;
    flex-direction:column;
    background:#000;
  }
  .player-stage{
    position:absolute;inset:0;width:100%;height:100%;
    background:#000;
    display:flex;align-items:center;justify-content:center;
  }
  .player-stage video{
    width:100%;height:100%;
    max-width:100%;max-height:100%;
    object-fit:contain;background:#000;
  }

  /* Bottom controls bar (auto-show/hide) */
  .player-controls{
    position:absolute;left:0;right:0;bottom:0;z-index:5;
    padding:20px 12px max(12px,env(safe-area-inset-bottom));
    background:linear-gradient(0deg,rgba(0,0,0,.85) 0%,rgba(0,0,0,0) 100%);
    display:flex;flex-direction:column;gap:10px;
    transition:opacity .3s,transform .3s;
  }
  .player.ui-hidden .player-controls{opacity:0;transform:translateY(100%);pointer-events:none}
  .player-progress{
    width:100%;height:3px;background:rgba(255,255,255,.2);border-radius:2px;overflow:hidden;
  }
  .player-progress-bar{height:100%;background:var(--accent);width:0;transition:width .25s linear}
  .player-ctrl-row{display:flex;align-items:center;justify-content:space-between;gap:8px}
  .player-ctrl-time{font-size:.72rem;color:var(--text-2);font-variant-numeric:tabular-nums}
  .player-ctrl-actions{display:flex;align-items:center;gap:4px}
  .player-ctrl-actions .icon-btn{width:38px;height:38px;background:rgba(0,0,0,.5);border-color:rgba(255,255,255,.1)}
  .player-ctrl-actions .icon-btn.play-btn{width:48px;height:48px}
  .player-vol{
    -webkit-appearance:none;appearance:none;
    width:90px;height:4px;background:rgba(255,255,255,.25);
    border-radius:2px;outline:none;cursor:pointer;
    margin:0 4px;
  }
  .player-vol::-webkit-slider-thumb{
    -webkit-appearance:none;appearance:none;
    width:14px;height:14px;border-radius:50%;
    background:#fff;border:none;cursor:pointer;
  }
  .player-vol::-moz-range-thumb{
    width:14px;height:14px;border-radius:50%;
    background:#fff;border:none;cursor:pointer;
  }
  .player-vol:hover{background:rgba(255,255,255,.4)}
  .player-overlay{padding:16px}
  .player-spinner{width:40px;height:40px;border-width:2px}
  .player-error h4{font-size:1rem}
  .player-error p{font-size:.8rem;max-width:320px}

  /* Channel rail — slide-up bottom sheet, hidden by default */
  .player-side{
    position:absolute;left:0;right:0;bottom:0;z-index:6;
    width:100%;
    height:60vh;max-height:60vh;
    background:var(--bg-2);
    border-top:1px solid var(--border);
    border-radius:16px 16px 0 0;
    transform:translateY(100%);
    transition:transform .3s var(--ease);
    box-shadow:0 -10px 40px rgba(0,0,0,.5);
  }
  .player-side.open{transform:translateY(0)}
  .player-side-handle{
    display:block;
    width:40px;height:4px;border-radius:2px;
    background:var(--border-2);
    margin:8px auto 0;
  }
  .player-side h4{
    padding:8px 14px 4px;
    font-size:.75rem;
  }
  .side-list{
    flex-direction:row;
    overflow-x:auto;overflow-y:hidden;
    padding:4px 12px 16px;gap:8px;
    -webkit-overflow-scrolling:touch;
    scroll-snap-type:x proximity;
    scrollbar-width:none;
  }
  .side-list::-webkit-scrollbar{display:none}
  .side-item{
    flex:0 0 88px;
    flex-direction:column;align-items:center;gap:4px;
    padding:4px;
    scroll-snap-align:start;
  }
  .side-item img{width:64px;height:36px}
  .side-item .si-name{
    font-size:.65rem;
    text-align:center;line-height:1.15;
    display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;
    overflow:hidden;white-space:normal;
    word-break:break-word;
  }

  /* Player in landscape: fill screen, controls overlay */
  @media(orientation:landscape){
    .player-side{height:50vh;max-height:50vh}
  }
}

/* ---------- DESKTOP-ONLY (hide mobile elements on larger screens) ---------- */
@media(min-width:769px){
  .bottom-nav{display:none!important}
  .player-side-handle{display:none!important}
}

/* Reduced motion */
@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{
    animation-duration:.001ms!important;
    animation-iteration-count:1!important;
    transition-duration:.001ms!important;
    scroll-behavior:auto!important;
  }
  .live-dot{animation:none}
}
