/* Compact directory/favorite cards inspired by media-library grids.
   Streamer cards are intentionally narrower than LIVE cards and keep channel artwork
   completely unobstructed: no dark fade and no text on top of the image. */

body[data-view="explore"][data-explore-mode="streamers"] .streamer-card,
body[data-view="favorites"] .streamer-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "media"
    "name"
    "stats"
    "characters"
    "tags";
  grid-template-rows: auto auto 18px 22px 17px;
  align-self: stretch;
  align-content: start;
  row-gap: 5px;
  column-gap: 0;
  min-width: 0;
  padding: 8px;
  overflow: visible;
  background: #fff;
}

/* Explicitly remove the previous dark metadata overlay. */
body[data-view="explore"][data-explore-mode="streamers"] .streamer-card::before,
body[data-view="favorites"] .streamer-card::before {
  content: none !important;
  display: none !important;
  background: none !important;
}

body[data-view="explore"][data-explore-mode="streamers"] .streamer-card > .streamer-media,
body[data-view="favorites"] .streamer-card > .streamer-media {
  grid-area: media;
  display: block;
  min-width: 0;
  margin-bottom: 0;
  position: relative;
  z-index: 1;
}
body[data-view="explore"][data-explore-mode="streamers"] .streamer-card > .streamer-media > .card-media-link,
body[data-view="favorites"] .streamer-card > .streamer-media > .card-media-link {
  display: block;
  min-width: 0;
}

/* YouTube channel artwork is normally square. Show the whole source image instead of
   forcing it into the LIVE 16:9 crop. */
body[data-view="explore"][data-explore-mode="streamers"] .channel-avatar-wrap,
body[data-view="favorites"] .channel-avatar-wrap {
  aspect-ratio: 1 / 1;
  max-height: none;
  display: grid;
  place-items: center;
  padding: 0;
  position: relative;
  overflow: hidden;
  border: 1px solid #e0e2e7;
  border-radius: 9px;
  background: #f2f3f6;
}

body[data-view="explore"][data-explore-mode="streamers"] .channel-avatar-wrap .channel-icon,
body[data-view="favorites"] .channel-avatar-wrap .channel-icon {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: 8px;
}

/* LIVE card parity: service links overlay the artwork top-left like .watch-services. */

body[data-view="explore"][data-explore-mode="streamers"] .streamer-row,
body[data-view="favorites"] .streamer-row {
  grid-area: name;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  align-items: start;
  gap: 10px;
  min-width: 0;
  width: 100%;
  margin: 0;
  padding: 0;
  color: var(--text);
  pointer-events: auto;
}

body[data-view="explore"][data-explore-mode="streamers"] .streamer-name,
body[data-view="favorites"] .streamer-name {
  display: -webkit-box;
  min-width: 0;
  min-height: 0;
  max-height: 2.65em;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.32;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: normal;
  text-shadow: none;
  pointer-events: auto;
}

body[data-view="explore"][data-explore-mode="streamers"] .streamer-stats,
body[data-view="favorites"] .streamer-stats {
  grid-area: stats;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 5px 8px;
  min-width: 0;
  min-height: 0;
  margin: 0;
  color: var(--muted);
  pointer-events: auto;
}

body[data-view="explore"][data-explore-mode="streamers"] .streamer-stats span,
body[data-view="favorites"] .streamer-stats span {
  min-width: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: none;
}

body[data-view="explore"][data-explore-mode="streamers"] .streamer-stats b,
body[data-view="favorites"] .streamer-stats b {
  display: inline;
  margin: 0 4px 0 0;
  color: #737986;
  font-size: 9px;
}

body[data-view="explore"][data-explore-mode="streamers"] .streamer-characters,
body[data-view="favorites"] .streamer-characters {
  grid-area: characters;
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.3;
  pointer-events: auto;
}

body[data-view="explore"][data-explore-mode="streamers"] .streamer-characters > b,
body[data-view="favorites"] .streamer-characters > b {
  flex: 0 0 auto;
  padding: 0;
  color: #737986;
  font-size: 9px;
  text-shadow: none;
}

body[data-view="explore"][data-explore-mode="streamers"] .streamer-character-list,
body[data-view="favorites"] .streamer-character-list {
  display: flex;
  flex-wrap: nowrap;
  gap: 3px;
  min-width: 0;
  overflow: hidden;
}

body[data-view="explore"][data-explore-mode="streamers"] .streamer-character-chip,
body[data-view="favorites"] .streamer-character-chip {
  flex: 0 0 auto;
  min-height: 18px;
  padding: 2px 6px;
  border: 1px solid #dedfe5;
  border-radius: 999px;
  background: #f5f6f8;
  color: var(--text);
  font-size: 9px;
  font-weight: 750;
  backdrop-filter: none;
}

