/* =========================================================
   race-bets-table.css（完全版・最適化）
   - SWELL影響回避：.brbt 以下で完結
   - 上段：買い目表 + このレースの収支（PC=左右 / SP=縦）
   - 下段：節間収支 + 節間トータル（PC=左右 / SP=縦）
   - SP：横スクロール禁止 / 13px / 行高さ30px統一
========================================================= */
.brbt{
  width:100%;
  margin-top:12px; /* ← 追加：見出しの上余白用 */
}

/* =========================
   head
========================= */
.brbt__head{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:10px;
  margin:10px 0 8px;
}
.brbt__title{
  font-weight:800;
  font-size:16px;
  line-height:1.2;
    margin-top:10px;  
}
.brbt__sub{
  font-size:12px;
  color:#666;
  white-space:nowrap;
}

/* notice */
.brbt__notice{
  margin:8px 0 10px;
  padding:8px 10px;
  background:rgba(255, 240, 240, 1);
  border:1px solid rgba(220, 0, 0, .15);
  color:#a00;
  font-weight:700;
  font-size:13px;
}

/* actions */
.brbt__actions{
  display:flex;
  justify-content:flex-end;
  gap:6px;
  margin:0 0 8px;
}
.brbt__btn{
  appearance:none;
  -webkit-appearance:none;
  border:1px solid rgba(0,0,0,.15);
  background:#fff;
  color:#222;
  padding:8px 10px;
  font-weight:800;
  font-size:13px;
  cursor:pointer;
}
.brbt__btn:hover{ background:rgba(0,0,0,.03); }

/* =========================================================
   layout（上段：表 + 右ボックス）
========================================================= */
.brbt__layout{
  display:grid;
  grid-template-columns: 1fr 260px;
  gap:10px;
  align-items:start;
}
@media (max-width: 780px){
  .brbt__layout{ grid-template-columns: 1fr; }
}

/* =========================================================
   tablewrap（上段）
========================================================= */
/* =========================================================
   ✅ brbt内の文字を全部太字に
========================================================= */
.brbt{
  font-weight:800;
}
.brbt__tablewrap{
  width:100%;
  overflow:auto;
  border:1px solid rgba(0,0,0,.12);
  background:#fff;
}
.brbt__loading,
.brbt__empty{
  padding:14px 12px;
  font-size:14px;
  color:#444;
}
.brbt-th--odds,
.brbt-td--odds{
  text-align: center;
}
.brbt__table{
  width:100%;
  border-collapse:collapse;
  table-layout:fixed;
}
table[data-brbt-table="1"] thead th{
  white-space: nowrap !important;   /* 改行禁止 */
  word-break: keep-all !important;  /* 強制分割禁止 */
}
/* =====================================================
   ✅ 上表（6列）PC/SP共通：列幅を%で固定
   12 / 23 / 17 / 12 / 17 / 17 %
   （No / 買い目 / 購入額 / 判定 / 確定オッズ / 払戻）
===================================================== */
table[data-brbt-table="1"] thead th:nth-child(1),
table[data-brbt-table="1"] tbody td:nth-child(1){ width:10% !important; }

table[data-brbt-table="1"] thead th:nth-child(2),
table[data-brbt-table="1"] tbody td:nth-child(2){ width:23% !important; }

table[data-brbt-table="1"] thead th:nth-child(3),
table[data-brbt-table="1"] tbody td:nth-child(3){ width:17% !important; }

table[data-brbt-table="1"] thead th:nth-child(4),
table[data-brbt-table="1"] tbody td:nth-child(4){ width:12% !important; }

table[data-brbt-table="1"] thead th:nth-child(5),
table[data-brbt-table="1"] tbody td:nth-child(5){ width:19% !important; }

table[data-brbt-table="1"] thead th:nth-child(6),
table[data-brbt-table="1"] tbody td:nth-child(6){ width:17% !important; }

/* th（SWELL回避：必ず brbt-th を当てる） */
.brbt__th.brbt-th{
  padding:10px 8px;
  font-size:12px;
  font-weight:800;
  color:#222;
  background:#f3f4f6;
  border-bottom:1px solid rgba(0,0,0,.12);
  border-right:1px solid rgba(0,0,0,.08);
  text-align:center;
}
.brbt__th.brbt-th:last-child{ border-right:0; }


/* td */
.brbt__td.brbt-td{
  padding:10px 8px;
  font-size:14px;
  border-bottom:1px solid rgba(0,0,0,.08);
  border-right:1px solid rgba(0,0,0,.06);
  vertical-align:middle;
  background:#fff;
}
.brbt__td.brbt-td:last-child{ border-right:0; }
.brbt__tbody .brbt__tr:last-child .brbt__td{ border-bottom:0; }

