/* =========================================
   統計・ヒートマップ表・グラフ用 共通CSS
   ========================================= */

.rs-table-caption {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #1e3a8a;
    text-align: center;
}

/* グラフを囲む枠 */
.rs-graph-wrapper {
    width: 100%; 
    box-sizing: border-box; 
    overflow-x: auto; 
    margin-bottom: 30px; 
    border: 1px solid #cbd5e1; 
    padding: 15px 10px; 
    background: #fff; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

/* テーブルを囲む枠 */
.rs-table-wrapper {
    width: 100%;
    overflow-y: auto; 
    overflow-x: auto; 
    -webkit-overflow-scrolling: touch;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

/* ★ スマホ表示時 (600px未満) は高さを約9行分(390px)に制限 */
@media screen and (max-width: 599px) {
    .rs-table-wrapper {
        max-height: 390px; 
    }
}

/* ★ PC表示時 (600px以上) は高さを少し抑えめの固定値(550px)に制限 */
@media screen and (min-width: 600px) {
    .rs-table-wrapper {
        max-height: 550px; 
    }
}

.rs-table {
    width: 100%;
    border-collapse: separate; 
    border-spacing: 0;
    color: #000;     
    min-width: 600px;
    border-left: 2px solid #222;
    border-top: 2px solid #222;
}

.rs-table th, .rs-table td {
    border-right: 1px solid #94a3b8; 
    border-bottom: 1px solid #94a3b8; 
    padding: 8px 6px;
    white-space: nowrap;
    color: #000;     
    font-size: 13px !important; 
}

@media screen and (min-width: 600px) {
    .rs-table th, .rs-table td {
        font-size: 14px !important; 
    }
}

.rs-table th:last-child, .rs-table td:last-child {
    border-right: 2px solid #222 !important;
}
.rs-table tbody tr:last-child td {
    border-bottom: 2px solid #222 !important;
}

/* THEADの行 (上下スクロールで固定。黒背景に白文字) */
.rs-table thead th {
    position: sticky;
    top: 0; 
    background-color: #222; 
    color: #fff;            
    font-weight: bold;      
    text-align: center;
    vertical-align: middle;
    z-index: 10; 
    border-right: 1px solid #666; 
    border-bottom: 1px solid #666;
}

.rs-table thead th[rowspan="2"],
.rs-table thead tr:last-child th {
    border-bottom: 2px solid #222 !important;
}

/* 動的な太線区切り */
.rs-border-right-thick {
    border-right: 2px solid #222 !important;
}
.rs-table thead .rs-border-right-thick {
    border-right: 2px solid #aaa !important; 
}

/* Theadの2行目（内訳の下の行）の位置を計算して固定 */
.rs-table thead tr:nth-child(2) th {
    top: 36px; 
}

/* Sticky (列の固定) の魔法 */
.rs-sticky-col1 {
    position: sticky;
    left: 0;
    background-color: #fff;
    z-index: 5;
    text-align: center;
}
.rs-sticky-col2 {
    position: sticky;
    left: 45px; 
    background-color: #fff;
    z-index: 5;
    border-right: 2px solid #222 !important; 
    text-align: center;
}
.rs-sticky-col1.no-col2 {
    border-right: 2px solid #222 !important;
}

.rs-table tbody .rs-sticky-col1,
.rs-table tbody .rs-sticky-col2 {
    font-weight: bold;
}

.rs-table thead .rs-sticky-col1, 
.rs-table thead .rs-sticky-col2 {
    z-index: 15;
    background-color: #111; 
    color: #fff;
    border-right: 2px solid #aaa !important; 
}
.rs-table thead .rs-sticky-col1.no-col2 {
    border-right: 2px solid #aaa !important;
}

.rs-num-val { 
    text-align: right; 
    padding-right: 12px !important;
}

/* =========================================
   大相撲ガイド：デイリーランキング表＆サマリー専用CSS
   ========================================= */

/* --- 1. デイリーランキング表 (.dr-table) --- */
.dr-table-wrapper {
    width: 100%;
    max-height: 600px;
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    background: #fff;
}
.dr-table {
    border-collapse: separate;
    border-spacing: 0;
    width: max-content; 
    color: #000;
    font-size: 12px;
    border-left: 2px solid #222;
    border-top: 2px solid #222;
}
@media screen and (min-width: 600px) {
    .dr-table { font-size: 13px; }
}
.dr-table th, .dr-table td {
    border-right: 1px solid #aaa;
    border-bottom: 1px solid #aaa;
    padding: 6px 8px;
    white-space: nowrap;
    text-align: center;
    vertical-align: middle;
    color: #000 !important;
}
.dr-table tbody tr:hover td, .dr-table tbody tr:hover th {
    background-color: #f1f5f9; 
}
.dr-table th:last-child, .dr-table td:last-child {
    border-right: 2px solid #222 !important;
}
.dr-table tbody tr:last-child td, .dr-table tbody tr:last-child th {
    border-bottom: 2px solid #222 !important;
}

/* THEADの固定とデザイン */
.dr-table thead th {
    position: sticky;
    background-color: #f1f5f9; 
    color: #1e293b !important;
    font-weight: bold;
    z-index: 10;
    border-bottom: 2px solid #222 !important;
    border-right: 1px solid #94a3b8;
}
.dr-table thead tr:nth-child(1) th { top: 0; }
.dr-table thead tr:nth-child(2) th { top: 32px; }

.dr-border-thick { border-right: 2px solid #222 !important; }

/* 左端のSticky固定 */
.dr-sticky-left-1 { position: sticky; left: 0; z-index: 5; background: #fff; border-right: 1px solid #aaa; }
.dr-sticky-left-2 { position: sticky; left: 40px; z-index: 5; background: #fff; border-right: 2px solid #222 !important; }

/* ホバー時のSticky要素突き抜け防止 */
.dr-table tbody tr:hover .dr-sticky-left-1, 
.dr-table tbody tr:hover .dr-sticky-left-2 {
    background-color: #f1f5f9 !important;
}
.dr-table thead .dr-sticky-left-1, .dr-table thead .dr-sticky-left-2 {
    z-index: 15;
    background-color: #e2e8f0;
}

/* 数値の右寄せ設定 */
.dr-num { text-align: right !important; padding-right: 6px; }

.dr-header-title { font-size: 15px; font-weight: bold; margin-bottom: 5px; color: #333; }
.dr-header-update { font-size: 11px; color: #666; margin-bottom: 10px; }


/* --- 2. 個別サマリーカード (.dr-summary-card) --- */
.dr-summary-card {
    border: 2px solid #eef2ff;
    border-radius: 12px;
    background: #fcfdff;
    padding: 20px;
    margin: 30px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.dr-summary-title {
    font-size: 18px !important;
    font-weight: bold;
    color: #1e3a8a !important;
    margin-top: 0 !important;
    margin-bottom: 15px !important;
    text-align: center;
    border-bottom: 1px dashed #cbd5e1 !important;
    padding-bottom: 10px !important;
    border-left: none !important; 
    background: transparent !important;
}
.dr-summary-title::before, .dr-summary-title::after { display: none !important; }

.dr-summary-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}
.dr-summary-label {
    width: 95px; /* 「勝ち越し人数」が収まるように少し拡張 */
    font-size: 13px;
    font-weight: bold;
    color: #333;
    flex-shrink: 0;
}
.dr-summary-bar-wrapper {
    flex-grow: 1;
    height: 24px;
    background-color: #f1f5f9; 
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    margin-right: 15px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}
.dr-summary-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s ease-out;
}
.dr-summary-value {
    position: absolute;
    top: 0;
    left: 8px;
    line-height: 24px;
    font-size: 13px;
    font-weight: bold;
    color: #000;
    text-shadow: 1px 1px 0px rgba(255,255,255,0.8), -1px -1px 0px rgba(255,255,255,0.8), 1px -1px 0px rgba(255,255,255,0.8), -1px 1px 0px rgba(255,255,255,0.8);
}
.dr-summary-rank {
    width: 45px;
    text-align: right;
    font-size: 15px;
    font-weight: bold;
    color: #b91c1c; 
    flex-shrink: 0;
}

.dr-btn-cta {
    display: inline-block; 
    background: #d3381c; 
    color: #fff !important; 
    text-decoration: none !important; 
    padding: 12px 25px; 
    border-radius: 30px; 
    font-weight: bold; 
    font-size: 15px; 
    box-shadow: 0 4px 6px rgba(211, 56, 28, 0.3); 
    transition: opacity 0.3s;
}
.dr-btn-cta:hover {
    opacity: 0.8;
}

@media (max-width: 480px) {
    .dr-summary-label { width: 85px; font-size: 11px; letter-spacing: -0.5px; } /* スマホでもギリギリ収まるように */
    .dr-summary-rank { width: 35px; font-size: 13px; }
    .dr-summary-card { padding: 15px 10px; }
    .dr-btn-cta { width: 100%; box-sizing: border-box; font-size: 14px; }
}

/* =========================================
   大相撲ガイド：中長期ランキング表 専用CSS
   ========================================= */

.mr-table-caption {
    font-size: 15px;
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}
.mr-header-update {
    font-size: 11px;
    color: #666;
    margin-bottom: 10px;
}

.mr-table-wrapper {
    width: 100%;
    max-height: 600px;
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    background: #fff;
}
.mr-table {
    border-collapse: separate;
    border-spacing: 0;
    width: max-content; 
    color: #000;
    font-size: 12px;
    border-left: 2px solid #222;
    border-top: 2px solid #222;
}
@media screen and (min-width: 600px) {
    .mr-table { font-size: 13px; }
}

.mr-table th, .mr-table td {
    border-right: 1px solid #aaa;
    border-bottom: 1px solid #aaa;
    padding: 6px 8px;
    white-space: nowrap;
    text-align: center; 
    vertical-align: middle;
    color: #000 !important; 
}
.mr-table tbody tr:hover td, .mr-table tbody tr:hover th {
    background-color: #f1f5f9; 
}
.mr-table th:last-child, .mr-table td:last-child {
    border-right: 2px solid #222 !important;
}
.mr-table tbody tr:last-child td, .mr-table tbody tr:last-child th {
    border-bottom: 2px solid #222 !important;
}

/* THEADの固定とデザイン */
.mr-table thead th {
    position: sticky;
    background-color: #f1f5f9; 
    color: #1e293b !important;
    font-weight: bold;
    z-index: 10;
    border-bottom: 2px solid #222 !important;
    border-right: 1px solid #94a3b8;
}
.mr-table thead tr:nth-child(1) th { top: 0; }
.mr-table thead tr:nth-child(2) th { top: 32px; /* JSで再計算 */ }

.mr-border-thick { border-right: 2px solid #222 !important; }

/* 左端のSticky固定 */
.mr-sticky-left-1 { position: sticky; left: 0; z-index: 5; background: #fff; border-right: 1px solid #aaa; }
.mr-sticky-left-2 { position: sticky; left: 40px; z-index: 5; background: #fff; border-right: 2px solid #222 !important; }

/* ホバー時のSticky要素突き抜け防止 */
.mr-table tbody tr:hover .mr-sticky-left-1, 
.mr-table tbody tr:hover .mr-sticky-left-2 {
    background-color: #f1f5f9 !important;
}

/* THEAD内のSticky交差点はZ-Indexを高く */
.mr-table thead .mr-sticky-left-1, .mr-table thead .mr-sticky-left-2 {
    z-index: 15;
    background-color: #e2e8f0;
}

/* 数値の右寄せ設定 */
.mr-num { text-align: right !important; padding-right: 6px; }