/* ルート変数 */
:root {
  --primary-color: #ff8c00; /* index.php の広告ボーダー色に合わせる */
}

/* リセットと基本設定 */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
}
body {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
            padding: 0 0 10px 0;
    margin: 0; /* body の上下マージンを0に */
    background: linear-gradient(to bottom, #fff, #ffe6e6);
    color: #333;
    min-height: 100vh;
    background-image: radial-gradient(circle, rgba(208, 182, 255, 0.3) 2px, transparent 2px);
    background-size: 10px 10px;
            box-sizing: border-box; /* padding を含めて高さを計算 */
    padding-top: 95px !important; /* PCナビゲーションの高さ変更分を反映 (129px -> 95px) */
}
/* メインコンテンツ */
main { /* main のスタイルは変更なし */
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1080px;
    margin-left: auto; /* 中央揃え */
    margin-right: auto; /* 中央揃え */
    padding-left: 15px; /* 左右の余白 */
    padding-right: 15px; /* 左右の余白 */
    padding-bottom: 20px; /* 下部の余白 */
    box-sizing: border-box;
}
/* タイトル */
.main-title {
    font-family: 'M PLUS Rounded 1c', '游ゴシック', 'Yu Gothic', sans-serif;
    font-size: 42px; /* index.php, friend_board.php と同じ文字サイズに */
    font-weight: 700;
    color: #ff1495;
    margin: 0 0 15px; /* 上マージンを0にし、ナビゲーションとの間隔はmainのpadding-topで制御 */
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
    text-align: center;
}
/* イントロセクション */
.intro-tight {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    text-align: center;
    padding: 20px;
}
.intro-tight h2 {
    font-size: 14px;
    font-family: '游ゴシック', 'Yu Gothic', sans-serif;
    font-weight: 700;
    color: #ff4500;
    line-height: 20px;
    margin: 0;
    padding: 0;
}
.intro-tight p {
    font-size: 14px;
    font-family: '游ゴシック', 'Yu Gothic', sans-serif;
    font-weight: 700;
    color: #ff4500;
    line-height: 20px;
    margin: 0;
    padding: 0;
}

/* 絞り込みフォーム */
.filter-title {
    font-family: 'M PLUS Rounded 1c', '游ゴシック', 'Yu Gothic', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #2c2929;
    text-align: center;
    margin: 0 0 8px 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}
/* tier.php の絞り込みフォームの背景を白に設定 */
.filter-and-sort-controls .form-section-details {
    background-color: #ffffff; /* 白背景 */
    padding: 5px;  /* 上パディング5px、左右下15px (index.phpのdetails基本スタイルに合わせる) */
    border-radius: 8px;        /* 角を丸くする */
    border: 1px solid #dddddd; /* 薄い境界線を追加して区切りを明確に */
    margin-bottom: 25px;       /* 下の要素（ソートボタンなど）との間隔をindex.phpに合わせる */
}

/* tier.php の絞り込みフォーム内のコンテンツ(form#filter-form)の上部にスペースを作成 */
.filter-and-sort-controls .form-section-details #filter-form {
    padding-top: 15px; /* 絞り込みボタンとチェックボックス群の間のスペース */
}

