*{box-sizing:border-box}
html{min-height:100%;background:#080916}
body{
  margin:0;
  min-height:100%;
  font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Tahoma,sans-serif;
  background:
    radial-gradient(circle at 20% 0%,rgba(239,54,95,.34),transparent 30%),
    radial-gradient(circle at 85% 20%,rgba(61,112,255,.24),transparent 28%),
    linear-gradient(180deg,#111327 0%,#090a16 100%);
  color:#fff;
}
button,input{font:inherit}
.tv-shell{width:min(980px,100%);margin:0 auto;padding:16px 14px 110px}
.hero-card,.glass-card{
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.075);
  box-shadow:0 22px 70px rgba(0,0,0,.34);
  backdrop-filter:blur(16px);
  border-radius:26px;
  padding:17px;
  margin-bottom:14px;
}
.compact-card{padding-bottom:13px}
.brand{display:inline-flex;align-items:center;gap:7px;color:#ff4d70;font-weight:950;letter-spacing:.3px}
h1{margin:6px 0 7px;font-size:25px;line-height:1.45}
h2{margin:0 0 13px;font-size:18px;line-height:1.5}
p{margin:0;color:rgba(255,255,255,.68);line-height:1.8}
.route-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.route-card{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:12px;
  border:1px solid rgba(255,255,255,.12);
  background:linear-gradient(180deg,rgba(255,255,255,.11),rgba(255,255,255,.055));
  color:#fff;
  border-radius:20px;
  padding:14px;
  cursor:pointer;
  text-align:right;
  transition:transform .18s ease,border-color .18s ease,background .18s ease;
}
.route-card:active{transform:scale(.985)}
.route-card.active{border-color:rgba(255,77,112,.80);background:linear-gradient(180deg,rgba(255,77,112,.23),rgba(255,255,255,.065))}
.route-icon{
  width:44px;height:44px;border-radius:16px;
  display:grid;place-items:center;
  background:rgba(255,255,255,.10);
  font-size:24px;flex:0 0 auto;
}
.route-info{display:grid;gap:2px;min-width:0}
.route-info strong{font-size:17px;line-height:1.4}
.route-info span{font-size:13px;color:rgba(255,255,255,.64);line-height:1.4}
.section-head{display:grid;gap:12px;margin-bottom:12px}
.section-head h2{margin:0}
#channelSearch{
  width:100%;
  min-height:54px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(0,0,0,.24);
  color:#fff;
  border-radius:19px;
  padding:0 18px;
  outline:none;
  display:block;
  line-height:54px;
  white-space:nowrap;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.06),0 12px 28px rgba(0,0,0,.14);
}
#channelSearch:focus{border-color:rgba(255,77,112,.92);background:rgba(0,0,0,.31)}
#channelSearch::placeholder{color:rgba(255,255,255,.45)}

.category-tabs{
  display:flex;
  gap:8px;
  overflow-x:auto;
  padding:2px 0 12px;
  margin-bottom:2px;
  scrollbar-width:none;
  -webkit-overflow-scrolling:touch;
}
.category-tabs::-webkit-scrollbar{display:none}
.category-chip{
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  gap:7px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.075);
  color:#fff;
  border-radius:999px;
  padding:10px 13px;
  cursor:pointer;
  transition:transform .16s ease,border-color .16s ease,background .16s ease;
}
.category-chip:active{transform:scale(.97)}
.category-chip.active{border-color:rgba(255,77,112,.86);background:linear-gradient(135deg,rgba(255,61,104,.32),rgba(255,122,61,.18))}
.category-chip b{font-size:13px;line-height:1;white-space:nowrap}
.category-chip small{
  min-width:24px;
  height:22px;
  padding:0 6px;
  display:grid;
  place-items:center;
  border-radius:999px;
  background:rgba(255,255,255,.11);
  color:rgba(255,255,255,.82);
  font-size:12px;
  font-weight:800;
}

