/* ==========================================================================
   0. レスポンシブ基準設定
   ========================================================================== */

html {
  scrollbar-gutter: stable;
  font-size: clamp(14px, 3.2vw, 18px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* ==========================================================================
   1. 全体設定
   ========================================================================== */

body {
  padding-top: 3.8rem;          /* 60px → rem化 */
  margin: 0;
  overflow-x: hidden;           /* 横スクロール防止 */
  font-family: sans-serif;
  background-color: #f4f6f9;
}

body.is-loading {
  overflow: hidden;
}

body.modal-open {
  overflow: hidden;
  scrollbar-gutter: stable;
}

body.is-hide-images .main-image {
  display: none !important;
}

:root {
  /* デフォルト（櫻坂）の色 */
  --theme-color: #f0a1b5;
}

body.sakurazaka46 {
  --theme-color: #f0a1b5;
}

body.hinatazaka46 {
  --theme-color: #5bbee4;
}


/* ==========================================================================
   2. ローディングオーバーレイ
   ========================================================================== */

#loadingOverlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}

/* スケール・速度を画面に応じて微調整可能に */
:root {
  --loading-min-scale: 0.7;
  --loading-max-scale: clamp(1.6, 4vw, 2.2);
  --loading-duration: 1.4s;
}

/* アイコン自体を可変サイズ化（SVG想定） */
.loading-icon {
  font-size: clamp(2rem, 8vw, 3.5rem);
  /* color: var(--theme-color); */
  background:linear-gradient(#ff69b4 30%, #5bbee4 );
	background-clip:text;
  animation: loadingPulse var(--loading-duration) ease-in-out infinite;
	-webkit-text-fill-color: transparent;
}

@keyframes loadingPulse {
  0% {
    transform: scale(var(--loading-min-scale));
  }

  50% {
    transform: scale(var(--loading-max-scale));
  }

  100% {
    transform: scale(var(--loading-min-scale));
  }
}

/* フェードアウト用 */
.loading-hide {
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* ==========================================================================
   3. アコーディオンアイコン
   ========================================================================== */

.accordion-icon::after {
  display: inline-block;

  /* 16px → 可変サイズ化 */
  width: clamp(0.9rem, 3.5vw, 1.2rem);
  height: clamp(0.9rem, 3.5vw, 1.2rem);

  /* 6px → rem化 */
  margin: 0.35rem 0.35rem 0;
  content: "";
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23888'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  transition: transform 0.25s ease;
}

.collapsed.accordion-icon::after,
.collapsed .accordion-icon::after {
  transform: rotate(90deg);
}

/* ==========================================================================
   4. 上部固定バー
   ========================================================================== */

.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  width: 100%;

  /* 50px → 可変高さ */
  height: clamp(3rem, 6vw, 3.5rem);
  background: #fff;

  /* 3px → rem化 */
  border-bottom: 0.2rem solid;
  border-image: linear-gradient(to right, #fff, var(--theme-color), #7f1084) 1;
}

.top-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;

  /* 1200px → より自然な制御 */
  max-width: min(92%, 75rem);
  height: 100%;

  /* 20px → rem化 */
  margin: 0 auto;
}

.top-bar-main h1 {
  margin: 0;

  /* 18px → 可変フォント */
  font-size: clamp(1rem, 4vw, 1.2rem);
}

.top-bar-right {
  display: flex;

  /* 10px → rem化 */
  gap: 0.6rem;
  align-items: center;
}

#siteName {
  transition: opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
}

#siteName:hover {
  opacity: 0.7;
}

.menu-btn {
  /* 22px → 可変 */
  font-size: clamp(1.2rem, 5vw, 1.5rem);
  color: #888;
  cursor: pointer;
  background: none;
  border: none;
  -webkit-tap-highlight-color: transparent;
}

.menu-btn:hover {
  color: #333;
  transition: color 0.2s;
}

.menu-btn:active {
  background-color: rgb(0, 0, 0 / 0.1) !important;
}

/* ==========================================================================
   5. 通知用トースト / サイドバー / オーバーレイ
   ========================================================================== */

/* =========================
   通知トースト
   ========================= */

.toast-notification {
  position: fixed;

  /* 60px → 可変 */
  top: clamp(3.2rem, 6vw, 3.8rem);
  left: 50%;
  z-index: 10000;
  visibility: hidden;

  /* 200px → 可変 */
  width: clamp(14rem, 60vw, 16rem);
  padding: 0.6rem 1rem;
  font-size: clamp(0.8rem, 3.5vw, 0.9rem);
  color: #fff;
  text-align: center;
  background-color: var(--theme-color);
  border-radius: 50px;
  opacity: 0;
  transform: translateX(-50%) translateY(-20px);
  transition: all 0.3s ease;
}

.toast-notification.show {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* =========================
   サイドバー
   ========================= */

.sidebar {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 1200;

  /* 210px → 可変 */
  width: clamp(13rem, 65vw, 18rem);
  height: 100vh;
  padding: clamp(1rem, 4vw, 1.5rem);
  background: #fff;
  box-shadow: -0.2rem 0 0.8rem rgb(0 0 0 / 0.1);
  transform: translateX(100%);
  transition: transform 0.2s ease;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sidebar.active {
  transform: translateX(0);
}

/* 閉じるボタン */

.close-sidebar-btn {
  position: absolute;
  top: 0.6rem;
  right: 1.4rem;
  z-index: 1250;
  padding: 0.3rem 0.6rem;

  /* 32px → 可変 */
  font-size: clamp(1.6rem, 6vw, 2rem);
  line-height: 1;
  color: #888;
  cursor: pointer;
  background: none;
  border: none;
  transition: color 0.2s;
  -webkit-tap-highlight-color: var(--theme-color)
}

.close-sidebar-btn:hover {
  color: #333;
}

/* =========================
   サイドバー内部
   ========================= */

.sidebar-content {
  margin-top: clamp(3rem, 8vw, 4rem);
}

.sidebar-group {
  margin-top: 0.8rem;
}

.sidebar-group-title {
  padding-bottom: 0.4rem;
  font-size: clamp(0.7rem, 3vw, 0.8rem);
  font-weight: bold;
  color: #888;
  text-transform: uppercase;
}

.sidebar-item,
.sidebar-link {
  display: flex;
  align-items: center;
  padding: 0.6rem 0 0.6rem 0.8rem;
  font-size: clamp(0.85rem, 3.5vw, 0.95rem);
  cursor: pointer;
  transition:
    color 0.3s ease,
    opacity 0.3s ease,
    background-color 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}

.sidebar-item svg,
.sidebar-link svg {
  flex-shrink: 0;
  margin-right: 0.5rem;
}

.sidebar-item .check-icon {
  visibility: hidden;
  flex-shrink: 0;
  width: clamp(0.9rem, 3.5vw, 1rem);
  height: clamp(0.9rem, 3.5vw, 1rem);
  margin-right: 0.5rem;
}

.sidebar-item.active[data-type="group"] .check-icon,
.sidebar-item.active[data-type="mode"] .check-icon,
.sidebar-item.active[data-type="photo"] .check-icon {
  visibility: visible;
}

.sidebar-item[data-type="group"].active,
.sidebar-item[data-type="mode"].active,
.sidebar-item[data-type="photo"].active {
  color: white;
  background-color: var(--theme-color);
  border-radius: 0.4rem;
}

.sidebar-link span {
  flex: 1;
}

.sidebar-link:hover {
  margin-left: auto;
  color: #888;
}

.sidebar-divider {
  margin: 0.4rem 0 0.3rem;
  border: none;
  border-top: 1px solid #e0e0e0;
}

/* =========================
   オーバーレイ
   ========================= */

.sidebar-overlay,
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  visibility: hidden;
  width: 100%;
  height: 100vh;
  background: rgb(0 0 0 / 0.3);
  opacity: 0;
  transition: 0.3s;
}

.sidebar-overlay {
  z-index: 1100;
}

.modal-overlay {
  z-index: 1300;
}

.modal-overlay.active,
.sidebar-overlay.active {
  visibility: visible;
  opacity: 1;
}

/* ==========================================================================
   6. モーダル本体
   ========================================================================== */

.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background-color: transparent;
}

.modal.active {
  display: flex;
}

.modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 92%;
  max-width: clamp(22rem, 90vw, 38rem);
  max-height: 85vh;
  overflow: hidden;
  pointer-events: auto;
  background-color: #fff;
  border-radius: 1rem;
  box-shadow: 0 0.3rem 1.2rem rgb(0 0 0 / 0.2);
  -webkit-overflow-scrolling: touch;
}

