/* 連鎖倍率表ページ専用スタイル */

.chain-page {
    padding-top: 80px;
    padding-bottom: 100px;
    background-color: #ffffff;
}

.text-center {
    text-align: center;
}

.mt-5 {
    margin-top: 50px;
}

/* ヒーローセクション */
.basic-hero {
    min-height: 30vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
}

.basic-title {
    font-size: 4rem;
    font-weight: 900;
    letter-spacing: -0.05em;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #000, #444);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.basic-subtitle {
    font-size: 1.2rem;
    color: #888;
    font-weight: 700;
}

/* トグルボタン */
.view-toggle {
    display: inline-flex;
    background: #f4f6f8;
    padding: 5px;
    border-radius: 30px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);
}

.toggle-btn {
    border: none;
    background: transparent;
    padding: 10px 25px;
    font-size: 1rem;
    font-weight: bold;
    color: #888;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-btn.active {
    background: #fff;
    color: #111;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* セクションレイアウト */
.basic-section {
    padding: 60px 0;
}

.basic-section h2 {
    font-size: 2.5rem;
    font-weight: 900;
    color: #111;
    margin-bottom: 20px;
}

.bg-light {
    background-color: #fbfbfd;
    border-radius: 40px;
    margin: 0 20px;
}

/* テーブルスタイル（スクロールエリア化＆ヘッダー固定対応） */
.table-responsive {
    overflow-x: auto;
    overflow-y: auto; 
    max-height: 75vh; 
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    background: #fff;
    scrollbar-width: thin;
    scrollbar-color: #ccc #f8f9fa;
}

.multiplier-table {
    width: 100%;
    border-collapse: separate; 
    border-spacing: 0;
    min-width: 760px; 
    text-align: center;
}

.multiplier-table th,
.multiplier-table td {
    padding: 4px 6px; 
    vertical-align: middle;
    border-bottom: 1px solid #eee; 
}

/* 1段目のヘッダー固定 */
.multiplier-table th {
    position: sticky;
    top: 0; 
    height: 40px; 
    box-sizing: border-box;
    padding: 0 10px; 
    background: #f8f9fa;
    font-weight: 900;
    color: #555;
    font-size: 0.9rem;
    white-space: nowrap;
    border-bottom: 2px solid #ddd;
    z-index: 20; 
}

/* 2段組みのヘッダー固定（1段目のすぐ下） */
.sub-header-row th {
    top: 40px; 
    background: #fdfdfd;
    border-bottom: 3px solid #ddd;
    z-index: 19;
}

/* キャラクター列（左固定） */
.sticky-col {
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 10;
    box-shadow: 2px 0 5px rgba(0,0,0,0.05);
    min-width: 155px; 
}

/* ヘッダーの左上角 */
.multiplier-table th.sticky-col {
    background: #f8f9fa;
    z-index: 30; 
}

/* tbody ごとのグループアニメーション設定 */
.multiplier-table tbody {
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    background: #fff;
    position: relative;
    z-index: 1;
}

.multiplier-table tbody:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    z-index: 5; 
}

.multiplier-table tbody:hover td {
    background: #fbfbfd;
}

.multiplier-table tbody:hover td.sticky-col {
    background: #fbfbfd; 
}

/* 罫線の設定 */
.multiplier-table tbody tr:first-child td:not(.char-col) {
    border-bottom: 1px dashed #eee;
}

.multiplier-table tbody tr.row-second td {
    border-bottom: 2px solid #eee;
}

.multiplier-table tbody td.char-col {
    border-bottom: 2px solid #eee;
}

/* リンクとキャラアイコン */
.char-link {
    text-decoration: none;
    color: inherit;
    display: inline-block;
}

/* キャラクター配置のレイアウト */
.char-flex {
    display: flex;
    flex-direction: column; 
    gap: 4px; 
    justify-content: center;
    align-items: flex-start;
}

.char-row {
    display: flex;
    flex-direction: row; 
    gap: 4px; 
}

.char-icon-group {
    display: flex;
    align-items: center;
    background: #f4f6f8;
    padding: 3px 6px 3px 3px; 
    border-radius: 20px;
    font-size: 0.85rem; 
    font-weight: bold;
    transition: background 0.2s ease, transform 0.2s ease;
}

