/* モバイル詳細検索の最終レイアウト調整（競合CSSを避けるため後段で上書き） */

@media (max-width: 768px) {
  html,
  body {
    overflow-x: hidden;
  }

  .page {
    width: 100%;
    max-width: 100%;
  }

  /* 詳細検索の基本グリッド */
  .detail-panel .class-filter,
  .detail-panel .scenario-wrap {
    grid-template-columns: 96px minmax(0, 1fr) !important;
    gap: 8px !important;
    align-items: center !important;
    min-height: 44px !important;
  }

  /* ラベル位置の統一（個別要件だけ例外） */
  .detail-panel .class-filter .label,
  .detail-panel .scenario-wrap .label {
    justify-self: center !important;
    text-align: center !important;
    white-space: nowrap !important;
  }

  /* ランク・最低試合数は左寄せ */
  #rank-filter-guide .label,
  #rank-filter-match .label,
  #rank-filter-tier .label {
    justify-self: center !important;
    text-align: center !important;
  }
  #tier-min-games-filter .label {
    justify-self: start !important;
    text-align: left !important;
  }

  /* 閾値・先攻/後攻は中央寄せ */
  #tier-threshold-filter .label,
  #detail-panel .scenario-wrap .label,
  #match-detail-panel .scenario-wrap .label {
    justify-self: center !important;
    text-align: center !important;
  }

  #rank-filter-guide,
  #rank-filter-match,
  #rank-filter-tier,
  #tier-min-games-filter {
    grid-template-columns: 96px minmax(0, 1fr) !important;
    gap: 8px !important;
  }

  /* クラスアイコンは4列 */
  #guide-filters #class-filter .filter-buttons,
  #guide-filters #opp-filter .filter-buttons {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  #guide-filters #class-filter .filter-buttons button,
  #guide-filters #opp-filter .filter-buttons button {
    min-height: 44px !important;
  }

  /* 先攻/後攻3択を1行固定 */
  #detail-panel .scenario-switch,
  #match-detail-panel .scenario-switch {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
    width: 100% !important;
    flex-wrap: nowrap !important;
  }

  #detail-panel .scenario-switch button,
  #match-detail-panel .scenario-switch button {
    min-width: 0 !important;
    width: 100% !important;
    padding: 0 4px !important;
    font-size: 12.5px !important;
    white-space: nowrap !important;
  }

  /* 閾値は3項目を横並び固定 */
  #tier-threshold-filter {
    grid-template-columns: 96px minmax(0, 1fr) !important;
  }

  #tier-threshold-filter .filter-buttons {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 4px !important;
    width: 100%;
  }

  #tier-threshold-filter .checkbox {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    white-space: nowrap !important;
    margin-left: 0 !important;
  }

  #tier-threshold-filter .cr-input {
    width: 48px !important;
    min-width: 48px !important;
    padding: 0 4px !important;
  }

  /* 最低試合数入力の安定表示 */
  #tier-min-games-filter .filter-buttons {
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
  }

  #tier-min-games-filter .cr-input {
    width: 86px !important;
    min-width: 86px !important;
  }

  /* チェックボックス行の高さ統一 */
  .detail-panel .filter-buttons .checkbox {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    min-height: 38px !important;
    line-height: 1.2 !important;
  }

  .detail-panel .filter-buttons .checkbox input[type="checkbox"] {
    margin: 0 !important;
    width: 18px !important;
    height: 18px !important;
    flex: 0 0 auto !important;
  }

  /* ランク/グループ/アーキタイプはトリガー1つだけ表示 */
  #guide-filters #rank-filter-guide.mobile-sheet-target .filter-buttons,
  #matchup-filters #rank-filter-match.mobile-sheet-target .filter-buttons,
  #tier-filters #rank-filter-tier.mobile-sheet-target .filter-buttons,
  #guide-filters #group-filter.mobile-sheet-target .filter-buttons,
  #matchup-filters #group-filter-match.mobile-sheet-target .filter-buttons,
  #tier-filters #group-filter-tier.mobile-sheet-target .filter-buttons {
    display: block !important;
    width: 100%;
  }

  #guide-filters #rank-filter-guide.mobile-sheet-target .filter-buttons > button:not(.sheet-trigger),
  #matchup-filters #rank-filter-match.mobile-sheet-target .filter-buttons > button:not(.sheet-trigger),
  #tier-filters #rank-filter-tier.mobile-sheet-target .filter-buttons > button:not(.sheet-trigger),
  #guide-filters #group-filter.mobile-sheet-target .filter-buttons > button:not(.sheet-trigger),
  #matchup-filters #group-filter-match.mobile-sheet-target .filter-buttons > button:not(.sheet-trigger),
  #tier-filters #group-filter-tier.mobile-sheet-target .filter-buttons > button:not(.sheet-trigger) {
    display: none !important;
  }

  #guide-filters #rank-filter-guide.mobile-sheet-target .filter-buttons > .sheet-trigger,
  #matchup-filters #rank-filter-match.mobile-sheet-target .filter-buttons > .sheet-trigger,
  #tier-filters #rank-filter-tier.mobile-sheet-target .filter-buttons > .sheet-trigger,
  #guide-filters #group-filter.mobile-sheet-target .filter-buttons > .sheet-trigger,
  #matchup-filters #group-filter-match.mobile-sheet-target .filter-buttons > .sheet-trigger,
  #tier-filters #group-filter-tier.mobile-sheet-target .filter-buttons > .sheet-trigger {
    display: inline-flex !important;
    width: 100% !important;
    min-height: 44px !important;
    border-radius: 12px !important;
  }

  /* CRプリセットもトリガーのみ表示 */
  .cr-presets.mobile-sheet-target {
    display: block !important;
    width: 100%;
    min-width: 0;
    flex: 1 1 auto;
  }

  .cr-presets.mobile-sheet-target > button:not(.sheet-trigger) {
    display: none !important;
  }

  .cr-presets.mobile-sheet-target > .sheet-trigger {
    display: inline-flex !important;
    width: 100% !important;
    min-height: 40px !important;
    border: 1px solid var(--line) !important;
    border-radius: 12px !important;
    background: #fff !important;
    color: var(--text) !important;
    justify-content: flex-start !important;
    padding: 0 12px !important;
    box-shadow: none !important;
    transform: none !important;
  }

  /* CRは数値の右側に1行で配置 */
  #cr-filter .filter-buttons,
  #cr-filter-match .filter-buttons,
  #cr-filter-tier .filter-buttons {
    display: grid !important;
    grid-template-columns: 54px 54px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 6px !important;
    flex-wrap: nowrap !important;
    overflow-x: visible !important;
  }
  #cr-filter .cr-input,
  #cr-filter-match .cr-input,
  #cr-filter-tier .cr-input {
    width: 54px !important;
    min-width: 54px !important;
    padding: 0 4px !important;
  }
  #cr-filter .cr-presets.mobile-sheet-target > .sheet-trigger,
  #cr-filter-match .cr-presets.mobile-sheet-target > .sheet-trigger,
  #cr-filter-tier .cr-presets.mobile-sheet-target > .sheet-trigger {
    min-height: 38px !important;
  }

  /* CRはアイコン主体で表示 */
  .cr-presets.mobile-sheet-target > .sheet-trigger .sheet-trigger-value {
    justify-content: center !important;
    width: 100%;
  }
  .cr-presets.mobile-sheet-target > .sheet-trigger .sheet-trigger-value img {
    height: 24px !important;
    width: auto !important;
    max-width: 100% !important;
    object-fit: contain !important;
  }
  .cr-presets.mobile-sheet-target > .sheet-trigger .sheet-trigger-text {
    display: none !important;
  }
  .cr-presets.mobile-sheet-target > .sheet-trigger.no-icon .sheet-trigger-text {
    display: inline !important;
  }

  /* モバイル: CRはリストトリガーのみ表示（アイコンボタンは非表示） */
  #cr-filter .cr-presets > button:not(.sheet-trigger),
  #cr-filter-match .cr-presets > button:not(.sheet-trigger),
  #cr-filter-tier .cr-presets > button:not(.sheet-trigger) {
    display: none !important;
  }
  #cr-filter .cr-presets > .sheet-trigger,
  #cr-filter-match .cr-presets > .sheet-trigger,
  #cr-filter-tier .cr-presets > .sheet-trigger {
    display: inline-flex !important;
  }

  .mobile-filter-sheet-item.is-cr-option {
    justify-content: center !important;
    min-height: 52px !important;
    padding: 0 8px !important;
  }
  .mobile-filter-sheet-item.is-cr-option img {
    height: 32px !important;
    width: auto !important;
    max-width: none !important;
    object-fit: contain !important;
  }
  .mobile-filter-sheet-item.is-cr-option span {
    display: none !important;
  }
  .mobile-filter-sheet-item.is-cr-option.no-icon {
    justify-content: center !important;
  }
  .mobile-filter-sheet-item.is-cr-option.no-icon span {
    display: inline !important;
  }

  /* CRフィルタ行の横スクロールを禁止 */
  #cr-filter .filter-buttons,
  #cr-filter-match .filter-buttons,
  #cr-filter-tier .filter-buttons {
    flex-wrap: nowrap !important;
    overflow-x: visible !important;
    gap: 6px !important;
  }

  .sheet-trigger-text {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 14px !important;
  }

  #rank-filter-guide .sheet-trigger-text,
  #rank-filter-match .sheet-trigger-text,
  #rank-filter-tier .sheet-trigger-text {
    font-size: 13px !important;
  }

  /* ラベル位置の最終固定 */
  #rank-filter-guide .label,
  #rank-filter-match .label,
  #rank-filter-tier .label {
    justify-self: center !important;
    text-align: center !important;
  }
  #tier-min-games-filter .label {
    justify-self: start !important;
    text-align: left !important;
  }
  #tier-threshold-filter .label,
  #detail-panel .scenario-wrap .label,
  #match-detail-panel .scenario-wrap .label {
    justify-self: center !important;
    text-align: center !important;
  }
}