.modal-header {
  flex-shrink: 0;
  padding: 0.9rem;
  text-align: center;
  border-bottom: 1px solid #eee;
}

.modal-header h3 {
  margin: 0;
  font-size: clamp(1rem, 4vw, 1.2rem);
  color: #333;
}

.modal-body {
  flex-grow: 1;
  padding: 0 1.2rem;
  overflow-y: auto;
  text-align: left;
  -webkit-overflow-scrolling: touch;
}

/* モーダル用 カード */

.modal-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: clamp(1rem, 4vw, 1.4rem);
  margin: 1rem;
  background-color: #fafafa;
  border: 1px solid #eee;
  border-radius: 1rem;
}

.modal-card-description h4 {
  margin: 0 0 0.3rem;
  font-size: clamp(0.95rem, 3.5vw, 1.05rem);
  color: #333;
}

.modal-card-description p {
  margin-top: 0.8rem;
  margin-bottom: 0;
  font-size: clamp(0.8rem, 3.2vw, 0.9rem);
  line-height: 1.6;
  color: #666;
}

.modal-card-action {
  display: flex;
  justify-content: flex-end;
  width: 100%;
  margin-top: 0.8rem;
}

.modal-footer {
  display: flex;
  flex-shrink: 0;
  justify-content: center;
  padding: 0.9rem;
  background-color: #f9f9f9;
  border-top: 1px solid #eee;
}