.hover-lift-small:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.char-icon {
    width: 24px; 
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 6px;
    background: #ddd;
}

/* 強制改行防止 */
.char-name {
    white-space: nowrap; 
}

/* セル内の表示切替と左揃え */
.cell-content {
    display: flex;
    justify-content: flex-start; 
    align-items: center;
    width: 100%; /* セルの横幅いっぱいに広げる */
}

/* ★得点表示の右寄せ化 */
.score-view {
    font-family: 'Arial', sans-serif;
    font-weight: bold;
    color: #333;
    font-size: 0.95rem;
    text-align: right; /* 右寄せに変更 */
    width: 100%; /* フレックス内で幅を最大に取り、右寄せを有効にする */
}

.score-view.hidden,
.yokoku-view.hidden {
    display: none;
}

/* 予告ぷよ画像表示エリア */
.yokoku-container {
    display: grid;
    grid-template-columns: repeat(3, min-content);
    justify-content: start; /* 予告表示は左寄せのまま維持 */
    align-items: center;
    gap: 2px 1px; 
}

.yokoku-container img {
    height: 22px; 
    width: auto;
    object-fit: contain;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .basic-title { font-size: 2.5rem; }
    .bg-light { margin: 0; border-radius: 0; }
    .sticky-col { min-width: 130px; }
    .char-icon-group { padding: 2px 4px 2px 2px; font-size: 0.75rem; }
    .char-icon { width: 20px; height: 20px; }
    .yokoku-container img { height: 18px; } 
    .table-responsive { max-height: 65vh; }
}

/* 連鎖倍率表ページ専用スタイル */

.chain-page {
    padding-top: 80px;
    padding-bottom: 100px;
    background-color: #ffffff;
}

.text-center {
    text-align: center;
}

.mt-5 {
    margin-top: 50px;
}

/* ヒーローセクション */
.basic-hero {
    min-height: 30vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
}

.basic-title {
    font-size: 4rem;
    font-weight: 900;
    letter-spacing: -0.05em;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #000, #444);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.basic-subtitle {
    font-size: 1.2rem;
    color: #888;
    font-weight: 700;
}

/* トグルボタン */
.view-toggle {
    display: inline-flex;
    background: #f4f6f8;
    padding: 5px;
    border-radius: 30px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);
}

.toggle-btn {
    border: none;
    background: transparent;
    padding: 10px 25px;
    font-size: 1rem;
    font-weight: bold;
    color: #888;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-btn.active {
    background: #fff;
    color: #111;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* セクションレイアウト */
.basic-section {
    padding: 60px 0;
}

.basic-section h2 {
    font-size: 2.5rem;
    font-weight: 900;
    color: #111;
    margin-bottom: 20px;
}

.bg-light {
    background-color: #fbfbfd;
    border-radius: 40px;
    margin: 0 20px;
}

/* ★追加：画像表示ボタン */
.image-btn-container {
    margin-bottom: 20px;
}

.btn-image-link {
    display: inline-block;
    background-color: #f4f6f8;
    color: #333;
    padding: 8px 30px;
    border-radius: 25px;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: bold;
    border: 1px solid #ddd;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.btn-image-link:hover {
    background-color: #333;
    color: #fff;
    border-color: #333;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.btn-image-link.hidden {
    display: none !important;
}
/* ★ここまで */

/* テーブルスタイル（スクロールエリア化＆ヘッダー固定対応） */
.table-responsive {
    overflow-x: auto;
    overflow-y: auto; 
    max-height: 75vh; 
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    background: #fff;
    scrollbar-width: thin;
    scrollbar-color: #ccc #f8f9fa;
}

.multiplier-table {
    width: 100%;
    border-collapse: separate; 
    border-spacing: 0;
    min-width: 760px; 
    text-align: center;
    border-left: 1px solid #ddd; 
}

.multiplier-table th,
.multiplier-table td {
    padding: 4px 6px; 
    vertical-align: middle;
    border-bottom: 1px solid #eee; 
    border-right: 1px solid #ddd; 
}

/* 1段目のヘッダー固定 */
.multiplier-table th {
    position: sticky;
    top: 0; 
    height: 40px; 
    box-sizing: border-box;
    padding: 0 10px; 
    background: #f8f9fa;
    font-weight: 900;
    color: #555;
    font-size: 0.9rem;
    white-space: nowrap;
    border-bottom: 2px solid #ccc; 
    border-top: 1px solid #ddd; 
    z-index: 20; 
}

/* 2段組みのヘッダー固定（1段目のすぐ下） */
.sub-header-row th {
    top: 40px; 
    background: #fdfdfd;
    border-bottom: 3px solid #ccc;
    border-top: none; 
    z-index: 19;
}

/* キャラクター列（左固定） */
.sticky-col {
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 10;
    box-shadow: 2px 0 5px rgba(0,0,0,0.05);
    min-width: 155px; 
}

/* ヘッダーの左上角 */
.multiplier-table th.sticky-col {
    background: #f8f9fa;
    z-index: 30; 
}

/* tbody ごとのグループアニメーション設定 */
.multiplier-table tbody {
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    background: #fff;
    position: relative;
    z-index: 1;
}

.multiplier-table tbody:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    z-index: 5; 
}

