/* ==========================================================================
   Tier List App Modern Style
   ========================================================================== */

#filter-app {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #1e293b;
  max-width: 1200px;

  padding: 5px;
}

/* --- フィルターアコーディオン (折りたたみ) --- */
.filter-accordion {
  background: #f3f4f6; /* 薄いウォームグレー */
  border: 1px solid #d1d5db;
  border-radius: 12px;
  margin-bottom: 24px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.filter-summary {
  padding: 12px 20px;
  background: #e2e8f0; /* ソフトなブルーグレー */
  color: #334155;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease;
}

.filter-summary:hover {
  background: #cbd5e1;
}

.filter-content {
  padding: 5px;
  background: #f8fafc;
  border-top: 1px solid #d1d5db;
}

.filter-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 5px;
}

/* フィルター各グループ */
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  background: #e2e8f0; /* ソフトなブルーグレー */
  border-radius: 8px;
  border: 1px solid #cbd5e1;

}

/* 表示フォルダ専用グループ（全幅表示） */
.filter-group-folder {
  grid-column: 1 / -1;
  background: #e0f2fe; /* 淡いライトブルー */
  border-color: #bae6fd;
}

.filter-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.input-range-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-input-text,
.filter-input-num {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: #0f172a;
  padding: 6px 10px;
  font-size: 0.85rem;
  width: 100%;
  max-width: 100px;
  box-sizing: border-box;
}

.filter-input-text:focus,
.filter-input-num:focus {
  outline: none;
  border-color: #0284c7;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.2);
}

.range-separator {
  color: #64748b;
  font-size: 0.85rem;
  font-weight: bold;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.btn-toggle {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-toggle:hover {
  background: #f1f5f9;
}

.btn-toggle.active {
  background: #0284c7;
  border-color: #0369a1;
  color: #ffffff;
}

/* リセットボタン */
.filter-actions {
  margin-top: 6px;
  display: flex;
  justify-content: flex-end;
}

.btn-reset {
  background: #ffe4e6;
  border: 1px solid #fca5a5;
  color: #be123c;
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(225, 29, 72, 0.1);
  transition: all 0.2s ease;
}

.btn-reset:hover {
  background: #e11d48;
  color: #ffffff;
  box-shadow: 0 4px 8px rgba(225, 29, 72, 0.25);
}

/* --- Tier 表示セクション --- */
.tier-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 20px;
}

.tier-card {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
  width: fit-content;
  max-width: 100%;
  box-sizing: border-box;
}

.tier-card-header {
  padding: 5px 5px;
  display: flex;
  align-items: center;
}

.tier-1 .tier-card-header { background: linear-gradient(90deg, #fee2e2 0%, #ffffff 100%); border-left: 6px solid #ef4444; }
.tier-2 .tier-card-header { background: linear-gradient(90deg, #ffedd5 0%, #ffffff 100%); border-left: 6px solid #f97316; }
.tier-3 .tier-card-header { background: linear-gradient(90deg, #c3feda 0%, #ffffff 100%); border-left: 6px solid #08ea79; }
.tier-4 .tier-card-header { background: linear-gradient(90deg, #dbeafe 0%, #ffffff 100%); border-left: 6px solid #3b82f6; }

.tier-badge {
  font-size: 1.05rem;
  font-weight: 800;
}

.tier-1 .tier-badge { color: #dc2626; }
.tier-2 .tier-badge { color: #ea580c; }
.tier-3 .tier-badge { color: #04ca46; }
.tier-4 .tier-badge { color: #2563eb; }

.tier-empty {
  padding: 5px;
  text-align: center;
  color: #94a3b8;
  font-size: 0.85rem;
}

/* テーブル＆画面外スクロール対応 */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.deck-table {
  width: auto;
  border-collapse: collapse;
  text-align: left;
  white-space: nowrap;
}

.deck-table th,
.deck-table td {
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
}

.deck-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  font-size: 0.85rem;
}

.col-category {
  text-align: center;
  padding: 0px 5px;
}

.col-deck-info {
  padding:2px 10px 2px 2px;
}

.col-count {
  padding: 2px 5px 2px 0px;
  text-align: center;
  font-weight: 700;
}

.count-zero {
  color: #cbd5e1;
}

/* 強調されたリンク風数字ボタン */
.count-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 28px;
  padding: 0 10px;
  background: #e0f2fe;
  color: #0284c7;
  border: 1px solid #7dd3fc;
  border-radius: 6px;
  text-decoration: underline;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(2, 132, 199, 0.15);
  transition: all 0.15s ease;
}

.count-link:hover {
  background: #0284c7;
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(2, 132, 199, 0.35);
}

/* デッキ画像＋文字縁取りスタイル */
.deck-card {
  position: relative;
  width: 140px;
  height: 60px;
  border-radius: 6px;
  overflow: hidden;
  background: #cbd5e1;
  border: 1px solid #cbd5e1;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.deck-img-crop {
  width: 100%;
  height: 90px;
  margin-top: -15px;
  object-fit: cover;
  display: block;
}

/* 黒グラデーションを除去し、縁取り（text-shadow）を適用 */
.deck-name-overlay {
  position: absolute;
  bottom: 4px;
  left: 0;
  right: 0;
  padding: 0 4px;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  text-align: center;
  line-height: 1.1;
  white-space: normal;
  word-break: break-all;
  /* 上下左右1pxの黒フチ＋ドロップシャドウ */
  text-shadow: 
    1px  1px 0 #000,
   -1px  1px 0 #000,
    1px -1px 0 #000,
   -1px -1px 0 #000,
    0px  2px 4px rgba(0, 0, 0, 0.8);
}