/* ================================================== */
/*  art69.css                                          */
/*  129期デビュー後の初期成績予測 固有スタイル         */
/*  共通部分は tohyama_202512.css を参照              */
/* ================================================== */

/* 注釈（下線マーカー） */
.udl-green {
  text-decoration: solid underline 2px #66cdaa;
  text-underline-offset: 2px;
  font-weight: 500;
}
.note-supsm {
  font-size: 70%;
  vertical-align: 20%;
  padding: 0 1px;
  color: #666;
}

/* 脚注風コメントブロック */
.cmt-block {
  display: block;
  font-size: 88%;
  line-height: 1.6;
  padding: 10px 14px;
  margin: 10px 20px 18px 25px;
  border-top: 1px dashed #a0a0a0;
  border-bottom: 1px dashed #a0a0a0;
  background-color: #fafafa;
  color: #555;
}
.cmt-block p {
  margin: 0;
  text-indent: -1.7em;
  padding-left: 1.7em;
}
.cmt-block p + p {
  margin-top: 4px;
}

/* 数式ボックス（総合点） */
.formula-total {
  background: #fffceb;
  border-left: 4px solid #f5c518;
  border-radius: 4px;
  padding: 18px 22px 14px;
  margin: 24px 0 28px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  box-sizing: border-box;
  max-width: 100%;
}
/* 数式ボックス（予測式） */
.formula-pred {
  background: #effaf4;
  border-left: 4px solid #28a745;
  border-radius: 4px;
  padding: 18px 22px 14px;
  margin: 24px 0 28px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  box-sizing: border-box;
  max-width: 100%;
}
/* 予測式2つを横並びにするラッパー */
.formula-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin: 24px 0 28px;
}
.formula-row > .formula-pred {
  flex: 1 1 320px;
  min-width: 0; /* flexアイテムがコンテンツより狭くなれるように */
  margin: 0;
}
.formula-total > .formula-title,
.formula-pred > .formula-title {
  font-weight: bold;
  font-size: 16px;
  color: #003366;
  margin-bottom: 6px;
  display: block;
}
.formula-body {
  overflow-x: auto;
  max-width: 100%;
  margin: 4px 0 8px;
}

/* 変数定義リスト */
.variables {
  font-size: 14px;
  margin: 6px 0 0 10px;
}
.variables dl {
  margin: 4px 0;
}
.variables dt {
  float: left;
  font-weight: bold;
  color: #003366;
}
.variables dt::after {
  content: "：";
}
.variables dd {
  margin: 0 0 4px 80px;
}
.variables .note {
  display: block;
  margin-top: 4px;
  color: #666;
  font-size: 12px;
}

/* 小さな追記 */
p.add-note {
  font-size: 86%;
  color: #555;
  margin: 6px 0 20px 10px;
  padding-left: 1em;
  text-indent: -1em;
  line-height: 1.5;
}