.multiplier-table tbody:hover td {
    background: #fbfbfd;
}

.multiplier-table tbody:hover td.sticky-col {
    background: #fbfbfd; 
}

/* 罫線の設定 */
.multiplier-table tbody tr:first-child td:not(.char-col) {
    border-bottom: 1px dashed #aaa; 
}

.multiplier-table tbody tr.row-second td {
    border-bottom: 2px solid #ccc; 
}

.multiplier-table tbody td.char-col {
    border-bottom: 2px solid #ccc; 
    border-right: 2px solid #ccc; 
}

/* リンクとキャラアイコン */
.char-link {
    text-decoration: none;
    color: inherit;
    display: inline-block;
}

/* キャラクター配置のレイアウト */
.char-flex {
    display: flex;
    flex-direction: column; 
    gap: 4px; 
    justify-content: center;
    align-items: flex-start;
}

.char-row {
    display: flex;
    flex-direction: row; 
    gap: 4px; 
}

.char-icon-group {
    display: flex;
    align-items: center;
    background: #f4f6f8;
    padding: 3px 6px 3px 3px; 
    border-radius: 20px;
    font-size: 0.85rem; 
    font-weight: bold;
    transition: background 0.2s ease, transform 0.2s ease;
}

.hover-lift-small:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.char-icon {
    width: 24px; 
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 6px;
    background: #ddd;
}

/* 強制改行防止 */
.char-name {
    white-space: nowrap; 
}

/* セル内の表示切替と左揃え */
.cell-content {
    display: flex;
    justify-content: flex-start; 
    align-items: center;
    width: 100%; 
}

/* 得点表示の右寄せ化 */
.score-view {
    font-family: 'Arial', sans-serif;
    font-weight: bold;
    color: #333;
    font-size: 0.95rem;
    text-align: right; 
    width: 100%; 
}

.score-view.hidden,
.yokoku-view.hidden {
    display: none;
}

/* 予告ぷよ画像表示エリア */
.yokoku-container {
    display: grid;
    grid-template-columns: repeat(3, min-content);
    justify-content: start; 
    align-items: center;
    gap: 2px 1px; 
}

.yokoku-container img {
    height: 22px; 
    width: auto;
    object-fit: contain;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .basic-title { font-size: 2.5rem; }
    .bg-light { margin: 0; border-radius: 0; }
    .sticky-col { min-width: 130px; }
    .char-icon-group { padding: 2px 4px 2px 2px; font-size: 0.75rem; }
    .char-icon { width: 20px; height: 20px; }
    .yokoku-container img { height: 18px; } 
    .table-responsive { max-height: 65vh; }
}

/* =========================================================
   ★追加：画像表示リンクボタン用スタイル
   ========================================================= */
.img-link-btn {
    display: inline-block;
    background: #333;
    color: #fff;
    padding: 8px 24px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.img-link-btn:hover {
    background: #000;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* JSで非表示にするためのクラス */
.img-link-btn.hidden {
    display: none;
}