@media (min-width: 769px) {
  /* PCのみ: マリガンガイドの詳細検索を右側に寄せる */
  #guide-filters .guide-sub-row {
    flex-direction: row !important;
    align-items: center !important;
    gap: 16px !important;
  }
  #guide-filters .guide-sub-row > * {
    width: auto !important;
  }
  #guide-filters .guide-sub-row .slot-my-archetype {
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }
  #guide-filters .guide-top-actions {
    width: auto !important;
    display: flex;
    justify-content: flex-end;
    margin: 0 0 0 auto !important;
  }
  /* PC: CRはアイコンボタンのみ表示（リストトリガーは非表示） */
  #cr-filter .cr-presets > .sheet-trigger,
  #cr-filter-match .cr-presets > .sheet-trigger,
  #cr-filter-tier .cr-presets > .sheet-trigger {
    display: none !important;
  }
  #cr-filter .cr-presets > button:not(.sheet-trigger),
  #cr-filter-match .cr-presets > button:not(.sheet-trigger),
  #cr-filter-tier .cr-presets > button:not(.sheet-trigger) {
    display: inline-flex !important;
  }

  #cr-filter .filter-buttons,
  #cr-filter-match .filter-buttons,
  #cr-filter-tier .filter-buttons {
    overflow-y: visible !important;
    padding-top: 2px !important;
    padding-bottom: 2px !important;
  }

  #cr-filter .cr-presets button,
  #cr-filter-match .cr-presets button,
  #cr-filter-tier .cr-presets button {
    min-height: 36px !important;
    height: 36px !important;
    line-height: 1 !important;
    overflow: visible !important;
    align-items: center !important;
  }

  #cr-filter .cr-presets button.active,
  #cr-filter-match .cr-presets button.active,
  #cr-filter-tier .cr-presets button.active {
    transform: translateY(-1px) !important;
  }

  #cr-filter .cr-presets img,
  #cr-filter-match .cr-presets img,
  #cr-filter-tier .cr-presets img {
    max-height: 22px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    object-position: center !important;
    display: block !important;
  }
}