body[data-view="explore"][data-explore-mode="streamers"] .streamer-character-empty,
body[data-view="favorites"] .streamer-character-empty {
  color: var(--muted);
  text-shadow: none;
}

/* One short tag line is enough in the dense directory grid. */
body[data-view="explore"][data-explore-mode="streamers"] .streamer-hashtags,
body[data-view="favorites"] .streamer-hashtags {
  grid-area: tags;
  display: block;
  min-width: 0;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  line-height: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-view="explore"][data-explore-mode="streamers"] .streamer-hashtags span,
body[data-view="favorites"] .streamer-hashtags span {
  margin-right: 5px;
  color: inherit;
  font-size: inherit;
  white-space: nowrap;
}

body[data-view="explore"][data-explore-mode="streamers"] .streamer-profile-tags,
body[data-view="favorites"] .streamer-profile-tags,
body[data-view="explore"][data-explore-mode="streamers"] .streamer-card > small,
body[data-view="favorites"] .streamer-card > small,
body[data-view="explore"][data-explore-mode="streamers"] .streamer-activity,
body[data-view="favorites"] .streamer-activity {
  display: none;
}

/* Upcoming start time overlays the lower-left of the square channel artwork so card
   height stays identical across live/upcoming/offline entries. */
body[data-view="explore"][data-explore-mode="streamers"] .favorite-scheduled,
body[data-view="favorites"] .favorite-scheduled {
  grid-area: media !important;
  align-self: end;
  justify-self: start;
  z-index: 6;
  max-width: calc(100% - 16px);
  margin: 0 0 8px 8px;
  padding: 4px 8px;
  overflow: hidden;
  border-radius: 5px;
  background: rgba(16, 17, 24, .78);
  color: #fff;
  font-size: 9px;
  font-weight: 750;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

/* Streamer cards are deliberately narrower than LIVE cards. At the common desktop
   width this produces a YouTube-Music-like library density while keeping each tile a
   little larger than the reference. */
@media (min-width: 1180px) and (max-width: 1599px) {
  body[data-view="explore"][data-explore-mode="streamers"] .streamer-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
  }

  body[data-view="favorites"] .streamer-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
  }
}

@media (min-width: 1600px) and (max-width: 2099px) {
  body[data-view="explore"][data-explore-mode="streamers"] .streamer-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
  }

  body[data-view="favorites"] .streamer-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 14px;
  }
}

@media (min-width: 2100px) {
  body[data-view="explore"][data-explore-mode="streamers"] .streamer-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 15px;
  }

  body[data-view="favorites"] .streamer-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 15px;
  }
}

@media (min-width: 900px) and (max-width: 1179px) {
  body[data-view="explore"][data-explore-mode="streamers"] .streamer-grid,
  body[data-view="favorites"] .streamer-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
  }
}

@media (min-width: 761px) and (max-width: 899px) {
  body[data-view="explore"][data-explore-mode="streamers"] .streamer-grid,
  body[data-view="favorites"] .streamer-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 11px;
  }
}

/* Character cards keep the compact treatment introduced earlier. */
body[data-view="characters"] .character-art {
  height: clamp(112px, 8vw, 150px);
}

body[data-view="characters"] .character-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-view="characters"] .character-counts {
  flex-wrap: nowrap;
  gap: 4px 10px;
  overflow: hidden;
}

body[data-view="characters"] .character-counts small {
  white-space: nowrap;
}

@media (min-width: 1500px) and (max-width: 2099px) {
  body[data-view="characters"] .character-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (min-width: 2100px) {
  body[data-view="characters"] .character-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body[data-view="explore"][data-explore-mode="streamers"] .streamer-grid,
  body[data-view="favorites"] .streamer-grid,
  body[data-view="characters"] .character-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  body[data-view="explore"][data-explore-mode="streamers"] .streamer-card,
  body[data-view="favorites"] .streamer-card {
    padding: 7px;
  }

  body[data-view="explore"][data-explore-mode="streamers"] .streamer-name,
  body[data-view="favorites"] .streamer-name {
    font-size: 12px;
  }

  body[data-view="explore"][data-explore-mode="streamers"] .favorite-scheduled,
  body[data-view="favorites"] .favorite-scheduled {
    margin: 0 0 7px 7px;
  }

  body[data-view="characters"] .character-art {
    height: 116px;
  }
}


/* Streamer name row keeps a 40px favorite column like LIVE title rows. */
/* Service badges share LIVE sizing but wrap on narrow directory tiles. */
body[data-view="explore"][data-explore-mode="streamers"] .streamer-card .watch-services,
body[data-view="favorites"] .streamer-card .watch-services {
  flex-wrap: wrap;
  max-width: calc(100% - 12px);
}
body[data-view="explore"][data-explore-mode="streamers"] .streamer-card .watch-service,
body[data-view="favorites"] .streamer-card .watch-service {
  min-height: 32px;
  padding: 0 8px;
  font-size: 11px;
}