/* ========== テーブル：127期まとめ ========== */
table.summary-table {
  border-collapse: collapse;
  font-size: 14px;
  margin: 20px auto 10px;
  width: 100%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
table.summary-table caption {
  font-weight: bold;
  text-align: left;
  margin-bottom: 10px;
  color: #333;
}
table.summary-table th,
table.summary-table td {
  border: 1px solid #ddd;
  text-align: center;
  padding: 8px 10px;
  white-space: nowrap;
}
table.summary-table thead th {
  background-color: #003366;
  color: white;
  font-weight: 500;
}
table.summary-table tbody th {
  background-color: #eef2f6;
  color: #333;
  font-weight: 500;
  text-align: left;
}
/* 対象年度（127期）を薄黄色でハイライト */
table.summary-table tbody td.pick {
  background-color: #fffccf;
  font-weight: 600;
}

/* 昇班者名のテーブル */
table.name-table {
  border-collapse: collapse;
  font-size: 14px;
  margin: 20px auto;
  width: 100%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
table.name-table caption {
  font-weight: bold;
  text-align: left;
  margin-bottom: 10px;
  color: #333;
}
table.name-table th,
table.name-table td {
  border: 1px solid #ddd;
  padding: 10px 12px;
  text-align: center;
}
table.name-table thead th {
  background: #003366;
  color: white;
  font-weight: 500;
}
table.name-table tbody th {
  background: #eef2f6;
  font-weight: 500;
}
table.name-table td.names {
  text-align: left;
  line-height: 1.8;
}

/* ========== 予測値テーブル（表3-1） ========== */
.pred-table-wrap {
  margin: 24px 0 8px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
}
table.pred-table {
  border-collapse: collapse;
  font-size: 13px;
  min-width: 1000px;
  width: 100%;
}
table.pred-table caption {
  padding: 10px 12px;
  font-weight: bold;
  text-align: left;
  background: #f4f8fb;
  border-bottom: 1px solid #dbe4ed;
}
table.pred-table caption .nrm {
  font-weight: normal;
  font-size: 85%;
  color: #555;
}
table.pred-table caption .legend-gcap {
  display: inline-block;
  background-color: #ffeccc;
  padding: 1px 8px;
  border-radius: 2px;
  font-weight: 500;
  color: #8a4b00;
}
table.pred-table thead th {
  background-color: #003366;
  color: white;
  font-weight: 500;
  padding: 6px 5px;
  border: 1px solid #22497c;
  text-align: center;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
}
table.pred-table tbody td {
  border: 1px solid #ddd;
  padding: 4px 6px;
  text-align: center;
  white-space: nowrap;
}
table.pred-table tbody tr:nth-child(even) td:not(.total):not(.pred):not(.gcap) {
  background-color: #fafbfc;
}
/* 選手名セル */
table.pred-table tbody td.name {
  text-align: left;
  font-weight: 500;
  min-width: 7.5em;
}
/* ゴールデンキャップ */
table.pred-table tbody td.gcap {
  background-color: #ffeccc !important;
  font-weight: 600;
}
/* 総合点セル（薄黄色） */
table.pred-table tbody td.total {
  background-color: #fffccf;
  font-weight: 600;
}
/* 予測値セル（薄緑） */
table.pred-table tbody td.pred {
  background-color: #e6fff5;
  font-weight: 600;
}
/* トップ3のランクセルを強調 */
table.pred-table tbody tr.top3 td.rank {
  background: linear-gradient(180deg, #fff4c4 0%, #ffd976 100%);
  font-weight: bold;
  color: #8a5a00;
}

/* 凡例 */
.legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13px;
  margin: 8px 0 14px 2px;
  color: #555;
}
.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend-swatch {
  display: inline-block;
  width: 18px;
  height: 14px;
  border: 1px solid #bbb;
  border-radius: 2px;
}
.sw-gcap { background: #ffeccc; }
.sw-total { background: #fffccf; }
.sw-pred { background: #e6fff5; }
.sw-top3 {
  background: linear-gradient(180deg, #fff4c4 0%, #ffd976 100%);
}

/* 選手紹介段落の装飾 */
.player-hl {
  text-decoration: solid underline 2px #66cdaa;
  text-underline-offset: 3px;
  font-weight: 600;
  color: #003366;
}

/* 図を横並び */
.fig-pair {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  margin: 20px 0 10px;
}
.fig-pair figure {
  margin: 0;
  max-width: 560px;
  flex: 1 1 300px;
  min-width: 0; /* 画像の intrinsic 幅で flex アイテムが縮まないのを防ぐ */
}
.fig-pair figure img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  border: 1px solid #eee;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  background: white;
}
.fig-pair figcaption {
  text-align: left;
  padding: 6px 4px 0;
  font-size: 14px;
  font-weight: 500;
  color: #555;
}

/* art69 モバイル調整 */
@media (max-width: 768px) {
  .formula-total,
  .formula-pred {
    padding: 14px 12px 10px;
  }
  /* 横並びは解除し必ず縦積みに */
  .formula-row {
    flex-direction: column;
    gap: 16px;
  }
  .formula-row > .formula-pred {
    flex: 1 1 auto;
    width: 100%;
  }
  .variables dt {
    float: none;
  }
  .variables dd {
    margin-left: 10px;
  }
  .cmt-block {
    margin: 8px 6px 16px 10px;
  }
  table.pred-table {
    font-size: 12px;
  }
}

/* 予測式：狭い画面では数式をスクロールなしで収めるため文字サイズを縮小 */
@media (max-width: 500px) {
  .formula-pred .formula-body {
    font-size: clamp(10px, 3.2vw, 16px);
    overflow-x: visible;
  }
  /* MathJax の display math 周囲余白を詰めて更に横幅を確保 */
  .formula-pred .formula-body mjx-container[display="true"] {
    margin: 0.3em 0;
  }
}