@media (min-width: 769px) and (max-width: 1320px) {
  /* 狭いPC幅: クラスを1段目、アーキタイプ+詳細検索を2段目へ */
  #guide-filters .guide-sub-row {
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    row-gap: 12px !important;
  }
  #guide-filters .guide-sub-row > #class-filter {
    flex: 1 1 100% !important;
    width: 100% !important;
  }
  #guide-filters .guide-sub-row .slot-my-archetype {
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }
  #guide-filters .guide-sub-row .guide-top-actions {
    flex: 0 0 auto !important;
    margin: 0 0 0 12px !important;
  }
}

/* 通常ボタンとCRプリセットの見た目/アニメーションを共通化 */
#guide-filters .class-filter button,
#matchup-filters .class-filter button,
#tier-filters .class-filter button,
#cr-filter .cr-presets button,
#cr-filter-match .cr-presets button,
#cr-filter-tier .cr-presets button {
  border: 1px solid var(--line) !important;
  background: #fff !important;
  color: var(--text) !important;
  box-shadow: none !important;
  transform: none !important;
  transition: background 0.15s, transform 0.15s, border-color 0.15s, box-shadow 0.15s !important;
}

#guide-filters .class-filter button:hover,
#matchup-filters .class-filter button:hover,
#tier-filters .class-filter button:hover,
#cr-filter .cr-presets button:hover,
#cr-filter-match .cr-presets button:hover,
#cr-filter-tier .cr-presets button:hover {
  background: #F6F8FB !important;
}

