html {
    overflow-y: scroll;
}

.container {
    max-width: 890px;
    margin: 0 auto;
    padding: 20px;
    font-family: sans-serif;
}

/* タブメニュー */
.tabs {
    margin-bottom: 30px;
}

.tab-button {
    padding: 10px 20px;
    border: none;
    border-bottom: 2px solid transparent;
    background: #f0f0f0;
    cursor: pointer;
    margin-right: 5px;
    font-size: 14px;
}

a.tab-button {
    text-decoration: none;
    color: #000;
}

.tab-button.active {
    border-bottom: 2px solid #333;
    font-weight: bold;
    background: #ddd;
}

.tab-content {
    display: none;
}

/* ランキングリスト */
.ranking-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ranking-list li {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #ccc;
    gap: 15px; /* 余白追加 */
}

.icon-info-row {
    display: flex;
}

/* アイコン画像＋順位三角バッジ */
.icon-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
    flex-shrink: 0;
    padding-right: 10px;
}

.icon {
    width: 100px;
    height: 100px;
    border-radius: 0%;
    object-fit: cover;
}

/* 三角形バッジ */
.rank-badge {
    position: absolute;
    top: 0;
    left: 0;
    background-color: black;
    color: white;
    font-size: 0.75em;
    font-weight: bold;
    clip-path: polygon(0 0, 100% 0, 0 100%);
    width: 35px;
    height: 35px;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    line-height: 1;
    padding: 0;    
}

.rank-badge::after {
    content: attr(data-rank);
    transform: translate(3px, 3px);
    display: block;
}

