/* joho-bits（0と1・2しんすう）。色は sho.css（shogaku.css の写し）の 約束：みどり＝正かい・おもて（つかう）、オレンジ＝点・くり上がり・光る 所、赤（--ng）＝まちがい。
   字は 18px 以上（カードの 数字・点の 下の 1/0 は 大きく）。ボタンは 48px 以上。 */
.jb-w { --jb-dot: #f59e0b; --jb-dotd: #b45309; --jb-on: #0f8a72; --jb-onl: #e7f7ef; --jb-off: #f3f4f6; --jb-ng: #c2410c;
  font-size: 1.1rem; line-height: 1.7; }
.jb-w button { font: inherit; cursor: pointer; touch-action: manipulation; }
.jb-w button:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }
.jb-w p { margin: 6px 0; }
.jb-mono, .jb-bits, .jb-wh, .jb-sumn { font-family: "UD Digi Kyokasho NK-R", "BIZ UDGothic", "Noto Sans Mono CJK JP", ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.jb-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ボタン */
.jb-b { min-height: 48px; padding: 6px 18px; border-radius: 12px; border: 2px solid var(--line, #e5e7eb); background: #fff; color: var(--ink, #1f2937); font-weight: 700; }
.jb-b.main { background: var(--teal-d, #0f8a72); border-color: var(--teal-d, #0f8a72); color: #fff; font-size: 1.15rem; }
.jb-b:disabled { opacity: .45; cursor: default; }
.jb-b.next { display: block; margin: 12px auto 0; }
.jb-b[hidden], .jb-w [hidden] { display: none !important; }
.jb-ctl { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 12px 0 4px; }
.jb-choices { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 6px 0; }
.jb-ch { min-height: 52px; min-width: 64px; padding: 4px 16px; border: 2px solid var(--line, #e5e7eb); border-radius: 12px; background: #fff; font-size: 1.35rem; font-weight: 700; color: var(--ink, #1f2937); }
.jb-ch.idk { font-size: 1rem; color: var(--sub, #4b5563); border-style: dashed; }
.jb-ch:hover:not(:disabled) { border-color: var(--teal, #1abc9c); }
.jb-ch.picked { border-color: var(--ink, #1f2937); box-shadow: inset 0 0 0 2px var(--ink, #1f2937); opacity: 1; }
.jb-ch.right { background: var(--jb-onl); border-color: var(--jb-on); }
.jb-ch.right::before { content: "○ "; color: var(--jb-on); }
.jb-ch.nope { border-color: var(--jb-ng); color: var(--jb-ng); text-decoration: line-through; }
.jb-ch:disabled:not(.picked):not(.right):not(.nope) { opacity: .5; }
.jb-tabs { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 8px; }
.jb-tab { min-width: 48px; min-height: 48px; border-radius: 999px; border: 2px solid var(--line, #e5e7eb); background: #fff; font-weight: 700; font-size: 1.1rem; }
.jb-tab[aria-pressed="true"] { background: var(--ink, #1f2937); color: #fff; border-color: var(--ink, #1f2937); }
.jb-tab.done::after { content: " ○"; color: var(--jb-on); }
.jb-tab.done[aria-pressed="true"]::after { color: #9ef0d6; }

/* 文 */
.jb-q { font-weight: 700; font-size: 1.15rem; text-align: center; }
.jb-fb { min-height: 1.6em; text-align: center; }
.jb-res { font-weight: 700; font-size: 1.15rem; }
.jb-res.ok { color: var(--jb-on); }
.jb-res.ng { color: var(--jb-ng); }
.jb-res.try { color: var(--orange-t, #b45309); }
.jb-praise { display: inline-block; margin-top: 8px; padding: 8px 14px; border-radius: 12px; background: var(--jb-onl); color: var(--jb-on); font-weight: 700; font-size: 1.15rem; }
.jb-note { color: var(--ink, #1f2937); background: var(--orange-l, #fff4dc); border-radius: 10px; padding: 6px 12px; display: inline-block; text-align: left; max-width: 34em; }
.jb-carry { color: var(--jb-dotd); font-weight: 700; }
.jb-big { font-size: 1.6rem; font-weight: 700; text-align: center; color: var(--jb-on); }
.jb-yomi { text-align: center; color: var(--sub, #4b5563); font-size: 1rem; letter-spacing: .05em; margin: 2px 0 8px; }
.jb-yomi.c { margin-top: 4px; }
.jb-goal { text-align: center; font-size: 1.25rem; font-weight: 700; margin: 4px 0; }
.jb-goal b { font-size: 2.4rem; color: var(--jb-dotd); margin-right: 4px; }
.jb-goal small { display: block; font-size: .95rem; color: var(--sub, #4b5563); font-weight: 400; }
.jb-wline { text-align: center; font-size: 1rem; color: var(--sub, #4b5563); }
.jb-ask { margin: 10px 0 0; }

/* 合計 */
.jb-sum { display: flex; flex-direction: column; align-items: center; min-height: 92px; justify-content: center; }
.jb-sumn { font-size: 3rem; font-weight: 700; line-height: 1.1; color: var(--ink, #1f2937); }
.jb-expr { font-size: 1.1rem; color: var(--sub, #4b5563); font-weight: 700; }
.jb-sum.dim .jb-expr { font-weight: 400; }

/* 点の カード */
.jb-cards { display: grid; gap: 8px; justify-content: center; margin: 4px auto; }
.jb-cards.n4 { grid-template-columns: repeat(4, minmax(0, 84px)); }
.jb-cards.n5 { grid-template-columns: repeat(5, minmax(0, 72px)); gap: 6px; }
.jb-cards.n3 { grid-template-columns: repeat(3, minmax(0, 84px)); }
.jb-cards.n2 { grid-template-columns: repeat(2, minmax(0, 84px)); }
.jb-cards.n6 { grid-template-columns: repeat(6, minmax(0, 80px)); gap: 6px; }
.jb-cards.n7 { grid-template-columns: repeat(7, minmax(0, 80px)); gap: 6px; }
.jb-cards.n8 { grid-template-columns: repeat(8, minmax(0, 80px)); gap: 6px; }
@media (max-width: 600px) { /* 6まい いじょうは 4まいずつ 2だんに（右はしを そろえる：下の だんの 右が 1） */
  .jb-cards.n6, .jb-cards.n7, .jb-cards.n8 { grid-template-columns: repeat(4, minmax(0, 76px)); row-gap: 4px; }
  .jb-cards.n6 .jb-cw:first-child { grid-column-start: 3; }
  .jb-cards.n7 .jb-cw:first-child { grid-column-start: 2; }
}
.jb-cards.n1 { grid-template-columns: minmax(0, 84px); }
.jb-cw { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.jb-card { display: block; width: 100%; padding: 0; border: 3px solid #cbd5e1; border-radius: 10px; background: var(--jb-off); color: inherit;
  background-image: repeating-linear-gradient(45deg, transparent 0 7px, rgba(148,163,184,.18) 7px 9px); transition: transform .25s ease, background-color .2s; }
.jb-csvg { display: block; width: 100%; height: auto; }
.jb-cnum { font-size: 15px; font-weight: 700; fill: #64748b; }
.jb-dot { fill: none; stroke: #94a3b8; stroke-width: 1.3; stroke-dasharray: 2.2 1.8; }
.jb-half { stroke: #cbd5e1; stroke-width: .8; stroke-dasharray: 2 2; }
.jb-cw.on .jb-card { background: #fff; background-image: none; border-color: var(--jb-on); box-shadow: 0 2px 0 var(--jb-on); }
.jb-cw.on .jb-dot { fill: var(--jb-dot); stroke: var(--jb-dotd); stroke-width: 1; stroke-dasharray: none; }
.jb-cw.on .jb-cnum { fill: var(--ink, #1f2937); }
.jb-bit { display: block; font-size: 2rem; font-weight: 700; line-height: 1.3; color: #94a3b8; font-family: "UD Digi Kyokasho NK-R", "BIZ UDGothic", ui-monospace, monospace; }
.jb-cw.on .jb-bit { color: var(--jb-on); }
.jb-cw.hid .jb-card { background: #fff; background-image: none; border-style: dashed; }
.jb-cw.hid .jb-csvg { visibility: hidden; }
.jb-cw.hid .jb-card::after { content: "？"; position: absolute; }
.jb-cw.hid .jb-card { position: relative; }
.jb-cw.hid .jb-card::after { left: 0; right: 0; top: 50%; transform: translateY(-50%); text-align: center; font-size: 1.8rem; color: #94a3b8; font-weight: 700; }
.jb-cw.pop .jb-card { animation: jb-pop .5s ease; }
.jb-cw.hint .jb-card { outline: 4px solid var(--jb-dot); outline-offset: 2px; }
.jb-cw.bad .jb-card { outline: 4px dashed var(--jb-ng); outline-offset: 2px; }
button.jb-card:active { transform: scale(.96); }
@keyframes jb-pop { 0% { transform: scale(.7); } 70% { transform: scale(1.08); } 100% { transform: scale(1); } }

/* ヒント */
.jb-hints { margin: 8px auto; padding: 8px 12px 8px 1.6em; max-width: 34em; background: #fffbeb; border-radius: 10px; font-size: 1rem; }
.jb-hints:empty { display: none; }
.jb-hints .jb-hl0 { list-style: none; margin-left: -1.2em; font-weight: 700; }

/* count：メーター */
.jb-meters { display: flex; flex-direction: column; gap: 10px; margin: 4px auto 0; max-width: 520px; }
.jb-mrow { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: #f8fafc; border: 2px solid var(--line, #e5e7eb); }
.jb-mrow.two { background: #f0fdf9; border-color: #a7e3d3; }
.jb-mlab { flex: 0 0 auto; width: 7.2em; font-weight: 700; font-size: 1rem; line-height: 1.35; }
.jb-mlab small { display: block; font-weight: 400; color: var(--sub, #4b5563); font-size: .85rem; }
.jb-whs { flex: 1; display: flex; justify-content: flex-end; gap: 5px; }
.jb-wh { --s: 46px; position: relative; display: block; width: 46px; height: 74px; overflow: hidden; border-radius: 10px; background: #fff; border: 2px solid #94a3b8;
  box-shadow: inset 0 10px 10px -8px rgba(0,0,0,.25), inset 0 -10px 10px -8px rgba(0,0,0,.25); }
.jb-strip { position: absolute; left: 0; right: 0; top: calc((74px - 4px - var(--s) * 3) / 2); display: flex; flex-direction: column; }
.jb-d { display: block; height: var(--s); line-height: var(--s); text-align: center; font-size: 2.3rem; font-weight: 700; color: var(--ink, #1f2937); }
.jb-d:first-child, .jb-d:last-child { color: #cbd5e1; font-size: 1.6rem; }
.jb-wh.roll .jb-strip { transform: translateY(calc(var(--s) * -1)); transition: transform .4s ease-in-out; }
.jb-wh.roll .jb-d:last-child { color: var(--ink, #1f2937); }
.jb-wh.lead .jb-d:nth-child(2) { color: #b6bec9; }
.jb-wh.carry { border-color: var(--jb-dot); animation: jb-glow 1.2s ease; }
.jb-wh.got { border-color: var(--jb-dotd); background: var(--orange-l, #fff4dc); }
.jb-wh.new { animation: jb-pop .5s ease; }
@keyframes jb-glow { 0%, 60% { box-shadow: 0 0 0 5px rgba(245,158,11,.6); } 100% { box-shadow: none; } }
.jb-dotrow { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 6px 0 0; min-height: 28px; }
.jb-dl { font-size: .9rem; color: var(--sub, #4b5563); flex: 0 0 auto; }
.jb-ds { display: flex; flex-wrap: wrap; gap: 4px; max-width: 320px; }
.jb-ds i { display: block; width: 14px; height: 14px; border-radius: 50%; background: var(--jb-dot); border: 1.5px solid var(--jb-dotd); }
.jb-ds i:nth-child(5n) { margin-right: 6px; }

/* read・rule：0と1の ならび */
.jb-bits { display: flex; justify-content: center; gap: 6px; margin: 6px 0 0; }
.jb-bt { display: block; width: 52px; height: 64px; line-height: 60px; text-align: center; font-size: 2.4rem; font-weight: 700; border: 2px solid #94a3b8; border-radius: 10px; background: #fff; }
.jb-wts { display: grid; gap: 6px; justify-content: center; }
.jb-wts { --bw: 52px; }
.jb-wts.n4 { grid-template-columns: repeat(4, var(--bw)); }
.jb-wts.n5 { grid-template-columns: repeat(5, var(--bw)); }
.jb-wts span { text-align: center; font-weight: 700; color: var(--jb-dotd); background: var(--orange-l, #fff4dc); border-radius: 8px; }
.jb-proof { margin: 8px 0; }
.jb-pad { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; }
.jb-pad input { width: 5em; min-height: 48px; font-size: 1.4rem; text-align: center; border: 2px solid #94a3b8; border-radius: 10px; margin-left: 6px; }
.jb-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.jb-pside { background: #f8fafc; border-radius: 12px; padding: 8px 4px; text-align: center; min-width: 0; }
.jb-pside .jb-bt { width: 34px; height: 46px; line-height: 42px; font-size: 1.7rem; }
.jb-pside .jb-bits { gap: 3px; }
.jb-ptag { display: inline-block; min-width: 2em; font-weight: 700; background: var(--ink, #1f2937); color: #fff; border-radius: 999px; padding: 0 10px; }
.jb-cnt { font-size: 1rem; color: var(--sub, #4b5563); }
.jb-pcard { margin: 10px 0; padding: 8px; border-radius: 12px; background: #f8fafc; }
.jb-pcard .jb-ptag { margin-bottom: 4px; }
.jb-bar { position: relative; height: 34px; margin: 6px 0 0; background: #fff; border: 2px solid var(--line, #e5e7eb); border-radius: 8px; overflow: hidden; }
.jb-barf { position: absolute; left: 0; top: 0; bottom: 0; background: var(--jb-dot); }
.jb-bar::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(90deg, transparent 0 calc(100% / var(--mx, 15) - 2px), rgba(255,255,255,.85) calc(100% / var(--mx, 15) - 2px) calc(100% / var(--mx, 15))); }
.jb-barn { position: relative; z-index: 1; display: inline-block; margin: 2px 4px; padding: 0 8px; line-height: 26px; font-weight: 700; background: rgba(255,255,255,.92); border-radius: 6px; }
.jb-pres { text-align: center; margin-top: 8px; }

@media (max-width: 420px) {
  .jb-mlab { width: 5.6em; font-size: .9rem; }
  .jb-wh { --s: 42px; width: 40px; height: 70px; }
  .jb-strip { top: calc((70px - 4px - var(--s) * 3) / 2); }
  .jb-d { font-size: 2rem; }
  .jb-whs { gap: 4px; }
  .jb-wts { --bw: 46px; }
  .jb-bt { width: 46px; height: 58px; line-height: 54px; font-size: 2.1rem; }
  .jb-pside .jb-bt { width: 28px; height: 40px; line-height: 36px; font-size: 1.4rem; }
  .jb-pside .jb-yomi { font-size: .78rem; }
}
@media (prefers-reduced-motion: reduce) {
  .jb-wh.roll .jb-strip, .jb-card { transition: none; }
  .jb-cw.pop .jb-card, .jb-wh.carry, .jb-wh.new { animation: none; }
}

/* free */
.jb-ex { text-align: center; font-size: .95rem; color: var(--sub, #4b5563); }
.jb-hints li.use { color: var(--jb-on); font-weight: 700; }
.jb-hints li.nouse { color: var(--sub, #4b5563); }

/* 読み上げ（🔊）の ボタン：部品の button の きまりで 大きさが かわらない ように（2026-11-15） */
.jb-w .say { font-size: 18px; line-height: 1; flex: none; padding: 0; }