/* tier.php の絞り込みボタンが開いたときのスタイル調整 */
.filter-and-sort-controls .form-section-details[open] > .form-section-summary.summary-button {
    border-bottom: 1px solid #dddddd; /* <details>の枠線に合わせる */
    border-radius: 8px 8px 0 0; /* 上部の角丸は維持し、下部の角丸をなくす */
    margin-bottom: 0; /* 開いたときはsummary自体の下にマージンが不要な場合 */
}
/* スライダー（画像サイズ調整用） */
.slider-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}
.slider-container label {
    font-size: 14px;
    font-family: '游ゴシック', 'Yu Gothic', sans-serif;
    font-weight: 700;
    color: #333;
}
#image-size-slider {
    width: 200px;
}
#size-value {
    font-weight: 700;
    color: #007bff;
}
/* チェックボックスコンテナ */
.checkbox-container-base {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    max-width: 1000px;
    padding: 0 10px;
}
.checkbox-container-row {
    margin: 2px 0;
}
.checkbox-container.compact {
    margin-top: 10px;
}
.checkbox-container {
    display: inline-flex;
    align-items: center;
    min-width: 24px;
    min-height: 24px;
}
/* チェックボックス */
input[type="checkbox"] {
    display: none;
}
input[type="checkbox"] + label {
    position: relative;
    padding: 2px 4px 2px 24px;
    cursor: pointer;
    font-size: 14px;
    font-family: '游ゴシック', 'Yu Gothic', sans-serif;
    font-weight: 700;
    color: #000;
    line-height: 20px;
    transition: background-color 0.2s ease;
    user-select: none;
}
input[type="checkbox"] + label::before {
    content: "";
    position: absolute;
    left: 3px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid #666;
    background: #f0f0f0;
    border-radius: 4px;
    box-sizing: border-box;
}
input[type="checkbox"]:checked + label::before {
    background: #ff8c00 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: #e67e22;
}
input[type="checkbox"] + label:hover {
    background-color: #e6f0ff;
}
label {
    display: inline-block;
    text-align: center;
    outline: none;
}
label:focus {
    outline: 2px solid #007bff;
}
/* 詳細トグル */
details {
    margin: 10px 0;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 5px;
}
summary {
    cursor: pointer;
    font-weight: 700;
    padding: 5px;
    color: #333;
}
details[open] summary {
    border-bottom: 1px solid #ddd;
}
/* ボタンエリア */
.button-container {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 15px 0 0;
    flex-wrap: wrap;
    padding: 0 10px;
}
.csv-button {
    padding: 10px 20px;
    font-size: 14px;
    font-family: '游ゴシック', 'Yu Gothic', sans-serif;
    font-weight: 700;
    border: none;
    border-radius: 6px;
    background: #6c757d; /* デフォルトの背景色を灰色に変更 (非アクティブ状態) */
    color: #fff;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease; /* トランジションを調整 */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    min-width: 100px;
border: 2px solid transparent; /* 枠線用のスペースを確保 */
    box-sizing: border-box;
}

/* tier順アクティブボタン (既存の.activeを流用) */
.csv-button.active:not(.popularity-active) {
    background: #007bff;
    color: #fff;
    
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
    border-color: #0056b3; /* アクティブ時の枠線色 */
}

/* いいね順アクティブボタン */
.csv-button.active.popularity-active {
    background: #e83e8c; /* ピンク色 */
    color: white;
    box-shadow: 0 2px 4px rgba(232, 62, 140, 0.2);
    border-color: #c2185b; /* アクティブ時の枠線色 */
}

/* 非アクティブなソートボタン (JavaScriptで .inactive クラスを付与する場合) */
/* もし .inactive クラスを使わない場合は、.csv-button のデフォルトスタイルが適用される */
.csv-button.inactive {
    background-color: #6c757d; /* 灰色 */
    color: white;
    border-color: #545b62;
}