#guide-filters .class-filter button.active,
#matchup-filters .class-filter button.active,
#tier-filters .class-filter button.active,
#cr-filter .cr-presets button.active,
#cr-filter-match .cr-presets button.active,
#cr-filter-tier .cr-presets button.active {
  border-color: rgba(37, 99, 235, 0.55) !important;
  background: rgba(37, 99, 235, 0.10) !important;
  color: var(--text) !important;
  box-shadow: none !important;
  transform: translateY(-1px) !important;
}

.tier-archetype-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

body.tier-detail-open {
  overflow: hidden;
}

.tier-archetype-detail-overlay.hidden {
  display: none;
}

.tier-archetype-detail-dialog {
  width: min(860px, calc(100% - 72px));
  max-height: min(88vh, 980px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tier-archetype-detail-head {
  position: relative;
  display: block;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--line);
  background: #f9fbff;
  overflow: visible;
  border-radius: 16px 16px 0 0;
  min-height: 122px;
  z-index: 8;
}

.tier-archetype-detail-head.has-hero-image {
  --tier-hero-left: max(44%, calc(100% - 560px));
  --tier-hero-fade-width: clamp(120px, 18vw, 220px);
}

.tier-archetype-detail-head.has-hero-image::before {
  content: "";
  position: absolute;
  left: var(--tier-hero-left);
  right: 0;
  top: 0;
  bottom: 0;
  background-image: var(--tier-hero-url);
  background-position: left center;
  background-repeat: no-repeat;
  background-size: cover;
  z-index: 0;
}

.tier-archetype-detail-head.has-hero-image::after {
  content: "";
  position: absolute;
  left: var(--tier-hero-left);
  width: var(--tier-hero-fade-width);
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, #f9fbff 0%, rgba(249, 251, 255, 0.9) 30%, rgba(249, 251, 255, 0.35) 70%, rgba(249, 251, 255, 0) 100%);
  z-index: 0;
}

.tier-archetype-detail-title-wrap {
  position: relative;
  padding: 10px 16px 8px;
  z-index: 2;
}

.tier-archetype-detail-hero {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tier-hero-band {
  min-height: 92px;
  border: 0;
  border-radius: 0;
  background: transparent;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 16px;
  margin: 0 -16px 0 -16px;
}

.tier-hero-band .hero-name {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
  max-width: min(56%, 520px);
  min-height: 58px;
  padding-left: 20px;
  margin: 0;
  text-align: left;
}

.tier-hero-band .hero-name .name {
  font-weight: 800;
  font-size: clamp(24px, 3.6vw, 36px);
  line-height: 1.1;
}

.tier-hero-meta {
  font-size: 13px;
  font-weight: 700;
  color: #3f4c63;
  position: absolute;
  left: 26px;
  transform: none;
  bottom: 6px;
  z-index: 4;
  line-height: 1.15;
  text-align: left;
  white-space: nowrap;
}

.tier-hero-meta strong {
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  margin-right: 8px;
}

.class-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.tier-archetype-detail-close {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 10px;
  min-height: 34px;
  padding: 0 12px;
  font-weight: 800;
  cursor: pointer;
  margin: 0;
  position: absolute;
  top: 10px;
  right: 16px;
  z-index: 5;
}

.tier-archetype-detail-chips {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 0;
}

.tier-filter-details {
  margin-top: 0;
  position: relative;
  z-index: 6;
  width: fit-content;
  margin-left: 0;
}

.tier-filter-details > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 800;
  background: rgba(249, 251, 255, 0.22);
  box-shadow: none;
  backdrop-filter: blur(2px);
}

.tier-filter-details > summary::-webkit-details-marker {
  display: none;
}

.tier-filter-details[open] > summary {
  margin-bottom: 0;
}

.tier-filter-floating {
  position: absolute;
  right: 16px;
  top: auto;
  bottom: 8px;
  z-index: 24;
}

.tier-archetype-detail-close,
.tier-filter-details > summary {
  width: 84px;
  min-width: 84px;
  justify-content: center;
}

.tier-filter-details > summary {
  min-height: 26px;
  font-size: 10px;
  padding: 0 6px;
}

.tier-filter-floating .tier-archetype-detail-chips {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  bottom: auto;
  z-index: 80;
  min-width: min(560px, calc(100vw - 72px));
  max-width: min(760px, calc(100vw - 72px));
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.22);
  pointer-events: auto;
}

