:root {
  --primary-color: #ff4081;
  --success-color: #4CAF50;
  --success-hover: #45a049;
  --reset-color: #f44336;
  --reset-hover: #d32f2f;
  --text-dark: #333;
  --text-light: #666;
  --border-color: #ccc;
  --shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  --font-size-base: 1em;
  --font-size-small: 0.8em;
  --font-size-large: 1.2em;
}

html {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif; /* stylep.css と合わせる */
  }

body {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center; /* stylep.css の body と共通 */
          padding: 0 0 10px 0;
  margin: 0; /* body の上下マージンを0に */
  background: linear-gradient(to bottom, #fff, #ffe6e6); /* stylep.css の body と共通 */
  color: #333; /* stylep.css の body と共通 */
  min-height: 100vh; /* stylep.css の body と共通 */
  background-image: radial-gradient(circle, rgba(208, 182, 255, 0.3) 2px, transparent 2px); /* stylep.css の body と共通 */
  background-size: 10px 10px; /* stylep.css の body と共通 */
          box-sizing: border-box; /* padding を含めて高さを計算 */
  padding-top: 95px !important; /* PCナビゲーションの高さ変更分を反映 (129px -> 95px) */
}
.container {
  width: 100%;
  max-width: 1080px; /* stylep.css の main と共通 */
  margin: 0 auto; /* 上マージンはpadding-topで制御するため0に */
  flex: 1; /* stylep.css の main と共通 (body が flex-direction: column なので高さを埋める) */
  display: flex; /* stylep.css の main と共通 */
  flex-direction: column; /* stylep.css の main と共通 */
}

/* メインタイトルのポップなデザイン */
.main-title {
    font-family: 'M PLUS Rounded 1c', '游ゴシック', 'Yu Gothic', sans-serif;
    font-size: 42px; /* 文字サイズを大きく */
    font-weight: 700;
    color: #ff1495; /* style.css の .main-title と同じ色 */
    text-align: center;
    margin-top: 0; /* PC版: ナビゲーション下の余白をbodyのpadding-topで制御するため */
    margin: 20px 0 50px;    
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8); /* style.css の .main-title と同じテキストシャドウ */
}

h2 {
  font-family: 'M PLUS Rounded 1c', '游ゴシック', 'Yu Gothic', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: #70CC70;
  margin-bottom: 8px;
  text-align: center;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.05);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

#postForm h3 {
  font-family: 'M PLUS Rounded 1c', '游ゴシック', 'Yu Gothic', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: #FF4040;
  margin-bottom: 8px;
  text-align: center;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.05);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

#searchForm h3 {
  font-family: 'M PLUS Rounded 1c', '游ゴシック', 'Yu Gothic', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: #6495ED;
  margin-bottom: 8px;
  text-align: center;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.05);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

#postForm {
  background-color: #ffedf2;
  padding: 20px; /* stylep.css の #filter-form や .card-detail に近い値 */
  border: 1px solid #ebc7c7;
  border-radius: 5px; /* stylep.css と共通 */
  margin-bottom: 40px;
}

#searchForm {
  background-color: #f0f1ff;
  padding: 20px; /* stylep.css の #filter-form や .card-detail に近い値 */
  border: 1px solid #b3c1ff;
  border-radius: 5px; /* stylep.css と共通 */
  margin: 20px 0; /* stylep.css の #filter-form や .card-detail に合わせる */
  }

.form-group {
  display: grid; /* この部分は friend_board 固有のレイアウトなので維持 */
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  margin-bottom: 20px;
  justify-items: center;
}

.form-group.producer-id {
  grid-template-columns: 1fr;
  margin-bottom: 10px;
}

.form-group.recovery-filter {
  grid-template-columns: 1fr;
  margin-bottom: 10px;
  background-color: #fffde7;
  padding: 20px;
  border: 1px solid #ddd;
  border-radius: 5px;
}

.form-group.recovery-filter label {
  text-align: center;
  font-weight: bold;
  padding: 0px 0;
  font-size: var(--font-size-small);
  color: #ff8c00;
}

.form-group.recovery-filter .checkbox-group label {
  color: var(--text-dark);
}

.form-group label {
  text-align: center;
  font-weight: bold;
  padding: 5px 0;
  font-size: var(--font-size-small);
}

.custom-select {
  margin: 0 auto;
  text-align: center;
  position: relative;
  width: 100%;
}

