﻿/**
 * player_filter - ローカルスタイル
 * version: 20251222 - Using shared design-tokens.css
 * 
 * 共通デザイントークンは /css/shared/design-tokens.css から読み込み済み
 */

body {
  font-family: "Inter", sans-serif;
  background-color: var(--c-bg);
  color: var(--c-text);
}

/* Widget Accordion Layout */
.widgets-accordion-container {
  margin-top: 1.5rem;
}

.widget-accordion {
  background-color: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.widget-accordion:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.widget-accordion[open] {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.widget-accordion-header {
  display: flex;
  align-items: center;
  padding: 0.875rem 1rem;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  cursor: pointer;
  user-select: none;
  list-style: none;
  font-weight: 600;
  color: #374151;
  transition: background-color 0.2s;
}

.widget-accordion-header::-webkit-details-marker {
  display: none;
}

.widget-accordion-header::before {
  content: "▶";
  font-size: 0.7rem;
  margin-right: 0.75rem;
  color: #6b7280;
  transition: transform 0.2s;
}

.widget-accordion[open] > .widget-accordion-header::before {
  transform: rotate(90deg);
}

.widget-accordion-header:hover {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.widget-accordion-title {
  flex: 1;
  font-size: 0.95rem;
}

.widget-accordion-content {
  padding: 1rem;
  border-top: 1px solid #e2e8f0;
  background-color: #fff;
}

/* 旧スタイル互換用 */
.widgets-grid-container {
  margin-top: 2rem;
}
.widget-card {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 1rem;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.05);
}

/* 全スロット技能マップ */
.slot-skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}

.slot-skill-card {
  background: linear-gradient(135deg, #f8fafc 0%, #fff 100%);
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 0.75rem;
  transition: box-shadow 0.2s, transform 0.2s;
}

.slot-skill-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.slot-skill-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.slot-number {
  font-weight: 700;
  font-size: 0.85rem;
  color: #1e3a8a;
}

.slot-fill-rate {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
}

.slot-fill-rate.high {
  background: #dcfce7;
  color: #166534;
}
.slot-fill-rate.mid {
  background: #fef9c3;
  color: #854d0e;
}
.slot-fill-rate.low {
  background: #fee2e2;
  color: #991b1b;
}

.slot-skill-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.slot-skill-bar-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem;
  align-items: center;
  font-size: 0.7rem;
}

.slot-skill-bar-bg {
  grid-column: 1 / -1;
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  overflow: hidden;
}

.slot-skill-bar {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 2px;
}

.slot-skill-name {
  color: #374151;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.slot-skill-percent {
  color: #6b7280;
  font-weight: 500;
}

.slot-unique-count {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px dashed #e2e8f0;
  font-size: 0.65rem;
  color: #9ca3af;
  text-align: right;
}

/* 隠れた実力者 */
.hidden-gems-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}

.hidden-gem-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
  border: 1px solid #fde047;
  border-radius: 0.5rem;
  transition: transform 0.2s;
}

.hidden-gem-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(234, 179, 8, 0.2);
}

.gem-rank {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eab308;
  color: white;
  font-weight: 700;
  font-size: 0.8rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.gem-content {
  flex: 1;
  min-width: 0;
}
.gem-player {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}
.gem-name {
  font-weight: 600;
  color: #1e3a8a;
  text-decoration: underline;
}
.gem-spec {
  font-size: 0.7rem;
  color: #6b7280;
}
.gem-stats {
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
}
.gem-highlight {
  font-weight: 700;
  color: #b45309;
}
.gem-value {
  color: #6b7280;
  margin-left: 0.25rem;
}
.gem-total {
  font-size: 0.7rem;
  color: #6b7280;
}
.gem-gap {
  color: #22c55e;
  font-weight: 600;
}

/* 急成長プレイヤー */
.improved-section {
  margin-bottom: 1rem;
}
.improved-section-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.5rem;
}
.improved-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.improved-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
}

.improved-rank {
  font-weight: 700;
  color: #6366f1;
  min-width: 20px;
}
.improved-name {
  font-weight: 600;
  color: #1e3a8a;
  text-decoration: underline;
}
.improved-spec {
  font-size: 0.75rem;
  color: #6b7280;
  flex: 1;
}
.improved-growth {
  font-weight: 700;
  font-size: 0.9rem;
}
.improved-growth.positive {
  color: #22c55e;
}
.improved-growth.negative {
  color: #ef4444;
}