.tier-list-block,
.tier-class-block {
  overflow: visible;
}

.tier-filter-floating[open] .tier-archetype-detail-chips,
.tier-filter-floating:hover .tier-archetype-detail-chips,
.tier-filter-floating:focus-within .tier-archetype-detail-chips {
  display: flex;
}

.tier-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  min-height: 24px;
  padding: 0 10px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

.tier-archetype-detail-body {
  padding: 30px 30px 36px;
  overflow: auto;
  display: grid;
  gap: 42px;
  position: relative;
  z-index: 1;
}

.tier-archetype-detail-section {
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
}

.tier-archetype-detail-section h4 {
  margin: 0 0 20px;
  font-size: 22px;
  color: #264dbf;
  border-left: 4px solid #7aa0ff;
  padding-left: 10px;
  line-height: 1.2;
}

.tier-section-note {
  margin: -6px 0 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.tier-archetype-grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 30px;
}

.tier-list-head {
  display: flex;
  justify-content: flex-start;
  font-size: 18px;
  font-weight: 800;
  margin: 20px 0 14px;
  color: var(--text);
  line-height: 1.05;
}

.tier-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 4px;
}

.tier-card li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}

.tier-compact-table {
  width: 100%;
  border-collapse: collapse;
}

.tier-compact-table th,
.tier-compact-table td {
  border: 1px solid var(--line);
  padding: 4px 8px;
  font-size: 13px;
  text-align: left;
}

.tier-compact-table thead th {
  color: var(--text) !important;
  text-align: center !important;
}

.tier-compact-table th:first-child,
.tier-compact-table td:first-child {
  text-align: left;
  padding: 0 0 0 10px;
}

