/* ============================
   BowLink Ranking Page CSS
   ============================ */

/* Base & Dark Theme */
body {
  font-family: "Outfit","Noto Sans JP",sans-serif;
  background: #121212;
  margin: 0;
  padding: 0; /* paddingを調整 */
  text-align: center;
}
h1 {
  font-size: 24px;
  margin: 40px 10px 20px;
  color: #E6E6E6;
}
.source-info {
  text-align: right; 
  font-size: 12px; 
  color: #666; 
  max-width: 900px;
  margin: 5px auto 20px;
  padding-right: 20px; /* 右端の余白を確保 */
}

/* Table Structure */
.table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 10px; /* 左右に少し余白 */
}
.ranking-table {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  border-collapse: collapse;
  background: #1e1e1e; /* ダークテーマの背景 */
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  min-width: 700px; /* PC/タブレットで横スクロールを発生させる最小幅 */
}
.ranking-table th, .ranking-table td {
  padding: 12px 10px;
  border-bottom: 1px solid #333; /* 暗い罫線 */
  font-size: 14px;
  white-space: nowrap;
  vertical-align: middle;
  color: #E0E0E0; /* 明るい文字色 */
}
.ranking-table th {
  background-color: #333; /* ヘッダーを濃く */
  font-weight: bold;
  color: #fff;
}
.ranking-table td img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #444; /* ダークテーマに合わせた枠線 */
}
.player-name {
  font-weight: bold;
  color: #4db6ff; /* BowLinkのメインカラー（青）を適用 */
}
.rank-col { text-align: center; }

/* Medal Colors (Dark Theme) */
.ranking-table tbody tr.rank-1 { background-color: rgba(255, 215, 0, 0.12); } /* 金の薄い透過 */
.ranking-table tbody tr.rank-1 td { color: #ffd700; font-weight: bold; }

.ranking-table tbody tr.rank-2 { background-color: rgba(192, 192, 192, 0.1); } /* 銀の薄い透過 */
.ranking-table tbody tr.rank-2 td { color: #c0c0c0; font-weight: bold; }

.ranking-table tbody tr.rank-3 { background-color: rgba(205, 127, 50, 0.1); } /* 銅の薄い透過 */
.ranking-table tbody tr.rank-3 td { color: #cd7f32; font-weight: bold; }

/* 4位以下のゼブラ柄 */
.ranking-table tbody tr:nth-child(n+4):nth-child(even) { background-color: #242424; }
.ranking-table tbody tr:nth-child(n+4):nth-child(odd) { background-color: #1e1e1e; }

/* ============================
   Mobile View: 重要な4列のみ表示
   ============================ */
@media (max-width: 720px) {
  .table-container {
    padding: 0 5px; /* スマホでさらに余白を詰める */
  }
  .ranking-table {
    min-width: unset; /* 固定幅を解除 */
    /* スマホで横スクロールしないように幅を100%に近づける */
    max-width: 100%;
  }

  /* スマホで非表示にする列 (img-col/hidden-mobile クラスを持つ要素) */
  .hidden-mobile {
    display: none !important;
  }
  
  /* スマホでのみ表示される主要な列幅を調整 */
  .ranking-table th, .ranking-table td {
    padding: 10px 4px; /* 余白をさらに詰める */
    font-size: 13px;
  }
  .player-name {
    font-size: 14px;
  }
  /* 主要な列の幅をパーセンテージで指定して、バランスを整える */
  .rank-col { width: 10%; }
  .name-col { width: 40%; }
  .img-col { display: none; }
}