/* モーダル用 閉じるボタン */

.modal-close-btn {
  display: inline-block;
  width:100%;
  padding: 0.4rem 0.8rem;
  font-size: clamp(0.85rem, 3.5vw, 0.95rem);
  color: #333;
  cursor: pointer;
  background-color: #f8f9fa;
  border: none;
  border-radius: 0.6rem;
  -webkit-tap-highlight-color: transparent;
}

.modal-close-btn:hover {
  background-color: #eee;
}

.modal-close-btn:active {
  background-color: rgb(0 0 0 / 0.1) !important;
  transform: scale(0.97);
}

/* ==========================================================
   ボタン共通
   ========================================================== */

.backup-btn,
.file-input-btn,
.reset-btn {
  display: inline-block;
  align-self: flex-end;
  padding: 0.4rem 1rem;
  margin-right: 0.6rem;
  font-size: clamp(0.8rem, 3.2vw, 0.9rem);
  color: white;
  cursor: pointer;
  border: none;
  border-radius: 999px;
  transition: opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.backup-btn,
.file-input-btn {
  background-color: var(--theme-color);
}

.backup-btn:hover,
.file-input-btn:hover {
  opacity: 0.9;
}

.backup-btn:active,
.file-input-btn:active {
  transform: scale(0.97);
}

/* 初期化関連 */

.reset-text {
  margin-bottom: 1.2rem;
}

.reset-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 0.8rem 0;
}

.reset-btn {
  background-color: #e74c3c;
}

.reset-btn:hover {
  opacity: 0.9;
}

.reset-btn:active {
  background-color: rgb(231 76 60 / 0.9) !important;
  transform: scale(0.97);
}

.reset-btn:disabled,
.reset-btn.is-disabled {
  pointer-events: none;
  cursor: not-allowed;
  background-color: #ccc !important;
  opacity: 0.7;
  transform: none !important;
}

/* ==========================================================
   テキスト系
   ========================================================== */

.usage-text {
  margin-bottom: 0.4rem;
}

.usage-text h4,
.info-text h4,
.inq-text h4 {
  margin: 0 0 0.3rem;
  font-size: clamp(0.95rem, 3.5vw, 1.05rem);
  color: #333;
}

.usage-text h5 {
  margin-bottom: 0.3rem;
  font-size: clamp(0.8rem, 3.2vw, 0.9rem);
}

.usage-text svg{
  padding-top: 0.2rem;
}

.usage-text p,
.info-text p,
.inq-text p {
  margin-top: 0.8rem;
  margin-bottom: 0;
  font-size: clamp(0.8rem, 3.2vw, 0.9rem);
  line-height: 1.6;
}

.info-text h4 {
  margin-bottom: 1.4rem;
}

.info-text h4,
.info-text p {
  text-align: center;
}

/* ==========================================================
   Twitterリンク
   ========================================================== */

.twitter-link {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  justify-content: center;
  margin: 1rem 0;
  font-size: clamp(0.8rem, 3.2vw, 0.9rem);
  color: #1da1f2;
  text-align: center;
  text-decoration: none;
}

