/* カウンターピッカー専用スタイル */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ===== メインコンテナ ===== */
.cp-container {
  width: 1000px;
  margin: 20px auto;
  padding: 30px;
  font-family: 'Inter', 'Noto Sans JP', sans-serif;
}

/* ===== ステップインジケーター ===== */
.cp-steps {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  margin-bottom: 40px;
}

.cp-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: 50px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: default;
}

.cp-step.active {
  background: linear-gradient(135deg, rgba(231,65,43,0.2), rgba(231,65,43,0.05));
  border-color: #e7412b;
  box-shadow: 0 0 20px rgba(231,65,43,0.15);
}

.cp-step.completed {
  background: rgba(46,204,113,0.1);
  border-color: rgba(46,204,113,0.4);
}

.cp-step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.4);
  transition: all 0.4s;
}

.cp-step.active .cp-step-number {
  background: #e7412b;
  color: #fff;
  box-shadow: 0 0 12px rgba(231,65,43,0.4);
}

.cp-step.completed .cp-step-number {
  background: #2ecc71;
  color: #fff;
}

.cp-step-label {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.35);
  transition: color 0.4s;
}

.cp-step.active .cp-step-label {
  color: #fff;
}

.cp-step.completed .cp-step-label {
  color: rgba(46,204,113,0.9);
}

.cp-step-connector {
  width: 50px;
  height: 2px;
  background: rgba(255,255,255,0.1);
  transition: background 0.6s;
  position: relative;
}

.cp-step-connector.active {
  background: linear-gradient(90deg, #2ecc71, #e7412b);
  box-shadow: 0 0 8px rgba(231,65,43,0.3);
}

/* ===== セクションカード（グラスモーフィズム） ===== */
.cp-card {
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 30px;
  margin-bottom: 30px;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.cp-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
}

.cp-card:hover {
  border-color: rgba(255,255,255,0.12);
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.cp-card-title {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.cp-card-title .icon {
  font-size: 24px;
}

.cp-card-subtitle {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 24px;
  line-height: 1.6;
}

/* ===== ファイターグリッド ===== */
.cp-fighter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
  max-height: 450px;
  overflow-y: auto;
  padding: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(231,65,43,0.3) transparent;
}

.cp-fighter-grid::-webkit-scrollbar {
  width: 6px;
}

.cp-fighter-grid::-webkit-scrollbar-track {
  background: transparent;
}

.cp-fighter-grid::-webkit-scrollbar-thumb {
  background: rgba(231,65,43,0.3);
  border-radius: 3px;
}

.cp-fighter-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: 12px;
  border: 2px solid transparent;
  background: rgba(255,255,255,0.04);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.cp-fighter-btn:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.15);
  transform: translateY(-2px);
}

.cp-fighter-btn.selected {
  background: linear-gradient(135deg, rgba(231,65,43,0.25), rgba(231,65,43,0.08));
  border-color: #e7412b;
  box-shadow: 0 0 16px rgba(231,65,43,0.2);
  transform: scale(1.08);
  animation: cp-select-pulse 0.4s ease;
}

@keyframes cp-select-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1.08); }
}

.cp-fighter-btn.selected::after {
  content: '✓';
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: #e7412b;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  box-shadow: 0 0 6px rgba(231,65,43,0.5);
}

/* ファイターアイコン: 丸型表示 */
.cp-fighter-btn img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.1);
  transition: all 0.25s;
}

.cp-fighter-btn.selected img {
  border-color: #e7412b;
  box-shadow: 0 0 10px rgba(231,65,43,0.5);
}

/* ===== 選択済みタグエリア ===== */
.cp-selected-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
}

.cp-selected-header .cp-sel-count {
  background: #e7412b;
  color: #fff;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
}

.cp-selected-area {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 50px;
  padding: 16px;
  background: rgba(255,255,255,0.02);
  border: 2px dashed rgba(255,255,255,0.1);
  border-radius: 14px;
  transition: all 0.3s;
  align-items: center;
}

.cp-selected-area.has-items {
  border-style: solid;
  border-color: rgba(231,65,43,0.2);
  background: rgba(231,65,43,0.03);
}

.cp-selected-placeholder {
  font-size: 13px;
  color: rgba(255,255,255,0.25);
  font-style: italic;
  width: 100%;
  text-align: center;
}