/* 急成長プレイヤー（Top5スタイル） */
.improved-list-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 0.25rem;
  max-height: 450px;
  overflow-y: auto;
}

.improved-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.25rem 0.4rem;
  background: #f9fafb;
  border-radius: 0.25rem;
  font-size: 0.8rem;
}

.improved-list-item:hover {
  background: #e0e7ff;
}

.improved-info-container {
  display: flex;
  align-items: baseline;
  flex: 1;
  min-width: 0;
  margin-right: 0.5rem;
  overflow: hidden;
}

.improved-player-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  color: var(--c-text);
}

.improved-player-name:hover {
  text-decoration: underline;
}

.improved-spec-name {
  font-size: 0.7rem;
  color: var(--c-text-sub);
  margin-left: 0.5rem;
  white-space: nowrap;
}

.improved-team-name {
  font-size: 0.7rem;
  color: #9ca3af;
  margin-left: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.improved-value-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.improved-total-value {
  font-weight: 500;
  color: #4b5563;
}

.improved-growth-value {
  font-weight: 700;
  font-size: 0.75rem;
}

.improved-growth-value.positive {
  color: #22c55e;
}
.improved-growth-value.negative {
  color: #ef4444;
}

/* 役職バランス */
.role-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.5rem;
  background: #f9fafb;
  border-radius: 0.375rem;
}

.role-legend-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  color: #374151;
}

.role-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.team-balance-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.team-balance-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 0.75rem;
  transition: box-shadow 0.2s;
}

.team-balance-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.balance-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.balance-rank {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #6366f1;
  color: white;
  font-weight: 700;
  font-size: 0.75rem;
  border-radius: 50%;
}

.balance-team-name {
  font-weight: 600;
  flex: 1;
}
.balance-score {
  font-size: 0.75rem;
  color: #6b7280;
  background: #e0e7ff;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
}

.balance-role-bar {
  display: flex;
  height: 20px;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.role-bar {
  min-width: 8px;
  transition: flex 0.3s;
}

.balance-details {
  display: flex;
  gap: 1rem;
  font-size: 0.7rem;
  color: #6b7280;
}

/* 類似プレイヤー */
.similar-players-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.similar-pair-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 1px solid #93c5fd;
  border-radius: 0.5rem;
}
.similar-rank {
  font-weight: 700;
  color: #3b82f6;
  min-width: 24px;
}
.similar-player {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.similar-name {
  font-weight: 600;
  color: #1e3a8a;
}
.similar-spec {
  font-size: 0.7rem;
  color: #6b7280;
}
.similar-vs {
  font-size: 1.2rem;
  color: #9ca3af;
}
.similar-score {
  font-weight: 700;
  color: #22c55e;
  background: #dcfce7;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  font-size: 0.8rem;
}

/* レア構成 */
.rare-builds-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}
.rare-build-card {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
  border: 1px solid #c4b5fd;
  border-radius: 0.5rem;
}
.rare-rank {
  font-size: 1rem;
}
.rare-content {
  flex: 1;
}
.rare-player {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}
.rare-name {
  font-weight: 600;
  color: #6b21a8;
  text-decoration: underline;
}
.rare-spec {
  font-size: 0.7rem;
  color: #6b7280;
}
.rare-skills {
  font-size: 0.7rem;
  color: #4b5563;
  line-height: 1.4;
}

/* メタトレンド */
.meta-header {
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 1rem;
  padding: 0.5rem;
  background: #f9fafb;
  border-radius: 0.375rem;
}
.meta-section {
  margin-bottom: 1rem;
}
.meta-section-title {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.meta-spec-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.5rem;
}
.meta-spec-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.5rem;
  background: #f9fafb;
  border-radius: 0.25rem;
  font-size: 0.75rem;
}
.meta-spec-name {
  flex: 1;
  font-weight: 500;
}
.meta-spec-change {
  font-weight: 700;
}
.meta-spec-change.positive {
  color: #22c55e;
}
.meta-spec-change.negative {
  color: #ef4444;
}
.meta-spec-change.neutral {
  color: #6b7280;
}
.meta-spec-count {
  color: #9ca3af;
  font-size: 0.65rem;
}

