/* ============================================================
   縦画面版（800×1280）の上書きレイヤー。各モードの旧CSS（1280×720の絶対配置）より後に読み込む。
   旧CSSが付ける位置の inline style（JSが top/left/width を直接指定する箇所）は !important で打ち消す。
   文字は8.8型の実寸で読める大きさ（本文 20px 以上、ラベルでも 13px 以上）。
   ============================================================ */
html, body { touch-action: manipulation; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; background: #05080f; }
button { touch-action: manipulation; }
#stage { background: #0a1126; }
.mini-btn { width: 64px; height: 56px; font-size: 28px; border-radius: 14px; }
.audio-btns { right: 18px; top: 16px; gap: 12px; }

/* ---------- タイトル ---------- */
.t-wrap { top: 150px; }
.t-kicker { font-size: 34px; letter-spacing: 18px; padding-left: 18px; }
.t-logo { margin-top: 14px; font-size: 84px; letter-spacing: 2px; -webkit-text-stroke: 11px #10204a; }
.t-kari { font-size: 34px; margin-left: 4px; display: block; margin-top: 6px; }
.t-bar { width: 560px; margin-top: 22px; }
.t-start { top: 560px; width: 560px; height: 120px; margin-left: -280px; font-size: 56px; border-radius: 60px; }
.t-start:active { top: 564px; }
.t-opt { top: 730px; width: 400px; height: 88px; margin-left: -200px; font-size: 32px; border-radius: 44px; }
.t-opt:active { background: rgba(30,60,130,0.85); }

/* 共通ボタン */
#beta .bb { font-size: 26px; padding: 12px 28px; border-radius: 14px; min-height: 64px; }
#beta .bb.sub { font-size: 24px; }
#beta .bb:hover { filter: none; }
#beta .bb:active:not(:disabled) { filter: brightness(1.2); transform: translateY(1px); }

/* ---------- メニュー ---------- */
#bMenu #bModes { position: absolute; left: 0; right: 0; top: 0; bottom: 120px; padding: 24px 20px 0; display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: min-content; gap: 14px; align-content: start; }
#bMenu .mrow, #bMenu .fgrow { position: static !important; left: auto !important; top: auto !important; width: auto !important; margin: 0; }
#bMenu #fgMain { grid-column: 1 / 3; height: 170px; padding: 0 36px; }
#bMenu #fgSetBtn { grid-column: 1 / 3; height: 84px; flex-direction: row; justify-content: center; gap: 28px; }
#bMenu .fgn { font-size: 44px; letter-spacing: 2px; white-space: nowrap; }
#bMenu .fgs { font-size: 19px; }
#bMenu #fgMain { flex-wrap: nowrap; gap: 8px; }
#bMenu #fgMain .mbx { align-self: center; flex-direction: column; align-items: flex-end; gap: 0; min-width: 120px; }
#bMenu #fgMain .mvl { font-size: 48px; }
#bMenu #fgMain .ml { font-size: 20px; }
#bMenu .fgn2 { font-size: 30px; }
#bMenu .fgc { margin-top: 0; font-size: 44px; }
#bMenu .mrow, #bMenu.ten .mrow, #bMenu.nine .mrow { height: 150px; padding: 12px 18px; flex-direction: column; align-items: flex-start; justify-content: space-between; border-radius: 16px; }
#bMenu .mtx { width: 100%; }
#bMenu.ten .mn, #bMenu.nine .mn, #bMenu .mn { font-size: 31px; letter-spacing: 1px; line-height: 1.1; }
#bMenu.ten .ms, #bMenu.nine .ms, #bMenu .ms { font-size: 16px; margin-top: 4px; line-height: 1.3; white-space: normal; max-height: 42px; overflow: hidden; }
#bMenu .mbx, #bMenu.ten .mbx, #bMenu.nine .mbx { min-width: 0; align-self: flex-end; display: flex; align-items: baseline; gap: 10px; }
#bMenu .ml, #bMenu.ten .ml, #bMenu.nine .ml { font-size: 15px; }
#bMenu .mvl, #bMenu.ten .mvl, #bMenu.nine .mvl { font-size: 32px; }
#bMenu .mvl small, #bMenu.ten .mvl small { font-size: 16px; }
#bMenu .mrow:not(:disabled):hover, #bMenu .fgrow:not(:disabled):hover { transform: none; }
#bMenu .mbtns { top: auto; bottom: 26px; gap: 20px; }
#bMenu .mbtns .bb { min-width: 280px; }

/* ---------- オプション ---------- */
#bOpt h1, #bRules h1, #bRaces h1 { top: 26px; font-size: 48px; }
#bOpt .otabs { left: 20px; width: 760px; top: 100px; gap: 8px; flex-wrap: wrap; }
#bOpt .otab { flex: 1 1 calc(50% - 8px); font-size: 24px; padding: 12px 0; min-height: 64px; }
#bOpt .olist { left: 20px; width: 760px; top: 250px; bottom: 120px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
#bOpt .olist .orow { height: auto; min-height: 108px; padding: 12px 0; flex-wrap: wrap; gap: 10px; align-content: center; }
#bOpt .olx { max-width: 100%; flex: 1 1 100%; }
#bOpt .olist .ol { font-size: 28px; }
#bOpt .od { font-size: 18px; line-height: 1.4; }
#bOpt .oc { flex: 1 1 100%; justify-content: flex-start; flex-wrap: wrap; gap: 14px; }
#bOpt .oc button { width: 84px; min-height: 64px; font-size: 34px; }
#bOpt .oc button.tx, #bOpt .oc button.tg { min-width: 180px; font-size: 24px; width: auto; }
#bOpt .oc button.gb { width: 150px; font-size: 26px; }
#bOpt #oVal { min-width: 120px; font-size: 44px; }
#bOpt .yl { font-size: 20px; margin-left: 6px; }
#bOpt .yc { gap: 10px; }
#bOpt .yc button { width: 78px; font-size: 32px; }
#bOpt .yv { min-width: 96px; font-size: 40px; }
#bOpt #oRaceN { font-size: 24px; }
#bOpt .back, #bRules .back { top: auto; bottom: 28px; min-width: 260px; }
#bRules .rtext { left: 24px; width: 752px; top: 110px; height: auto; bottom: 120px; font-size: 22px; line-height: 1.6; -webkit-overflow-scrolling: touch; }
#bRules .rtext h2 { font-size: 26px; margin: 22px 0 6px; }
#bRaces .rg { left: 20px; top: 100px; width: 760px; bottom: 220px; overflow-y: auto; align-content: start; grid-template-columns: 1fr 1fr; gap: 10px 12px; -webkit-overflow-scrolling: touch; }
#bRaces .rc { height: 70px; gap: 12px; padding: 0 14px; }
#bRaces .rc input { width: 32px; height: 32px; }
#bRaces .rc .rn { font-size: 24px; }
#bRaces .rc .rs { font-size: 16px; }
#bRaces .rinfo { left: 24px; width: 752px; top: auto; bottom: 130px; font-size: 20px; line-height: 1.4; }
#bRaces .rbtns { top: auto; bottom: 28px; }
#bRaces .rbtns .bb { margin: 0 6px; min-width: 200px; padding: 12px 10px; }

/* ---------- プレイ画面（成績・血統・重賞成績・リベンジ・フルゲート内） ---------- */
#beta #bPlay.on { display: flex; flex-direction: column; padding: 0 20px 18px; }
#bTop { position: static; height: 68px; flex: none; margin: 0 -20px; padding: 0 22px; font-size: 24px; }
#bTop #bRace { font-size: 30px; letter-spacing: 2px; }
#bTop #bQn { font-size: 22px; }
#bTop .sc { font-size: 22px; }
#bTop .sc span { font-size: 38px; }
#bTop { gap: 10px; }
#bTop #bRace { flex: 1 1 auto; }
#bQuit { position: static !important; width: 92px; height: 44px; min-height: 0 !important; font-size: 19px !important; padding: 0 6px !important; border-width: 2px; flex: none; order: 5; margin: 0 6px 0 4px; }
#bTop .sc { order: 6; }
#bPanel { position: relative; left: auto; top: auto; width: auto; height: auto; flex: none; margin: 8px 0 0; border-radius: 14px; padding: 0 0 6px; }
#bPA { position: static; }
#bPanel .ph { position: relative; left: auto; top: auto; right: auto; height: auto; padding: 12px 16px 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; align-items: center; }
#bPanel .yr { position: static; font-size: 24px; color: #555; grid-column: 1; }
#bPanel .gc { position: static; transform: none; grid-column: 2; justify-self: start; font-size: 20px; }
#bPanel .gc span { padding: 3px 14px; }
#bPanel .tt { position: static; grid-column: 1 / 3; font-size: 36px; line-height: 1.15; flex-wrap: wrap; gap: 4px 0; }
#bPanel .tt .kai { font-size: 20px; margin-right: 10px; }
#bPanel .tt .gi { font-size: 22px; padding: 1px 16px; margin-left: 12px; }
#bPanel .pd { position: static; grid-column: 1 / 3; height: auto; display: grid; grid-template-columns: 58px 1fr; gap: 8px; align-items: center; margin-top: 2px; }
#bPanel .pd .pc { font-size: 14px; line-height: 1.2; padding-right: 8px; }
#bPanel .pd .pcol { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
#bPanel .pd .pr { height: auto; flex-direction: column; align-items: stretch; gap: 2px; font-size: 20px; }
#bPanel .pd .pl { width: auto; font-size: 13px; line-height: 17px; }
#bPanel .pd .pr .hm { min-width: 0; height: 32px; line-height: 32px; padding: 0 6px; font-size: 19px; text-align: center; white-space: nowrap; overflow: hidden; }
#bPanel .pd .pr .hm.mk::after { font-size: 18px; }
#bPanel .pd .pv { min-width: 0; text-align: center; }
#bPanel .hm.mk::after { font-size: 20px; }
#bPanel .yr .hm { padding: 0 10px; }

/* 成績表：1頭＝3行ブロック（①着順・枠・馬番・馬名・人気／②性齢・騎手・調教師・体重／③タイム・着差・コーナー・上り） */
#bTbl { position: static; left: auto; top: auto; width: auto; margin: 10px 12px 0; display: block; table-layout: auto; }
#bTbl thead { display: none; }
#bTbl tbody { display: block; }
#bTbl tr { display: grid; grid-template-columns: repeat(24, 1fr); grid-template-rows: 44px 32px 32px; border-bottom: 2px solid #b8c2cc; padding: 3px 0; }
#bTbl tr:nth-child(odd) td { background: transparent; }
#bTbl td { position: relative; height: auto; border: none; display: flex; align-items: center; justify-content: center; font-size: 21px; padding: 0 2px; min-width: 0; text-align: center; }
#bTbl td .lb { display: none; font-style: normal; font-size: 13px; color: #78909c; font-weight: bold; white-space: nowrap; width: 31px; text-align: left; flex: none; }
#bTbl td[data-k="trainer"] .lb, #bTbl td[data-k="weight"] .lb, #bTbl td[data-k="time"] .lb { width: 44px; }
#bTbl td[data-k="corner"] .lb { width: 57px; }
#bTbl td[data-k="popularity"] .lb { width: 31px; }

#bTbl td[data-k="rank"] { grid-area: 1 / 1 / 2 / 4; font-size: 28px; }
#bTbl td[data-k="waku"] { grid-area: 1 / 4 / 2 / 7; }
#bTbl td[data-k="umaban"] { grid-area: 1 / 7 / 2 / 10; font-size: 26px; }
#bTbl td[data-k="name"] { grid-area: 1 / 10 / 2 / 21; justify-content: flex-start; padding-left: 8px; font-size: 27px; }
#bTbl td[data-k="popularity"] { grid-area: 1 / 21 / 2 / 25; }
#bTbl td[data-k="sexAge"] { grid-area: 2 / 1 / 3 / 6; }
#bTbl td[data-k="jockey"] { grid-area: 2 / 6 / 3 / 12; }
#bTbl td[data-k="trainer"] { grid-area: 2 / 12 / 3 / 19; }
#bTbl td[data-k="weight"] { grid-area: 2 / 19 / 3 / 25; }
#bTbl td[data-k="time"] { grid-area: 3 / 1 / 4 / 8; }
#bTbl td[data-k="margin"] { grid-area: 3 / 8 / 4 / 13; }
#bTbl td[data-k="corner"] { grid-area: 3 / 13 / 4 / 20; }
#bTbl td[data-k="last3f"] { grid-area: 3 / 20 / 4 / 25; }
#bTbl td[data-k="popularity"] .lb, #bTbl td[data-k="sexAge"] .lb, #bTbl td[data-k="jockey"] .lb, #bTbl td[data-k="trainer"] .lb, #bTbl td[data-k="weight"] .lb,
#bTbl td[data-k="time"] .lb, #bTbl td[data-k="margin"] .lb, #bTbl td[data-k="corner"] .lb, #bTbl td[data-k="last3f"] .lb { display: inline; }
#bTbl td[data-k="trainer"], #bTbl td[data-k="jockey"], #bTbl td[data-k="weight"] { font-size: 19px; }
#bTbl td[style*="font-size:15px"] { font-size: 16px !important; }
#bTbl td .wk { width: 38px; line-height: 38px; font-size: 22px; }
#bTbl td[data-k="sexAge"], #bTbl td[data-k="jockey"], #bTbl td[data-k="trainer"], #bTbl td[data-k="weight"], #bTbl td[data-k="time"], #bTbl td[data-k="margin"], #bTbl td[data-k="corner"], #bTbl td[data-k="last3f"], #bTbl td[data-k="popularity"] { justify-content: flex-start; padding-left: 4px; }
#bTbl td.mk { color: transparent; }
#bTbl td.mk .lb { color: #78909c; }
#bTbl td.mk .wk { visibility: hidden; }
#bTbl td.mk::after { content: "？"; position: absolute; inset: 3px 3px; background: #dfe5e9; color: #90a4ae; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 20px; }
#bTbl td.mk[data-k="sexAge"]::after, #bTbl td.mk[data-k="jockey"]::after, #bTbl td.mk[data-k="margin"]::after, #bTbl td.mk[data-k="last3f"]::after, #bTbl td.mk[data-k="popularity"]::after { inset: 4px 3px 4px 36px; }
#bTbl td.mk[data-k="trainer"]::after, #bTbl td.mk[data-k="weight"]::after, #bTbl td.mk[data-k="time"]::after { inset: 4px 3px 4px 49px; }
#bTbl td.mk[data-k="corner"]::after { inset: 4px 3px 4px 62px; }
#bTbl td.ans.mk::after { content: "？？？？？"; inset: 3px 4px; background: #fff3c4; color: #b8860b; letter-spacing: 6px; font-size: 24px; }
#bTbl.r4 tr { grid-template-rows: 40px 30px 30px; }
#bTbl.r4 td { font-size: 18px; }
#bTbl.r4 td[data-k="name"] { font-size: 23px; }
/* 1番人気凡走馬の予約行：常に同じ高さを確保（凡走の有無で変えない） */
#bTbl tr.fv { grid-template-rows: 46px; border-bottom: none; background: #fff; }
#bTbl tr.fv.on { background: #fdecea; }
#bTbl tr.fv td:not([data-k="rank"]):not([data-k="waku"]):not([data-k="umaban"]):not([data-k="name"]):not([data-k="popularity"]) { display: none; }
#bTbl tr.fv td .lb { display: none; }
#bTbl tr.fv td[data-k="popularity"] .lb { display: inline; }

/* 血統アタックの勝ち馬カード */
#bPB .cbody { position: static; display: block; padding: 8px 16px 4px; }
#bPB .cr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 6px; }
#bPB .ct { height: 70px; padding: 3px 12px 4px; border-radius: 9px; }
#bPB .cl { font-size: 14px; line-height: 17px; }
#bPanel #bPB .cv { height: 40px; font-size: 25px; }
#bPanel #bPB .cv.sm { font-size: 19px; line-height: 21px; }
#bPB .cwr { display: grid; grid-template-columns: 56px 1fr; gap: 8px; margin-top: 4px; }
#bPB .cwl { width: auto; font-size: 15px; padding-right: 6px; }
#bPB .cwg { grid-template-columns: 1fr 1fr; grid-auto-rows: 34px; gap: 6px 8px; }
#bPanel #bPB .cv.wl { height: 34px; font-size: 16px; padding: 0 8px; line-height: 34px; overflow: hidden; }
#bPanel #bPB .cv.wl.xs { grid-column: span 2; }
#bPB .cwho { font-size: 22px; padding: 4px 12px; }
#bPB .cwho small { font-size: 13px; }
#bPanel #bPB .ph { grid-template-columns: 1fr auto; }
#bPanel #bPB .ph .tt, #bPanel #bPB .ph .yr { grid-column: 1; }
#bPanel #bPB .ph .pd { display: block; grid-column: 2; grid-row: 1 / 3; }

/* 答え候補（2列×3段の大きなボタン） */
#bChoices { position: static; left: auto; top: auto; width: auto; flex: none; margin-top: 8px; grid-template-columns: 1fr 1fr; gap: 10px; }
#bChoices button { height: 66px; font-size: 27px; border-radius: 14px; line-height: 1.15; padding: 0 8px; }
#bChoices button[style*="font-size:20px"] { font-size: 22px !important; }
#bChoices button:hover:not(.done):not(:disabled) { filter: none; }
#bChoices button:active:not(.done):not(:disabled) { filter: brightness(1.25); }
#bChoices button.done { opacity: 0.55; }
#bChoices button.done.ok, #bChoices button.done.ng { opacity: 1; }
#bChoices button.sel { outline: 4px solid #fff; outline-offset: -1px; opacity: 1; }
#bChoices button:disabled { opacity: 0.9; }
/* タイピング回答：キーボードに隠れないよう、画面上部（パネルの上）に置く */
#bType { position: static; width: auto; order: -1; flex: none; margin: 10px 0 0; gap: 10px; }
#bType input { height: 76px; font-size: 32px; }
#bType .bb { height: 76px; padding: 0 28px; }

/* 解答後エリア（プロフィール＋次へ） */
#bFb:not(.on) > * { visibility: hidden; }
#bFb:not(.on)::before { content: "答え合わせ"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 22px; color: #5d70a6; letter-spacing: 6px; }
#bFb { position: relative; left: auto; top: auto; width: auto; height: auto; min-height: 0; flex: 1 1 0; overflow: hidden; margin-top: 8px; display: flex; flex-direction: column; background: rgba(0,0,0,0.5); padding: 12px 16px 0; }
#bFb .m { position: absolute; left: auto; right: 16px; top: 12px; width: auto; font-size: 26px; }
#bFb .c { position: static; right: auto; font-size: 19px; line-height: 1.34; flex: 1 1 0; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
#bFb .c b { font-size: 30px; margin-right: 12px; }
#bFb .c > div { white-space: normal; overflow: visible; text-overflow: clip; }
#bFb .c > div:first-child { padding-right: 130px; }
#bFb .c .pg { font-size: 20px; }
#bFb .c .w { font-size: 20px; display: flex; }
#bFb .c .w .wt { white-space: normal; flex: 0 1 auto; }
#bFb .bb { position: static; right: auto; top: auto; align-self: stretch; width: 100%; height: 64px; margin: 6px 0 10px; font-size: 28px; flex: none; border-color: #ffe08a; background: linear-gradient(#f4b73a, #d38a12); color: #3b2600; border-radius: 16px; }
#bPlay .hv { text-decoration: underline dotted; text-underline-offset: 6px; text-decoration-thickness: 2px; cursor: pointer; }

/* ---------- 結果 ---------- */
#bResult h2, #fgRes h2 { top: 40px; font-size: 40px; }
#bResult .big, #fgRes .big { position: absolute; left: 0; right: 0; top: 120px; width: auto; }
#bResult .big .rk, #fgRes .big .rk { font-size: 200px; }
#bResult .big .tot, #fgRes .big .tot { font-size: 48px; }
#bResult .big .best, #fgRes .big .best { font-size: 22px; }
#bResult .big .best small, #fgRes .big .best small { font-size: 17px; }
#bList { left: 30px; width: 740px; top: 520px; font-size: 24px; }
#bList td { padding: 10px 8px; }
#bResult .btns, #fgRes .btns { top: auto; bottom: 36px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; padding: 0 20px; }
#bResult .btns .bb, #fgRes .btns .bb { margin: 0; flex: 1 1 30%; padding: 12px 6px; }

/* ---------- 更新通知トースト ---------- */
#pwaToast { position: absolute; left: 20px; right: 20px; bottom: 16px; z-index: 200; display: none; align-items: center; gap: 12px; padding: 12px 16px; background: rgba(10,17,38,0.96); border: 2px solid #ffd54a; border-radius: 14px; font-size: 20px; line-height: 1.35; }
#pwaToast span { flex: 1; }
#pwaToast button { font: inherit; font-size: 20px; color: #fff; background: #2a56b8; border: 2px solid #ffd54a; border-radius: 10px; padding: 8px 16px; min-height: 48px; }
#pwaToast button.x { background: transparent; border-color: #9fb3d9; min-width: 48px; padding: 8px; }

/* ============================================================
   名馬アタック（#bCareer）・次走アタック（#bNextMode）：横2ペイン → 縦積み
   競走成績の表は、1戦＝2行のカード（①日付・場・レース名・格／②距離馬場・頭数・人気・着順・騎手・馬体重・相手）。
   行は内容に合わせて高さが伸びる（見切れなし）。未開示の行は置かないので、スクロールバーから戦数は読めない。
   ============================================================ */
#bCareer #crPlay.on, #bNextMode #nxPlay.on { display: flex; flex-direction: column; padding: 0 20px 18px; }
#crTop, #nxTop { order: -3; position: static; left: auto; right: auto; top: auto; height: 72px; flex: none; margin: 0 -20px; padding: 0 22px; gap: 10px; font-size: 22px; }
#crTitle, #nxTitle { font-size: 28px; letter-spacing: 1px; flex: 1 1 auto; }
#crTop .sc, #nxTop .sc { margin-right: 0; order: 6; font-size: 22px; }
#crTop .sc span, #nxTop .sc span { font-size: 38px; }
#crQuit, #nxQuit { position: static !important; width: 92px; height: 44px; min-height: 0 !important; font-size: 19px !important; padding: 0 6px !important; border-width: 2px; flex: none; order: 5; margin: 0 6px 0 4px; }
#bCareer .bb, #bNextMode .bb { font-size: 26px; padding: 12px 24px; min-height: 64px; border-radius: 14px; }
#bCareer .bb:hover, #bNextMode .bb:hover { filter: none; }

#crTblW, #nxTblW { position: relative; left: auto; top: auto; width: auto; flex: none; margin-top: 10px; -webkit-overflow-scrolling: touch; }
#crTblW { height: 450px; }
#nxTblW { height: 540px; }
#crTbl, #nxTbl { display: block; width: 100%; table-layout: auto; font-size: 17px !important; }
#crTbl colgroup, #nxTbl colgroup { display: none; }
#crTbl tbody, #nxTbl tbody { display: block; }
#crTbl tr.rw, #nxTbl tr.rw { display: grid; grid-template-columns: repeat(24, 1fr); grid-auto-rows: minmax(30px, auto); height: auto; border-bottom: 2px solid rgba(255,255,255,0.22); padding: 3px 4px; }
#crTbl tr.gone, #nxTbl tr.gone { display: none; }
#crTbl td, #nxTbl td { display: block; border: none; padding: 2px 5px; line-height: 1.2; font-size: 17px; white-space: normal; word-break: break-all; overflow: hidden; min-width: 0; }
/* 値の並び＝日付・場・レース名・格・距離馬場・頭数・人気・着順・騎手・馬体重・相手（11列） */
#crTbl td:nth-child(1), #nxTbl td:nth-child(1) { grid-area: 1 / 1 / 2 / 7; }
#crTbl td:nth-child(2), #nxTbl td:nth-child(2) { grid-area: 1 / 7 / 2 / 11; }
#crTbl td:nth-child(3), #nxTbl td:nth-child(3) { grid-area: 1 / 11 / 2 / 22; font-size: 19px; }
#crTbl td:nth-child(4), #nxTbl td:nth-child(4) { grid-area: 1 / 22 / 2 / 25; text-align: right; }
#crTbl td:nth-child(5), #nxTbl td:nth-child(5) { grid-area: 2 / 1 / 3 / 7; }
#crTbl td:nth-child(6), #nxTbl td:nth-child(6) { grid-area: 2 / 7 / 3 / 10; }
#crTbl td:nth-child(7), #nxTbl td:nth-child(7) { grid-area: 2 / 10 / 3 / 13; }
#crTbl td:nth-child(8), #nxTbl td:nth-child(8) { grid-area: 2 / 13 / 3 / 16; font-weight: bold; }
#crTbl td:nth-child(9), #nxTbl td:nth-child(9) { grid-area: 2 / 16 / 3 / 21; }
#crTbl td:nth-child(10), #nxTbl td:nth-child(10) { grid-area: 2 / 21 / 3 / 25; }
#crTbl td:nth-child(11), #nxTbl td:nth-child(11) { grid-area: 3 / 1 / 4 / 25; color: #cfe0ff; font-size: 16px; }
#crTbl td:nth-child(11):empty, #nxTbl td:nth-child(11):empty { display: none; }

#crProf { position: relative; left: auto; top: auto; width: auto; height: 410px; flex: none; margin-top: 10px; padding: 8px 10px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
#crProf .pg { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
#crProf .pt { padding: 4px 8px 5px; }
#crProf .pl { font-size: 13px; }
#crProf .pv { font-size: 18px; line-height: 22px; min-height: 22px; }
#crProf .pv.hid { height: 22px; }
#crProf .sec { font-size: 14px; margin: 8px 0 3px; }
#crProf .pn { font-size: 16px; line-height: 22px; white-space: normal; text-overflow: clip; }
#crProf .pblk.hid { height: 110px; }

#crType { position: static; order: -1; width: auto; height: 76px; flex: none; margin-top: 10px; display: flex; }
#crIn { font-size: 30px; }
#crIn::placeholder { font-size: 20px; }
#crType .bb { height: 76px; padding: 0 28px; }
#crCh { position: static; width: auto; height: auto; flex: none; margin-top: 10px; grid-template-columns: 1fr 1fr; gap: 8px; }
#crCh button { height: 64px; font-size: 25px; }
#crCh button[style*="font-size:18px"] { font-size: 20px !important; }
#crCh button:hover:not(:disabled) { filter: none; }
#crFb { position: relative; left: auto; top: auto; width: auto; height: auto; min-height: 200px; flex: 1 1 auto; margin-top: 10px; padding: 12px 16px; }
#crFb .m { position: static; font-size: 28px; }
#crFb .c { position: static; font-size: 20px; line-height: 1.4; margin: 4px 0 8px; }
#crFb .c b { font-size: 32px; }
#crFb .bb { position: static; width: 100%; height: 70px; border-color: #ffe08a; background: linear-gradient(#f4b73a, #d38a12); color: #3b2600; }
#crPlay.done #crFb { display: flex; flex-direction: column; justify-content: space-between; }
#crPlay:not(.ch):not(.done) #crType { display: flex; }

#crResult h2, #nxResult h2 { top: 40px; font-size: 40px; }
#crResult .big, #nxResult .big { left: 0; right: 0; top: 120px; width: auto; }
#crResult .big .rk, #nxResult .big .rk { font-size: 200px; }
#crResult .big .tot, #nxResult .big .tot { font-size: 48px; }
#crResult .big .best, #nxResult .big .best { font-size: 22px; }
#crList { left: 30px; width: 740px; top: 520px; font-size: 24px; }
#nxRList { left: 30px; width: 740px; top: 520px; height: 590px; }
#nxRList .sm { font-size: 24px; } #nxRList .mi { font-size: 20px; }
#crResult .btns, #nxResult .btns { top: auto; bottom: 36px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; padding: 0 20px; }
#crResult .btns .bb, #nxResult .btns .bb { margin: 0; flex: 1 1 30%; padding: 12px 6px; }

/* 名馬アタック専用オプション */
#crOpt h1 { top: 40px; font-size: 44px; }
#crOpt .olist { left: 20px; width: 760px; top: 140px; }
#crOpt .orow { height: auto; min-height: 120px; flex-wrap: wrap; padding: 12px 0; gap: 10px; }
#crOpt .ol { font-size: 28px; flex: 1 1 100%; }
#crOpt .oc { flex: 1 1 100%; justify-content: flex-start; flex-wrap: wrap; gap: 14px; }
#crOpt .oc button { width: 84px; min-height: 64px; font-size: 34px; }
#crOpt .oc button.tg { min-width: 180px; font-size: 24px; width: auto; }
#crOpt .ov { min-width: 140px; font-size: 44px; }
#crOpt .yc button { width: 78px; } #crOpt .yl { font-size: 20px; } #crOpt .yv { font-size: 40px; min-width: 96px; } #crOpt .yn { font-size: 18px; }
#crOpt .back { top: auto; bottom: 28px; min-width: 260px; }

/* ---------- 次走アタック：馬名の選択 ---------- */
#nxSel h1 { top: 36px; font-size: 48px; }
#nxIn { left: 20px; width: 760px; top: 120px; height: 76px; font-size: 32px; }
#nxRand { left: 20px; top: 210px; width: 760px; height: 76px; display: flex; align-items: center; justify-content: center; gap: 18px; font-size: 28px; }
#nxRand small { display: inline; font-size: 18px; margin: 0; }
#nxList { left: 20px; width: 760px; top: 304px; bottom: 120px; height: auto; grid-template-columns: 1fr 1fr; -webkit-overflow-scrolling: touch; }
#nxList button { height: 70px; font-size: 26px; }
#nxList button:hover { border-color: #9fb3d9; background: rgba(255,255,255,0.12); }
#nxSel .back { top: auto; bottom: 28px; min-width: 260px; }

/* ---------- 次走アタック：プレイ ---------- */
#nxSide { position: relative; left: auto; top: auto; width: auto; height: auto; min-height: 230px; flex: none; margin-top: 10px; padding: 12px 16px 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; align-content: start; }
#nxSide .nh { grid-column: 1; font-size: 32px; }
#nxSide .nn { grid-column: 2; margin-top: 8px; text-align: right; font-size: 20px; }
#nxSide .nq { grid-column: 1 / 3; margin-top: 6px; font-size: 32px; }
#nxSide .nf { grid-column: 1; margin-top: 8px; height: 40px; font-size: 32px; }
#nxSide .nc { grid-column: 2; margin-top: 8px; min-height: 40px; font-size: 22px; text-align: right; }
#nxSide .ns { position: static; grid-column: 1; margin-top: 4px; font-size: 20px; }
#nxNext { display: none; position: static; grid-column: 2; justify-self: end; align-self: end; min-width: 220px; height: 64px; padding: 6px 24px; font-size: 26px; border-color: #ffe08a; background: linear-gradient(#f4b73a, #d38a12); color: #3b2600; }
#nxSide.done #nxNext { display: block; }
#nxCh { position: static; width: auto; height: auto; flex: none; margin-top: 10px; grid-template-columns: 1fr 1fr; grid-template-rows: none; grid-auto-rows: 70px; gap: 8px; }
#nxCh button { font-size: 24px; padding: 0 12px 0 36px; }
#nxCh button.s1 { font-size: 21px; } #nxCh button.s2 { font-size: 18px; }
#nxCh button i { font-size: 17px; left: 10px; }
#nxCh button:hover:not(:disabled) { filter: none; }

/* ============================================================
   同級生アタック・年度アタック（#bGen）
   ============================================================ */
#bGen .gv.on { display: flex; flex-direction: column; padding: 0 20px 18px; }
#bGen .gtop { position: static; left: auto; right: auto; top: auto; height: 72px; flex: none; margin: 0 -20px; padding: 0 22px; gap: 10px; font-size: 22px; }
#bGen .gtitle { font-size: 26px; letter-spacing: 0; flex: 0 0 auto; white-space: nowrap; }
#bGen .gtop .gq { flex: 1 1 auto; text-align: right; font-size: 17px; line-height: 1.2; }
#bGen .gtitle.ext { font-size: 22px; }

#bGen .sc { margin-right: 0; order: 6; font-size: 22px; }
#bGen .sc span { font-size: 38px; }
#bGen .gquit { position: static !important; width: 92px; height: 44px; min-height: 0 !important; font-size: 19px !important; padding: 0 6px !important; border-width: 2px; flex: none; order: 5; margin: 0 6px 0 4px; }
#gcPlay .gquit, #gyPlay .gquit { }
#bGen .bb { font-size: 26px; padding: 12px 24px; min-height: 64px; border-radius: 14px; }
#bGen .bb:hover { filter: none; }

/* 同級生アタック */
#gcAsk { position: static; margin-top: 22px; font-size: 26px; }
#gcRef { position: static; height: 120px; line-height: 120px; margin: 4px 0 0; font-size: 72px; }
#gcRef.s1 { font-size: 58px; } #gcRef.s2 { font-size: 44px; }
#gcRefSub { position: static; height: 34px; font-size: 22px; margin-bottom: 14px; }
#gcCh { position: static; width: auto; height: auto; flex: none; grid-template-columns: 1fr 1fr; grid-template-rows: none; grid-auto-rows: 168px; gap: 14px; }
#gcCh button { padding: 8px 10px 8px 40px; }
#gcCh button:hover:not(:disabled) { filter: none; }
#gcCh button i { font-size: 20px; }
#gcCh .cnm { font-size: 32px; } #gcCh .cnm.s1 { font-size: 27px; } #gcCh .cnm.s2 { font-size: 22px; }
#gcCh .cs { font-size: 17px; }
#gcCh .ct { font-size: 17px; }
#gcMsg { position: static; height: auto; min-height: 56px; margin-top: 14px; font-size: 26px; line-height: 1.4; }
#gcGo { position: static; transform: none; align-self: center; min-width: 360px; height: 80px; margin-top: 10px; font-size: 30px; border-color: #ffe08a; background: linear-gradient(#f4b73a, #d38a12); color: #3b2600; }
#gcGo:disabled { opacity: 0.5; }
#gcResult h2, #gyResult h2 { top: 40px; font-size: 40px; }
#bGen .big { left: 0; right: 0; top: 120px; width: auto; }
#bGen .big .rk { font-size: 200px; } #bGen .big .tot { font-size: 48px; } #bGen .big .best { font-size: 22px; }
#gcRList { left: 30px; width: 740px; top: 520px; height: 590px; }
#gcRList .mi { font-size: 21px; } #gcRList .mi .n { min-width: 0; display: block; }
#gcResult .btns { top: auto; bottom: 36px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; padding: 0 20px; }
#gcResult .btns .bb { margin: 0; flex: 1 1 30%; padding: 12px 6px; }

/* 年度アタック：設定 */
#gySel h1 { top: 40px; font-size: 48px; }
#gySel .gset { position: static !important; top: auto !important; height: 84px; margin: 0; gap: 12px; }
#gySel .gset:first-of-type { margin-top: 150px; }
#gySel .gl { width: 110px; font-size: 28px; }
#gySel .gst { width: 84px; height: 76px; font-size: 30px; padding: 0; }
#gySel .gv2 { width: 400px; height: 76px; line-height: 70px; font-size: 32px; }
#gySel.on { padding: 0 20px; }
#gyInfo { position: static; margin-top: 30px; font-size: 28px; line-height: 1.4; }
#gyBst { position: static; margin-top: 14px; font-size: 22px; height: auto; }
#gyStart { position: static; transform: none; align-self: center; margin-top: 50px; min-width: 420px; height: 90px; font-size: 34px; border-color: #ffe08a; background: linear-gradient(#f4b73a, #d38a12); color: #3b2600; }
#gySel .back { position: absolute; left: 50%; top: auto; bottom: 36px; transform: translateX(-50%); min-width: 260px; }

/* 年度アタック：プレイ（枠は縦に5段：年 ＋ 馬のチップ） */
#gySlots { position: static; width: auto; height: auto; flex: none; margin-top: 14px; grid-template-columns: 1fr; gap: 8px; }
#gySlots .gySlot { display: grid; grid-template-columns: 112px 1fr; align-items: center; height: 74px; border-radius: 12px; padding: 0 6px; }
#gySlots .gsy { height: auto; line-height: 1; font-size: 32px; grid-row: 1 / 3; grid-column: 1; }
#gySlots .gsb { position: static; height: 62px; grid-column: 2; grid-row: 1 / 3; }
#gySlots .gsa { position: static; grid-column: 2; grid-row: 2; height: 24px; line-height: 24px; font-size: 18px; text-align: left; pointer-events: none; }
#gySlots .gsa:empty { display: none; }
#gySlots .gySlot.ng { height: 104px; grid-template-rows: 1fr auto; padding-top: 4px; }
#gySlots .ng .gsb { height: 60px; grid-row: 1; }
#gySlots .ng .gsy { grid-row: 1 / 3; }
#gyPool { position: static; left: auto; top: auto; width: auto; height: auto; flex: none; margin-top: 12px; padding: 6px; grid-template-columns: 1fr 1fr; grid-template-rows: none; grid-auto-rows: 66px; gap: 8px; }
#bGen .gyChip { border-radius: 12px; cursor: pointer; padding: 0 8px; }
#bGen .gyChip:hover { filter: none; }
#bGen .gyChip .cn { font-size: 26px; } #bGen .gyChip.z7 .cn { font-size: 23px; } #bGen .gyChip.z8 .cn { font-size: 21px; } #bGen .gyChip.z9 .cn { font-size: 19px; } #bGen .gyChip.z10 .cn { font-size: 17px; }
#bGen .gyChip.z11 .cn { font-size: 16px; white-space: normal; word-break: break-all; }
#gySlots .gsb .gyChip.z7 .cn { font-size: 26px; } #gySlots .gsb .gyChip.z8 .cn { font-size: 24px; } #gySlots .gsb .gyChip.z9 .cn { font-size: 22px; } #gySlots .gsb .gyChip.z10 .cn { font-size: 20px; } #gySlots .gsb .gyChip.z11 .cn { font-size: 18px; }
#bGen .gyChip .cw { font-size: 14px; margin-top: 1px; }
#gyMsg { position: static; height: auto; min-height: 50px; margin-top: 10px; font-size: 26px; line-height: 1.35; }
#gyBtns { position: static; display: flex; justify-content: center; gap: 12px; margin-top: 6px; }
#gyBtns > span { display: flex; gap: 12px; width: 100%; }
#gyBtns .bb { margin: 0; font-size: 28px; min-width: 0; flex: 1 1 auto; height: 78px; }
#gyBtns .bb.sub { font-size: 23px; flex: 1 1 28%; }
#gyGo { min-width: 420px; border-color: #ffe08a; background: linear-gradient(#f4b73a, #d38a12); color: #3b2600; }
#gyAgain { border-color: #ffe08a; background: linear-gradient(#f4b73a, #d38a12); color: #3b2600; }

/* ============================================================
   フルゲートアタック：出題モード設定・結果（#bFull）
   ============================================================ */
#bFull h1 { top: 36px; font-size: 40px; left: 0; right: 0; }
#bFull .back { top: auto; bottom: 28px; min-width: 260px; }
#fgGrid { left: 20px; top: 112px; width: 760px; grid-template-columns: 1fr; gap: 10px; }
#fgGrid .fgm { height: 96px; padding: 0 22px; }
#fgGrid .fgm .fn { font-size: 30px; }
#fgGrid .fgm .fs { font-size: 16px; }
#fgGrid .fgm .fo { font-size: 34px; }
#fgNote { left: 30px; width: 740px; top: auto; bottom: 120px; font-size: 18px; line-height: 1.45; }
#fgGrid { bottom: 230px; overflow-y: auto; align-content: start; -webkit-overflow-scrolling: touch; }
#fgList { left: 30px; top: 520px; width: 740px; height: 590px; }
#fgList .mi { font-size: 22px; } #fgList .mi .n { min-width: 0; display: block; }
#fgList .mi .sub { font-size: 17px; }

#bTop #bRace { font-size: 25px; letter-spacing: 0; white-space: nowrap; }
#bTop #bQn { font-size: 19px; text-align: right; line-height: 1.2; }