.twitter-link:hover {
  text-decoration: underline;
  -webkit-tap-highlight-color: transparent;
}

/* ==========================================================================
   7. フィルター
   ========================================================================== */

/* =========================
   フィルター
   ========================= */

.filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.5rem 0.3rem 0;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.filter-title {
  font-size: clamp(0.9rem, 3.5vw, 1rem);
  font-weight: bold;
  color: #555;
}

#filterBody {
  display: flex;
  flex-direction: column;
}

/* 行ブロック */

.filter-row,
#genFilter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid #eee;
}

#memberFilter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.3rem 0 0;
}

/* =========================
   ボタン群
   ========================= */

/* flex → grid化で自然列制御 */

.filter-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(5.5rem, 1fr));
  gap: 0.4rem;
  padding: 0.3rem 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.filter-btn {
  min-width: 5.7rem;
  max-width: 7.0rem;
  padding: 0.4rem 0.6rem;
  font-size: clamp(0.8rem, 3.2vw, 0.9rem);
  color:#000000;
  cursor: pointer;
  background-color: #f5f5f5;
  border: none;
  border-radius: 999px;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.filter-btn:hover {
  opacity: 0.85;
}

.filter-btn.active {
  color: white;
  background-color: var(--theme-color);
}

/* =========================
   検索エリア
   ========================= */

.search-area {
  display: flex;
  align-items: left;
}

.search-wrapper {
  position: relative;
  flex: 1;
  width: 100%;
  padding-bottom: 0.3rem;
  color: #333;
}

#searchInput {
  width: 100%;
  padding: 0.7rem 0.9rem 0.7rem 2.4rem;
  font-size: clamp(0.85rem, 3.5vw, 0.95rem);
  border: 1px solid #ddd;
  border-radius: 0.6rem;
}

#searchInput:focus {
  outline: none;
  border-color: var(--theme-color);
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 0.8rem;
  padding-bottom: 0.1rem;
  color: #888;
  pointer-events: none;
  transform: translateY(-50%);
}

/* =========================
   チェックボックス
   ========================= */

input[type="checkbox"] {
  accent-color: var(--theme-color);
}

/* 説明無し */

.checkbox-wrapper {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  font-size: clamp(0.8rem, 3.2vw, 0.9rem);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.checkbox-wrapper input[type="checkbox"] {
  flex-shrink: 0;
  margin-top: 0.2rem;
}

/* オプション群 */

.filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.4rem;
  -webkit-tap-highlight-color: transparent;
}

/* 説明付き */

.desc-checkbox-wrapper {
  display: flex;
  gap: 0.4rem;
  align-items: flex-start;
  width: 100%;
  cursor: pointer;
}

.desc-checkbox-wrapper input[type="checkbox"] {
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.desc-checkbox-info {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.desc-checkbox-title {
  margin-bottom: 0.15rem;
  font-size: clamp(0.8rem, 3.2vw, 0.9rem);
  line-height: 1.4;
}

.desc-checkbox-description {
  margin-top: 0.3rem;
  font-size: clamp(0.75rem, 3vw, 0.85rem);
  line-height: 1.6;
  color: #666;
}

/* ==========================================================================
   8. 設定から読み込むフィルター
   ========================================================================== */

/* =========================
   保存設定（行数入力）
   ========================= */

#rowsPerImageInput {
  width: clamp(4.5rem, 18vw, 6rem);
  padding: 0.6rem;
  font-size: clamp(0.85rem, 3.5vw, 0.95rem);
  text-align: center;
  cursor: pointer;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 0.4rem;
  transition: border 0.2s ease;
}

#rowsPerImageInput:hover {
  border-color: var(--theme-color);
}

#rowsPerImageInput:focus {
  outline: none;
  border-color: var(--theme-color);
}


/* =========================
   推しメン設定（ドロップダウン）
   ========================= */

#oshimenSelect {
  width: 100%;
  padding: 0.6rem;
  font-size: clamp(0.85rem, 3.5vw, 0.95rem);
  color:#000000;
  cursor: pointer;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 0.4rem;
  transition: border 0.2s ease, box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

#oshimenSelect:hover {
  border-color: var(--theme-color);
}

#oshimenSelect:focus {
  outline: none;
  border-color: var(--theme-color);
}

/* ==========================================================================
   8. 統計情報
   ========================================================================== */

.stats-summary-card {
  background-color: #fff;
}

