body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN",
    "Yu Gothic", Meiryo, sans-serif;
  background: #f7f7f7;
  color: #333;
  margin: 0;
  padding: 0;
}

.container {
  max-width: 1000px;
  margin: 40px auto;
  padding: 0 20px;
}

/*.main-sct-item {
  background: #fff;
  border: 1px solid #ddd;
}*/

.period {
  padding: 0;
}

.period-ttl {
  margin: 0;
  padding: 16px 20px;
  font-size: 22px;
  font-weight: 700;
  border-bottom: 1px solid #e5e5e5;
  background: #fafafa;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/*#period-released {
  font-size: 13px;
  font-weight: 400;
  color: #777;
}*/

.period-inner {
  padding: 20px;
}

.period-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.period-list li {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid #f0f0f0;
}

.period-list li:last-child {
  border-bottom: none;
}

.period-list input[type="radio"] {
  margin: 0;
}

.period-list label {
  min-width: 90px;
  font-weight: 700;
  cursor: pointer;
}

.period-date {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ランキング種類 */
.ranking-search {
  padding: 0;
}

.ranking-search-inner {
  padding: 20px;
}

.ranking-type-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 30px;
}

.ranking-type-list li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ranking-type-list input[type="radio"] {
  margin: 0;
}

.ranking-type-list label {
  min-width: auto;
  font-weight: 700;
  cursor: pointer;
}

.selectWrap {
  position: relative;
}

.selectWrap select {
  min-width: 110px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid #ccc;
  background: #fff;
  border-radius: 4px;
  font-size: 14px;
  outline: none;
}

.selectWrap select:focus {
  border-color: #666;
}

.range-separator {
  font-size: 18px;
  color: #666;
  padding: 0 4px;
}

.period-btn {
  margin: 20px 0 0;
  text-align: center;
}

.btn-update {
  min-width: 180px;
  height: 44px;
  border: none;
  background: #24a0ed;
  color: #fff;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.btn-update:hover {
  background: #24a0ed;
}
/* ============================================
   ランキングテーブル カードデザイン
============================================ */
.ranking-table-wrap {
  margin-top: 24px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, .08);
  overflow: hidden;
  border: none; /* 旧borderを無効化 */
}

table {
  width: 100%;
  border-collapse: collapse;
}

/* ── thead ── */
thead tr {
  background: linear-gradient(135deg, #2c3e6b 0%, #4a6fa5 100%);
}

thead th {
  background: transparent; /* グラデーションはtrに委譲 */
  border-bottom: none;
  padding: 14px 16px;
  text-align: left;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .06em;
  text-transform: uppercase;
}

thead th:first-child {
  width: 80px;
  text-align: center;
}

thead th:last-child {
  width: 140px;
  text-align: center;
}

/* ── tbody ── */
tbody td {
  border-top: 1px solid #f0f2f5;
  padding: 14px 16px;
  font-size: 14px;
  vertical-align: middle;
  color: #333;
}

tbody tr:nth-child(even) {
  background: #f8f9fc;
}

tbody tr:nth-child(odd) {
  background: #fff;
}

tbody tr:hover {
  background: #eef2f9;
  transition: background .15s ease;
}

/* ── 順位セル ── */
tbody td:first-child {
  text-align: center;
  font-weight: 700;
  font-size: 16px;
  color: #2c3e6b;
  width: 80px;
}

/* 1〜3位バッジ風 */
tbody tr:nth-child(1) td:first-child { color: #f0d005; font-size: 20px; font-weight:800; }
tbody tr:nth-child(2) td:first-child { color: #7a8fa6; font-size: 20px; font-weight:800; }
tbody tr:nth-child(3) td:first-child { color: #a0673a; font-size: 20px; font-weight:800; }

/* ── 曲名・アーティストリンク ── */
tbody td a {
  display: inline;
  position: static;
  color: #4a6fa5;
  text-decoration: none;
  font-weight: 600;
}

tbody td a:hover {
  color: #2c3e6b;
  text-decoration: underline;
}

/* ── YouTubeサムネイル列 ── */
thead th:last-child,
tbody td:last-child {
  width: 140px;
  text-align: center;
}

/* サムネイルホバーオーバーレイ（再定義） */
td a.youtube-link {
  display: inline-block;
  position: relative;
}

td a.youtube-link::after {
  content: "▶";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 16px;
  padding: 6px 10px;
  border-radius: 50%;
  opacity: 0;
  transition: opacity .2s;
}

td a.youtube-link:hover::after {
  opacity: 1;
}

td a.youtube-link:hover img {
  filter: brightness(0.72);
}

.youtube-thumb {
  width: 120px;
  height: 68px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  transition: filter .2s;
}

/* ============================================
   スマホ対応
============================================ */
@media screen and (max-width: 720px) {
  .ranking-table-wrap {
    border-radius: 12px;
    margin-top: 16px;
  }

  thead th {
    padding: 12px 10px;
    font-size: 11px;
  }

  tbody td {
    padding: 12px 10px;
    font-size: 13px;
  }


  thead th:last-child,
  tbody td:last-child {
    width: 100px;
  }
}

a {
  color: #0066cc;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.disabled-area {
  opacity: 0.45;
  pointer-events: none;
}

.youtube-thumb {
  width: 120px;
  height: 68px;
  /* 16:9 비율 */
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

.btn-update.is-loading {
  opacity: 0.6;
  cursor: wait;
}

.btn-update.is-loading::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  border: 2px solid #ffffff;
  border-top-color: transparent;
  border-radius: 50%;
  vertical-align: middle;
  animation: loading-spin 0.8s linear infinite;
}

/* ランキング種類 */
.ranking-type {
  margin-bottom: 24px;
  padding: 20px;
  border: 1px solid #ddd;
  background-color: #fff;
}

.ranking-type .period-ttl {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: bold;
}

.ranking-type-list {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.ranking-type-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 180px;
  padding: 12px 16px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #f8f8f8;
  cursor: pointer;
  transition: 0.2s;
}

.ranking-type-list label:hover {
  background-color: #eee;
}

.ranking-type-list input[type="radio"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #333;
}

/* 選択中のラベル */
.ranking-type-list label:has(input[type="radio"]:checked) {
  border-color: #333;
  background-color: #333;
  color: #fff;
  font-weight: bold;
}

@keyframes loading-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 768px) {
  .period-list li {
    align-items: flex-start;
    flex-direction: column;
  }

  .period-list label {
    min-width: auto;
  }

  .period-ttl {
    font-size: 18px;
  }

  .youtube-thumb {
    width: 90px;
    height: 50px;
  }

  .ranking-type-list {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .ranking-type-list {
    flex-direction: column;
  }

  .ranking-type-list label {
    width: 100%;
    box-sizing: border-box;
  }
}