/*!
 * tsum-box.css v5.3
 * ツムカード3カラム / 名前＋バッチ → レベル＋残りツム → スライダー
 * 残りコインはデータ保持のみ（表示しない）
 * 完売バッチ時に2段目を非表示
 * スマホ横はみ出し防止
 */

/* ===== グリッドレイアウト ===== */
.tsum-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

@media (min-width: 768px) {
  .tsum-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1200px) {
  .tsum-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

/* ===== カード本体 ===== */
.tsum-card {
  border: 1px solid #ddd;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  background: #fff;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-sizing: border-box;
  max-width: 100%;
  width: 100%;
  overflow-wrap: break-word;
}

/* ===== ヘッダー（名前＋バッチ） ===== */
.tsum-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 0.5rem;
}

.tsum-name {
  font-size: 1rem;
  font-weight: bold;
  white-space: nowrap;
}

/* 完売バッチ */
.sold-out {
  background: #e60000;
  color: #fff;
  padding: 0.1rem 0.7rem;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: bold;
  display: none;
  pointer-events: none;
  white-space: nowrap;
  line-height: 1;
  height: 98%;      /* 高さ固定でカードの伸縮を防止 */
  box-sizing: border-box;
}

.tsum-card.sold .sold-out {
  display: inline-block;
}

/* ===== 2段目（レベル＋残りツム） ===== */
.tsum-subinfo {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.9rem;
  color: #555;
}

/* sold のとき2段目は非表示 */
.tsum-card.sold .tsum-subinfo {
  display: none;
}

/* ===== 残りコインは保持だけ（非表示） ===== */
.tsum-meta .remain-coin {
  display: none;
}

/* ===== スライダー ===== */
.tsum-skill {
  margin-top: 0.3rem;
}
.tsum-skill input[type="range"],
.tsum-range {
  width: 100%;
}

/* ===== 残りコイン合計（全幅中央揃え） ===== */
.total-coin-heading {
  grid-column: 1 / -1;
  text-align: center;
  margin-bottom: 0.5rem;
  font-size: 1.3rem;
  font-weight: bold;
}

.total-remain-wrap {
  background: #f8f8f8;
  padding: 0.75rem 1rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  margin-bottom: 1rem;
  grid-column: 1 / -1;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* ===== CSV & 保存ボタン ===== */
.csv-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 1rem;
}

@media (max-width: 767px) {
  .csv-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

.tsum-save {
  padding: 0.75rem 1.5rem;
  background: #28a745;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
}
.tsum-save:hover {
  background: #1e7e34;
}

.csv-actions .csv-btn {
  padding: 0.75rem 1.5rem;
  background: #0073aa;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
.csv-actions .csv-btn:hover {
  background: #005177;
}

.csv-actions input[type="file"] {
  display: none;
}

/* ===== スマホ全体の横スクロール防止 ===== */
body {
  overflow-x: hidden;
}