.cp-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  background: rgba(231,65,43,0.15);
  border: 1px solid rgba(231,65,43,0.3);
  border-radius: 50px;
  animation: cp-tag-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cp-tag-in {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.cp-tag img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.cp-tag-name {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}

.cp-tag-remove {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.6);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  margin-left: 2px;
}

.cp-tag-remove:hover {
  background: #e7412b;
  color: #fff;
}

/* ===== アクションボタン ===== */
.cp-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 24px 0;
}

.cp-btn {
  padding: 14px 36px;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Inter', 'Noto Sans JP', sans-serif;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.cp-btn-primary {
  background: linear-gradient(135deg, #e7412b, #d63520);
  color: #fff;
  box-shadow: 0 4px 16px rgba(231,65,43,0.3);
}

.cp-btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(231,65,43,0.4);
}

.cp-btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.cp-btn-primary.cp-ready {
  animation: cp-btn-bounce 0.6s ease;
}

@keyframes cp-btn-bounce {
  0%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
  50% { transform: translateY(-2px); }
  70% { transform: translateY(-4px); }
}

.cp-btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  animation: none;
}

.cp-btn-secondary {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.1);
}

.cp-btn-secondary:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

/* ===== 結果エリア ===== */
.cp-results {
  display: none;
  animation: cp-fade-up 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.cp-results.visible {
  display: block;
}

@keyframes cp-fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== 結果カード ===== */
.cp-result-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cp-result-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  transition: all 0.3s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.cp-result-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #e7412b, transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.cp-result-item:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(231,65,43,0.2);
  transform: translateX(4px);
}

.cp-result-item:hover::before {
  opacity: 1;
}

.cp-result-rank {
  font-size: 22px;
  font-weight: 800;
  color: rgba(255,255,255,0.15);
  min-width: 36px;
  text-align: center;
}