/* 固定2列 */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 2列 */
  gap: 0.75rem;
}

/* 各項目 */

.stats-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ラベル */

.stats-label {
  padding-bottom:3px;
  font-size: clamp(0.7rem, 2.8vw, 0.8rem);
  color: #888;
}

/* 値 */

.stats-value {
  font-size: clamp(0.95rem, 3.8vw, 1.1rem);
  font-weight: bold;
  color: #333;
}

.stats-value small {
  font-size: clamp(0.7rem, 2.8vw, 0.8rem);
  font-weight: normal;
  color: #666;
}

/* ==========================================================================
   9. メインコンテンツエリア（カード、ケバブメニュー）
   ========================================================================== */

.main-content {
  max-width: min(1200px, 96%);
  padding: 0.8rem;
  margin: 0 auto;
}

/* =========================
   カード
   ========================= */

.card {
  padding: 0 1rem 0.2rem;
  margin-bottom: 1.2rem;
  overflow: visible;
  background: #fff;
  border-left: 0.35rem solid transparent;
  border-radius: 0.9rem;
  box-shadow: 0 0.15rem 0.5rem rgb(0 0 0 / 0.08);
  transition: margin-bottom 0.3s ease;
}

.card-content {
  padding: 0.8rem 0;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.5rem;
}

.card-header-main {
  flex: 1;
}

.card-header-title {
  margin-bottom: 0.4rem;
  font-size: clamp(0.95rem, 3.5vw, 1.05rem);
}

.card-header-stats {
  padding-bottom: 0.3rem;
  margin: 0 0 0.6rem;
  font-size: clamp(0.8rem, 3vw, 0.9rem);
  line-height: 1.5;
}

.card-body {
  max-height: 100000px;
  padding: 0 0 0.4rem;
  overflow: visible !important;
  border-top: 1px solid #eee;
  opacity: 1;
  transition: max-height 0.3s ease-out, opacity 0.3s ease;
  -webkit-overflow-scrolling: touch;
}

.card.is-favorite {
  border-left-color: var(--theme-color) !important;
}

.card-divider {
  margin: 0.8rem -1rem;
  border: none;
  border-top: 1px solid #e0e0e0;
}

/* =========================
   カード展開部
   ========================= */

.card.collapsed .card-body,
.filter-content.collapsed,
#memberFilter.collapsed,
#filterBody.collapsed {
  display: none !important;
  max-height: 0;
  pointer-events: none;
  opacity: 0;
}
/* =========================
   ケバブメニュー
   ========================= */

.kebab-container {
  position: relative;
}

.kebab-btn-js {
  padding: 0.25rem;
  font-size: clamp(1rem, 4vw, 1.2rem);
  color:#000000;
  cursor: pointer;
  background: none;
  border: none;
  border-radius: 0.4rem;
  -webkit-tap-highlight-color: transparent;
}

.kebab-menu {
  position: absolute;
  top: 2rem;
  right: 0;
  z-index: 100;
  display: none;
  flex-direction: column;
  min-width: clamp(9rem, 35vw, 11rem);
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 0.6rem;
  box-shadow: 0 0.4rem 1rem rgb(0 0 0 / 0.12);
  -webkit-tap-highlight-color: transparent;
}

.kebab-menu.active {
  display: flex;
}

.kebab-item {
  padding: 0.7rem 1rem;
  font-size: clamp(0.85rem, 3vw, 0.95rem);
  color:#000000;
  text-align: left;
  cursor: pointer;
  background: none;
  border: none;
}

.kebab-item:hover {
  background: rgb(0 0 0 / 0.05);
}

/* =========================
   メモ
   ========================= */

.memo-textarea {
  width: 100%;
  min-height: clamp(8rem, 25vw, 12rem);
  padding: 0.7rem;
  font-size: clamp(0.85rem, 3.5vw, 0.95rem);
  resize: vertical;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 0.4rem;
  transition: border-color 0.2s ease;
}

.memo-textarea:focus {
  outline: none;
  border-color: var(--theme-color);
}

/* =========================
   参考画像
   ========================= */

.main-image {
  display: block;
  width: 100%;
  height: auto;
  margin: 0.8rem auto 1rem;
  border-radius: 0.6rem;
  box-shadow: 0 0.15rem 0.4rem rgb(0 0 0 / 0.1);
}

/* ==========================================================================
   10. テーブル / カウンター
   ========================================================================== */