.custom-select input[type="text"] {
  width: 100%;
  max-width: 300px;
  padding: 5px;
  font-size: var(--font-size-base);
  box-sizing: border-box;
  margin: 0 auto;
  display: block;
  border: 1px solid var(--border-color);
  border-radius: 4px;
}

.support-card-container, .skill-card-container, .level-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.support-select-box {
  border: 1px solid var(--border-color);
  cursor: pointer;
  width: 140px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  font-size: var(--font-size-small);
  overflow: hidden;
  background-color: #fff;
  transition: border-color 0.3s ease;
  border-radius: 8px; /* 角を丸くする */
}

.support-select-box:hover, .support-select-box:focus { border-color: var(--primary-color); outline: none; }
.support-select-box img { width: 100%; height: 100%; object-fit: contain; }

.skill-select-box {
  border: 1px solid var(--border-color);
  cursor: pointer;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  overflow: hidden;
  font-size: var(--font-size-small);
  background-color: #fff;
  transition: border-color 0.3s ease;
  border-radius: 8px; /* 角を丸くする */
}

.skill-select-box:hover, .skill-select-box:focus { border-color: var(--primary-color); outline: none; }
.skill-select-box img, .skill-image img { width: 100%; height: auto; object-fit: contain; }
.skill-select-box .overlay, .skill-image .overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

.attribute-select-box, .level-select-box {
  border: 1px solid var(--border-color);
  cursor: pointer;
  width: 110px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  font-size: var(--font-size-small);
  white-space: normal;
  line-height: 1.2;
  transition: border-color 0.3s ease;
  border-radius: 8px; /* 角を丸くする */
}

.level-select-box {
  cursor: pointer;
  text-align: center;
  padding: 6px 10px; /* Adjusted to be similar to badge padding */
  border: 1px solid #ddd;
  border-radius: 12px; /* 角丸を少し戻す */
  background-color: #fff; /* Default background */
  color: #555; /* Default text color */
  font-size: 1em; /* 文字サイズを少し大きく */
  min-width: 100px; /* Minimum width */
  display: flex; /* flexを使って中身を中央揃え */
  align-items: center; /* 垂直方向中央揃え */
  justify-content: center; /* 水平方向中央揃え */
  line-height: 1; /* line-heightはflexでの中央揃えに影響しないように基本値に */
  height: 38px; /* 高さを固定して、内容による変動を防ぐ (paddingを考慮) */
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.attribute-select-box:hover, .attribute-select-box:focus, .level-select-box:hover, .level-select-box:focus { border-color: var(--primary-color); outline: none; }

.checkbox-group {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 5px;
}

.checkbox-group label, .skill-card-state-options label, .form-group.recovery-filter .checkbox-group label {
  display: flex;
  align-items: center;
  font-size: var(--font-size-small);
  position: relative; /* ::before の配置基準 */
  padding-left: 25px; /* チェックボックスのスペース */
  cursor: pointer;
  user-select: none; /* テキスト選択を防ぐ */
}

.checkbox-group label::before, .skill-card-state-options label::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border: 2px solid #666;
  background: #f0f0f0;
  border-radius: 4px;
  box-sizing: border-box;
}

.checkbox-group input[type="checkbox"],
.skill-card-state-options input[type="checkbox"],
.form-group.recovery-filter .checkbox-group input[type="checkbox"] {
  opacity: 0; /* 非表示にするが、フォーカスは可能にするため display:none は避ける */
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.checkbox-group input[type="checkbox"]:checked + label::before,
.skill-card-state-options input[type="checkbox"]:checked + label::before,
.form-group.recovery-filter .checkbox-group input[type="checkbox"]:checked + label::before {
  background: var(--success-color) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>') no-repeat center;
  background-size: 12px;
  border-color: var(--success-hover);
}

.checkbox-group label:hover, .skill-card-state-options label:hover {
  background-color: #f0f0f0; /* ホバー時の背景色 (任意) */
}

.form-group.recovery-filter .checkbox-group {
  flex-direction: column; /* 縦並び */
  align-items: flex-start; /* 左寄せ */
  gap: 8px; /* 各チェックボックス間の隙間 */
}

button {
  display: block;
  margin: 0 auto;
  padding: 10px 20px;
  font-size: var(--font-size-base);
  cursor: pointer;
  background-color: var(--success-color);
  color: white;
  border: none;
  border-radius: 5px;
  width: 100%;
  max-width: 200px;
  margin-bottom: 20px;
  transition: background-color 0.3s ease;
}

button:hover, button:focus { background-color: var(--success-hover); outline: none; }
button.reset-button { background-color: var(--reset-color); margin-top: 10px; }
button.reset-button:hover, button.reset-button:focus { background-color: var(--reset-hover); outline: none; }

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10001; /* ナビゲーションバー(10000)より手前に表示 */
  background-color: rgba(0, 0, 0, 0.5);
  overflow-y: auto;
}