.channel-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.channel-card{
  display:grid;
  grid-template-columns:54px minmax(0,1fr) auto;
  align-items:center;
  gap:11px;
  min-height:76px;
  padding:11px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.065);
  border-radius:21px;
}
.channel-logo{
  width:54px;height:54px;
  object-fit:contain;
  border-radius:16px;
  background:rgba(255,255,255,.10);
  border:1px solid rgba(255,255,255,.08);
  padding:5px;
}
.logo-fallback{display:grid;place-items:center;font-weight:950;color:#fff;background:linear-gradient(135deg,rgba(255,77,112,.55),rgba(61,112,255,.34))}
.channel-info{min-width:0}
.channel-info strong{
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:15px;
  line-height:1.55;
}
.watch-btn{
  border:0;
  color:#fff;
  background:linear-gradient(135deg,#ff3d68,#ff7a3d);
  border-radius:15px;
  padding:10px 13px;
  font-weight:950;
  cursor:pointer;
  box-shadow:0 10px 24px rgba(255,61,104,.26);
}
.watch-btn:active{transform:scale(.97)}
.empty{
  grid-column:1/-1;
  padding:18px;
  border:1px dashed rgba(255,255,255,.18);
  color:rgba(255,255,255,.68);
  border-radius:18px;
  line-height:1.8;
  text-align:center;
}
.player-panel{
  position:fixed;
  inset:auto 12px 12px 12px;
  z-index:1000;
  background:rgba(9,10,22,.96);
  border:1px solid rgba(255,255,255,.14);
  border-radius:24px;
  padding:12px;
  box-shadow:0 24px 90px rgba(0,0,0,.55);
}
.player-panel.hidden,.hidden{display:none!important}
.player-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
.player-head strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.5}
.player-actions{display:flex;gap:7px;flex:0 0 auto}
.player-actions button{
  border:0;
  color:#fff;
  background:rgba(255,255,255,.11);
  border-radius:12px;
  padding:8px 10px;
  cursor:pointer;
}
video,.youtube-player{
  display:block;
  width:100%;
  height:min(54vh,520px);
  background:#000;
  border:0;
  border-radius:16px;
}
.player-note{font-size:13px;color:rgba(255,255,255,.66);margin-top:8px;line-height:1.6;min-height:0}
.signal-empty{padding:10px 0;color:#ff9cab;font-weight:800}
.tv-video-zoomed{object-fit:cover!important}
.tv-fullscreen-lock{overflow:hidden!important;height:100%!important}
.tv-fullscreen-active{
  position:fixed!important;
  inset:0!important;
  width:100vw!important;
  height:100vh!important;
  z-index:2147483640!important;
  background:#05050b!important;
  border-radius:0!important;
  padding:12px!important;
  display:flex!important;
  flex-direction:column!important;
  justify-content:center!important;
}
.tv-fullscreen-active video,.tv-fullscreen-active .youtube-player{
  height:calc(100vh - 80px)!important;
  max-height:calc(100vh - 80px)!important;
  border-radius:12px!important;
}
@media (orientation:landscape) and (max-height:620px){
  .tv-fullscreen-active video,.tv-fullscreen-active .youtube-player{height:calc(100vh - 50px)!important;max-height:calc(100vh - 50px)!important}
}
@media(max-width:680px){
  .tv-shell{padding:12px 10px 120px}
  .hero-card,.glass-card{border-radius:22px;padding:14px}
  h1{font-size:22px}
  .section-head{gap:10px}
  #channelSearch{min-height:52px;line-height:52px}
  .channel-grid{grid-template-columns:1fr}
  .channel-card{grid-template-columns:50px minmax(0,1fr) auto;min-height:70px}
  .channel-logo{width:50px;height:50px;border-radius:15px}
  .watch-btn{padding:9px 12px}
  .player-panel{inset:auto 8px 8px 8px;border-radius:20px}
  .player-actions button{padding:7px 8px;font-size:12px}
}


/* TV V3: full-width one-line search */
.tv-search, .search-card, .search-box { width: 100%; }
#channelSearch { width: 100%; min-height: 58px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.category-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 560px) { .category-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.load-more-btn{
  grid-column:1/-1;
  min-height:48px;
  border:1px solid rgba(255,255,255,.14);
  border-radius:16px;
  background:rgba(255,255,255,.08);
  color:#fff;
  font-weight:900;
  cursor:pointer;
}
.load-more-btn:active{transform:scale(.99)}