.tier-compact-table thead th:first-child {
  text-align: center !important;
  padding-left: 0;
}

.tier-compact-table th:nth-child(n + 2),
.tier-compact-table td:nth-child(n + 2) {
  width: 66px;
  text-align: left;
  white-space: nowrap;
  padding-left: 12px;
}

.tier-compact-table th:nth-child(4),
.tier-compact-table td:nth-child(4) {
  width: 76px;
}

.tier-compact-table th {
  background: #f7faff;
}

.tier-compact-table .empty {
  text-align: center;
  color: var(--muted);
}

.archetype-mini-cell {
  position: relative;
  display: flex;
  align-items: stretch;
  align-items: center;
  min-height: 28px;
  border-radius: 0;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: transparent;
  min-width: 0;
  height: 100%;
}

.archetype-mini-cell .info {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  max-width: min(60%, 340px);
  padding-left: 6px;
  padding-right: 10px;
}

.archetype-mini-cell .name {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.archetype-mini-cell .thumb {
  position: absolute;
  inset: 0 0 0 auto;
  width: min(50%, 300px);
  margin-left: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
  pointer-events: none;
}

.archetype-mini-cell .thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.88) 12%, rgba(255, 255, 255, 0.26) 24%, rgba(255, 255, 255, 0.04) 42%);
}

.archetype-mini-cell .thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center center;
}

.sample-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  min-height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 800;
  color: #9f1239;
  background: #fff1f2;
  position: relative;
  cursor: help;
}

.sample-badge[data-tooltip]:hover::after,
.sample-badge[data-tooltip]:focus-visible::after,
.sample-badge[data-tooltip]:active::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  z-index: 120;
  pointer-events: none;
}

.tier-class-block + .tier-class-block {
  margin-top: 0;
}

.tier-class-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 44px 44px;
}

.tier-class-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-weight: 800;
  margin: 18px 0 16px;
  font-size: 20px;
  align-items: flex-start;
}

.tier-hero-band .hero-name .class-icon {
  width: 30px;
  height: 30px;
}

.tier-class-head .class-icon {
  width: 30px;
  height: 30px;
}

.tier-class-head .title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tier-class-head-meta {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-weight: 700;
  line-height: 1.25;
}

.tier-class-head-meta .games,
.tier-class-head-meta .avg {
  font-size: 13px;
  color: var(--text);
}

.tier-class-block table {
  width: 100%;
  border-collapse: collapse;
}

.tier-class-block th,
.tier-class-block td {
  border: 1px solid var(--line);
  padding: 6px 8px;
  font-size: 13px;
}

.tier-class-block th {
  background: #f7faff;
}

.tier-reco-title {
  font-weight: 800;
  margin-bottom: 4px;
}

.tier-reco-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tier-reco-list span {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  min-height: 24px;
  padding: 0 10px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
}

.tier-guide-grid {
  overflow: auto;
}

.tier-guide-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 12px;
}

.tier-guide-intro {
  margin: 0 0 10px;
}

.tier-guide-intro-title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 800;
}