.modal-content {
  background-color: #fff3e0; /* 薄い橙色 (例: Material Design の Orange 50) */
  margin: 5% auto;
  padding: 55px 15px 15px 55px; /* 左パディングを 15px から 30px に増やして右にずらす */
  border: 1px solid #ffcc80; /* 橙系の薄い枠線 (例: Material Design の Orange 200) */
  width: 90%;
  max-width: 1200px;
  height: 70vh;
  overflow-y: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  box-sizing: border-box;
  position: relative; /* 閉じるボタンの配置基準 */
  /* top: 10px; */
  border-radius: 15px; /* 角丸の半径を大きくして丸みを出す */
  box-shadow: 0 5px 15px rgba(0,0,0,0.2); /* 少し影を濃くして立体感を出す */
}

/* モーダル内の画像コンテナ */
.modal-images {
  display: grid; /* サポートカードとスキルカードのデフォルト表示 */
  justify-items: center; /* セル内のアイテムを中央揃え */
  width: 100%; /* 親要素の幅いっぱいに広がるようにする */
  /* gap と grid-template-columns は各モーダルタイプで指定 */
}

.attribute-row {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  justify-content: flex-start; /* 属性行全体を左寄せにする */
  width: 100%;
}

.attribute-title {
  width: 150px;
  font-weight: bold;
  text-align: left;
  padding-left: 10px;
  padding-left: 5px; /* スマホ表示で少し左に寄せる */
  font-size: 0.9em;
}

.attribute-values {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start; /* アイテムを左揃えで配置 */
  gap: 5px;
}

