.bstl-best-build {
  --bb-radius: 12px;
  --bb-border: 1px solid rgba(0,0,0,0.06);
  --bb-shadow: 0 4px 16px rgba(0,0,0,0.06);
  --bb-bg: #ffffff;
  --bb-muted: #6c757d;
  --bb-strong: #212529;
  --bb-accent: #0d6efd; /* SWELLに寄せた落ち着いた青系アクセント */
  --bb-gap: 12px;
  background: var(--bb-bg);
  border: var(--bb-border);
  border-radius: var(--bb-radius);
  box-shadow: var(--bb-shadow);
  padding: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96) 0%, rgba(255,255,255,0.92) 100%);
}

.bstl-best-build-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.bstl-best-build-header img {
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.bstl-best-build-header strong {
  font-size: 18px;
  letter-spacing: .2px;
}

.bstl-character-descriptions {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bstl-description-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bstl-description-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--bb-strong);
  border-bottom: 1px solid #e9ecef;
  padding-bottom: 4px;
}

.bstl-description-item {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 4px 8px;
  font-size: 12px;
  color: var(--bb-muted);
  line-height: 1.4;
}

.bstl-description-label {
  font-weight: 600;
  color: var(--bb-strong);
  min-width: 80px;
  flex-shrink: 0;
}

.bstl-description-text {
  color: var(--bb-muted);
  line-height: 1.4;
  flex: 1;
}

.bstl-best-build-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--bb-gap);
}

@media (max-width: 768px) {
  .bstl-best-build-form { grid-template-columns: 1fr; }
}

.bstl-field {
  display: grid;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #eef0f3;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.04);
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}

.bstl-field label {
  font-weight: 600;
  color: var(--bb-strong);
  font-size: 14px;
}

.bstl-field:hover {
  border-color: #e3e7ee;
  box-shadow: 0 10px 24px rgba(0,0,0,0.06);
}

.bstl-field select {
  width: 100%;
  appearance: none;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
}

.bstl-field .bstl-icon-preview {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  background: #f8f9fa;
}

@media (max-width: 768px) {
  .bstl-field .bstl-icon-preview {
    width: 24px;
    height: 24px;
  }
}

.bstl-gear-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

@media (max-width: 480px) {
  .bstl-gear-group { grid-template-columns: 1fr; }
}

.bstl-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.bstl-vote-btn {
  background: var(--bb-accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background-color .2s ease;
  box-shadow: 0 6px 16px rgba(13, 110, 253, 0.18);
}

.bstl-vote-btn:hover { transform: translateY(-1px); }
.bstl-vote-btn:active { transform: translateY(0); }

.bstl-vote-result {
  color: var(--bb-muted);
}

.bstl-best-build-summary {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed #e9ecef;
}

.bstl-best-build-summary h4 {
  margin: 0 0 8px 0;
  font-size: 15px;
}

.bstl-best-build-summary ol {
  margin: 12px 0 0 0;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  list-style: none;
}

.bstl-best-build-summary li {
  display: block;
  padding: 16px;
  color: var(--bb-strong);
  background: #ffffff;
  border: 1px solid #eef0f3;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.04);
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.bstl-best-build-summary li:hover {
  border-color: #e3e7ee;
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
  transform: translateY(-2px);
}

.bstl-bb-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}

.bstl-bb-cell {
  display: grid;
  grid-template-rows: auto 16px auto;
  align-items: start;
  justify-items: center;
}

.bstl-bb-cell img,
.bstl-bb-placeholder {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: #f3f5f8;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.bstl-bb-name {
  margin-top: 6px;
  font-size: 12px;
  color: #495057;
  text-align: center;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.bstl-bb-desc {
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.4;
  color: #6c757d;
  text-align: center;
}

.bstl-bb-desc--gear { min-height: 0; }

.bstl-bb-votes {
  display: inline-block;
  margin-left: 0;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--bb-accent);
  background: rgba(13, 110, 253, 0.08);
  border: 1px solid rgba(13, 110, 253, 0.25);
  border-radius: 9999px;
  padding: 2px 8px;
  line-height: 1.6;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .bstl-bb-cell img, .bstl-bb-placeholder { width: 40px; height: 40px; }
}

.bstl-best-build-summary li span {
  display: inline-flex;
  align-items: center;
}

.bstl-vote-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.bstl-vote-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--bb-muted);
}

