@charset "utf-8";

/* =========================================
   1. 共通変数定義 (:root)
   ========================================= */
:root {
  --bg-color: #1a1a1a;
  --bg-card: #252525;
  --text-main: #e0e0e0;
  --text-sub: #aaa;
  --color-primary: #8ab4f8;
  --color-accent: #ff4081;
  --color-border: #444;
  --color-border-hover: #666;
}

/* =========================================
   2. 共通: 基本設定 (Base)
   ========================================= */
body { 
  background-color: var(--bg-color); 
  color: var(--text-main); 
  font-family: 'Helvetica Neue', Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif; 
  margin: 0; 
  padding: 40px 20px; 
  display: flex; 
  justify-content: center;
}

.container { 
  max-width: 1650px; 
  width: 100%; 
}

h1 {
  text-align: center;
  font-size: 2rem; 
  margin: 20px 0 40px; 
  width: 100%;
  display: block;
}

.section-title { 
  font-size: 1.5rem; 
  margin: 20px 0 20px; 
  padding-left: 10px; 
  border-left: 5px solid var(--color-primary); 
  color: #fff; 
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-divider { 
  border: 0; 
  height: 1px; 
  background: #333; 
  margin: 10px 0; 
}

.no-data-msg { 
  text-align: center; 
  color: #888; 
  margin: 20px 0; 
}

.date-section { margin-bottom: 5px; }

.date-divider { 
  display: flex; 
  align-items: center; 
  font-size: 1.25rem; 
  color: var(--color-primary); 
  margin-bottom: 10px; 
  font-weight: bold; 
}

.date-divider::after { 
  content: ""; 
  flex-grow: 1; 
  height: 1px; 
  background: #333; 
  margin-left: 20px; 
}

/* =========================================
   3. 共通: ヘッダー (Header)
   ========================================= */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between; 
  padding: 10px 20px;
  background-color: var(--bg-color); 
  gap: 20px;
}
.header-left, .header-right { flex-shrink: 0; }
.title-logo { height: 60px; width: auto; display: block; }
.header-center {
  flex-grow: 1; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.header-page-title { margin: 0; font-size: 1.5rem; color: #ffffff; font-weight: bold; }

.site-summary {
  display: inline-flex; align-items: center; gap: 12px; 
  background: var(--bg-card); padding: 8px 16px; border-radius: 12px; border: 1px solid #333;
}
.summary-item { display: flex; flex-direction: column; align-items: center; min-width: 55px; }
.summary-item:not(:last-child) { border-right: 1px solid #444; }
.summary-label { font-size: 12px; color: #888; font-weight: bold; margin-bottom: 2px; text-align: center; }
.summary-value { font-size: 16px; font-weight: bold; color: #fff; text-align: center; }
.summary-value.live-color { color: #ff4d4f; }
.summary-value.soon-color { color: #ffa940; }
.summary-value.update-time { font-size: 14px; color: #aaa; }

/* =========================================
   4. 共通: フッター (Footer)
   ========================================= */
.root-footer { 
  margin-top: 60px; padding: 40px 20px; border-top: 1px solid #333; text-align: center; 
}
.footer-content { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.sns-links a { color: #fff; text-decoration: none; display: flex; align-items: center; gap: 8px; font-weight: bold; font-size: 14px; }
.x-icon { width: 16px; height: 16px; fill: currentColor; }
.free-comment { font-size: 13px; color: #ccc; margin: 5px 0; }
.disclaimer { font-size: 11px; color: #666; max-width: 600px; margin: 0; line-height: 1.5; }
.copyright { font-size: 12px; margin-top: 10px; color: #888; }
.important-link { color: var(--color-primary); text-decoration: underline; word-break: break-all; }

/* =========================================
   5. 共通: ナビゲーション (Navigation)
   ========================================= */
.site-navigation {
  box-sizing: border-box; margin: 20px auto; background: rgba(30, 30, 35, 0.8);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px); border-radius: 12px; padding: 12px 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.nav-container { display: flex; flex-direction: row; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap; }
.nav-link {
  display: inline-flex; align-items: center; padding: 8px 16px; border-radius: 8px;
  background: rgba(255, 255, 255, 0.05); color: #bbb; text-decoration: none;
  font-size: 14px; font-weight: 500; transition: all 0.2s ease; border: 1px solid transparent; white-space: normal; text-align: center;
}
.nav-link.active { background: var(--color-primary); color: #1a1a1a; font-weight: bold; }

.breadcrumb-nav {
  max-width: 100%; margin: 0 auto 10px; padding: 0 10px; font-size: 14px; color: #aaa;
}
.breadcrumb-list {
  list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; align-items: center;
}
.breadcrumb-item { display: inline-flex; align-items: center; }
.breadcrumb-item:not(:last-child)::after {
  content: '›'; margin: 0 8px; color: #666; font-size: 16px;
}
.breadcrumb-item a { color: var(--color-primary); text-decoration: none; transition: color 0.2s; }
.breadcrumb-item a:hover { text-decoration: underline; color: #fff; }
.breadcrumb-item.active { color: #eee; font-weight: bold; }

/* =========================================
   6. 共通: コントロール (Controls / Search / Filters)
   ========================================= */
.controls { display: flex; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.controls-row-top { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 5px; width: 100%; }
.expanded-search { flex-grow: 1; min-width: 200px; }
.bottom-filters { display: flex; flex-wrap: wrap; gap: 10px; }
.search-box { padding: 12px 20px; border-radius: 25px; border: 1px solid var(--color-border); background: var(--bg-card); color: #fff; flex-grow: 1; outline: none; -webkit-appearance: none; appearance: none;}
.filter-tag {
  background-color: #333; color: #ddd; border: 1px solid #555; border-radius: 20px; 
  padding: 6px 14px; cursor: pointer; font-size: 0.9rem; transition: all 0.2s ease;
}
.filter-tag:hover { background-color: var(--color-border); }
.filter-tag.active { background-color: #e50914; color: #fff; border-color: #e50914; font-weight: bold; }

#favFilterBtn {
  margin-left: 10px; border: 1px solid var(--color-accent); background: transparent; color: var(--color-accent);
  padding: 5px 14px; border-radius: 20px; cursor: pointer; transition: all 0.2s ease;
}
#favFilterBtn:hover { background: rgba(255, 64, 129, 0.1); }
#noSearchResults {
  display: none; text-align: center; padding: 40px 20px; color: #aaa;
  background-color: rgba(255, 255, 255, 0.05); border-radius: 8px; margin-top: 20px;
}

.view-switcher {
  display: flex; justify-content: flex-end; align-items: center; gap: 10px;
}
.view-switcher button { 
  padding: 8px 16px; cursor: pointer; background: #333; color: #fff; border: none; border-radius: 6px; 
  font-weight: bold; font-size: 0.8rem; transition: background 0.2s; 
}
.view-switcher button.active { background: var(--color-primary); color: #000; }

/* =========================================
   7. 共通: 動画カード & グリッドシステム (Base: Desktop)
   ========================================= */
.video-flex-row { 
  display: flex; 
  flex-wrap: wrap; 
  gap: 10px; 
}

.video-card-vertical {
  background-color: var(--bg-card); border: 2px solid var(--color-border); border-radius: 12px; 
  overflow: visible; position: relative; transition: transform 0.2s ease, border-color 0.2s;
  display: flex; flex-direction: column; box-sizing: border-box;
  width: calc((100% - 60px) / 7);
  min-width: 160px; 
}
.video-card-vertical:hover { transform: translateY(-4px); border-color: var(--color-border-hover); z-index: 2000;}

.video-link-area { text-decoration: none; color: inherit; display: block; flex-grow: 1; }

.thumbnail-container {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  background-color: #000; border-radius: 12px 12px 0 0; overflow: hidden;
  transform: translateZ(0); 
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  mask-image: radial-gradient(white, black);
}
.video-thumbnail { width: 100%; height: 100%; object-fit: cover; }

.video-info-compact { padding: 12px; flex-grow: 1; }
.video-meta-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }

.video-title-compact {
  font-size: 14px; margin: 0; line-height: 1.5; color: #eee;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.time-badge { display: inline-block; font-size: 13px; padding: 2px 8px; border-radius: 4px; background: #444; color: #ddd; }
.viewer-count-text { font-size: 13px; color: #ff4d4f; font-weight: bold; }
.member-status-text { font-size: 13px; color: #2ecc71; font-weight: bold; white-space: nowrap; }

.video-channel-row { padding: 10px 12px; border-top: 1px solid rgba(255,255,255,0.05); }
.channel-link-compact { display: flex; align-items: center; text-decoration: none; color: #aaa; font-size: 12px; }
.channel-link-compact:hover { color: #fff; }
.channel-icon-mini { width: 24px; height: 24px; border-radius: 50%; margin-right: 10px; }
.channel-name-mini { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* =========================================
   8. 共通: バッジ & ステータス
   ========================================= */
.avatar { border-radius: 50%; border: 3px solid #333; object-fit: cover; width: 100%; height: 100%; }

.is-live-card { border-color: #ff4d4f !important; box-shadow: 0 0 12px rgba(255, 77, 79, 0.3); animation: pulse-shadow-red 2s infinite ease-in-out; }
.is-member-card { border-color: #2ecc71 !important; box-shadow: 0 0 12px rgba(46, 204, 113, 0.3); animation: pulse-shadow-green 2s infinite ease-in-out; }
.is-member-card .video-thumbnail { filter: brightness(0.6) saturate(0.8); transition: filter 0.3s ease; }
.is-member-card:hover .video-thumbnail { filter: brightness(0.8) saturate(1.0); }

.live-badge-top-left, .member-badge-top-left, .upcoming-badge-top-left {
  position: absolute; top: -6px; left: -6px; padding: 5px 10px; border-radius: 6px; 
  z-index: 999; box-shadow: 0 2px 8px rgba(0,0,0,0.5); pointer-events: none;
}
.live-badge-top-left { background-color: #ff0000 !important; color: white !important; font-size: 16px; font-weight: bold; animation: pulse-opacity 2s infinite ease-in-out; }
.member-badge-top-left { background-color: #2ecc71 !important; color: white !important; font-size: 16px; font-weight: bold; animation: pulse-opacity 2s infinite ease-in-out; }
.upcoming-badge-top-left { background: rgba(50, 50, 50, 0.9); color: #ddd; font-size: 12px; font-weight: bold; border: 1px solid #555; text-transform: uppercase; letter-spacing: 0.5px; }

.viewer-count { font-size: 14px; font-weight: bold; color: #ff4d4f; }
.member-only-text { color: #2ecc71 !important; font-weight: bold; }

/* =========================================
   9. 共通: 推しボタン (Fav Button)
   ========================================= */
.fav-btn {
  background: transparent; border: none; cursor: pointer; 
  display: flex; align-items: center; justify-content: center; color: #ccc;
  transition: all 0.2s ease; z-index: 10;
}
.fav-btn:hover { transform: scale(1.1); color: #fff; }
.fav-btn.is-active { color: var(--color-accent); }
.fav-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
.fav-btn.is-active svg { fill: var(--color-accent); stroke: none; animation: popHeart 0.3s cubic-bezier(0.17, 0.89, 0.32, 1.49); }

.video-card-vertical .fav-btn {
  background: var(--bg-card); border-radius: 50%;
}
.video-card-vertical .list-view-fav { 
  margin-left: auto; background: transparent; width: 24px; height: 24px; padding: 0; 
}
.video-card-vertical .list-view-fav:hover { 
  background-color: rgba(255,255,255,0.1); border-radius: 50%; 
}

/* =========================================
   10. 共通: アニメーション (Keyframes)
   ========================================= */
@keyframes pulse-opacity {
  0% { opacity: 1; } 50% { opacity: 0.6; } 100% { opacity: 1; }
}
@keyframes pulse-shadow-red {
  0% { box-shadow: 0 0 8px rgba(255, 77, 79, 0.3); } 50% { box-shadow: 0 0 18px rgba(255, 77, 79, 0.6); } 100% { box-shadow: 0 0 8px rgba(255, 77, 79, 0.3); }
}
@keyframes pulse-shadow-green {
  0% { box-shadow: 0 0 8px rgba(46, 204, 113, 0.3); } 50% { box-shadow: 0 0 18px rgba(46, 204, 113, 0.6); } 100% { box-shadow: 0 0 8px rgba(46, 204, 113, 0.3); }
}
@keyframes popHeart {
  0% { transform: scale(1); } 50% { transform: scale(1.4); } 100% { transform: scale(1); }
}

/* =========================================
   11. ツールチップ（フキダシ）設定
   ========================================= */
.card-tooltip {
  visibility: hidden; opacity: 0; position: absolute;
  top: auto; bottom: 10px; left: 50%; transform: translateX(-50%);
  margin: 0; background-color: #383838; color: #f0f0f0; border: 1px solid #555;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.6); width: max-content; max-width: 240px;
  padding: 10px 14px; font-size: 0.8rem; line-height: 1.5; border-radius: 6px;
  z-index: 1000; pointer-events: none; white-space: normal;
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}

.video-card-vertical:hover .card-tooltip {
  visibility: visible; opacity: 1; transform: translateX(-50%) translateY(-5px);
}

/* =========================================
   12. 共通: Back to Top
   ========================================= */
#common-back-to-top {
  position: fixed; bottom: 25px; right: 25px; width: 55px; height: 55px;
  background-color: #333; color: #fff; border: none; border-radius: 50%;     
  cursor: pointer; box-shadow: 0 4px 6px rgba(0,0,0,0.3); z-index: 1000;
  opacity: 0; visibility: hidden; transform: translateY(10px); transition: all 0.3s ease;
  display: flex; align-items: center; justify-content: center;
}
#common-back-to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
#common-back-to-top:hover { background-color: #555; transform: translateY(-3px); box-shadow: 0 6px 8px rgba(0,0,0,0.4); }


/* ==========================================================
   13. レスポンシブ設定一括定義 (Responsive Design Consolidation)
   ========================================================== */
@media (max-width: 1400px) {
  .video-card-vertical {
   width: calc((100% - 40px) / 5);
   min-width: 0;
  }
}

@media (max-width: 1000px) {
  .video-card-vertical {
   width: calc((100% - 30px) / 4);
   min-width: 0;
  }
}

@media (max-width: 768px) {
  .site-header { flex-wrap: wrap; justify-content: center; }
  .header-center { order: 3; width: 100%; margin-top: 10px; min-width: 0;}
  .site-navigation { width: calc(100% - 20px); padding: 10px; margin: 10px auto; }
  .nav-container { gap: 6px; }
  .nav-link { padding: 6px 12px; font-size: 13px; min-width: 80px; justify-content: center; }
  .breadcrumb-nav { font-size: 12px; }
  .controls { flex-direction: column; align-items: stretch; }
  .search-box { width: 100%; box-sizing: border-box; }
  .quick-filters { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-start; }
  .filter-tag { flex: 0 1 auto; width: auto; white-space: nowrap; }
  #favFilterBtn { margin-left: 0; align-self: flex-start; }
  .view-switcher { justify-content: flex-start; margin-bottom: 10px; }
  .video-card-vertical {
   width: calc((100% - 20px) / 3);
   min-width: 0;
  }
  .video-title-compact { font-size: 12px; margin: 0; line-height: 1.5; color: #eee; }
  .channel-link-compact { font-size: 10px; }
  .channel-icon-mini { width: 18px; height: 18px; margin-right: 4px; }
  .card-tooltip { display: none !important; }
  #common-back-to-top { width: 50px; height: 50px; bottom: 25px; right: 25px; }
}

@media (max-width: 580px) {
  .video-card-vertical {
   width: calc((100% - 10px) / 2);
   min-width: 0;
  }
}

@media (max-width: 450px) {
  .video-card-vertical { 
    width: calc((100% - 10px) / 2); 
    min-width: 0; 
  }
  .video-info-compact { padding: 8px; }
  .time-badge { font-size: 10px; padding: 2px 5px; }
  .viewer-count-text, .member-status-text { font-size: 10px; }
  .video-meta-row { gap: 4px; margin-bottom: 4px; }
  .video-channel-row { padding: 6px 8px; }
  .channel-link-compact { font-size: 10px; }
  .fav-btn svg { width: 15px; height: 15px; }
  .video-card-vertical .list-view-fav { width: 20px; height: 20px; }
}