@charset "utf-8";

/* =========================================
   チャンネル一覧用スタイル
   ========================================= */

.channel-card {
  background-color: var(--bg-card); border: 2px solid var(--color-border); border-radius: 20px;
  transition: transform 0.2s, border-color 0.2s; position: relative;
  isolation: isolate; width: 100%; box-sizing: border-box; overflow: visible; 
}
.channel-card:hover { transform: translateY(-5px); border-color: var(--color-border-hover); }
.channel-card a { text-decoration: none; color: inherit; display: flex; height: 100%; box-sizing: border-box; }

.title-text {
  font-size: 16px; font-weight: bold; margin: 0 0 10px 0; width: 100%;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  line-height: 1.3; height: 2.6em;
}

.last-date, .info-row { font-size: 13px; color: #bbb; width: 100%; }

/* =========================================
   Grid View (カード表示 - 8列基準)
   Base: 1400px以上
   ========================================= */
#displayArea:not(.list-view) ul {
  display: grid; grid-template-columns: repeat(8, 1fr);
  gap: 15px; list-style: none; padding: 20px !important;
}

#displayArea:not(.list-view) .channel-card a { flex-direction: column; align-items: center; padding: 10px; }
#displayArea:not(.list-view) .avatar-container { width: 90px; height: 90px; margin-top: 5px; margin-bottom: 20px; }
#displayArea:not(.list-view) .title-text { text-align: center; }
#displayArea:not(.list-view) .live-current-title {
  font-size: 12px; color: #bbb; text-align: center; display: -webkit-box;
  -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  line-height: 1.4; height: 2.8em; margin-bottom: 5px;
}
#displayArea:not(.list-view) .viewer-count,
#displayArea:not(.list-view) .member-only-text,
#displayArea:not(.list-view) .last-date,
#displayArea:not(.list-view) .info-row { text-align: center; }

/* =========================================
   List View (リスト表示 - 4列基準)
   ========================================= */
.list-view ul {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 15px; list-style: none; padding: 15px !important;
}

.list-view .channel-card a { flex-direction: row; align-items: center; padding: 12px 15px; }
.list-view .avatar-container { width: 65px; height: 65px; flex-shrink: 0; margin: 0 20px 0 0; }
.list-view .info-wrapper { display: flex; flex-direction: column; justify-content: center; min-width: 0; flex-grow: 1; }
.list-view .title-text, .list-view .live-current-title, .list-view .viewer-count, 
.list-view .member-only-text, .list-view .last-date, .list-view .info-row { text-align: left !important; }
.list-view .title-text { height: auto; max-height: 2.6em; margin-bottom: 2px; }
.list-view .live-current-title {
  font-size: 13px; color: #aaa; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; height: 2.8em;
  white-space: normal !important; margin-bottom: 2px;
}

.channel-card .fav-btn {
  position: absolute; top: 10px; right: 10px;
  background: #252525; border-radius: 50%;
  color: #ccc; z-index: 10;
}

/* =========================================
   レスポンシブ調整
   ========================================= */

@media (max-width: 1200px) { 
  #displayArea:not(.list-view) ul { grid-template-columns: repeat(6, 1fr); }
  .list-view ul { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1000px) { 
  #displayArea:not(.list-view) ul { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 768px) { 
  #displayArea:not(.list-view) ul { grid-template-columns: repeat(3, 1fr); }
  .list-view ul { grid-template-columns: 1fr; } 
}

@media (max-width: 580px) { 
  #displayArea:not(.list-view) ul { grid-template-columns: repeat(2, 1fr); }
  #displayArea:not(.list-view) .avatar-container { width: 90px; height: 90px; }
}

@media (max-width: 450px) {
  #displayArea:not(.list-view) ul { grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 10px !important; }
  #displayArea:not(.list-view) .channel-card a { padding: 8px; }
  #displayArea:not(.list-view) .avatar-container { width: 65px; height: 65px; margin-bottom: 8px; }
  #displayArea:not(.list-view) .title-text { font-size: 13px; margin-bottom: 4px; height: 2.8em; }
  #displayArea:not(.list-view) .live-current-title { font-size: 11px; line-height: 1.3; }
  #displayArea:not(.list-view) .info-row, #displayArea:not(.list-view) .last-date { font-size: 11px; }
  .list-view .channel-card a { padding: 8px 10px; }
  .list-view .avatar-container { width: 50px; height: 50px; margin-right: 12px; }
  .list-view .title-text { font-size: 14px; }
}