/* サンブレイク BZシナリオ推測ツール（[sunbreak_bz]・js/bz-scenario.js）
   2026-10-13 オーナー指示（案C「スルー回数から」）。見た目はリコリスのツール（lycoris-pt.css）にそろえる。
   機種ページの本文（.entry-content）に出るので、テーマの表・ボタン・リストの全体指定に負けないよう .hp-sbz の中だけで完結させる */
.hp-sbz {
  --sbz-L: #2b7de0;
  --sbz-M: #1f9d57;
  --sbz-H: #e04343;
  --sbz-S: #8e44d6;
  --sbz-now: #1a3fff;
  --sbz-hot: #c03a00;
  --sbz-track: rgba(0, 0, 0, 0.07);
  margin: 14px 0 22px;
  padding: 14px 14px 12px;
  border: 1px solid var(--line-gold, rgba(245, 184, 0, 0.3));
  border-radius: 12px;
  background: var(--bg-card, #fff);
  color: var(--text-main, #1a1a1a);
  line-height: 1.6;
  scroll-margin-top: 72px; /* 解析タブの案内から飛んだ時、上の固定タブ（sticky）の下に隠れないように */
}
:root:not([data-theme="light"]) .hp-sbz {
  --sbz-now: #8fb0ff;
  --sbz-hot: #ff8a5c;
  --sbz-track: rgba(255, 255, 255, 0.1);
}
.hp-sbz [hidden] { display: none !important; }
.hp-sbz p { margin: 0; }

.hp-sbz .hp-sbz__title {
  margin: 0 0 6px;
  color: var(--text-gold, #8a5e00);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.hp-sbz .hp-sbz__sec {
  margin: 12px 0 0;
  padding: 0 0 4px;
  border-bottom: 1px solid var(--line-gold-hi, rgba(245, 184, 0, 0.5));
  color: var(--text-light, #666);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.hp-sbz .hp-sbz__title + .hp-sbz__sec { margin-top: 2px; }

/* スルー回数 → [−] 0回 [＋] */
.hp-sbz__q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 52px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line-gold, rgba(245, 184, 0, 0.3));
}
.hp-sbz__q-label {
  display: inline-flex;
  flex-direction: column;
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.3;
  white-space: nowrap;
}
.hp-sbz__q-label small {
  color: var(--text-light, #666);
  font-size: 0.72rem;
  font-weight: 700;
}
.hp-sbz__step { display: inline-flex; align-items: center; gap: 6px; }
.hp-sbz .hp-sbz__step-btn {
  width: 44px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 1.5px solid var(--line-gold-hi, rgba(245, 184, 0, 0.5));
  border-radius: 8px;
  background: transparent;
  color: var(--text-main, #1a1a1a);
  font: inherit;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation; /* 連打で拡大しないように */
  user-select: none;
}
.hp-sbz .hp-sbz__step-btn[data-d="1"] {
  border-color: var(--gold, #f5b800);
  background: var(--gold, #f5b800);
  color: #131419;
}
.hp-sbz .hp-sbz__step-btn:disabled { opacity: 0.35; cursor: default; }
.hp-sbz .hp-sbz__step-btn:active:not(:disabled) { transform: scale(0.95); }
.hp-sbz button:focus-visible,
.hp-sbz select:focus-visible,
.hp-sbz summary:focus-visible { outline: 3px solid var(--text-main, #1a1a1a); outline-offset: 2px; }
.hp-sbz__step-val {
  min-width: 1.4em;
  font-size: 1.35rem;
  font-weight: 800;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.hp-sbz__step-unit { margin-left: -3px; color: var(--text-light, #666); font-size: 0.78rem; font-weight: 700; }

/* 分かる回だけ選ぶ: 1回目 [分からない ▼] */
.hp-sbz .hp-sbz__slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  margin: 0;
  padding: 4px 0;
  border-bottom: 1px solid var(--line-gold, rgba(245, 184, 0, 0.3));
  font-size: 0.92rem;
  font-weight: 800;
}
.hp-sbz__slot-n { white-space: nowrap; }
.hp-sbz .hp-sbz__pick {
  width: auto;
  min-width: 0;
  max-width: 62%;
  height: 38px;
  margin: 0;
  padding: 0 30px 0 12px;
  border: 1.5px dashed var(--line-gold-hi, rgba(245, 184, 0, 0.5));
  border-radius: 8px;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  color: var(--text-light, #666);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
/* 選んだ回は実線・濃い字（「分からない」のままの回と見分ける） */
.hp-sbz .hp-sbz__pick.is-set {
  border-style: solid;
  color: var(--text-main, #1a1a1a);
}
.hp-sbz .hp-sbz__pick option { color: #1a1a1a; background: #fff; }

.hp-sbz .hp-sbz__err {
  margin: 10px 0 0;
  padding: 8px 10px;
  border-left: 3px solid var(--sbz-H);
  border-radius: 6px;
  background: rgba(224, 67, 67, 0.1);
  font-size: 0.88rem;
  font-weight: 700;
}

/* 結果: 次（n回目）のBZ  AT当選 38.1% */
.hp-sbz__res {
  margin: 12px 0 0;
  padding: 10px 12px 12px;
  border: 2px solid var(--line-gold-hi, rgba(245, 184, 0, 0.5));
  border-radius: 10px;
}
.hp-sbz .hp-sbz__res-h { color: var(--text-light, #666); font-size: 0.78rem; font-weight: 800; }
.hp-sbz .hp-sbz__big { display: flex; align-items: baseline; gap: 8px; margin: 0 0 6px; }
.hp-sbz__big-label { font-size: 0.9rem; font-weight: 800; }
.hp-sbz__big-val {
  color: var(--sbz-hot);
  font-size: 2rem;
  font-weight: 900;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.hp-sbz__bar {
  display: flex;
  height: 22px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--sbz-track);
}
.hp-sbz__seg {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}
.hp-sbz__seg--L { background: var(--sbz-L); }
.hp-sbz__seg--M { background: var(--sbz-M); }
.hp-sbz__seg--H { background: var(--sbz-H); }
.hp-sbz__seg--S { background: var(--sbz-S); }
.hp-sbz .hp-sbz__levels { margin: 4px 0 0; color: var(--text-light, #666); font-size: 0.76rem; font-weight: 700; }
.hp-sbz__cum { display: flex; gap: 4px; margin: 8px 0 0; }
.hp-sbz__cum > span {
  flex: 1;
  min-width: 0;
  padding: 3px 0 4px;
  border-radius: 6px;
  background: rgba(245, 184, 0, 0.12);
  text-align: center;
  line-height: 1.3;
}
.hp-sbz__cum small { display: block; color: var(--text-light, #666); font-size: 0.68rem; font-weight: 700; }
.hp-sbz__cum b { font-size: 0.9rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.hp-sbz .hp-sbz__res-note { margin: 6px 0 0; color: var(--text-light, #666); font-size: 0.7rem; }

/* いまのシナリオ: A [■■■■■■■] [====    ] 39.0% */
.hp-sbz__scs { margin: 6px 0 0; }
.hp-sbz__sc {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
  font-size: 0.85rem;
  font-weight: 800;
}
.hp-sbz__sc-n { width: 1em; text-align: center; }
.hp-sbz__seq { display: inline-flex; gap: 2px; }
.hp-sbz__cell {
  display: block;
  width: 10px;
  height: 14px;
  border-radius: 2px;
}
.hp-sbz__cell--L { background: var(--sbz-L); }
.hp-sbz__cell--M { background: var(--sbz-M); }
.hp-sbz__cell--H { background: var(--sbz-H); }
.hp-sbz__cell--S { background: var(--sbz-S); }
.hp-sbz__cell--none { background: var(--sbz-track); }
.hp-sbz__cell.is-past { opacity: 0.4; }
.hp-sbz__cell.is-next { outline: 2px solid var(--sbz-now); outline-offset: 1px; }
.hp-sbz__meter {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: var(--sbz-track);
  overflow: hidden;
}
.hp-sbz__meter > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: var(--gold, #f5b800);
  transition: width 0.2s ease;
}
.hp-sbz__sc-v { width: 4.6em; text-align: right; font-variant-numeric: tabular-nums; }
.hp-sbz__sc.is-dead { opacity: 0.3; }
.hp-sbz .hp-sbz__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin: 6px 0 0;
  color: var(--text-light, #666);
  font-size: 0.7rem;
  font-weight: 700;
}
.hp-sbz__lg::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 3px;
  border-radius: 2px;
  vertical-align: -1px;
}
.hp-sbz__lg--L::before { background: var(--sbz-L); }
.hp-sbz__lg--M::before { background: var(--sbz-M); }
.hp-sbz__lg--H::before { background: var(--sbz-H); }
.hp-sbz__lg--S::before { background: var(--sbz-S); }
.hp-sbz__lg--now::before { outline: 2px solid var(--sbz-now); outline-offset: -2px; }

/* リセット */
.hp-sbz__ops { display: flex; justify-content: flex-end; margin: 10px 0 0; }
.hp-sbz .hp-sbz__op {
  min-height: 36px;
  margin: 0;
  padding: 0 16px;
  border: 1px solid var(--line-gold-hi, rgba(245, 184, 0, 0.5));
  border-radius: 8px;
  background: transparent;
  color: var(--text-main, #1a1a1a);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}
.hp-sbz .hp-sbz__op:disabled { opacity: 0.4; cursor: default; }

/* シナリオごとの BZ レベルの表（開閉） */
.hp-sbz__table { margin: 10px 0 0; font-size: 0.85rem; }
.hp-sbz__table > summary {
  cursor: pointer;
  color: var(--text-gold, #8a5e00);
  font-weight: 700;
}
.hp-sbz__scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.hp-sbz .hp-sbz__table table {
  width: 100%;
  min-width: 320px;
  margin: 8px 0 0;
  border-collapse: collapse;
  font-size: 0.74rem;
}
.hp-sbz .hp-sbz__table th,
.hp-sbz .hp-sbz__table td {
  padding: 4px 2px;
  border: 1px solid var(--line-gold, rgba(245, 184, 0, 0.3));
  text-align: center;
  white-space: nowrap;
}
.hp-sbz .hp-sbz__table th { font-weight: 800; }
/* ★!important: animations-misc.css の .entry-content td / tr:nth-child(even) td { background・color … !important } に負けて
   レベルの色が消える（凡例と合わなくなる）。両方 !important なら詳細度でこちら (0,3,1) が勝つ */
.hp-sbz .hp-sbz__table td.hp-sbz__lv { color: #fff !important; font-weight: 800; }
.hp-sbz .hp-sbz__table td.hp-sbz__lv--L { background: var(--sbz-L) !important; }
.hp-sbz .hp-sbz__table td.hp-sbz__lv--M { background: var(--sbz-M) !important; }
.hp-sbz .hp-sbz__table td.hp-sbz__lv--H { background: var(--sbz-H) !important; }
.hp-sbz .hp-sbz__table td.hp-sbz__lv--S { background: var(--sbz-S) !important; }
.hp-sbz .hp-sbz__note { margin: 8px 0 0; color: var(--text-light, #666); font-size: 0.74rem; line-height: 1.7; }

/* 解析情報タブの「シナリオ推測ツールを使う」（bz-scenario.php の hp_sbz_kaiseki_stub） */
a.hp-sbz-go { font-weight: 800; }

@media (max-width: 360px) {
  .hp-sbz .hp-sbz__step-btn { width: 40px; }
  .hp-sbz__cell { width: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .hp-sbz__meter > span { transition: none; }
}