/* ホバーエフェクト (アクティブでないボタンのみ) */
.csv-button:not(.active):hover {

    background: #ff1493;
}
.csv-button.like {
    background: #28a745;
    color: #fff;
    opacity: 1;
}
.csv-button.like:hover {
    background: #218838;
}
.csv-button.reply-toggle,
.csv-button.edit-toggle {
    background: #00ced1;
    color: #fff;
    opacity: 1;
}
.csv-button.reply-toggle:hover,
.csv-button.edit-toggle:hover {
    background: #00b7eb;
}
.csv-button.delete {
    background: #dc3545;
    color: #fff;
    opacity: 1;
}
.csv-button.delete:hover {
    background: #c82333;
}
/* skill_card_detail.php の評価ボタン専用のスタイル */
.evaluation-form .csv-button.good {
    background-color: #4CAF50; /* ポップな緑 */
    border: none;
    border-radius: 20px; /* 丸みを強くする */
    padding: 10px 20px;
    font-size: 1em;
    color: #fff; /* 文字色を白に */
    opacity: 1; /* 不透明に */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex; /* Flexboxを有効化 */
    align-items: center; /* 上下中央揃え */
    justify-content: center; /* 左右中央揃え */

    transition: all 0.2s ease-in-out;
}
.evaluation-form .csv-button.good:hover {
    background-color: #45a049;
    transform: translateY(-2px); /* 少し浮き上がる */
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.evaluation-form .csv-button.bad {
    background-color: #f44336; /* ポップな赤 */
    border: none;
    border-radius: 20px; /* 丸みを強くする */
    padding: 10px 20px;
    font-size: 1em;
    color: #fff; /* 文字色を白に */
    opacity: 1; /* 不透明に */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex; /* Flexboxを有効化 */
    align-items: center; /* 上下中央揃え */
    justify-content: center; /* 左右中央揃え */

    transition: all 0.2s ease-in-out;
}
.evaluation-form .csv-button.bad:hover {
    background-color: #d32f2f;
    transform: translateY(-2px); /* 少し浮き上がる */
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}
/* リセットボタン */
.reset-button {
    padding: 10px 20px;
    font-size: 16px;
    font-family: '游ゴシック', 'Yu Gothic', sans-serif;
    font-weight: 700;
    border: none;
    border-radius: 6px;
    background: #ff4d4d;
    color: #fff;
    cursor: pointer;
    opacity: 0.9;
    transition: all 0.3s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    min-width: 100px;
    position: fixed; /* 画面右下に固定 */
    bottom: 20px;
    right: 20px;
     z-index: 1000; /* 他の要素より手前に表示 (style.cssと合わせる) */
    /* テキストを中央揃えにするためのスタイル */
    display: inline-flex; /* Flexbox を使用して中央揃え */
    align-items: center; /* 垂直方向中央揃え */
    justify-content: center; /* 水平方向中央揃え */
    text-align: center; /* フォールバックまたは単一行の場合 */
    line-height: normal; /* line-height をリセットして影響を避ける */
}
.reset-button:hover {
    opacity: 1;    background: #e60000;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* ホバー時の影を強調 */
}
.tier-row {
    display: grid;
    grid-template-columns: 15% 85%; /* ラベル部分と画像部分の幅の割合 */
    border: 2px solid #ccc; /* 線の太さを2pxに変更 */
    border-radius: 8px; /* 角を8pxで丸める */
    margin-bottom: 10px;
    overflow: hidden; /* 子要素のはみ出しをクリップし、角の途切れを防ぐ */
}
.tier-label {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom, #efeefc, #dadffc); /* ピンク系のグラデーションに変更 */
    /* border-right: 1px solid #ccc; */ /* 角の途切れの原因になる可能性があるため一旦コメントアウト */
    padding: 10px;
}
.tier-label-image {
    width: 60px; /* ラベル画像のサイズ */
    height: 60px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: #fff;
}
/* tier.php で表示されるカード画像のスタイル */
.tier-image {
  width: 100%; /* 親要素の幅に合わせる */
  height: auto; /* 高さはアスペクト比を維持して自動調整 */
  max-width: 208px; /* メディアクエリの .image-item の幅に合わせるか、希望の最大幅を指定 */
  object-fit: contain; /* アスペクト比を保ちつつ、指定された領域内に収まるように調整 */
  border-radius: 6px; /* 少し角を丸める */
  border: 2px solid #6aff72; /* ゴールド系の枠線に変更 */
}
.tier-images {
    display: grid; /* カードをグリッド表示 */
    grid-template-columns: repeat(auto-fit, minmax(208px, 1fr)); /* カードの最小幅と列数自動調整 */
    gap: 8px;
    padding: 10px;
    background-color: #ffefef; /* 薄い水色系の背景に変更 */
    box-sizing: border-box;
}

/* 画像表示エリア */
#image-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    max-width: 1080px;
    min-height: 200px;
    margin: 20px 0;
    padding: 10px;
    background-color: #f0f5ff; /* tier.php 用の背景色 */
    border: 1px solid #cce0ff; /* tier.php 用のボーダー */
    border-radius: 5px;
    position: relative;
    flex-grow: 1;
}
.image-item {
    position: relative; 
    width: 208px;
    height: 117px;
}
.card-image,
.image-item.home img:not(.detail-image) {
    width: 100%; 
    height: 100%; 
    border-radius: 8px;
    border: 2px solid #9cf1c7;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    object-fit: cover;
    cursor: pointer;
    transition: opacity 0.3s ease;
}
.image-item img:not(.detail-image)[src$="placeholder.png"] {
    opacity: 0.5;
    border-color: #ccc;
}
/* 情報表示 */
.info {
    position: absolute;
    top: 100%;
    left: 0;
    width: auto;
    max-width: calc(100vw - 20px);
    background: #f0f0f0;
    padding: 10px 10px 5px;
    font-size: 14px;
    text-align: left;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    display: none;
    margin-top: 5px;
}
.info ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}
.info li {
    margin: 5px 0;
    white-space: nowrap;
}
.detail-image {
    border-radius: 8px;
    border: 2px solid #9cf1c7;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin: 10px;
    object-fit: cover;
}
.detail-image.main-image {
    width: 277px;
    height: 156px;
    border: 3px solid #ffd700;
}
.detail-image.sub-image {
    width: 93.5px;
    height: 93.5px;
    border: 3px solid #00ced1;
}
.detail-none {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    color: #666;
    width: 93.5px;
    height: 93.5px;
    border-radius: 8px;
    border: 2px solid #00ced1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background: #fff;
    margin: 10px;
}
.rank-image {
    width: 93.5px;
    height: 93.5px;
    border-radius: 8px;
    border: 3px solid #4682b4;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    object-fit: cover;
    margin: 10px;
}
.rank-none {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    color: #666;
    width: 93.5px;
    height: 93.5px;
    border-radius: 8px;
    border: 2px solid #4682b4;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background: #fff;
    margin: 10px;
}
.rank-text {
    font-size: 14px;
    font-weight: 700;
    color: #ff4500;
    margin: 5px 0;
    text-align: center;
    font-family: '游ゴシック', 'Yu Gothic', sans-serif;
}
/* 詳細ページ用CSS */
.card-detail {
    width: 100%;
    padding: 20px;
    background: #fff0f5;
    border: 3px solid #ff69b4;
    border-radius: 10px;
    margin: 20px 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.main-image-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}