/* 上位3位はメダル絵文字に置換されるため色は不要、フォールバック用に残す */
.cp-result-item:nth-child(1) .cp-result-rank { color: #FFD700; text-shadow: 0 0 8px rgba(255,215,0,0.4); }
.cp-result-item:nth-child(2) .cp-result-rank { color: #C0C0C0; text-shadow: 0 0 8px rgba(192,192,192,0.3); }
.cp-result-item:nth-child(3) .cp-result-rank { color: #CD7F32; text-shadow: 0 0 8px rgba(205,127,50,0.3); }

/* 結果のファイターアイコン: 鮮明表示 */
.cp-result-img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  flex-shrink: 0;
}

.cp-result-info {
  flex: 1;
  min-width: 0;
}

.cp-result-name {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.cp-result-stats {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}

.cp-result-stats span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cp-result-coverage {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.cp-coverage-bar-wrap {
  width: 100px;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
}

.cp-coverage-bar {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #e7412b, #2ecc71);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.cp-coverage-text {
  font-size: 13px;
  font-weight: 700;
  color: #2ecc71;
}

/* ===== ファイター詳細ページリンク ===== */
.cp-result-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(67,132,252,0.1);
  color: #4384fc;
  font-size: 16px;
  text-decoration: none;
  flex-shrink: 0;
  transition: all 0.25s;
  border: 1px solid rgba(67,132,252,0.2);
}

.cp-result-link:hover {
  background: rgba(67,132,252,0.25);
  transform: scale(1.1);
  color: #fff;
}

/* ===== 展開可能な詳細 ===== */
.cp-result-detail {
  display: none;
  padding: 16px 20px;
  margin: -1px 0 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-top: none;
  border-radius: 0 0 16px 16px;
  animation: cp-detail-open 0.3s ease;
}

.cp-result-detail.open {
  display: block;
}

@keyframes cp-detail-open {
  from { opacity: 0; max-height: 0; }
  to { opacity: 1; max-height: 500px; }
}

.cp-detail-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cp-detail-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(46,204,113,0.08);
  border: 1px solid rgba(46,204,113,0.2);
  border-radius: 10px;
}

.cp-detail-chip img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.cp-detail-chip-info {
  font-size: 12px;
}

.cp-detail-chip-name {
  font-weight: 600;
  color: #fff;
}

.cp-detail-chip-wr {
  color: #2ecc71;
  font-weight: 700;
}

/* ===== カウンターバッジ ===== */
.cp-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  background: #e7412b;
  color: #fff;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  margin-left: 8px;
}

/* ===== 空状態 ===== */
.cp-empty {
  text-align: center;
  padding: 40px 20px;
  color: rgba(255,255,255,0.3);
  font-size: 14px;
  font-style: italic;
}

/* ===== 初期非表示（さらに表示で展開） ===== */
.cp-hidden-result {
  display: none !important;
}

/* ===== さらに表示ボタン ===== */
.cp-btn-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 14px;
  margin-top: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px dashed rgba(255,255,255,0.15);
  border-radius: 14px;
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.cp-btn-more:hover {
  background: rgba(231,65,43,0.08);
  border-color: rgba(231,65,43,0.3);
  color: #fff;
}

.cp-more-count {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  font-weight: 400;
}

/* ===== シェアボタン ===== */
.cp-share-area {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.cp-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: #000;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s;
}

.cp-share-btn:hover {
  background: #1a1a1a;
  border-color: rgba(255,255,255,0.3);
  transform: translateY(-2px);
}

.cp-share-x {
  font-size: 18px;
  font-weight: 800;
}

/* ===== レスポンシブ ===== */
@media (max-width: 840px) {
  .cp-container {
    max-width: 90%;
    padding: 16px;
    margin: 10px auto;
  }

  .cp-steps {
    gap: 0;
    margin-bottom: 20px;
  }

  .cp-step {
    padding: 8px 12px;
  }

  .cp-step-label {
    font-size: 11px;
  }

  .cp-step-number {
    width: 26px;
    height: 26px;
    font-size: 12px;
  }

  .cp-step-connector {
    width: 20px;
  }

  .cp-card {
    padding: 16px 12px;
    border-radius: 14px;
    margin-bottom: 16px;
  }

  .cp-card-title {
    font-size: 16px;
  }

  .cp-card-subtitle {
    font-size: 12px;
    margin-bottom: 16px;
  }

  /* モバイル: 4列グリッド */
  .cp-fighter-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    max-height: 360px;
  }

  .cp-fighter-btn {
    padding: 6px 2px;
    border-radius: 10px;
    border-width: 1.5px;
  }

  .cp-fighter-btn img {
    width: 40px;
    height: 40px;
  }

  .cp-selected-area {
    padding: 10px;
    gap: 8px;
    min-height: 40px;
  }

  .cp-tag {
    padding: 4px 8px 4px 4px;
    gap: 5px;
  }

  .cp-tag img {
    width: 22px;
    height: 22px;
  }

  .cp-tag-name {
    font-size: 10px;
  }

  .cp-actions {
    margin: 16px 0;
    gap: 10px;
  }

  .cp-btn {
    padding: 12px 24px;
    font-size: 13px;
    border-radius: 10px;
  }

  .cp-result-item {
    padding: 12px;
    gap: 10px;
    border-radius: 12px;
  }

  .cp-result-rank {
    font-size: 18px;
    min-width: 24px;
  }

  .cp-result-img {
    width: 40px;
    height: 40px;
  }

  .cp-result-name {
    font-size: 13px;
  }

  .cp-result-stats {
    gap: 8px;
    font-size: 10px;
    flex-wrap: wrap;
  }

  .cp-coverage-bar-wrap {
    width: 60px;
  }

  .cp-coverage-text {
    font-size: 12px;
  }

  .cp-result-link {
    width: 30px;
    height: 30px;
    font-size: 13px;
    border-radius: 8px;
  }

  .cp-result-detail {
    padding: 12px;
  }

  .cp-detail-grid {
    gap: 8px;
  }

  .cp-detail-chip {
    padding: 5px 8px;
  }

  .cp-detail-chip img {
    width: 22px;
    height: 22px;
  }

  .cp-detail-chip-info {
    font-size: 11px;
  }

  .cp-result-list {
    gap: 8px;
  }
}

/* ===== IvVݒ ===== */
.cp-options {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cp-option-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: rgba(255,255,255,0.85);
  flex-wrap: wrap;
}
.cp-option-item label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  cursor: pointer;
}
.cp-option-item input[type="range"] {
  flex: 1;
  max-width: 200px;
  accent-color: #e7412b;
}
.cp-option-item select {
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
}
.cp-option-item select:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
