.video-anchor {
  position: relative;
  top: -90px;
}

.channel-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 24px;
}

.channel-tab {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255,255,255,.10);
  background: #111827;
  color: #fff;
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}

.channel-tab:hover,
.channel-tab.active {
  border-color: rgba(255,255,255,.28);
  background: #182236;
}

.channel-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: #1b4f91;
  color: #fff;
  font-size: .78rem;
  font-weight: 800;
  line-height: 1;
}

.video-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 28px;
  margin-bottom: 10px;
}

.video-row-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
}

.row-arrows {
  display: flex;
  gap: 8px;
}

.row-arrow {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: #111827;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}

.row-arrow:hover {
  background: #182236;
  border-color: rgba(255,255,255,.24);
  transform: translateY(-1px);
}

.video-row {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 6px 2px 18px;
  scroll-behavior: smooth;
}

.video-row::-webkit-scrollbar {
  height: 10px;
}

.video-row::-webkit-scrollbar-track {
  background: rgba(255,255,255,.08);
  border-radius: 999px;
}

.video-row::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.22);
  border-radius: 999px;
}

.video-card {
  flex: 0 0 240px;
  background: #111827;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.video-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 28px rgba(0,0,0,.28);
  border-color: rgba(255,255,255,.18);
}

.video-card-hidden {
  display: none;
}

.thumb-wrap {
  position: relative;
  background: #0b1220;
  overflow: hidden;
}

.thumb-img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #0b1220;
  transition: opacity .2s ease;
}

.preview-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  background: #000;
}

.thumb-wrap:hover .preview-frame {
  opacity: 1;
}

.thumb-wrap:hover .thumb-img {
  opacity: 0;
}

.play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  color: #fff;
  background: linear-gradient(to top, rgba(0,0,0,.42), rgba(0,0,0,.08));
  opacity: .85;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  text-shadow: 0 4px 18px rgba(0,0,0,.45);
}

.video-card:hover .play-overlay,
.trending-card:hover .play-overlay {
  opacity: 1;
  transform: scale(1.06);
}

.video-title {
  padding: 12px;
  font-size: .9rem;
  font-weight: 700;
  line-height: 1.35;
  color: #fff;
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  margin: 6px 0 16px;
}

.load-more-btn {
  border: 1px solid rgba(255,255,255,.12);
  background: #111827;
  color: #fff;
  border-radius: 999px;
  padding: 12px 18px;
  cursor: pointer;
  font-weight: 700;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.load-more-btn:hover {
  background: #182236;
  border-color: rgba(255,255,255,.24);
  transform: translateY(-1px);
}

.video-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 9999;
}

.video-modal.hidden {
  display: none;
}

.video-modal-content {
  position: relative;
  width: min(1100px, 100%);
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
}

#videoFrame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

#closeVideo {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: rgba(0,0,0,.7);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
}

#closeVideo:hover {
  background: rgba(0,0,0,.9);
}

.trending-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 10px 0 28px;
}

.trending-card {
  display: block;
  text-decoration: none;
  background: #111827;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  color: #fff;
}

.trending-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0,0,0,.28);
  border-color: rgba(255,255,255,.18);
}

.trending-card .meta {
  padding: 12px;
}

.trending-card .meta h3 {
  margin: 0 0 6px;
  font-size: .95rem;
  line-height: 1.35;
  color: #ffffff;
}

.trending-card .meta p {
  margin: 0;
  font-size: .85rem;
  color: #ffffff;
  line-height: 1.4;
}

@media (max-width: 1100px) {
  .trending-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .video-card {
    flex-basis: 210px;
  }

  .trending-grid {
    grid-template-columns: 1fr;
  }

  .video-modal {
    padding: 10px;
  }

  .video-modal-content {
    border-radius: 12px;
  }

  .video-row-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .channel-tabs {
    gap: 8px;
  }

  .channel-tab {
    width: 100%;
    justify-content: flex-start;
  }

  /* Disable hover-preview behavior on touch-sized layouts */
  .preview-frame {
    display: none;
  }

  .thumb-wrap:hover .thumb-img {
    opacity: 1;
  }

  .thumb-wrap:hover .preview-frame {
    opacity: 0;
  }
}