/* =========================
   テーブル共通
   ========================= */

.series-mode-table,
.member-mode-table {
  width: 100%;
  font-size: clamp(0.8rem, 3vw, 0.95rem);
  border-collapse: collapse;
}

/* 横スクロール保険（親に overflow-x:auto を推奨） */
.series-mode-table {
  padding-top: 0.5rem;
  table-layout: fixed;
}

/* =========================
   seriesモード
   ========================= */
/* テーブル全体 */
.series-mode-table th,
.series-mode-table td {
  width: clamp(1.6rem, 5vw, 2.2rem);
  min-width: clamp(1.6rem, 5vw, 2.2rem);
  padding: 0.5rem 0.3rem;
  text-align: center;
  border-bottom: 1px solid #eee;
}

/* メンバー名列 */
.series-mode-table th.member-col,
.series-mode-table td.member-name {
  min-width: clamp(7rem, 25vw, 9rem);
  text-align: left;
  white-space: nowrap; /* 折り返さない */
}

/* =========================
   memberモード
   ========================= */
/* テーブル全体 */
.member-mode-table th,
.member-mode-table td {
  padding: 0.5rem 0.3rem;
  text-align: center;
  border-bottom: 1px solid #eee;
}

/* シリーズ名列 */
.member-mode-table td.series-name {
  min-width: clamp(7rem, 25vw, 9rem);
  text-align: left;
}

/* =========================
   カウンター
   ========================= */

.counter-container {
  display: flex;
  gap: 0.3rem;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-left: 0.1rem;
  font-size: clamp(0.8rem, 3vw, 0.95rem);
  white-space: nowrap;
}

/* ＋－ボタン */

.cnt-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(1.8rem, 5vw, 2rem);
  height: clamp(1.8rem, 5vw, 2rem);
  padding: 0 !important;
  margin: 3px 0;
  font-size: clamp(0.75rem, 3vw, 0.9rem);
  color:#000000;
  cursor: pointer;
  border: none;
  border-radius: 0.3rem;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.cnt-btn:hover {
  background-color: #f0f0f0;
}

.cnt-btn:active {
  transform: scale(0.85);
}

/* 数値表示 */

.cnt-value {
  min-width: clamp(1.5rem, 5vw, 2rem);
  text-align: center;
}

/* テキスト入力 */

.cnt-input {
  width: clamp(2.8rem, 10vw, 3.5rem);
  height: clamp(1.8rem, 5vw, 2.2rem);
  font-size: clamp(0.8rem, 3vw, 0.95rem);
  color:#000000;
  text-align: center;
  border: none;
}

.cnt-input:focus {
  outline: none;
  border: 1px solid var(--theme-color) !important;
  border-radius: 0.3rem;
}

/* ==========================================================================
   11. レスポンシブ設定
   ========================================================================== */

/* =========================
   画面が広いとき（タブレット以上）
   ========================= */

@media (min-width: 768px) {
  .sidebar {
    width: clamp(280px, 22vw, 300px);
  }

  /* モーダルは高さ制限を解除 */
  .modal-card {
    max-height: none;
  }
  
  .search-wrapper {
    position: left;
    max-width: min(800px, 80%);
    margin: 0;
  }
  
  .stats-grid {
    grid-template-columns: repeat(4, 1fr); /* 4列 */
  }
  
  .stats-value,
  .stats-value small {
    text-align: center;
  }

  .main-image {
    max-width: clamp(420px, 50vw, 520px);
  }

  /* テーブル メンバー列を中央寄せに */
  .series-mode-table th.member-col,
  .series-mode-table td.member-name {
    font-size: clamp(0.9rem, 1.4vw, 1rem);
    text-align: center;
  }

  .member-mode-table th:nth-child(n+2),
  .member-mode-table td:nth-child(n+2) {
    width: 15%;
    min-width: clamp(4.5rem, 8vw, 6rem);
  }

  .cnt-btn {
    width: clamp(1.8rem, 3vw, 2.2rem);
    height: clamp(1.8rem, 3vw, 2.2rem);
    font-size: clamp(0.9rem, 1.5vw, 1rem);
  }

  .cnt-value {
    min-width: clamp(1.8rem, 3vw, 2.2rem);
    font-size: clamp(0.9rem, 1.5vw, 1rem);
  }

  .cnt-input {
    padding-left: 0.6rem;
    font-size: clamp(0.9rem, 1.5vw, 1rem);
  }
}