.brbt-td--no{ text-align:center; font-weight:800; }
.brbt-td--stake{ text-align:right; font-variant-numeric: tabular-nums; }
.brbt-td--judge{ text-align:center; }
.brbt-td--payout{ text-align:right; font-variant-numeric: tabular-nums; }

.brbt__bet{
  display:inline-flex;
  align-items:center;
  gap:6px;
  flex-wrap:wrap;
}
.brbt__bet-sep{
  font-weight:900;
  color:#333;
  line-height:1;
}
.brbt__icon{
  width:22px;
  height:22px;
  display:inline-block;
}

/* 判定バッジ */
.brbt__badge{
  display:inline-block;
  padding:4px 10px;
  border-radius:999px;
  font-weight:900;
  font-size:12px;
  line-height:1;
  border:1px solid rgba(0,0,0,.08);
}
.brbt__badge--hit{
  background:rgba(255, 230, 180, 1);
  color:#7a3d00;
}
.brbt__badge--refund{
  background:rgba(210, 235, 255, 1);
  color:#004a7a;
}

/* =========================================================
   右下：このレースの収支（上段）
========================================================= */
.brbt__racebox{
  border:1px solid rgba(0,0,0,.12);
  background:#fff;
  padding:12px 12px;
}
.brbt__racebox-title{
  font-weight:900;
  font-size:14px;
  margin:0 0 10px;
}
.brbt__racebox-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:8px 0;
  border-top:1px solid rgba(0,0,0,.08);
}
.brbt__racebox-row:first-of-type{
  border-top:0;
  padding-top:0;
}
.brbt__racebox-k{
  font-size:12px;
  font-weight:800;
  color:#444;
}
.brbt__racebox-v{
  font-size:14px;
  font-weight:900;
  color:#111;
  font-variant-numeric: tabular-nums;
}

/* =========================================================
   下段：節間収支
========================================================= */
.brbt__series{
  margin-top:12px;
}
.brbt__head--series{
  margin-top:0;
}

/* 節間レイアウト（PC=左右2カラム / SP=縦） */
.brbt__layout--series{
  display:grid;
  grid-template-columns: 1fr 260px;
  gap:10px;
  align-items:start;
}
@media (max-width: 780px){
  .brbt__layout--series{ grid-template-columns: 1fr; }
}

/* ✅ PCで横並びを崩す原因になるので margin は持たせない */
.brbt__serieswrap{
  width:100%;
  overflow:auto;
  border:1px solid rgba(0,0,0,.12);
  background:#fff;
  margin:0;
}

/* 右：節間トータル */
.brbt__seriesbox{
  border:1px solid rgba(0,0,0,.12);
  background:#fff;
  padding:12px 12px;
}

