/* 野球人生スロット（複製・デバッグ版）: 夜の球場風ダークテーマ、外部フォントなし */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: #050a18;
  color: #eef5ee;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
.stage { min-height: 100dvh; display: flex; justify-content: center; }
.phone {
  position: relative; width: 100%; max-width: 430px; min-height: 100dvh;
  background: linear-gradient(180deg, #0a1428 0%, #12244a 46%, #081026 100%);
  overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 0 40px rgba(0,0,0,.6);
}
.bg { position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background:
    radial-gradient(ellipse 90% 30% at 50% -4%, rgba(120,160,255,.20), transparent 70%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.025) 0 46px, transparent 46px 92px);
}
.scr { display: none; position: relative; flex: 1; flex-direction: column; padding: 18px 16px 20px; overflow-y: auto; }
.scr.is-on { display: flex; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

/* タイトル */
.tt-top { text-align: center; padding: 26px 0 8px; }
.tt-lead { color: #9db8e8; font-weight: 700; letter-spacing: .12em; font-size: 13px; }
.tt-logo { font-size: 42px; line-height: 1.15; font-weight: 900; margin: 10px 0 4px;
  background: linear-gradient(180deg, #fff8d6, #ffd94d 55%, #c89212); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.5)); }
.tt-ball { width: 110px; color: #7f9fd0; margin: 2px auto 0; display: block; }
.tt-sub { color: #cfdcf2; font-size: 13.5px; line-height: 1.7; margin-top: 8px; }
.tt-form { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; }
.tt-field > span { display: block; font-size: 12px; color: #9db8e8; font-weight: 700; margin-bottom: 6px; letter-spacing: .08em; }
.tt-field input { width: 100%; padding: 12px; border-radius: 10px; border: 1px solid #2c4470; background: rgba(0,0,0,.35); color: #fff; font-size: 16px; }
.seg { display: flex; gap: 8px; }
.seg button { flex: 1; padding: 11px 4px; border-radius: 10px; border: 1px solid #2c4470; background: rgba(0,0,0,.3); color: #cfdcf2; font-weight: 700; }
.seg button.on { background: #1d4a9e; border-color: #4a7ad9; color: #fff; }
.btn-main { margin-top: 6px; padding: 14px; border-radius: 999px; text-align: center;
  background: linear-gradient(180deg, #ffb03a, #e07b12); color: #231300; font-weight: 900;
  box-shadow: 0 4px 14px rgba(224,123,18,.45); display: flex; flex-direction: column; align-items: center; gap: 1px; width: 100%; }
.btn-main b { font-size: 19px; }
.btn-main small { font-size: 11.5px; font-weight: 700; opacity: .75; }
.tt-best { text-align: center; color: #8fa3c4; font-size: 12px; margin-top: 14px; min-height: 1em; }

/* スロット画面 */
.hud-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.year-main { display: block; font-size: 21px; font-weight: 900; }
.year-sub { display: block; font-size: 12px; color: #9db8e8; margin-top: 2px; }
.chip { flex: none; font-size: 11.5px; font-weight: 700; padding: 5px 10px; border-radius: 999px; background: #16294d; border: 1px solid #2c4470; color: #bfd2f2; }
.rail { display: flex; gap: 4px; margin-top: 12px; }
.lamp { flex: 1; text-align: center; font-size: 10px; padding: 4px 0; border-radius: 6px; background: rgba(0,0,0,.35); color: #6d7f9e; border: 1px solid rgba(255,255,255,.06); }
.lamp.done { background: #1d4a9e; color: #eaf1ff; }
.lamp.now { background: #e07b12; color: #fff; font-weight: 900; }
.marquee { margin-top: 14px; text-align: center; font-weight: 900; font-size: 15px; padding: 9px 8px; border-radius: 10px;
  background: rgba(0,0,0,.4); border: 1px solid #2c4470; color: #ffe9a8; min-height: 40px; }
.reels { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.reel { background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.09); border-radius: 12px; padding: 9px 10px 10px; }
.rhead { display: flex; justify-content: space-between; align-items: baseline; }
.rname { font-size: 13px; font-weight: 700; color: #cfdcf2; }
.pl .grade { font-weight: 900; font-size: 17px; margin-right: 5px; }
.pl .val { font-weight: 900; font-size: 17px; font-variant-numeric: tabular-nums; }
.win { margin-top: 7px; border-radius: 9px; background: #0b1512; border: 1px solid rgba(255,255,255,.08); padding: 7px 0; text-align: center; overflow: hidden; }
.win.spinning .cell b { filter: blur(1px); opacity: .75; }
.cell b { font-size: 20px; font-weight: 900; }
.cell.t0 b { color: #8b9a90; } .cell.t1 b { color: #f2f2f2; } .cell.t2 b { color: #54a8ff; }
.cell.t3 b { color: #35d465; } .cell.t4 b { color: #ff5348; } .cell.t5 b { color: #ffc93c; }
.cell.t6 b { background: linear-gradient(90deg, #ff5ec8, #ffc93c, #35d465, #54a8ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gauge { height: 5px; border-radius: 3px; background: rgba(255,255,255,.1); margin-top: 8px; overflow: hidden; }
.gauge i { display: block; height: 100%; width: 0; border-radius: 3px; transition: width .4s ease; }
.event { margin-top: 12px; background: rgba(0,0,0,.35); border: 1px solid #2c4470; border-radius: 12px; padding: 10px 12px; }
.event-title { font-size: 12px; font-weight: 900; color: #9db8e8; margin-bottom: 5px; }
.event-list { list-style: none; font-size: 13.5px; line-height: 1.65; }
.event-list li::before { content: "▸ "; color: #e07b12; font-weight: 900; }
.console { margin-top: auto; padding-top: 14px; display: flex; align-items: center; gap: 12px; }
.total-box { flex: 1; }
.total-box .k { font-size: 11px; color: #9db8e8; font-weight: 700; display: block; }
.total-num { font-size: 34px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.total-rank { display: block; font-size: 11.5px; color: #bfd2f2; margin-top: 3px; }
.spin { flex: none; width: 118px; height: 118px; border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #ff9a78, #e3261b 55%, #8c0c11);
  border: 4px solid #6a070c; color: #fff; box-shadow: 0 6px 18px rgba(227,38,27,.45);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.spin b { font-size: 24px; font-weight: 900; text-shadow: 0 2px 4px rgba(0,0,0,.4); }
.spin small { font-size: 10.5px; opacity: .9; }
.spin:disabled { opacity: .55; }
.spin:active { transform: scale(.97); }

/* 分かれ道 */
.fork-head { display: flex; justify-content: space-between; align-items: center; }
.fork-stage { font-weight: 900; color: #9db8e8; }
.fork-ov b { color: #ffd94d; font-size: 19px; }
.fork-title { font-size: 24px; font-weight: 900; line-height: 1.35; margin-top: 22px; }
.fork-say { color: #cfdcf2; line-height: 1.7; margin-top: 8px; font-size: 14px; }
.fork-cards { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.fcard { text-align: left; background: rgba(0,0,0,.35); border: 2px solid #2c4470; border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 5px; width: 100%; }
.fcard:active { border-color: #e07b12; }
.fc-name { font-size: 18px; font-weight: 900; }
.fc-row { font-size: 13.5px; color: #ffe9a8; }
.fc-note { font-size: 12.5px; color: #9faec8; }
.fork-foot { text-align: center; color: #8fa3c4; font-size: 12.5px; margin-top: 16px; }

/* 結果 */
.res-scroll { display: flex; flex-direction: column; gap: 14px; }
.card { border-radius: 16px; padding: 2px; background: linear-gradient(160deg, #3a4a42, #141c17); }
.card[data-tier="sr"] { background: linear-gradient(160deg, #7a5cff, #2a1a5e); }
.card[data-tier="ssr"] { background: linear-gradient(160deg, #ffc93c, #8c5a00); }
.card[data-tier="ur"] { background: linear-gradient(160deg, #ff5ec8, #ffc93c, #35d465, #54a8ff); }
.card-in { background: #0a1730; border-radius: 14px; padding: 16px; }
.card-top { display: flex; justify-content: space-between; font-size: 11px; color: #9db8e8; font-weight: 700; letter-spacing: .06em; }
.card-title { font-size: 30px; font-weight: 900; margin-top: 10px; color: #ffe9a8; }
.card-name { margin-top: 4px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.card-name b { font-size: 19px; }
.card-name span { font-size: 12.5px; color: #bfd2f2; }
.card-score { display: flex; gap: 10px; margin-top: 14px; }
.cs { flex: 1; background: rgba(255,255,255,.05); border-radius: 10px; padding: 8px 10px; }
.cs span { display: block; font-size: 10.5px; color: #9db8e8; }
.cs b { font-size: 19px; font-weight: 900; font-variant-numeric: tabular-nums; }
.cs b em { font-style: normal; }
.cs b small { font-size: 11px; margin-left: 2px; }
.card-mid { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.radar { width: 168px; height: 168px; flex: none; }
.rgrid { fill: none; stroke: rgba(255,255,255,.16); stroke-width: 1; }
.rshape { fill: rgba(53,212,101,.35); stroke: #35d465; stroke-width: 2; }
.rlabel { fill: #cfdcf2; font-size: 10.5px; font-weight: 700; }
.card-abil { list-style: none; flex: 1; display: flex; flex-direction: column; gap: 5px; }
.card-abil li { display: flex; align-items: baseline; gap: 7px; font-size: 13.5px; background: rgba(255,255,255,.04); border-radius: 8px; padding: 5px 9px; }
.card-abil li span { flex: 1; color: #cfdcf2; }
.card-abil li b { font-size: 16px; font-weight: 900; }
.card-abil li em { font-style: normal; font-weight: 900; font-variant-numeric: tabular-nums; }
.card-hist { list-style: none; margin-top: 12px; font-size: 12.5px; line-height: 1.8; color: #d7e0f2; border-top: 1px solid rgba(255,255,255,.1); padding-top: 10px; }
.card-after { margin-top: 10px; font-size: 13.5px; font-weight: 700; color: #ffe9a8; }
.card-foot { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 10px; font-size: 12px; color: #9db8e8; border-top: 1px solid rgba(255,255,255,.1); padding-top: 10px; }
.card-foot b { color: #ffd94d; }
.res-actions { display: flex; gap: 10px; }
.btn { flex: 1; text-align: center; padding: 12px; border-radius: 999px; border: 1px solid #2c4470; background: rgba(0,0,0,.35); color: #eef5ee; font-weight: 900; text-decoration: none; font-size: 15px; }
@media (max-width: 360px) {
  .tt-logo { font-size: 36px; }
  .card-mid { flex-direction: column; }
  .radar { width: 190px; height: 190px; }
  .card-abil { width: 100%; }
}

/* DEBUGバッジ */
.debug-badge { position: absolute; top: 8px; right: 10px; z-index: 20; font-size: 11px; font-weight: 900; letter-spacing: .06em;
  padding: 4px 10px; border-radius: 999px; background: #b3001b; color: #fff; border: 1px solid #ff8fa0; }
.card-debug { color: #ff8fa0; font-weight: 900; }

/* 要約バナー */
.summary { margin-top: 10px; background: rgba(255,217,77,.12); border: 1px solid #8a6d1f; border-radius: 12px; padding: 10px 12px; }
.summary-title { font-size: 12px; font-weight: 900; color: #ffd94d; margin-bottom: 3px; }
.summary-body { font-size: 13.5px; line-height: 1.65; font-weight: 700; }

/* ティア凡例 */
.legend { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.legend .lg { font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 999px; background: rgba(0,0,0,.4); border: 1px solid rgba(255,255,255,.14); }
.legend .t0 { color: #a8b8ae; } .legend .t1 { color: #f2f2f2; } .legend .t2 { color: #54a8ff; }
.legend .t3 { color: #35d465; } .legend .t4 { color: #ff5348; } .legend .t5 { color: #ffc93c; }
.legend .t6 { background: linear-gradient(90deg, rgba(255,94,200,.25), rgba(255,201,60,.25), rgba(53,212,101,.25), rgba(84,168,255,.25)); color: #fff; }
.legend-note { font-size: 11.5px; color: #9faec8; margin-top: 6px; line-height: 1.5; }

/* リールの伸びラベル（色だけでなく言葉で読む） */
.cell small { display: block; font-size: 10.5px; font-weight: 800; color: #b9c6de; margin-top: 1px; }
.cell.t5 small { color: #ffd94d; } .cell.t6 small { color: #fff; }

/* イベントログ */
.logbox { margin-top: 12px; background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.1); border-radius: 12px; padding: 10px 12px; }
.log-title { font-size: 12px; font-weight: 900; color: #9db8e8; margin-bottom: 5px; }
.log-list { list-style: none; font-size: 12.5px; line-height: 1.65; color: #cfdaf0; }
.log-list li { padding: 3px 0; border-top: 1px dashed rgba(255,255,255,.08); }
.log-list li:first-child { border-top: none; color: #fff; font-weight: 700; }

/* ===== ボタン位置固定（2026-12-05）: 内容が増えても操作ボタンが下へずれない ===== */
/* 要約・イベント・ログは固定高さ＋内部スクロール。hidden でも領域を確保し、
   出現時に下の要素（ボタン含む）が動かないようにする */
#summaryBanner, #eventBox, #logBox { flex: none; overflow-y: auto; }
#summaryBanner { height: 92px; }
#eventBox { height: 124px; }
#logBox { height: 140px; }
#summaryBanner[hidden], #eventBox[hidden], #logBox[hidden] {
  display: block; visibility: hidden;
}
/* スロット画面の本文は固定コンソール分だけ下に余白を取り、末尾が隠れないようにする */
#scrSlot { padding-bottom: 168px; }
/* 「回す」コンソールは画面下部に固定（親指位置）。スクロール量・内容量に依らず不動 */
#scrSlot .console {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  width: min(398px, calc(100vw - 32px));
  margin-top: 0; padding: 10px 12px; z-index: 30;
  background: rgba(8, 16, 38, .94); border: 1px solid #2c4470; border-radius: 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,.55); backdrop-filter: blur(4px);
}
#scrSlot .spin { width: 104px; height: 104px; }
/* 分かれ道: 見出し・説明の高さを固定し、カード位置が文言で動かないようにする */
.fork-title { min-height: 66px; }
.fork-say { min-height: 48px; }
.fcard { min-height: 118px; }
/* 結果画面: 「もう1回」は下部に張り付き、スクロールしても押しやすい位置に残る */
#scrResult { padding-bottom: 24px; }
#againBtn { position: sticky; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); z-index: 30; }

/* ===== 野球版の追加部品 ===== */
.tt-ball { width: 72px; color: #dfe9ff; margin: 4px auto 0; display: block; }
.seg-wrap { flex-wrap: wrap; }
.seg-wrap button { flex: 1 1 30%; }
.debug-info { margin-top: 8px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11.5px;
  color: #ffb3c0; background: rgba(179,0,27,.16); border: 1px dashed #b3001b; border-radius: 8px; padding: 6px 10px; }
.cs-path { font-size: 14.5px !important; line-height: 1.35; }
.card-pro { list-style: none; margin-top: 10px; font-size: 12.5px; line-height: 1.75; color: #d7e0f2;
  border-top: 1px solid rgba(255,255,255,.1); padding-top: 10px; max-height: 260px; overflow-y: auto; }
.card-pro li:first-child { color: #ffd94d; font-weight: 900; }
