
/* レイアウト */
#layout {
  display: grid;
  grid-template-columns: 1fr 360px; /* メイン / 右サイド */
  gap: 16px;
}
@media (max-width: 920px) {
  #layout { grid-template-columns: 1fr; }
}

/* 右サイド */
.sidebar {
  position: sticky;
  top: 12px;
  align-self: start;
  max-height: calc(100dvh - 24px);
  overflow: auto;
  padding: 12px;
  border: 1px solid #333;
  border-radius: 12px;
}

/* 見出しとボタン */
.sidebar-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 8px;
}
.btn-primary, .btn-secondary, .btn-ghost {
  font: inherit; padding: 6px 10px; border-radius: 8px; border: 1px solid #333; cursor: pointer;
}
.btn-primary { 
  background-color: #6AC990;
  color: #ffffff;
  border: none;
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.6s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);}
.btn-secondary { background: #111; }
.btn-ghost { background: transparent; }

.sidebar button:hover{
  background-color: #5a5;
  transform: translateY(5px);
}

.search-form {
  text-align: center;
}

.search-box {
  flex: 1;
  padding: 10px 14px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  outline: none;
  transition: all 0.2s ease;
}
/* 配信カード */
.streaming-card {
  display: grid; grid-template-columns: 48px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid #222;
}
.channel-icon, .vtuber-icon { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }

/* VTuber一覧グリッド */
.vtuber-list {
  display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.vtuber-item { display: grid; gap: 6px; align-content: start; padding: 10px; border: 1px solid #333; border-radius: 10px; }

/* Noise（サイドバー内での開閉） */
.noise-panel {
  margin-top: 10px;
  overflow: clip;
  transition: grid-template-rows .2s ease, opacity .2s ease;
}

/* アコーディオン風のスムーズ開閉（CSSだけでやるならdetailsも可） */
.noise-panel[hidden] {
  display: block; /* アニメのためblockにし、hiddenで不可視に */
  height: 0; opacity: 0; padding: 0; border: 0; margin: 0;
}
.noise-panel.is-open {
  background-color: #fff;
  height: auto; opacity: 1; padding-top: 10px;
}

.noise-detail {
  border-radius: 3px;
  padding: 0.2rem;
  font-size: 0.6rem;
  font-style: italic;
  background-color: #ddd;
  display: block;
  text-align: right;
  margin-top: 4px;}

/* --- デスクトップでもサイドバー内ドロワーにする --- */
@media (min-width: 921px) {
  .sidebar {
    position: sticky;
    position: relative;   /* 追加 */
    overflow: visible;    /* 追加（または :has(...) で条件付き） */
  }
  .noise-panel {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    max-height: 70vh;
    transform: translateY(100%); /* 初期は隠す */
    background: #111;
    border-top: 1px solid #333;
    border-radius: 12px 12px 0 0;
    padding: 12px;
    z-index: 20;
    box-shadow: 0 -10px 30px rgba(0,0,0,.4);
    transition: transform .25s ease;
  }
  .noise-panel.is-open { transform: translateY(0); }
}
/* hidden は確実に消す（競合対策） */
/*
 * #noise-panel[hidden] { display: none !important; }
 */

/* アクセシビリティ */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