/* パーセンタイル */
.percentiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}
.percentile-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 0.75rem;
}
.percentile-header {
  font-weight: 700;
  color: #4f46e5;
  font-size: 0.8rem;
  text-align: center;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e5e7eb;
}
.percentile-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.percentile-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
}
.percentile-label {
  color: #6b7280;
}
.percentile-value {
  font-weight: 600;
  color: #374151;
}
.percentile-range {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px dashed #e5e7eb;
  font-size: 0.65rem;
  color: #9ca3af;
}

/* ケミストリー */
.chemistry-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.chemistry-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 0.75rem;
}
.chemistry-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.chemistry-rank {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #8b5cf6;
  color: white;
  font-weight: 700;
  font-size: 0.75rem;
  border-radius: 50%;
}
.chemistry-team-name {
  font-weight: 600;
  flex: 1;
}
.chemistry-score {
  font-size: 0.8rem;
  font-weight: 600;
  color: #8b5cf6;
}
.chemistry-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.7rem;
  color: #6b7280;
}
.chemistry-strong {
  color: #22c55e;
}
.chemistry-weak {
  color: #f59e0b;
}

/* Utilities */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}
::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: #555;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Header */
.language-select-header {
  padding: 0.25rem 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  color: #4b5563;
  background-color: #f9fafb;
  min-width: 100px;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}
.message-box {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  padding: 1rem 1.5rem;
  border-radius: 0.375rem;
  box-shadow: 0 4px 6px rgb(0 0 0 / 0.1);
  z-index: 1000;
  display: none;
  opacity: 0;
  transition: opacity 0.3s;
  text-align: center;
}
.message-box.show {
  display: block;
  opacity: 1;
}
.message-box.success {
  background-color: var(--c-success);
}
.message-box.error {
  background-color: var(--c-error);
}
.message-box.info {
  background-color: var(--c-info);
}

/* Filters */
.filter-dropdown,
#globalKeywordSearchInput,
#occupationFilter,
#specializationFilter,
#teamFilter {
  font-size: 16px !important;
}
@media (min-width: 768px) {
  .filter-dropdown,
  #globalKeywordSearchInput,
  #occupationFilter,
  #specializationFilter,
  #teamFilter {
    font-size: 0.875rem !important;
  }
}
.advanced-filter-row .remove-filter-btn {
  background: transparent;
  border: none;
  color: var(--c-error);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 0.5rem;
}

/* Table - components.cssで共通定義済み */
/* 以下はローカル上書き */
.table-container {
  max-height: 70vh;
  overflow: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
}
.table-container table {
  width: 100%;
  min-width: max-content;
  border-collapse: collapse;
}
#resultsTable th,
#resultsTable td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--c-border);
  white-space: nowrap;
  font-size: 0.875rem;
  line-height: 1.25rem;
}
#resultsTable th {
  font-weight: 600;
  color: var(--c-text-sub);
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: var(--c-bg-header);
  cursor: pointer;
  user-select: none;
}
#resultsTable th:hover {
  background-color: #f3f4f6;
}
#resultsTable td {
  color: var(--c-text);
}
#resultsTable td.total-value-cell {
  font-weight: 600;
  color: var(--c-primary);
}
#resultsTable th:nth-child(1),
#resultsTable td:nth-child(1) {
  position: sticky;
  left: 0;
  z-index: 11;
  background-color: inherit;
  min-width: 40px;
}
#resultsTable tbody tr:nth-child(odd) {
  background-color: #fff;
}
#resultsTable tbody tr:nth-child(even) {
  background-color: var(--c-bg-alt);
}
#resultsTable td.clickable-name,
#resultsTable td.clickable-team {
  cursor: pointer;
  color: var(--c-primary);
  font-weight: 500;
}
#resultsTable td.clickable-name:hover,
#resultsTable td.clickable-team:hover {
  text-decoration: underline;
}