.basic-info,
.item-skill,
.comment-section,
.event-section,
.stats-section {
    background: linear-gradient(to bottom, #fff, #fff0f5);
    padding: 15px;
    border: 2px dotted #ff69b4;
    border-radius: 8px;
    margin-bottom: 20px;
}
.basic-info h3,
.item-skill h3,
.comment-section h3,
.event-section h3,
.stats-section h3 {
    font-family: 'M PLUS Rounded 1c', '游ゴシック', 'Yu Gothic', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #ff1493;
    margin: 0 0 10px;
    text-align: center;
}
.basic-info p,
.item-skill p,
.comment-section p {
    font-size: 14px;
    margin: 5px 0;
    font-family: '游ゴシック', 'Yu Gothic', sans-serif;
    font-weight: 700;
    color: #333;
}
.basic-info p span,
.item-skill p span {
    color: #ff4500;
}
.sub-section {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}
.rank-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.event-section {
    flex: 2;
}
.item-skill .sub-image-container {
    display: flex;
    justify-content: center;
    margin: 10px 0;
}
.event-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    min-width: 300px;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.info-item {
    background: linear-gradient(to bottom, #fff, #fff0f5);
    padding: 8px;
    border: 2px dotted #ff69b4;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.info-item.empty {
    display: flex;
    justify-content: center;
    align-items: center;
}
.info-item .icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #ffd700;
}
.info-item p {
    margin: 0;
    font-family: '游ゴシック', 'Yu Gothic', sans-serif;
}
.info-item .highlight {
    font-size: 14px;
    font-weight: 700;
    color: #ff4500;
    white-space: nowrap;
}
.evaluation {
    background: linear-gradient(to bottom, #fff, #fff0f5);
    padding: 15px;
    border: 2px dotted #ff69b4;
    border-radius: 8px;
    margin-bottom: 20px;
}
.evaluation h3 {
    font-family: 'M PLUS Rounded 1c', '游ゴシック', 'Yu Gothic', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #ff1493;
    margin: 0 0 10px;
    text-align: center;
}
.evaluation p {
    font-size: 14px;
    margin: 5px 0;
    font-family: '游ゴシック', 'Yu Gothic', sans-serif;
    font-weight: 700;
    color: #333;
}
.evaluation-form {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
    
}
/* チャット欄用CSS */
.chat-section {
    width: 100%;
    max-width: 1080px;
    padding: 20px;
    background: #fff0f5;
    border: 3px solid #ff69b4;
    border-radius: 10px;
    margin: 20px 0;
}
.chat-section h3 {
    font-family: 'M PLUS Rounded 1c', '游ゴシック', 'Yu Gothic', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #ff1493;
    margin: 0 0 10px;
    text-align: center;
}
.chat-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}
.form-group {
    display: flex;
    flex-direction: column;
}
.form-group label {
    font-size: 14px;
    font-weight: 700;
    color: #ff4500;
    margin-bottom: 5px;
}
.form-group input,
.form-group textarea {
    padding: 10px;
    font-size: 14px;
    border: 2px dotted #ff69b4;
    border-radius: 5px;
    width: 100%;
    box-sizing: border-box;
    background: #fff;
}
.form-group textarea {
    resize: vertical;
    min-height: 100px;
}
.chat-form .csv-button {
    align-self: flex-end;
    background: #ff69b4;
    color: #fff;
}
.chat-form .csv-button:hover {
    background: #ff1493;
}
.chat-comments {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.comment {
    background: #fff;
    padding: 10px;
    border: 2px dotted #ff69b4;
    border-radius: 5px;
}
.comment p {
    margin: 5px 0;
    font-family: '游ゴシック', 'Yu Gothic', sans-serif;
}
.comment p strong {
    color: #ff4500;
}
.comment p span {
    font-size: 12px;
    color: #666;
}
.comment-actions {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}
.reply-form,
.edit-form {
    margin-top: 10px;
    padding: 10px;
    background: #fff0f5;
    border-radius: 5px;
}
.replies {
    margin-left: 20px;
    margin-top: 10px;
}
.reply {
    background: #fff0f5;
    padding: 5px;
    border-left: 2px solid #00ced1;
    margin-bottom: 5px;
}
/* 人気カードセクション */
.popular-cards {
    width: 100%;
    max-width: 1080px;
    padding: 20px;
    background: #fff0f5;
    border: 3px solid #ff69b4;
    border-radius: 10px;
    margin: 20px 0;
}
.popular-cards h3 {
    font-family: 'M PLUS Rounded 1c', '游ゴシック', 'Yu Gothic', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #ff1493;
    margin: 0 0 10px;
    text-align: center;
}
.popular-cards-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}
.popular-card-item {
    text-align: center;
}
.popular-card-image {
    width: 150px;
    height: 84px;
    border-radius: 8px;
    border: 2px solid #ff69b4;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    object-fit: cover;
}
.popular-card-item p {
    margin: 5px 0 0;
    font-family: '游ゴシック', 'Yu Gothic', sans-serif;
    font-weight: 700;
    color: #333;
    font-size: 14px;
}
/* エラーと成功メッセージ */
.error {
    color: #ff0000;
    font-size: 14px;
}
.success {
    color: #28a745;
    font-size: 14px;
}
/* AdSense広告用 */
/* AdSense広告用（ポップアップ） */ .ad-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}
.ad-container {
    position: relative;
    background-color: #fff;
    padding: 15px;
    border-radius: 8px;
    max-width: 90%;
    min-height: 100px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
.ad-container .adsbygoogle {
    display: block !important;
    width: 100%;
    min-height: 50px;
}
.ad-container button {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 35px;
    height: 35px;
    font-size: 20px;
    line-height: 30px;
    background: #ff0000;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

/* AdSense広告用（インライン） */
.adsense-ad {
  margin: 20px 0;
  text-align: center;
  width: 100%;
}

.adsense-ad ins {
  display: block;
  width: 100%;
  max-width: 728px; /* レスポンシブ広告の最大幅の目安 */
  min-height: 50px; /* 広告表示のための最小高さを確保 */
  margin: 0 auto;
  padding: 0 10px; /* 左右に少しパディング */
  box-sizing: border-box;
}



/* メディアクエリ（レスポンシブ対応） */
@media screen and (min-width: 769px) {
    .tier-images {
        grid-template-columns: repeat(4, 208px);
    }
    .image-item,
    .image-item.home {
        width: 208px;
        height: 117px;
    }
    .card-image,
    .image-item.home img:not(.detail-image) {
        width: 208px;
        height: 117px;
    }
    .info {
        padding: 10px 5px 5px;
    }
}
@media screen and (max-width: 768px) {
    .tier-row {
        grid-template-columns: 100%;
    }
    .tier-label {
        border-right: none;
        border-bottom: 1px solid #ccc;
    }
    .tier-images {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
        gap: 4px;
    }
    .image-item,
    .image-item.home {
        width: 180px;
        height: 101px;
    }
    .card-image,
    .image-item.home img:not(.detail-image) {
        width: 180px;
        height: 101px;
    }
    .main-image-container .detail-image.main-image {
        width: 240px;
        height: 135px;
    }
    .sub-image-container .detail-image.sub-image,
    .rank-container .rank-image,
    .rank-none,
    .detail-none {
        width: 81px;
        height: 81px;
    }
    .event-info-grid {
        grid-template-columns: 1fr;
        min-width: auto;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .info {
        width: 180px;
        max-width: 180px;
        white-space: normal;
        word-wrap: break-word;
        overflow-wrap: break-word;
        overflow-x: hidden;
        padding: 10px 5px 5px;
        box-sizing: border-box;
        left: 0;
        margin: 0;
    }
    .info ul {
        margin: 0;
        padding: 0 5px;
    }
    .info li {
        white-space: normal;
        line-height: 1.2;
        margin: 2px 0;
    }
    #filter-form {
        padding: 15px;
        margin: 15px 0;
    }
    .sub-section {
        flex-direction: column;
    }
    .card-detail {
        padding: 15px;
    }
    .card-images {
        flex-direction: column;
        align-items: center;
    }
    .chat-section {
        padding: 15px;
    }
    .popular-card-image {
        width: 130px;
        height: 73px;
    }
    .info-item .highlight {
        font-size: 13px;
    }
    .basic-info,
    .item-skill,
    .comment-section,
    .event-section,
    .stats-section {
        padding: 12px;
        margin-bottom: 15px;
    }
    .basic-info h3,
    .item-skill h3,
    .comment-section h3,
    .event-section h3,
    .stats-section h3 {
        font-size: 16px;
    }
    .basic-info p,
    .item-skill p,
    .comment-section p {
        font-size: 13px;
    }
    .rank-text {
        font-size: 13px;
    }
}

@media screen and (max-width: 768px) { /* ブレークポイントをSPナビ表示基準に合わせる */
    body {
        padding-top: 65px !important; /* スマホナビゲーションの高さ変更分を反映 (50px -> 65px) */

    }
    .main-title {
        font-size: 30px;
        
    }
    .intro-tight h2 {
        font-size: 12px;
        line-height: 16px;
    }
    .intro-tight p {
        font-size: 12px;
        line-height: 16px;
    }
    .navbar {
        flex-wrap: nowrap;
        gap: 10px;
        padding: 5px;
    }
    .navbar a {
        font-size: 12px;
        padding: 8px 15px;
        white-space: nowrap;
    }
    .tier-images {
        grid-template-columns: repeat(2, minmax(150px, 1fr));
        gap: 4px;
    }
    .image-item,
    .image-item.home {
        width: 150px;
        height: 84px;
    }
    .card-image,
    .image-item.home img:not(.detail-image) {
        width: 150px;
        height: 84px;
    }
    .main-image-container .detail-image.main-image {
        width: 200px;
        height: 112px;
    }
    .sub-image-container .detail-image.sub-image,
    .rank-container .rank-image,
    .rank-none,
    .detail-none {
        width: 67.5px;
        height: 67.5px;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .info {
        width: 150px;
        max-width: 150px;
    }
    #image-container {
        max-width: 100%;
        padding: 0 5px;
        gap: 4px;
    }
    .checkbox-container-base {
        max-width: 100%;
        padding: 0 5px;
        gap: 3px;
    }
    input[type="checkbox"] + label {
        font-size: 13px;
        padding: 2px 4px 2px 24px;
    }
    input[type="checkbox"] + label::before {
        width: 16px;
        height: 16px;
        left: 3px;
    }
    .checkbox-container {
        min-width: 24px;
        min-height: 24px;
    }
    .csv-button {
        padding: 8px 16px;
        font-size: 12px;
        min-width: 80px;
    }
    #reset-button {
        padding: 8px 16px;
        font-size: 12px;
        min-width: 80px;
        bottom: 15px;
        right: 15px;
    }
    .card-info-grid {
        grid-template-columns: 1fr;
    }
    .popular-card-image {
        width: 110px;
        height: 62px;
    }
    .info-item .highlight {
        font-size: 12px;
    }
    .basic-info,
    .item-skill,
    .comment-section,
    .event-section,
    .stats-section {
        padding: 10px;
        margin-bottom: 12px;
    }
    .basic-info h3,
    .item-skill h3,
    .comment-section h3,
    .event-section h3,
    .stats-section h3 {
        font-size: 16px;
    }
    .basic-info p,
    .item-skill p,
    .comment-section p {
        font-size: 12px;
    }
    .rank-text {
        font-size: 12px;
    }
}
@media screen and (max-width: 320px) {
    .main-title {
        font-size: 24px;
    }
    .intro-tight h2,
    .intro-tight p {
        font-size: 11px;
        line-height: 14px;
    }
    .navbar a {
        font-size: 11px;
        padding: 6px 10px;
    }
    .tier-images {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
        gap: 2px;
    }
    .image-item,
    .image-item.home {
        width: 120px;
        height: 67px;
    }
    .card-image,
    .image-item.home img:not(.detail-image) {
        width: 120px;
        height: 67px;
    }
    .main-image-container .detail-image.main-image {
        width: 160px;
        height: 90px;
    }
    .sub-image-container .detail-image.sub-image,
    .rank-container .rank-image,
    .rank-none,
    .detail-none {
        width: 54px;
        height: 54px;
    }
    .info {
        width: 120px;
        max-width: 120px;
        font-size: 12px;
        padding: 8px 5px 3px;
    }
    .info li {
        font-size: 12px;
        line-height: 1.1;
    }
    .checkbox-container-base {
        gap: 2px;
    }
    input[type="checkbox"] + label {
        font-size: 12px;
        padding: 2px 4px 2px 20px;
    }
    input[type="checkbox"] + label::before {
        width: 14px;
        height: 14px;
        left: 3px;
    }
    .csv-button {
        padding: 6px 12px;
        font-size: 11px;
        min-width: 70px;
    }
    #reset-button {
        padding: 6px 12px;
        font-size: 11px;
        min-width: 70px;
        bottom: 10px;
        right: 10px;
    }
    .popular-card-image {
        width: 90px;
        height: 50px;
    }
    .info-item .highlight {
        font-size: 11px;
    }
    .basic-info,
    .item-skill,
    .comment-section,
    .event-section,
    .stats-section {
        padding: 8px;
        margin-bottom: 10px;
    }
    .basic-info h3,
    .item-skill h3,
    .comment-section h3,
    .event-section h3,
    .stats-section h3 {
        font-size: 14px;
    }
    .basic-info p,
    .item-skill p,
    .comment-section p {
        font-size: 11px;
    }
    .rank-text {
        font-size: 11px;
    }
}

.summary-button {
  /* style.css と同じデザインを適用 */
  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;
  margin: 0;}
/* 絞り込みフォーム関連のスタイルは style.css と共通化されているため、ここでは不要 */
.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-filter { /* tier.php 用の絞り込みボタンの色 */
  background-color: #3498db; /* 青系 (friend_board.php の検索ボタンに合わせる) */
}
.summary-exclusion-filter { /* 除外フィルターボタンの色 */
  background-color: #e74c3c; /* 赤系 (style.css と同じ) */
  color: white; /* 文字色を白に (style.css と同じ) */
  /* border と text-shadow は .summary-button から継承されるため、ここでは不要 */
}


/* NEW! バッジのスタイル */
.new-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: #ff4500; /* オレンジレッド系 */
    color: white;
    padding: 6px 12px; /* パディングを調整してバッジを大きく */
    font-size: 1.6em;  /* フォントサイズを大きく */
    font-weight: bold;
    border-radius: 4px;
    z-index: 10; /* 画像の上に表示するため */
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