.tier-guide-intro-body {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.tier-guide-control {
  display: grid;
  gap: 4px;
}

.tier-guide-control > span {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.tier-guide-control select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  padding: 0 10px;
}

.tier-guide-dd,
.tier-guide-class-dd {
  position: relative;
}

.tier-guide-dd > summary,
.tier-guide-class-dd > summary {
  list-style: none;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.tier-guide-dd > summary::-webkit-details-marker,
.tier-guide-class-dd > summary::-webkit-details-marker {
  display: none;
}

.tier-guide-dd > summary .value,
.tier-guide-class-dd > summary .value {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.tier-guide-dd > summary .value img,
.tier-guide-class-dd > summary .value img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.tier-guide-dd > summary .label,
.tier-guide-class-dd > summary .label {
  white-space: nowrap;
}

.tier-guide-dd > summary .caret,
.tier-guide-class-dd > summary .caret {
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
}

.tier-guide-dd-menu,
.tier-guide-class-dd-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 40;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
  padding: 4px 0;
  display: block;
  max-height: 240px;
  overflow: auto;
}

.tier-guide-dd-menu button,
.tier-guide-class-dd-menu button {
  width: 100%;
  min-height: 34px;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
  transition: background-color 0.18s ease;
}

.tier-guide-dd-menu button img,
.tier-guide-class-dd-menu button img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.tier-guide-dd-menu button:hover,
.tier-guide-class-dd-menu button:hover {
  background: #f7faff;
}

.tier-guide-dd-menu button.active,
.tier-guide-class-dd-menu button.active {
  background: #eef3ff;
}

.tier-guide-dd-menu button:last-child,
.tier-guide-class-dd-menu button:last-child {
  border-bottom: 0;
}

.tier-guide-dd.is-disabled > summary {
  background: #f6f8fc;
  color: var(--muted);
  cursor: not-allowed;
}

.tier-guide-class-buttons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.tier-guide-class-buttons button {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 700;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}

.tier-guide-class-buttons button img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.tier-guide-class-buttons button .label {
  font-weight: 700;
  line-height: 1;
}

.tier-guide-class-buttons button:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.tier-guide-class-buttons button.active {
  border-color: var(--accent);
  background: #eef3ff;
}

#tier-archetype-guide .guide-grid {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 0;
}

#tier-archetype-guide .guide-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

#tier-archetype-guide .guide-table thead th {
  white-space: nowrap;
  color: var(--text) !important;
  text-align: center !important;
  background: #f7faff;
}

#tier-archetype-guide .guide-table th:first-child,
#tier-archetype-guide .guide-table td:first-child {
  width: 220px;
  text-align: left;
  padding: 0 0 0 10px;
}

#tier-archetype-guide .guide-table thead th:first-child {
  text-align: center;
  padding-left: 0;
}

#tier-archetype-guide .guide-table th:not(:first-child),
#tier-archetype-guide .guide-table td:not(:first-child) {
  width: 66px;
  text-align: left;
  white-space: nowrap;
  padding-left: 12px;
}

#tier-archetype-guide .guide-table th:nth-child(4),
#tier-archetype-guide .guide-table td:nth-child(4) {
  width: 76px;
}

#tier-archetype-guide .guide-table td {
  border: 1px solid var(--line);
  padding: 0;
  font-size: 13px;
}

#tier-archetype-guide .guide-table th {
  border: 1px solid var(--line);
  padding: 4px 8px;
  font-size: 13px;
}

#tier-archetype-guide .guide-table .th-content {
  justify-content: center;
}

#tier-archetype-guide .guide-table .th-content .th-label {
  color: var(--text) !important;
  font-weight: 700;
}

#tier-archetype-guide .guide-table .th-help {
  color: var(--muted);
}

#tier-archetype-guide .guide-table .card-cell {
  gap: 8px;
  min-height: 28px;
}

#tier-archetype-guide .guide-table .card-cell .card-thumb {
  width: 120px;
  height: 28px;
  border-radius: 0;
  overflow: hidden;
  position: relative;
}

#tier-archetype-guide .guide-table .card-cell .card-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.82) 16%, rgba(255, 255, 255, 0.30) 32%, rgba(255, 255, 255, 0) 52%);
  pointer-events: none;
}

#tier-archetype-guide .guide-table .card-cell .card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#tier-guide-opp-archetype-select:disabled {
  background: #f6f8fc;
  color: var(--muted);
  cursor: not-allowed;
}

.tier-guide-grid table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.tier-guide-grid th,
.tier-guide-grid td {
  border: 1px solid var(--line);
  padding: 6px 8px;
  font-size: 13px;
  text-align: right;
}

.tier-guide-grid th:first-child,
.tier-guide-grid td:first-child {
  text-align: left;
}

.tier-guide-link-wrap {
  margin-top: 10px;
}

.tier-guide-link-wrap a {
  font-size: 13px;
  font-weight: 700;
}