.bstl-vote-count {
  font-weight: 600;
  color: var(--bb-accent);
  background: rgba(13, 110, 253, 0.08);
  border: 1px solid rgba(13, 110, 253, 0.25);
  border-radius: 9999px;
  padding: 2px 8px;
  white-space: nowrap;
}

.bstl-page-info {
  color: var(--bb-muted);
}

.bstl-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin-top: 16px;
  padding: 12px 0;
}

.bstl-pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  background: #ffffff;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  color: var(--bb-strong);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
}

.bstl-pagination-btn:hover {
  background: #f8f9fa;
  border-color: var(--bb-accent);
  color: var(--bb-accent);
  text-decoration: none;
}

.bstl-pagination-current {
  background: var(--bb-accent) !important;
  border-color: var(--bb-accent) !important;
  color: #ffffff !important;
  cursor: default;
}

.bstl-pagination-dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  color: var(--bb-muted);
  font-size: 12px;
}

.bstl-pagination-prev,
.bstl-pagination-next {
  font-weight: 600;
  min-width: 60px;
}

/* もっと見るボタン */
.bstl-load-more-container {
  display: flex;
  justify-content: center;
  margin-top: 16px;
  padding: 12px 0;
}

.bstl-load-more-votes-btn {
  background: var(--bb-accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 24px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background-color .2s ease;
  box-shadow: 0 6px 16px rgba(13, 110, 253, 0.18);
}

.bstl-load-more-votes-btn:hover:not(:disabled) { 
  transform: translateY(-1px); 
  box-shadow: 0 8px 20px rgba(13, 110, 253, 0.25);
}

.bstl-load-more-votes-btn:active { 
  transform: translateY(0); 
}

.bstl-load-more-votes-btn:disabled {
  background: #6c757d;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 2px 8px rgba(108, 117, 125, 0.15);
}

.bstl-loaded-info {
  color: var(--bb-muted);
  font-size: 12px;
}

/* ============ ギア投票部分の複数列（グリッド）対応 ============ */
.bstl-card-selector[data-type="gear"] {
  grid-template-columns: repeat(3, 1fr); /* iPad以上（デフォルト）は3列 */
}

@media (max-width: 768px) {
  /* 768px以下は2列 */
  .bstl-card-selector[data-type="gear"] {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  
  /* スマホ表示の時に要素が崩れないよう、サイズやパディングを調整 */
  .bstl-card-selector[data-type="gear"] .bstl-card-content {
    padding: 8px 28px 8px 8px;
    gap: 6px;
    border-radius: 10px;
  }
  
  .bstl-card-selector[data-type="gear"] .bstl-card-icon {
    width: 28px;
    height: 28px;
  }
  
  .bstl-card-selector[data-type="gear"] .bstl-card-checkbox {
    right: 8px;
    width: 14px;
    height: 14px;
    border-width: 1px;
  }
  
  .bstl-card-selector[data-type="gear"] input:checked + .bstl-card-content .bstl-card-checkbox::after {
    left: 4px;
    top: 1px;
    width: 3px;
    height: 7px;
    border-width: 0 1.5px 1.5px 0;
  }
  
  .bstl-card-selector[data-type="gear"] .bstl-card-name {
    font-size: 11px;
  }
  
  .bstl-card-selector[data-type="gear"] .bstl-stat-bar-group {
    gap: 4px;
    margin-top: 2px;
  }
  
  .bstl-card-selector[data-type="gear"] .bstl-stat-bar-label {
    font-size: 8px;
  }
  
  .bstl-card-selector[data-type="gear"] .bstl-stat-bar {
    min-width: 30px;
    height: 4px;
  }
}

@media (max-width: 768px) {
  .bstl-best-build-form { grid-template-columns: 1fr; }
  
  /* スマホ表示時のコンパクト化 */
  .bstl-field {
    padding: 10px;
    gap: 6px;
  }
  
  .bstl-field label {
    font-size: 13px;
  }
  
  .bstl-field select {
    padding: 8px 10px;
    font-size: 13px;
  }
  
  .bstl-gear-group {
    gap: 6px;
  }
  
  .bstl-vote-btn {
    padding: 8px 14px;
    font-size: 13px;
  }
  
  /* スマホ表示時のヘッダー調整 */
  .bstl-best-build-header {
    gap: 8px;
  }
  
  .bstl-best-build-header img {
    width: 48px;
    height: 48px;
  }
  
  .bstl-best-build-header strong {
    font-size: 16px;
  }
  
  /* スマホ表示時の説明文レスポンシブ対応 */
  .bstl-description-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
  }
  
  .bstl-description-label {
    min-width: 0;
    flex-shrink: 1;
  }
  
  .bstl-bsinfox-stats {
    margin: 0;
  }
  
  .bstl-description-text {
    flex: none;
    width: 100%;
    margin-top: 2px;
  }
}

.bstl-best-build-error {
  background: #fff8f8;
  border: 1px solid #ffd7d7;
  color: #b02a37;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
}

/* ============ カード型投票UI ============ */
.bstl-card-selector {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 8px;
}

@media (max-width: 600px) {
  .bstl-card-selector {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

.bstl-selector-card {
  display: block;
  cursor: pointer;
  margin: 0;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.bstl-card-content {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 44px 14px 14px; /* 右側にインジケーター用のスペースを空ける */
  border: 2px solid #eef0f3;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ホバー時の浮き上がり・ボーダー色変更 */
.bstl-selector-card:hover .bstl-card-content {
  border-color: #cbd5e1;
  background: #fafbfc;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

/* 選択時の強力なハイライト */
.bstl-selector-card input:checked + .bstl-card-content {
  border-color: var(--bb-accent);
  background: rgba(13, 110, 253, 0.03);
  box-shadow: 0 8px 20px rgba(13, 110, 253, 0.08);
  transform: translateY(-2px);
}

/* カスタムチェックインジケーター */
.bstl-card-checkbox {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border: 2px solid #cbd5e1;
  background: #fff;
  transition: all 0.2s ease;
}

/* ラジオボタン（ガジェット・スタパ）は丸型 */
.bstl-card-selector[data-type="gadget"] .bstl-card-checkbox,
.bstl-card-selector[data-type="starpower"] .bstl-card-checkbox {
  border-radius: 50%;
}

/* チェックボックス（ギア）は角丸四角型 */
.bstl-card-selector[data-type="gear"] .bstl-card-checkbox {
  border-radius: 6px;
}

/* 選択時のインジケーター塗りつぶし */
.bstl-selector-card input:checked + .bstl-card-content .bstl-card-checkbox {
  border-color: var(--bb-accent);
  background: var(--bb-accent);
}

/* 選択時のチェックマーク */
.bstl-selector-card input:checked + .bstl-card-content .bstl-card-checkbox::after {
  content: '';
  position: absolute;
  display: block;
}

/* ラジオボタンのインナードット */
.bstl-card-selector[data-type="gadget"] input:checked + .bstl-card-content .bstl-card-checkbox::after,
.bstl-card-selector[data-type="starpower"] input:checked + .bstl-card-content .bstl-card-checkbox::after {
  left: 5px;
  top: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffffff;
}

/* チェックボックスのチェックマーク */
.bstl-card-selector[data-type="gear"] input:checked + .bstl-card-content .bstl-card-checkbox::after {
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.bstl-card-icon {
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  flex-shrink: 0;
  object-fit: cover;
}

.bstl-card-icon-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #f3f4f6;
  flex-shrink: 0;
}

.bstl-card-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.bstl-card-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--bb-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bstl-card-stats {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}

.bstl-stat-bar-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.bstl-stat-bar-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--bb-muted);
  white-space: nowrap;
}

.bstl-stat-bar {
  flex: 1;
  height: 6px;
  background: #eef0f3;
  border-radius: 999px;
  overflow: hidden;
  min-width: 50px;
}

.bstl-stat-bar-fill {
  height: 100%;
  border-radius: 999px;
}

.bstl-stat-bar-fill.ownership {
  background: #3b82f6; /* 所有率：ブルー */
}

.bstl-stat-bar-fill.use {
  background: #f97316; /* 使用率：オレンジ */
}

/* ============ 投票セクションの余白統一システム ============ */
.bstl-best-build .bstl-vote-header,
.bstl-best-build-summary .bstl-vote-header {
  margin-bottom: 16px !important;
}

/* 説明文 p.bstl-vote-desc のマージン統一 (SWELLの段落デザインを踏襲しつつ余白を統一) */
.bstl-best-build p.bstl-vote-desc,
.bstl-best-build-summary p.bstl-vote-desc {
  margin: 0 0 20px 0 !important;
}

/* 票数 wrapper のマージン統一 */
.bstl-best-build-summary .bstl-vote-info {
  margin-bottom: 20px !important;
}

/* 見出し h4 自体の下マージンをクリアし、親コンテナである bstl-vote-header のマージンに一本化 */
.bstl-best-build .bstl-vote-header h4,
.bstl-best-build-summary .bstl-vote-header h4 {
  margin: 0 !important;
}