/* 上位ランク色分け */
.rank-1 { background-color: gold; color: black; }
.rank-2 { background-color: silver; color: black; }
.rank-3 { background-color: #cd7f32; color: white; }

/* 左側：VTuber基本情報 */
.info {
    flex: 1;
    line-height: 1.4;
    min-width: 0;
    font-size: 14px;
}

.info a {
    text-decoration: none;
    color: #0066cc;
}

.info a:hover {
    text-decoration: underline;
}

.stats-block {
    margin-top: 20px;
}

.stat-line {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.label {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 13px;
    color: #fff;
    min-width: 100px;
    text-align: center;
    margin-right: 10px;
}

.label.green {
    background-color: #55ACEE;
}

.label.red {
    background-color: #5D8AC1;
}

.value {
    font-size: 13px;
    color: #222;
}

/* 右側：飲酒情報または配信情報 */
.extra-info {
    flex-basis: 40%;
    font-size: 0.9em;
    color: #444;
}

/* よく飲むお酒のリスト */
.drink-list {
    list-style: disc;
    padding-left: 1.2em;
    margin: 0;
}

.drink-list li {
    margin-bottom: 4px;
}

/* 最近の飲酒配信リスト */
.recent-streams {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.recent-streams li {
    margin-bottom: 6px;
}

.recent-streams a {
    color: #0066cc;
    text-decoration: none;
    font-size: 13px;
}

.recent-streams a:hover {
    text-decoration: underline;
}

.recent-streams small {
    display: block;
    color: #888;
    font-size: 0.85em;
    margin-top: 2px;
}

.group {
    color: #666;
    font-size: 14px;
}

/* 新着配信リスト */
.stream-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.stream-item {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #ccc;
    padding-bottom: 10px;
}

.stream-item .thumb {
    width: 160px;
    height: 90px;
    object-fit: cover;
    margin-right: 12px;
    border-radius: 4px;
}

.stream-info {
    flex: 1;
}

.stream-info .meta {
    font-size: 14px;
    color: #555;
    margin-bottom: 4px;
}

.stream-info .meta a {
    color: #0066cc;
    text-decoration: none;
}

.stream-info .meta a:hover {
    text-decoration: underline;
}

.stream-info .title {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 4px;
}

.stream-info .tags {
    font-size: 0.9em;
    color: #333;
    margin-bottom: 6px;
}

.stream-info .tags .guest-line {
    font-size: 13px;
    color: #333;
}

.stream-info .tags .guest-line a {
    color: #0066cc;
    text-decoration: none;
}

.stream-info .tags .guest-line a:hover {
    text-decoration: underline;
}

.stream-info .tags .alcohol-line {
    font-size: 13px;
    color: #333;
}

.stream-info .yt-link {
    font-size: 0.9em;
    color: #0066cc;
    text-decoration: none;
}

/* 詳しく見るボタン */
.toggle-detail-btn {
    background-color: #eee;
    border: none;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 13px;
    margin-top: 8px;
}

.detail-box {
    margin-top: 10px;
    padding: 10px;
    background-color: #f9f9f9;
    border-left: 3px solid #ccc;
    font-size: 0.9em;
}

/* ページネーション */
.pagination {
    margin-top: 20px;
    text-align: center;
}

.pagination a {
    display: inline-block;
    margin: 0 5px;
    padding: 6px 10px;
    text-decoration: none;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.pagination a.current {
    background-color: #333;
    color: #fff;
    font-weight: bold;
}

/* ランキング期間切り替えボタン */
.ranking-switch {
    margin: 15px 0;
}

.switch-btn {
    font-size: 14px;
    padding: 6px 12px;
    margin-right: 5px;
    cursor: pointer;
    border: 1px solid #aaa;
    background-color: #f0f0f0;
    border-radius: 10px;
}

a.switch-btn {
    text-decoration: none;
    color: #000;
}

.switch-btn.active {
    background-color: #333;
    color: #fff;
}

.amazon-item {
    display: flex;
    gap: 1em;
    align-items: flex-start;
    margin-bottom: 15px;
}

.amazon-image-link{
    width: 100px;                    /* ✅ 固定幅にする */
    display: flex;
    justify-content: center;         /* 画像を中央揃え */
    align-items: center;
    flex-shrink: 0;
}

.amazon-image-link img {
    width: auto;
    height: auto;
    max-width: 100px;
    max-height: 100px;
    border-radius: 4px;
    object-fit: contain; /* ✅ 画像が収まるように縮小表示 */
    display: block;
}

.amazon-item-text .brand {
    font-size: 11px;
    color: #555;
    margin-bottom: 2px;
}

.amazon-item-text .name a {
    font-size: 13px;
    color: #333;
    text-decoration: none;
    font-weight: bold;
}

.amazon-item-text .name a:hover {
    text-decoration: underline;
}

.ec-buttons {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ec-btn {
    display: flex;               /* ✅ Flexboxで配置 */
    justify-content: center;    /* ✅ 水平方向中央揃え */
    align-items: center;        /* ✅ 垂直方向中央揃え */
    min-width: 120px;
    padding: 6px 8px;
    border-radius: 4px;
    text-decoration: none;
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    background-color: gray;
    transition: background 0.2s ease;
    box-sizing: border-box;
    text-align: center;         /* 念のため */
    height: 34px;               /* ✅ 高さ固定（縦中央揃えの安定化） */
}

.ec-btn.amazon {
    background-color: #F79256;
}

.ec-btn.rakuten {
    background-color: #F76956;
}

.ec-btn.yahoo {
    background-color: #66A7FF;
}

.ec-btn:hover {
    opacity: 0.85;
}

.select-wrapper {
    position: relative;
    display: inline-block;
    max-width: 200px;
}

#group-filter {
    width: 100%;
    padding: 6px 30px 6px 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 0px;
    background-color: #fff;
    color: #333;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.select-wrapper::after {
    content: "▼";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #666;
    font-size: 10px;
}


@media screen and (max-width: 768px) {
  /* 共通の調整 */
  body {
    padding: 0 10px;
    font-size: 14px;
  }

  .container {
    padding: 0px;
  }

  .tabs {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 5px;
  }

  .tab-button {
    margin-bottom: 5px;
    flex: 1 1;
    text-align: center;
    padding: 7px 2px;
  }

  .ranking-switch {
    display: flex;
    flex-wrap: wrap;
  }

  .ranking-list li {
    display: block;
    flex-direction: column; /* モバイルで縦積みベースに */
  }

  .stats-block {
    margin-top: 10px;
}

  .stream-item {
    display: flex;
    flex-direction: column;
    align-items: center; /* 中央揃え */
  }

  /* サムネイル画像を横幅いっぱいに */
  .stream-item > a {
    width: 100%;
    max-width: 100%;
    display: block;
    text-align: center; /* 中の img を中央揃え */
    margin-bottom: 8px;
  }

  .stream-item .thumb {
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: cover;
    border-radius: 6px;
}

  .toggle-detail-btn {
    display: block;
    margin: 10px auto 5px;
  }

  .ranking-filter {
    margin-bottom: 10px;
    font-size: 14px;
  }

  .ranking-filter select {
    width: 100%;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #ccc;
  }

}