@media (max-width: 768px) {
  .tier-archetype-detail-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .tier-archetype-detail-dialog {
    border-radius: 16px 16px 0 0;
    max-height: 92vh;
    width: 100%;
    overflow: hidden;
  }

  .tier-archetype-grid-two {
    grid-template-columns: 1fr;
  }

  .tier-hero-band {
    min-height: 78px;
    margin: 0 -16px 0 -16px;
    padding: 0 10px;
  }

  .tier-hero-band .hero-name .name {
    font-size: clamp(20px, 7vw, 30px);
  }

  .tier-hero-band .hero-name {
    min-height: 60px;
    max-width: 58%;
    padding-left: 8px;
  }

  .tier-hero-meta {
    font-size: 11px;
    left: 10px;
    right: 96px;
    bottom: 4px;
    white-space: normal;
    line-height: 1.2;
  }

  .tier-hero-meta strong {
    font-size: 16px;
  }

  .tier-guide-controls {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .tier-guide-class-buttons {
    gap: 6px;
  }

  .tier-guide-class-buttons button {
    width: 100%;
    min-width: 0;
    min-height: 32px;
    padding: 0 8px;
  }

  .tier-filter-details:not([open]) .tier-archetype-detail-chips {
    display: none;
  }

  .tier-filter-details > summary {
    width: 84px;
    min-width: 84px;
    font-size: 10px;
    min-height: 24px;
  }

  .tier-filter-floating {
    right: 10px;
    bottom: 6px;
  }

  .tier-filter-floating .tier-archetype-detail-chips {
    min-width: min(320px, calc(100vw - 24px));
    max-width: min(640px, calc(100vw - 24px));
    right: 0;
  }

  .tier-archetype-detail-head.has-hero-image {
    --tier-hero-left: max(30%, calc(100% - 250px));
    --tier-hero-fade-width: clamp(88px, 25vw, 136px);
  }

  .tier-compact-table {
    table-layout: fixed;
    width: 100%;
  }
  .tier-compact-table th,
  .tier-compact-table td {
    font-size: 12px;
    padding: 3px 5px;
  }
  .tier-compact-table th:nth-child(n + 2),
  .tier-compact-table td:nth-child(n + 2) {
    width: 54px;
    padding-left: 6px;
  }
  .tier-compact-table th:nth-child(4),
  .tier-compact-table td:nth-child(4) {
    width: 60px;
  }
  .archetype-mini-cell .thumb {
    width: 38%;
  }
  .archetype-mini-cell .info {
    max-width: 62%;
    padding-right: 6px;
  }
}

@media (max-width: 640px) {
  .tier-class-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 769px) {
  /* 詳細検索: ラベル列と入力開始位置を統一（PC） */
  #detail-panel .class-filter,
  #detail-panel .scenario-wrap,
  #tier-detail-panel .class-filter,
  #tier-detail-panel .scenario-wrap,
  #match-detail-panel .class-filter,
  #match-detail-panel .scenario-wrap {
    grid-template-columns: 92px minmax(0, 1fr) !important;
    column-gap: 10px !important;
    align-items: center !important;
  }

  #detail-panel .class-filter .label,
  #detail-panel .scenario-wrap .label,
  #tier-detail-panel .class-filter .label,
  #tier-detail-panel .scenario-wrap .label,
  #match-detail-panel .class-filter .label,
  #match-detail-panel .scenario-wrap .label {
    justify-self: center !important;
    text-align: center !important;
    min-width: 0 !important;
    width: auto !important;
    padding: 0 !important;
    white-space: nowrap !important;
  }

  #detail-panel .class-filter .filter-buttons,
  #tier-detail-panel .class-filter .filter-buttons,
  #match-detail-panel .class-filter .filter-buttons,
  #detail-panel .scenario-switch,
  #tier-detail-panel .scenario-switch,
  #match-detail-panel .scenario-switch {
    justify-content: flex-start !important;
    margin-left: 0 !important;
  }
}