/* =========================================================
   SP最適化（横スクロール禁止 / 13px / 行高さ30pxで統一）
========================================================= */
@media (max-width: 768px){

  /* ベース */
  .brbt{ font-size:13px; }

  /* ヘッダ周り */
  .brbt__head{
    gap:6px;
    margin:8px 0 6px;
  }
  .brbt__title{ font-size:14px; }
  .brbt__sub{
    font-size:11px;
    white-space:normal;
    text-align:right;
  }

  .brbt__actions{ margin:0 0 6px; }
  .brbt__btn{
    padding:6px 8px;
    font-size:13px;
  }

  /* 横スクロール禁止（上表＋節間表） */
  .brbt__tablewrap{ overflow:hidden; }
  .brbt__serieswrap{ overflow:hidden; margin:8px 0 10px; } /* SPだけ余白 */

  /* テーブル共通：上表/節間表（JSで data属性を付ける前提） */
  table[data-brbt-table="1"],
  table[data-brbt-series-table="1"]{
    width:100%;
    table-layout:fixed;
    border-collapse:collapse;
  }

  /* PCの固定幅指定をSPでは解除 */
  .brbt-th--no,
  .brbt-th--stake,
  .brbt-th--judge,
  .brbt-th--payout{
    width:auto !important;
  }

  /* 行高さ：30px 統一 */
  table[data-brbt-table="1"] .brbt__th.brbt-th,
  table[data-brbt-table="1"] .brbt__td.brbt-td,
  table[data-brbt-series-table="1"] .brbt__th.brbt-th,
  table[data-brbt-series-table="1"] .brbt__td.brbt-td{
    height:30px;
    padding:4px 4px;
    font-size:13px;
    line-height:1.1;
    vertical-align:middle;
  }

  /* th は全部中央 */
  table[data-brbt-table="1"] .brbt__th.brbt-th,
  table[data-brbt-series-table="1"] .brbt__th.brbt-th{
    text-align:center !important;
  }

  /* td：基本センター */
  table[data-brbt-table="1"] .brbt__td.brbt-td,
  table[data-brbt-series-table="1"] .brbt__td.brbt-td{
    text-align:center;
  }

table[data-brbt-table="1"] .brbt-td--stake,
table[data-brbt-table="1"] .brbt-td--payout{
  text-align:right !important;
  font-variant-numeric: tabular-nums;
}

/* ✅ 確定オッズだけ中央 */
table[data-brbt-table="1"] .brbt-td--odds{
  text-align:center !important;
  font-variant-numeric: tabular-nums;
}

  /* 節間表：金額系だけ右寄せ（3=購入 4=払戻 5=収支 6=回収率） */
  table[data-brbt-series-table="1"] .brbt__tbody td:nth-child(3),
  table[data-brbt-series-table="1"] .brbt__tbody td:nth-child(4),
  table[data-brbt-series-table="1"] .brbt__tbody td:nth-child(5),
  table[data-brbt-series-table="1"] .brbt__tbody td:nth-child(6){
    text-align:right !important;
    font-variant-numeric: tabular-nums;
  }

  /* 折り返し（横スク禁止のため） */
  table[data-brbt-table="1"] th,
  table[data-brbt-table="1"] td,
  table[data-brbt-series-table="1"] th,
  table[data-brbt-series-table="1"] td{
    overflow:hidden;
    word-break:break-word;
  }



  /* 節間（6列） 10 / 10 / 20 / 20 / 20 / 20 % */
  table[data-brbt-series-table="1"] thead th:nth-child(1),
  table[data-brbt-series-table="1"] tbody td:nth-child(1){ width:15% !important; }
  table[data-brbt-series-table="1"] thead th:nth-child(2),
  table[data-brbt-series-table="1"] tbody td:nth-child(2){ width:10% !important; }
  table[data-brbt-series-table="1"] thead th:nth-child(3),
  table[data-brbt-series-table="1"] tbody td:nth-child(3){ width:20% !important; }
  table[data-brbt-series-table="1"] thead th:nth-child(4),
  table[data-brbt-series-table="1"] tbody td:nth-child(4){ width:20% !important; }
  table[data-brbt-series-table="1"] thead th:nth-child(5),
  table[data-brbt-series-table="1"] tbody td:nth-child(5){ width:20% !important; }
  table[data-brbt-series-table="1"] thead th:nth-child(6),
  table[data-brbt-series-table="1"] tbody td:nth-child(6){ width:15% !important; }

  /* bet系：詰める */
  .brbt__bet{ gap:3px; flex-wrap:wrap; }
  .brbt__icon{ width:16px; height:16px; display:inline-block; }
  .brbt__badge{ padding:3px 6px; font-size:11px; }

  /* ✅ スマホ：タイトルを“変な箱(th風)”にしない（通常見出しへ戻す） */
  .brbt__racebox-title{
    display:block;
    margin:0 0 8px;
    padding:0;
    height:auto;
    line-height:1.2;
    text-align:left;
    font-weight:900;
    font-size:13px;
    color:#111;
    background:transparent;
    border:0;
  }

  .brbt__seriesbox{ padding:10px 10px; }

  /* 右側ボックス行も30px基準へ */
  .brbt__racebox-row{
    min-height:30px;
    padding:4px 0;
    display:flex;
    justify-content:space-between;
    align-items:center;
  }
  .brbt__racebox-v{
    text-align:right;
    font-variant-numeric: tabular-nums;
  }

  /* 空表示/ローディング */
  .brbt__loading,
  .brbt__empty{
    padding:10px 10px;
    font-size:13px;
  }
  /* =====================================================
     ✅ SP：買い目の間延び対策（アイコンと「-」を詰める）
  ===================================================== */
  table[data-brbt-table="1"] tbody td:nth-child(2) .brbt__bet{
    gap:2px !important;          /* ← ここで詰まる */
  }
  .brbt__bet-sep{
    margin:0 1px !important;     /* 「-」の左右も詰める */
  }


}
/* =========================================================
   ✅ 買い目（2列目）を崩さず中央寄せ（PC/SP共通）
   - tdは table-cell のまま（壊れない）
   - 中身を nowrap で1行固定
========================================================= */
.brbt__table tbody td:nth-child(2){
  text-align:center;
  vertical-align:middle;
}

/* アイコン列は1行固定（ここ重要） */
.brbt__table tbody td:nth-child(2) .brbt__bet{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex-wrap:nowrap;      /* ✅ wrap禁止 */
  white-space:nowrap;    /* ✅ 改行禁止 */
  gap:6px;
}

.brbt__actions--bottom{
  margin:12px 0 0;
}