/************************************
** 1. 既存テーブル復元 (exp / expall)
** サイト内の既存デザインを壊さないための保護レイヤー
************************************/
table.exp { width: 100%; border-collapse: collapse; margin: 1em auto; }
table.exp td, table.exp th { border: 1px solid #ccc; padding: 10px; font-size: 13px; color: #000; }
table.exp th { border-left: 5px solid #005ab3; color: #005ab3; text-align: center; }

table.expall { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.win table.expall { overflow-y: auto; max-height: 50vh; }
table.expall th { background: #191970; color: #fff; font-weight: normal; text-align: center; }

@media screen and (max-width: 640px) {
    table.resp1 th, table.resp1 td { display: block; width: 100%; border: none; border-left: 1px solid #ccc; border-right: 1px solid #ccc; font-size: 13px; }
    table.resp1.last td:last-child { border-bottom: 1px solid #ccc; }
}

/************************************
** 2. 【聖域】取組表専用：スナップスライダー (V97)
** ハイブリッド方式：jQueryで初期位置を合わせ、CSSでスナップ(ボヨヨン)を制御。
************************************/

/* スライダーの外枠 */
html body .entry-content .sm-torikumi-viewer {
    display: flex !important; 
    overflow-x: auto !important;
    overflow-y: hidden;
    width: 100%;
    max-width: 100vw;
    margin: 1.5em 0;
    padding: 0;
    /* [重要] 物理スナップ設定 */
    scroll-snap-type: x mandatory;
    /* [修正] JSでの初期ジャンプと喧嘩しないよう、アニメーションをオフにする */
    scroll-behavior: auto !important;
    -webkit-overflow-scrolling: touch;
    align-items: flex-start;
}

/* WordPressの自動整形(p, br)を完全に抹殺 */
html body .entry-content .sm-torikumi-viewer p,
html body .entry-content .sm-torikumi-viewer br {
    display: none !important;
}

/* 左右の滑走路（不可視の50%余白）：jQueryの390px地点を「中央」にする土台 */
html body .entry-content .sm-torikumi-viewer::before,
html body .entry-content .sm-torikumi-viewer::after {
    content: "";
    flex: 0 0 50% !important;
    min-width: 50% !important;
    height: 1px;
    background: transparent;
    pointer-events: none;
}

/* 取組表本体：唯一の吸着ターゲット */
html body .entry-content .sm-torikumi-viewer table.torikumi {
    flex: 0 0 780px !important;
    width: 780px !important;
    min-width: 780px !important;
    margin: 0 !important;
    border-collapse: collapse !important;
    /* 強力な中央吸着 */
    scroll-snap-align: center;
    scroll-snap-stop: always;
    position: relative;
    z-index: 1;
    /* GPU加速：再描画時のちらつきを抑制 */
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* --- 取組表：内部デザイン設定 (復元) --- */
.torikumi th, .torikumi td {
    padding: 0 !important; color: #111; font-size: 15px; text-align: center;
    vertical-align: middle; white-space: nowrap; border: 0.1px solid #000 !important; background-color: #fff;
}
.torikumi td { height: 25px; font-weight: bold; }
.torikumi ul li { list-style: none; margin: 0; font-size: 15px; }
.tr_midashi td { height: 20px; background: #000; color: #fff; font-size: 15px; }
.tbl-tr-info { width: 18em; } .tbl-tr-rikishi { width: 10em; } .tbl-tr-kimarite { width: 9em; } 
.Est ul { text-align: right; padding-right: 5px; } .Wst ul { text-align: left; padding-left: 5px; }
.tbl-tr-hoshi { padding: 1.5px !important; font-size: 15px; font-weight: bold; }
.winlight { background: #ffd6ad !important; }
.win .font_UDK { font-family: "UD デジタル 教科書体 NK-R", "UD Digi Kyokasho NK-R" !important; }

/* 段位別色分け */
.torikumi .head-cnt { background: #191970; color: #fff; height: 20px; } 
.torikumi .mu { background: #4b0082; color: #fff; }
.torikumi .jr { background: #a52a2a; color: #fff; }
.torikumi .ms { background: #007bbb; color: #fff; }
.torikumi .sd { background: #f39800; color: #111; }
.torikumi .jn { background: #c7dc68; color: #111; }
.torikumi .jk { background: #a0d8ef; color: #111; }

/************************************
** 3. 汎用テーブルシステム (SM-Table) V85
** 優勝力士一覧、力士名鑑ポータル等で使用する行列固定エンジン
************************************/
html body .entry-content .sm-table-wrapper {
    position: relative; width: 100%; margin: 1.5em 0; border: 1px solid #ddd; background: #fff;
    --sm-header-bg: #1e3a8a; --sm-header-text: #ffffff; --sm-col1-width: 60px; --sm-text-color: #000;
}
html body .entry-content .sm-table-wrapper > p, 
html body .entry-content .sm-table-wrapper > br { display: none !important; }
html body .entry-content .sm-table-wrapper.has-scroll-both { overflow: auto; max-height: 450px; -webkit-overflow-scrolling: touch; }
html body .entry-content .sm-table-wrapper table { 
    display: table !important; width: 100% !important; border-collapse: separate !important; border-spacing: 0 !important; 
    font-size: 14px; color: var(--sm-text-color) !important;
}
html body .entry-content .sm-table-wrapper th, 
html body .entry-content .sm-table-wrapper td { 
    padding: 12px 10px !important; border: 1px solid #eee !important; text-align: center; 
    min-width: 80px; white-space: nowrap; background-color: #fff; background-clip: padding-box; 
}
html body .entry-content .sm-table-wrapper td.text-L,
html body .entry-content .sm-table-wrapper td.is-wrap { white-space: normal !important; word-break: break-all; text-align: left; }
html body .entry-content .sm-table-wrapper tr.thead th { background-color: var(--sm-header-bg) !important; color: var(--sm-header-text) !important; font-weight: bold; position: sticky; top: -1px; z-index: 20; }