/* Analysis Cards */
.top5-card,
.occupation-skill-card,
.analysis-card {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 0.75rem;
}
.analysis-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  gap: 0.5rem;
}
@media (min-width: 768px) {
  .analysis-header {
    justify-content: flex-start;
    gap: 1.5rem;
  }
}
.top5-card-title,
.analysis-card-title,
.occupation-title {
  font-weight: 600;
  color: var(--c-primary);
  margin-bottom: 0.5rem;
}
.occupation-title {
  font-size: 1.125rem;
  color: #1e3a8a;
  margin-bottom: 1rem;
}

/* Top 5 Layout Fix (Corrected) */
.top5-list {
  list-style: none;
  padding: 0;
  font-size: 0.8rem;
  space-y: 0.25rem;
}
.top5-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
.top5-info-container {
  display: flex;
  align-items: baseline;
  flex: 1;
  min-width: 0;
  margin-right: 0.5rem;
  overflow: hidden;
}
.top5-player-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  color: var(--c-text);
}
.top5-player-name:hover {
  text-decoration: underline;
}
.top5-spec-name {
  font-size: 0.7rem;
  color: var(--c-text-sub);
  margin-left: 0.5rem;
  white-space: nowrap;
}
.top5-team-name {
  font-size: 0.7rem;
  color: #9ca3af;
  margin-left: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top5-player-value {
  font-weight: 500;
  color: #4b5563;
  flex-shrink: 0;
}
.show-more-btn {
  font-size: 0.75rem;
  color: #4f46e5;
  background: none;
  border: none;
  cursor: pointer;
  margin-top: 0.5rem;
}

/* Team Ranking */
.team-ranking-list {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 1rem;
}
.team-ranking-item {
  display: grid;
  grid-template-columns: 2rem 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 0.25rem 0;
  font-size: 0.85rem;
  border-bottom: 1px solid #e2e8f0;
}
.team-ranking-item:last-child {
  border-bottom: none;
}
.team-rank {
  font-weight: 600;
  text-align: center;
  color: #64748b;
}
.team-name {
  font-weight: 500;
  display: flex;
  align-items: center;
}
.team-avg-value {
  font-weight: 600;
  color: var(--c-primary);
}

/* Accordions */
.team-composition-accordion,
.stat-growth-accordion {
  border-bottom: 1px solid var(--c-border);
}
.team-composition-accordion:last-child,
.stat-growth-accordion:last-child {
  border-bottom: none;
}
.team-composition-accordion summary,
.stat-growth-accordion summary {
  cursor: pointer;
  padding: 0.75rem 0.5rem;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s;
}
.team-composition-accordion summary:hover,
.stat-growth-accordion summary:hover {
  background-color: var(--c-bg-hover);
}
.team-composition-accordion summary::after,
.stat-growth-accordion summary::after {
  content: "▼";
  font-size: 0.8em;
  color: var(--c-text-sub);
  transition: transform 0.2s;
}
.team-composition-accordion[open] > summary::after,
.stat-growth-accordion[open] > summary::after {
  transform: rotate(180deg);
}

.team-composition-accordion .team-member-list-container {
  padding: 0 0.5rem 0.75rem 0.5rem;
}
@media (max-width: 767px) {
  .team-composition-accordion .team-member-list-container {
    column-count: 1;
  }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .team-composition-accordion .team-member-list-container {
    column-count: 2;
  }
}

.team-role-group {
  margin-top: 0.75rem;
  page-break-inside: avoid;
  break-inside: avoid;
}
.team-role-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #4b5563;
  padding-bottom: 0.25rem;
  border-bottom: 2px solid var(--c-border);
  margin-bottom: 0.5rem;
}
.team-role-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
}
.team-member-item {
  display: block;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  cursor: pointer;
  font-size: 0.8rem;
}
.team-member-item:hover {
  background-color: var(--c-bg-hover);
}
.team-member-spec {
  font-size: 0.75rem;
  color: var(--c-text-sub);
  margin-left: 0.25rem;
}

/* Skill Usage */
.specialization-accordion summary {
  cursor: pointer;
  font-weight: 600;
  color: #059669;
  padding: 0.5rem;
  border-radius: 0.25rem;
  transition: background 0.2s;
  list-style: none;
}
.specialization-accordion summary:hover {
  background-color: #f0fdf4;
}
.specialization-accordion[open] > summary {
  background-color: #ecfdf5;
}
.specialization-accordion summary::before {
  content: "▶";
  margin-right: 0.5rem;
  display: inline-block;
  transition: transform 0.2s;
}
.specialization-accordion[open] > summary::before {
  transform: rotate(90deg);
}
.skill-usage-list {
  list-style: none;
  padding: 0.75rem 0.5rem 0.25rem;
  space-y: 0.5rem;
}
.skill-usage-item {
  display: flex;
  flex-direction: column;
}
.skill-usage-item > div:first-child {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.125rem;
  font-size: 0.75rem;
}
.skill-usage-bar-bg {
  background-color: #e5e7eb;
  border-radius: 0.25rem;
  height: 6px;
  width: 100%;
  overflow: hidden;
}
.skill-usage-bar {
  background-color: #10b981;
  height: 100%;
  border-radius: 0.25rem;
}

/* Stat Growth */
.stat-growth-accordion .stat-growth-list {
  padding: 0.5rem 1rem 1rem;
  column-count: 2;
  column-gap: 2rem;
}
@media (max-width: 767px) {
  .stat-growth-accordion .stat-growth-list {
    column-count: 1;
  }
}
.stat-growth-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  padding: 0.2rem 0;
  border-bottom: 1px solid #f3f4f6;
}
.stat-growth-value.positive {
  color: #16a34a;
}
.stat-growth-value.negative {
  color: var(--c-error);
}

/* Histogram */
.histogram-bar-container {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 100px;
  margin-top: 0.5rem;
}
.histogram-bar {
  background-color: #3b82f6;
  flex-grow: 1;
}
.histogram-label {
  font-size: 0.7rem;
  text-align: center;
  color: var(--c-text-sub);
  line-height: 1.3;
  flex-grow: 1;
  flex-basis: 0;
}

/* Modal */
#modal-container.flex {
  display: flex;
}
#modal-container.hidden {
  display: none;
}
#modal-content {
  padding: 1rem !important;
}
#modal-title .modal-name-link {
  color: #3b82f6;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.modal-player-details .player-card {
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
}
.modal-player-details .stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.125rem 1rem;
}
@media (min-width: 768px) {
  .modal-player-details .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.125rem 2.5rem;
  }
}
.stat-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.2rem 0;
  align-items: baseline;
}
.stat-value-container {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0.5rem;
  font-weight: 600;
}
.stat-item-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--c-border);
}
.total-value-main {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--c-primary);
}

/* Evaluation */
.evaluation-details summary {
  cursor: pointer;
  font-weight: 600;
  padding: 0.5rem;
  border-radius: 0.375rem;
  margin-top: 1.5rem;
  border-top: 1px solid var(--c-border);
  padding-top: 1.5rem;
  list-style: none;
  transition: background 0.2s;
}
.evaluation-details summary:hover {
  background-color: #f3f4f6;
}
.evaluation-details summary::before {
  content: "▶";
  margin-right: 0.5rem;
  display: inline-block;
  transition: transform 0.2s;
}
.evaluation-details[open] > summary::before {
  transform: rotate(90deg);
}
.evaluation-grid {
  padding: 0.75rem 0.5rem;
  font-size: 0.85rem;
}
.evaluation-pc {
  display: none;
}
.evaluation-sp {
  display: block;
}
@media (min-width: 641px) {
  .evaluation-pc {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem 2rem;
  }
  .evaluation-sp {
    display: none;
  }
}
.evaluation-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f3f4f6;
  padding: 0.25rem 0;
}
.evaluation-separator {
  height: 0.75rem;
}
.evaluation-item-total-highlight {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 2px solid #60a5fa;
}
.evaluation-explanation {
  font-size: 0.75rem;
  color: #4b5563;
  background-color: #f9fafb;
  padding: 0.75rem;
  border-radius: 0.375rem;
  margin: 0.75rem 0.5rem 0.25rem;
}
.stat-rank {
  font-size: 0.8em;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 0.25rem;
  color: #fff;
}
.rank-sss {
  background-color: #f59e0b;
}
.rank-ss {
  background-color: #a855f7;
}
.rank-s {
  background-color: var(--c-error);
}
.rank-a {
  background-color: #3b82f6;
}
.rank-b {
  background-color: var(--c-success);
}
.rank-c {
  background-color: var(--c-text-sub);
}

.chart-wrapper {
  position: relative;
  max-width: 450px;
  max-height: 450px;
  margin: auto;
}
.modal-analysis-container {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--c-border);
}
.modal-analysis-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

/* New: Video Search Button */
.video-search-btn {
  margin-left: 0.5rem;
  color: #9ca3af;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.video-search-btn:hover {
  color: #1d4ed8;
  background-color: #eef2ff;
}

/* Misc */
.custom-btn {
  color: #fff;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
  transition: all 0.15s;
}
.search-reset-button {
  background-color: var(--c-error);
  border-color: var(--c-error);
}
.search-reset-button:hover {
  background-color: #dc2626;
}
.player-type-list,
.ideal-comp-list {
  list-style: none;
  padding: 0;
}
.ideal-comp-list {
  column-count: 3;
  column-gap: 1.5rem;
}
@media (max-width: 767px) {
  .ideal-comp-list {
    column-count: 1;
  }
}
.player-type-item,
.ideal-comp-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  page-break-inside: avoid;
}
.player-type-value,
.ideal-comp-value {
  font-weight: 600;
  color: #1e3a8a;
}

/* ===========================================
   グローバル検索（全大会横断検索）
   =========================================== */
.global-search-wrapper {
  position: relative;
  z-index: 100;
}

.global-cross-search-input {
  font-size: 0.875rem;
  color: #374151;
  background: #fff;
}

.global-cross-search-input::placeholder {
  color: #9ca3af;
  font-size: 0.8rem;
}

.global-search-results-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  width: 380px;
  max-height: 450px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  z-index: 1000;
}

.global-search-empty {
  padding: 1.5rem;
  text-align: center;
  color: #6b7280;
  font-size: 0.875rem;
}

.global-search-section {
  border-bottom: 1px solid #f3f4f6;
}

.global-search-section:last-child {
  border-bottom: none;
}

.global-search-section-title {
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  font-size: 0.75rem;
  font-weight: 600;
  color: #6366f1;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: sticky;
  top: 0;
  z-index: 10;
}

.global-search-result-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  cursor: pointer;
  transition: background-color 0.15s;
  border-bottom: 1px solid #f9fafb;
}

.global-search-result-item:hover {
  background-color: #f0f9ff;
}

.global-search-result-item:last-child {
  border-bottom: none;
}

.global-search-match-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.125rem 0.375rem;
  font-size: 0.625rem;
  font-weight: 600;
  border-radius: 0.25rem;
  text-transform: uppercase;
  flex-shrink: 0;
}

.global-search-match-badge.name {
  background: #dbeafe;
  color: #1d4ed8;
}

.global-search-match-badge.team {
  background: #dcfce7;
  color: #16a34a;
}

.global-search-match-badge.skill {
  background: #fef3c7;
  color: #d97706;
}

.global-search-match-badge.other {
  background: #f3f4f6;
  color: #6b7280;
}

.global-search-player-name {
  font-weight: 600;
  color: #1e3a8a;
  flex-shrink: 0;
}

.global-search-player-name mark {
  background: #fef08a;
  color: inherit;
  padding: 0 0.125rem;
  border-radius: 0.125rem;
}

.global-search-spec {
  font-size: 0.75rem;
  color: #6b7280;
  flex-shrink: 0;
}

.global-search-team {
  font-size: 0.7rem;
  color: #9ca3af;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-search-team mark {
  background: #fef08a;
  color: inherit;
  padding: 0 0.125rem;
  border-radius: 0.125rem;
}

.global-search-more {
  padding: 0.5rem 1rem;
  font-size: 0.7rem;
  color: #6366f1;
  text-align: center;
  background: #f8fafc;
}

/* レスポンシブ対応 */
@media (max-width: 640px) {
  .global-search-results-dropdown {
    position: fixed;
    top: 120px;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    width: auto;
    max-width: none;
    max-height: none;
    margin-top: 0;
    overflow-y: auto;
  }
  
  .global-cross-search-input {
    max-width: 120px;
  }
  
  .global-search-wrapper {
    position: static;
  }
}