.attribute-item {
  cursor: pointer;
  border: 1px solid var(--border-color);
  padding: 5px 10px;
  border-radius: 5px;
  font-size: var(--font-size-small);
  min-width: 100px; /* 最小幅を少し広げる */
  height: 30px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center; /* 水平方向中央揃え */
  transition: background-color 0.3s ease;
}
.attribute-item:hover, .attribute-item:focus { background-color: #f0f0f0; outline: none; }

.support-image-item, .skill-image-item {
  display: inline-block;
  cursor: pointer;
  position: relative;
 
}

.support-image-item img { width: 105px; height: 60px; object-fit: contain; }
.skill-image-item .overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
/* スキルカード画像のサイズ指定を .skill-image-item img から .modal-skill-card img に移動または併記 */
.modal-skill-card img {
  width: 50px;
  height: 50px;
  object-fit: contain;
}
.support-link, .skill-link {
  display: inline-block;
  text-decoration: none;
}

.support-image, .skill-image {
  cursor: pointer;
  transition: transform 0.2s ease;
}

.support-image:hover, .skill-image:hover {
  transform: scale(1.05);
}

.skill-container {
  text-align: center;
  position: relative;
}

.card-detail {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 20px 0;
  padding: 15px;
  background-color: #f9f9f9;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  box-shadow: var(--shadow);
}

.card-info {
  flex: 1;
}

.card-info p {
  margin: 10px 0;
  font-size: var(--font-size-base);
}

.card-info p strong {
  color: var(--text-dark);
}

.close {
  color: #aaa;
  position: absolute;
  top: 15px;          /* モーダル上部からの位置 */
  left: 50%;          /* 水平方向中央に配置 */
  transform: translateX(-50%); /* 中央揃えのための調整 */
  
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  
  transition: color 0.3s ease;
}

.close:hover, .close:focus { color: black; outline: none; }

.posts-container {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* この部分は friend_board 固有のレイアウトなので維持 */
  gap: 15px;
  width: 100%;
  justify-items: center;
}

.post-item {
  border: 1px solid #ddd;
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 5px;
  background-color: #f9f9f9; /* stylep.css の #filter-form や .card-detail の背景に近い */
  width: 100%;
  max-width: 350px;
  box-shadow: var(--shadow);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.producer-id-wrapper {
  position: relative;
  width: 100%;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.producer-id {
  font-weight: bold;
  font-size: var(--font-size-base);
  text-align: center;
}

.copy-button {
  position: absolute;
  top: 50%;
  right: 5px;
  transform: translateY(-50%);
  width: 40px;
  height: 30px;
  padding: 0;
  background-color: var(--success-color);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  transition: background-color 0.3s ease;
}

.copy-button:hover, .copy-button:focus { background-color: var(--success-hover); outline: none; }

.cards-container {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.support-container {
  text-align: center;
  position: relative;
  display: flex; /* 子要素を縦に並べるため */
  flex-direction: column; /* 縦方向 */
  align-items: center; /* 水平中央揃え */
  width: auto; /* 幅はコンテンツに合わせる */
  margin: 0 auto; /* post-item内で中央に */
}

.support-container .support-link { /* 画像を囲むリンク要素 */
  display: block; /* 幅と高さを指定できるように */
  width: 94px; /* サポートカードの幅を94pxに */
  height: 54px; /* サポートカードの高さを54pxに */
  margin-bottom: 5px;
  box-sizing: border-box; /* 枠線を含めてサイズ計算 */
  transition: border-color 0.3s ease; /* 枠線色の変化を滑らかに */
}

.support-container .support-link img {
  width: 100%; /* 親（.support-link）の幅に合わせる */
  height: 100%; /* 親（.support-link）の高さに合わせる */
  object-fit: contain;
}

.skill-image {
  position: relative;
  width: 50px; /* 固定幅 */
  height: 50px; /* 固定高さ */
  box-sizing: border-box; /* 枠線を含めてサイズ計算 */
  transition: border-color 0.3s ease; /* 枠線色の変化を滑らかに */
}

/* カード共通の黒枠線スタイル */
.card-default-border {
  border: 2px solid black !important; /* 一回り大きい黒線 */
}

.support-level {
  font-size: 16px; /* バッジのフォントサイズに合わせて少し調整 */
  margin-top: 5px; /* カード画像との間隔を少し調整 */
  width: 90px; /* 親要素（.support-container）の幅に合わせる */
  display: flex;
  justify-content: center; /* バッジを水平方向中央に */
}

/* 凸数バッジ共通スタイル */
.level-badge-common {
  padding: 3px 8px;
  border-radius: 12px; /* .level-select-box と合わせる */
  font-size: 16px; /* .level-select-box とフォントサイズを統一 */
  font-weight: bold;
  line-height: 1; /* .level-select-box と合わせる */
  /* margin-top: 4px; */ /* フォーム内では不要なので削除、絞り込み結果では .support-level で調整 */
  display: flex;
  align-items: center; /* 垂直方向中央揃え */
  justify-content: center; /* 水平方向中央揃え */
  width: 90px; /* 親要素(.support-level)の幅の90% */
  text-align: center; /* バッジ内のテキストを中央揃え */
  box-sizing: border-box; /* paddingとborderをwidth/heightに含める */
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transition: all 0.2s ease-in-out;
}
.modal-images .level-badge-common {
  width: 110px;    /* 横幅を一回り大きく (例: 90px -> 110px) */
  height: 40px;    /* 高さを一回り大きく (例: 36px相当 -> 40px) */
  padding: 5px 10px;
  font-size: 1.1em;  /* フォントサイズを一回り大きく (例: 1em -> 1.1em) */
  font-weight: bold;
  line-height: 1;
  border-radius: 15px; /* 角丸を調整 */
  margin: 5px; /* アイテム間のマージン */
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

/* 各凸数ごとのスタイル */
.level-0 {
  background-color: #f0f0f0; /* ライトグレー */
  color: #555;
  border: 1px solid #dcdcdc;
}

.level-1 {
  background-color: #e3f2fd; /* 薄い水色 */
  color: #1565c0; /* 濃い青 */
  border: 1px solid #bbdefb;
}

.level-2 {
  background-color: #e8f5e9; /* 薄い緑 */
  color: #2e7d32; /* 濃い緑 */
  border: 1px solid #c8e6c9;
}

.level-3 {
  background-color: #fff8e1; /* 薄いクリーム色 */
  color: #e65100; /* 濃いオレンジ */
  border: 1px solid #ffecb3;
  text-shadow: 0 0 1px rgba(255,255,255,0.5);
}

.level-kan { /* 完凸 */
  background: linear-gradient(135deg, #fff176 0%, #ffd54f 50%, #ffb300 100%); /* ゴールド系グラデーション */
  color: #424242; /* 暗めのグレーで文字を読みやすく */
  border: 1px solid #ffc107;
  box-shadow: 0 2px 5px rgba(255, 193, 7, 0.5), 0 0 0 2px rgba(255,255,255,0.3) inset; /* 輝きと立体感 */
  text-shadow: 0 1px 0px rgba(255,255,255,0.4); /* 文字に少しハイライト */
  /* text-transform: uppercase; */ /* 例: KANTO TSU */
}

.attributes-container {
  display: flex;
  justify-content: space-between;
  text-align: center;
  flex-wrap: wrap;
  gap: 5px;
  width: 100%;
}

.attribute-item {
  flex: 1;
  min-width: 80px;
  margin: 3px;
  padding: 5px;
  text-align: center;
  border-radius: 5px;
  font-size: 0.7em;
  /* 属性の色表示のためのスタイルを追加 */
  color: var(--text-dark); /* デフォルトの文字色 */
}

.timestamp {
  font-size: 0.7em;
  color: var(--text-light);
  text-align: right;
  margin-top: 5px;
  width: 100%;
}

/* DBから取得した属性タイプに応じた背景色 */
.vocal-post-default { background-color: #ffcccc; }
.dance-post-default { background-color: #ccccff; }
.visual-post-default { background-color: #ffffcc; }
.vocal-post-ppoint, .dance-post-ppoint, .visual-post-ppoint { background-color: #d6eaff; } /* Pポイント */
.vocal-post-recovery, .dance-post-recovery, .visual-post-recovery { background-color: #d4f0d4; } /* 回復 */


/* 属性値に応じた文字色や装飾 */
.attribute-value-S { color: gold; font-weight: bold; text-shadow: 0 0 3px black; }
.attribute-value-A { color: crimson; font-weight: bold; }
.attribute-value-B { color: dodgerblue; }
.attribute-value-C { color: green; }
.attribute-value-D { color: orange; }
.attribute-value-E { color: mediumpurple; }
.attribute-value-F { color: grey; }


/* フォーム内の属性選択ボックスの色 */
.vocal-selected-default { background-color: #ffcccc !important; } /* ボーカルのデフォルト */
.dance-selected-default { background-color: #ccccff !important; } /* ダンスのデフォルト */
.visual-selected-default { background-color: #ffffcc !important; } /* ビジュアルのデフォルト */
.vocal-selected-ppoint, .dance-selected-ppoint, .visual-selected-ppoint { background-color: #d6eaff !important; } /* Pポイント */
.vocal-selected-recovery, .dance-selected-recovery, .visual-selected-recovery { background-color: #d4f0d4 !important; } /* 回復 */


/* AdSense広告のスタイル */
.adsense-ad {
  margin: 20px 0;
  text-align: center;
  width: 100%;
}

.adsense-ad ins {
  display: block;
  width: 100%;
  max-width: 728px;
  margin: 0 auto;
  padding: 0 10px;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .form-group { grid-template-columns: 1fr; gap: 10px; }
   body {
    padding-top: 70px !important; /* スマホナビゲーションの高さとコンテンツのめり込みを考慮して調整 */
 }
  .form-group > div { margin-bottom: 15px; }
  .form-group label { font-size: calc(var(--font-size-small) * 0.9); margin-bottom: 5px; }
  .custom-select input[type="text"] { width: 90%; font-size: calc(var(--font-size-base) * 0.9); }
  .support-select-box { width: 120px; height: 70px; }
  .skill-select-box { width: 50px; height: 50px; }
  .attribute-select-box, .level-select-box { width: 100px; height: 32px; }
  .checkbox-group { flex-direction: column; gap: 5px; } 
  /* .modal-images は上記の基本スタイルで auto-fit が効くため、ここでの個別指定は不要な場合が多い */
  .form-group.recovery-filter { padding: 15px; }
  .modal-content { width: 95%; height: 60vh;padding: 50px 15px 15px 40px;}

  .level-badge-common {
    font-size: 16px; /* PC版のフォントサイズ */
    font-weight: bold; /* PC版の太さ */
    line-height: 1.2;   /* PC版の行の高さ */
    padding: 0 5px;   /* 上下パディングはflex中央揃えのため0でも可、左右は5px */
    min-width: 0;     /* 最小幅はリセット */
    /* flex-basis: calc((100% - 10px) / 3); */ /* 固定幅にするためコメントアウト */
    /* width: calc((100% - 10px) / 3); */      /* 固定幅にするためコメントアウト */
    width: 60px; /* 親要素の60%程度の幅にする (お好みで調整してください) */
    height: 38px; /* 高さを一回り大きく (例: 30px -> 38px) */
    flex-grow: 0;     /* サイズ固定のため */
    flex-shrink: 0;   /* サイズ固定のため */
    margin: 5px auto; /* 上下マージン5px、左右はautoで中央揃え */
  }
  
  .attribute-title { width: 120px; font-size: calc(var(--font-size-small) * 0.9); }
  .attribute-item { 
    font-size: 0.7em; /* フォントサイズを少し調整 */
    margin: 0; /* gapプロパティでアイテム間の隙間を制御するため、個別のマージンは0に */
    padding: 0 5px; /* 上下パディングはflex中央揃えのため0でも可、左右は5px */
    flex-basis: calc((50% - 10px) / 4); /* 親(.attribute-values)のgap:5pxを考慮した3列均等幅 */
    width: 60px;      /* flex-basis と合わせて明示的に指定 */
    height: 30px; /* 高さを自動に戻す */
    flex-grow: 1; /* 利用可能なスペースがある場合、アイテムが均等に伸びるようにする */
    flex-shrink: 1; /* スペースが足りない場合、アイテムが均等に縮むようにする */
    min-width: 0; /* flexアイテムの暗黙の最小幅による影響を避ける */
    box-sizing: border-box; /* paddingとborderを幅に含める */
    white-space: normal; /* テキストを折り返さない */
    overflow: hidden; /* はみ出した内容を隠す */
    text-overflow: ellipsis; /* はみ出したテキストを...で表示 */
  }
  .support-image-item img { width: 90px; height: 50px; }
  .skill-image-item img { width: 45px; height: 45px; }
  .post-item { width: 95%; max-width: 300px; padding: 8px; margin-bottom: 10px; }
  .producer-id { text-align: center; }
  .copy-button { 
    right: 0; 
    width: 35px;
    height: 28px;
    font-size: 10px;
  }
  .cards-container { gap: 8px; flex-direction: row; align-items: center; }
  .support-container img { width: 80px; height: 50px; }
  .skill-image { width: 40px; height: 40px; }
  .attributes-container { flex-direction: row; align-items: center; gap: 5px; }
  .timestamp { font-size: 0.65em; }
  .adsense-ad { margin: 15px 0; }
  .adsense-ad ins { max-width: 90%; padding: 0 5px; }
  .card-detail { flex-direction: column; align-items: center; }
  .card-info p { font-size: calc(var(--font-size-base) * 0.9); }
}

@media (max-width: 600px) {
  h1 { font-size: 28px; margin: 8px 0 4px; }
  #postForm h3, #searchForm h3, h2 { font-size: 14px; }
  .navbar {
    flex-wrap: nowrap;
    gap: 0px;
    padding: 5px;
  }
  .navbar a {
    font-size: 12px;
    padding: 8px 15px;
    white-space: nowrap;  
  }
  .main-title { /* スマホ表示(600px以下)でタイトルを少し小さく */
    font-size: 32px;
    margin: 10px 0 6px; /* 他のページのSP表示時のタイトルマージンに合わせる */
  }
    .posts-container {
    grid-template-columns: 1fr;
  }
  .adsense-ad { margin: 10px 0; }
  .adsense-ad ins { max-width: 100%; }
}

@media (max-width: 320px) {
  h1 { font-size: 24px; }
  #postForm h3, #searchForm h3, h2 { font-size: 12px; }
  .navbar a {
    font-size: 10px;
    padding: 6px 12px;
  }
  .adsense-ad { margin: 8px 0; }
  .adsense-ad ins { padding: 0 2px; }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}


/* detailsとsummaryのスタイル */
.form-section-details {
  border: 1px solid #e0e0e0; /* 枠線の色を少し薄く */
  border-radius: 8px; /* 角丸をフォームに合わせる */
  margin-bottom: 25px; /* 各セクション間のマージン */
  background-color: #fff; /* 背景色 */
  box-shadow: 0 2px 4px rgba(0,0,0,0.05); /* 軽い影 */
}

.form-section-summary { /* 基本的な summary スタイル（detailsのデフォルトマーカー表示用など） */
  cursor: pointer;
  font-weight: bold;
  list-style-position: inside;
  outline: none;
  transition: background-color 0.2s ease;
}

.form-section-summary h3 {
  display: inline;
  margin: 0;
  font-size: 1.1em; /* h3のフォントサイズ調整 */
}

/* ポップなボタンスタイル */
.summary-button {
  display: block; /* ブロック要素にして幅を広げる */
  padding: 12px 20px;
  text-align: center;
  border-radius: 25px; /* 丸みを帯びた形状 */
  color: white;
  font-size: 1.2em; /* 少し大きめのフォント */
  font-weight: bold;
  text-shadow: 1px 1px 1px rgba(0,0,0,0.2);
  box-shadow: 0 4px 6px rgba(0,0,0,0.1), inset 0 -2px 2px rgba(0,0,0,0.1);
  transition: transform 0.1s ease-out, box-shadow 0.1s ease-out, background-color 0.2s ease;
  border-bottom: none; /* .form-section-summary の下線を上書き */
  margin: 0; /* detailsのデフォルトスタイルを打ち消す場合 */
}

.summary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 8px rgba(0,0,0,0.15), inset 0 -2px 2px rgba(0,0,0,0.1);
}

.summary-button:active {
  transform: translateY(1px);
  box-shadow: 0 2px 3px rgba(0,0,0,0.1), inset 0 -1px 1px rgba(0,0,0,0.1);
}

.summary-post {
  background-color: #e74c3c; /* 赤系 */
}
.summary-search {
  background-color: #3498db; /* 青系 */
}

.form-section-details[open] > .form-section-summary {
  border-bottom: 1px solid #e0e0e0;
  border-radius: 8px 8px 0 0; /* 開いている時も上部角丸維持 */
}

.form-section-details > .form-section-content,
.form-section-details > form { /* details直下のformにも適用 */
  padding: 15px;
}

.skill-card-state-options {
  display: flex;
  flex-direction: column; /* 縦並び */
  align-items: flex-start; /* 左寄せ */
  gap: 8px; /* 各チェックボックス間の隙間 */
  margin-top: 5px;
}

.results-title-container {
  margin-bottom: 20px; /* 投稿一覧との間隔 */
  /* 「絞り込み結果」のテキストがなくなったので、
     もしソートボタンだけになった場合にマージン等を調整したければここで行う */
}

/* ソートボタンのスタイル */
.sort-options {
  /* text-align: center; */ /* Flexboxで中央揃えするためコメントアウト */
  display: flex; /* Flexboxを有効にする */
  justify-content: center; /* 水平方向中央揃え */
}

.sort-button {
  background-color: #f0f0f0;
  border: 1px solid #ccc;
  padding: 8px 16px;
  margin: 0 5px;
  cursor: pointer;
  border-radius: 5px;
  font-size: 0.95em;
  color: #555555; /* 非アクティブ時の文字色を濃い灰色に */
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.sort-button.active {
  background-color: #e74c3c; /* アクティブなボタンの色 (投稿ボタンの赤系に合わせるか、お好みで) */
  color: white;
  border-color: #e74c3c;
}

.sort-button:hover:not(.active) {
  background-color: #e9e9e9;
}
.copy-count-display {
  font-size: 15px; /* フォントサイズを少し小さく */
  color: #000000;       /* 文字色を少し薄いグレーに */
  text-align: center;  /* 右寄せにする場合 */
  margin-top: 8px;    /* 上の要素との間隔 */
  width: 200px;        /* 親要素いっぱいに広げる */
}

/* AdSense広告用（インライン） - 他ページとスタイルを統一 */
.adsense-ad {
  margin: 20px 0;
  text-align: center;
  width: 100%;
  min-width: 1px; /* 広告表示のための最小幅を確保 */
}

.adsense-ad ins {
  display: block;
  width: 100%;
  max-width: 728px; /* レスポンシブ広告の最大幅の目安 */
  min-height: 50px; /* 広告表示のための最小高さを確保 */
  margin: 0 auto;
  padding: 0 10px; /* 左右に少しパディング */
  box-sizing: border-box;
}
/* --- ページネーション --- */
#paginationContainer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding-bottom: 20px; /* フッターとの間に余白を追加 */
    font-family: 'M PLUS Rounded 1c', sans-serif;
}

.page-numbers,
.pagination-controls {
    display: flex;
    flex-wrap: wrap; /* 画面幅が狭い場合に折り返す */
    justify-content: center; /* 中央揃え */
    align-items: center;
    gap: 8px;
}

.pagination-controls {
    gap: 15px;
    margin-top: 5px;
}

.page-button,
.pagination-button {
    background-color: transparent;
    border: none;
    color: #007bff; /* 標準的なリンクの青色 */
    cursor: pointer;
    padding: 5px 8px;
    text-decoration: none;
    font-size: 1rem;
    transition: background-color 0.2s, text-decoration 0.2s;
    border-radius: 4px; /* 少し角を丸める */
    /* 汎用buttonスタイルの上書き */
    width: auto;
    margin: 0;
}

.page-button:hover,
.pagination-button:hover {
    text-decoration: underline;
    background-color: #f0f0f0; /* ホバー時に薄い背景色を追加 */
}

/* アクティブな（現在の）ページ番号 */
.page-button.active {
    color: #343a40; /* 濃いグレー */
    font-weight: bold;
    cursor: default;
    text-decoration: none;
    background-color: transparent;
}

/* 省略記号 (...) */
.page-ellipsis {
    color: #6c757d;
    padding: 5px 2px;
}

/* --- モーダルタイプ別スタイル (スマートフォンデフォルト) --- */
.modal-type-attribute .modal-images {
  display: flex; /* 親要素(.attribute-row)を縦に並べる */
  flex-direction: column;
  gap: 10px; /* 各属性行の間の垂直方向のgap */
  align-items: stretch; /* 各行がコンテナの幅に広がるように */
  padding: 0 5px; /* 横方向のパディングを少し追加 */
}

.modal-type-attribute .attribute-row .attribute-values {
  display: flex;
  flex-wrap: nowrap; /* 子要素を一行で表示 */
  overflow-x: auto;  /* 横スクロールを可能にする */
  gap: 8px;          /* 属性アイテム間のgap */
  padding-bottom: 8px; /* スクロールバーのためのスペース */
  justify-content: flex-start; /* 左詰め */
}
.modal-type-attribute .attribute-row .attribute-item {
  flex-shrink: 0; /* アイテムが縮まないようにする */
  /* .attribute-item の既存スタイル (min-width, padding等) を活かす */
  margin: 0; /* gapで制御するためアイテム自体のマージンは0 */
}

/* PC表示時 (769px以上) のモーダル内画像表示数を増やす */
@media (min-width: 769px) {
 /* サポートカードモーダル (PC) */
  .modal-type-support .modal-images {
    grid-template-columns: repeat(10, 1fr); /* 横に10枚 */
    gap: 8px; /* PC版サポートカードのgap */
  }
  .modal-type-support .modal-support-card {
    /* margin: 8px; 必要であればアイテム個別のマージン */
  }

  /* スキルカードモーダル (PC) */
  .modal-type-skill .modal-images {
    grid-template-columns: repeat(18, 1fr); /* 横に18枚 */
    gap: 4px; /* PC版スキルカードのgap */
  }
  .modal-type-skill .modal-skill-card {
    /* margin: 2px; 必要であればアイテム個別のマージン */
  }

  /* 属性選択モーダル (ボーカル, ダンス, ビジュアル - PC) */
  .modal-type-attribute .modal-images {
    /* display: flex; flex-direction: column; はスマホから継承 */
    gap: 15px; /* 各属性行の間の垂直方向のgap (PC) */
    padding: 0 10px;
  }
  .modal-type-attribute .attribute-row {
    /* 必要であればPC用のスタイル調整 */
  }
  
  .modal-type-attribute .attribute-row .attribute-values {
    /* flex-wrap: nowrap; overflow-x: auto; はスマホから継承 */
    gap: 10px; /* 属性アイテム間のgap (PC) */
  }
  .modal-type-attribute .attribute-row .attribute-item {
    /* flex-shrink: 0; はスマホから継承 */
    /* PCでの属性アイテムのスタイル調整 (例: min-width を広げるなど) */
    min-width: 110px; /* 例: PCでは少し幅広に */

  }
}
