/* ── キャラ一覧（ステータス + 検索） ── */
.charlist-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.charlist-search {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  font-size: 0.95em;
  background: #0a0f1a;
  color: #fff;
  border: 1px solid #0f3460;
  border-radius: 8px;
  outline: none;
}
.charlist-search:focus { border-color: #4fc3f7; }
.charlist-search::placeholder { color: #667; }

.charlist-sort {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.charlist-sort-btn {
  padding: 4px 10px;
  font-size: 0.78em;
  background: #0f1e35;
  color: #7ec8e3;
  border: 1px solid #1a3a5c;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}
.charlist-sort-btn.active {
  background: #0f3460;
  color: #fff;
  border-color: #4fc3f7;
}
.charlist-sort-btn:hover:not(.active) { background: #162840; }

.charlist-count {
  color: #889;
  font-size: 0.78em;
  text-align: right;
}

.charlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.charlist-card {
  background: linear-gradient(145deg, #16213e, #1a1a2e);
  border: 1px solid #0f3460;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.charlist-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  background: #0a0f1a;
  overflow: hidden;
}
.charlist-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  cursor: pointer;
}
.charlist-type {
  position: absolute;
  left: 6px;
  bottom: 6px;
  margin: 0;
  font-size: 0.72em;
  box-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

.charlist-body {
  padding: 8px 9px 9px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.charlist-name {
  font-size: 0.95em;
  font-weight: bold;
  color: #e94560;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.charlist-stats {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 0.72em;
}
.charlist-stat {
  display: flex;
  justify-content: space-between;
  color: #ccc;
}
.charlist-stat span:last-child { color: #fff; font-weight: bold; }
.charlist-total { color: #ffd700 !important; }

.charlist-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 4px;
}
.charlist-skill {
  font-size: 0.62em;
  padding: 1px 5px;
  background: #0f3460;
  color: #9ec8e3;
  border-radius: 3px;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .charlist-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}

/* ── キャラ詳細モーダル ── */
.cd-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.cd-inner {
  position: relative;
  background: #0a0f1a;
  border: 1px solid #0f3460;
  border-radius: 12px;
  padding: 18px;
  max-width: 460px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
}
.cd-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 30px;
  height: 30px;
  background: #1a1a2e;
  color: #fff;
  border: 1px solid #0f3460;
  border-radius: 6px;
  font-size: 1.1em;
  line-height: 1;
  cursor: pointer;
}
.cd-close:hover { background: #16213e; }

.cd-head {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}
.cd-img {
  width: 84px;
  height: 112px;
  object-fit: cover;
  object-position: top center;
  border-radius: 8px;
  border: 1px solid #0f3460;
  background: #060a12;
  flex-shrink: 0;
  cursor: zoom-in;
}

/* ── 画像拡大モーダル（画面の約8割） ── */
.cimg-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  padding: 16px;
}
.cimg-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: 80vw;
  max-height: 80vh;
}
.cimg-img {
  max-width: 80vw;
  max-height: 74vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.7);
}
.cimg-name {
  color: #fff;
  font-size: 1.05em;
  font-weight: bold;
  text-shadow: 0 1px 4px #000;
}
.cd-head-info { display: flex; flex-direction: column; gap: 6px; }
.cd-name { font-size: 1.15em; font-weight: bold; color: #e94560; }
.cd-total { color: #aaa; font-size: 0.85em; }
.cd-total b { color: #ffd700; }

.cd-section-title {
  color: #7ec8e3;
  font-size: 0.82em;
  font-weight: bold;
  border-left: 3px solid #4fc3f7;
  padding-left: 7px;
  margin: 14px 0 8px;
}

.cd-hist { display: flex; flex-direction: column; gap: 4px; }
.cd-hist-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #0f1e35;
  border: 1px solid #1a2a4a;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.82em;
}
.cd-hist-result { font-weight: bold; width: 32px; flex-shrink: 0; }
.cd-hist-vs { flex: 1; color: #ddd; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-hist-mode { color: #889; font-size: 0.85em; flex-shrink: 0; }

.cd-chart {
  background: linear-gradient(145deg, #16213e, #1a1a2e);
  border: 1px solid #0f3460;
  border-radius: 10px;
  padding: 12px 10px;
}
