/* =========================================
   全体・テーブルコンテナ
========================================= */
.ps-type-table-wrapper {
  overflow-y: auto;
  overflow-x: auto;
  max-height: 650px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  background: #ffffff;
  margin-top: 25px;
  border: 1px solid #e2e8f0;
}

/* スクロールバーのカスタマイズ（見栄え良く） */
.ps-type-table-wrapper::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.ps-type-table-wrapper::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}
.ps-type-table-wrapper::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
.ps-type-table-wrapper::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.ps-type-table {
  border-collapse: collapse;
  width: 100%;
  font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  color: #334155;
  min-width: 1250px;
}

/* =========================================
   セル共通・配置設定
========================================= */
.ps-type-table th,
.ps-type-table td {
  padding: 8px 6px; /* 縦幅を少し詰めて一覧性を向上 */
  text-align: center;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.85rem;
}

/* 列の間のうっすらとした縦線 */
.ps-type-table td {
  border-right: 1px dashed #f1f5f9;
}
.ps-type-table th:last-child,
.ps-type-table td:last-child {
  border-right: none;
}

/* =========================================
   行のホバーエフェクト（軽量な背景色変更のみ）
========================================= */
.ps-type-table tbody tr:hover td {
  background-color: #f8fafc;
}

/* =========================================
   ヘッダー固定 & 装飾
========================================= */
.ps-type-table thead th {
  position: sticky;
  top: 0;
  background-color: #1e293b;
  color: #f8fafc;
  z-index: 10;
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  white-space: nowrap;
  padding: 12px 6px;
}

.ps-stat-col {
  background-color: #334155 !important;
  min-width: 85px;
}

/* =========================================
   左端列（No.とポケモン名）の固定
========================================= */
/* --- 1列目: No. --- */
.ps-type-table th:first-child,
.ps-type-table td.ps-no-col {
  position: sticky;
  left: 0;
  z-index: 6;
  min-width: 40px;
  width: 40px;
  background-color: #ffffff;
  color: #94a3b8;
  font-family: monospace;
}

/* --- 2列目: ポケモン名 --- */
.ps-type-table th:nth-child(2),
.ps-type-table td.ps-sticky-col {
  position: sticky;
  left: 40px; /* 1列目の幅に合わせる */
  z-index: 5;
  min-width: 140px;
  text-align: left;
  padding-left: 12px;
  font-weight: bold;
  background-color: #ffffff;
  border-right: 2px solid #e2e8f0; /* 少し控えめな境界線に */
}

/* 固定列のホバー時背景色同期 */
.ps-type-table tbody tr:hover td.ps-no-col,
.ps-type-table tbody tr:hover td.ps-sticky-col {
  background-color: #f8fafc;
}

/* ヘッダー部分のレイヤー調整 */
.ps-type-table thead th:first-child {
  z-index: 25;
  background-color: #1e293b;
}
.ps-type-table thead th:nth-child(2) {
  z-index: 20;
  background-color: #1e293b;
  border-right: 2px solid #0f172a;
}

/* =========================================
   相性・補完率の装飾（バッジ化）
========================================= */
.ps-badge-cell {
  width: 32px;
}

/* バッジの基本スタイル */
.ps-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-weight: bold;
  font-size: 0.8rem;
  margin: 0 auto;
}

/* 各倍率のカラー設定（少し彩度を抑えて目に優しく） */
.m-4 { background-color: #f59e0b; color: #fff; box-shadow: 0 1px 3px rgba(245,158,11,0.3); } 
.m-2 { background-color: #ef4444; color: #fff; box-shadow: 0 1px 3px rgba(239,68,68,0.3); } 
.m-1 { background-color: transparent; color: #94a3b8; font-weight: normal; } 
.m-0-5 { background-color: #10b981; color: #fff; } 
.m-0-25 { background-color: #059669; color: #fff; } 
.m-0 { background-color: #3b82f6; color: #fff; }

.ps-stat-cell { white-space: nowrap; }
.ps-stat-num { font-size: 1rem; font-weight: 700; color: #334155; }
.ps-stat-rate { font-size: 0.75rem; color: #64748b; margin-left: 4px; }

/* =========================================
   検索フォーム
========================================= */
#ps-search-form {
  display: flex; gap: 15px; flex-wrap: wrap; align-items: center;
  background: #f8fafc; padding: 20px; border-radius: 8px;
  border: 1px solid #e2e8f0;
}
#ps-search-form label {
  font-size: 0.9rem; font-weight: bold; color: #475569;
  display: flex; align-items: center; gap: 8px;
}
#ps-search-form select {
  padding: 8px 12px; font-size: 0.95rem; border: 1px solid #cbd5e1;
  border-radius: 6px; min-width: 200px; outline: none;
  background-color: #fff; transition: border-color 0.2s;
}
#ps-search-form select:focus {
  border-color: #3b82f6;
}
#ps-search-form button {
  padding: 10px 20px; font-weight: bold; color: #fff;
  background: #3b82f6; border: none; border-radius: 6px; cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}
#ps-search-form button:hover {
  background: #2563eb;
}
#ps-search-form button:active {
  transform: translateY(1px);
}

#ps-loader { display: inline-flex; align-items: center; gap: 8px; color: #64748b; font-size: 0.9rem; }
.spinner {
  width: 18px; height: 18px; border: 2px solid #e2e8f0;
  border-top-color: #3b82f6; border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }