:root {
  --frame: #1c1c1c; --frame-dark: #000;
  --bead: #7a3b16; --bead-hi: #d1782f;
  --accent: #c0392b; --ok: #2e7d5b; --gold: #d99a2b;
  --bg: #f6f2e9; --card: #ffffff; --line: #e6ddc9;
  --navy: #16305c; --navy-hi: #24487a; --royal-gold: #d4af37;
  --side: #16305c; --side-hi: #24487a;
  /* そろばんの大きさ：画面が広いほど 大きくなる。
     ただし 縦がみじかい画面（ノートPC・iPadの横向き）では そろばんが 場所を取りすぎて
     問題の字が 小さくなってしまうので、高さでも 上限をつける。 */
  --bh: clamp(22px, min(2.5vw, 3.2vh), 34px); --cw: clamp(34px, min(3.6vw, 4.6vh), 52px);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
/* iPhoneを横にしたとき 文字が勝手に大きくならないようにする */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  /* 書体：まるいゴシック。iPhone/iPadは ヒラギノ丸ゴ、Windowsは BIZ UDゴシックに 落ちる（どれも 読みやすい） */
  font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "BIZ UDPGothic", "BIZ UDGothic", Meiryo, system-ui, sans-serif; background: var(--bg); color: #2b2b2b;
  -webkit-tap-highlight-color: transparent;      /* 指でおしたとき 青い四角を出さない */
  overscroll-behavior-y: contain;                /* 下に引っぱって ページが再読み込みされるのを防ぐ */
}
button { cursor: pointer; font-family: inherit; }
/* 指でおしたとき「2回たたくと拡大」の待ち時間（約300ms）をなくす＝反応が速くなる */
button, .nav, .chip, .grade-cell, summary, label, select, .pill, .song, .seg button { touch-action: manipulation; }
.hidden { display: none !important; }

/* ---------- レイアウト ---------- */
.app { display: flex; min-height: 100vh; min-height: 100dvh; }
/* 左のメニュー：画面の高さに おさめ、長いぶんは メニューの中で なぞって動かす（下が 見切れない） */
.sidebar { width: 210px; flex-shrink: 0; background: var(--side); color: #f3ede2; padding: 16px 12px;
  position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.brand { font-size: 19px; font-weight: 800; padding: 6px 8px 16px; line-height: 1.3; }
.brand small { display: block; font-size: 10px; opacity: .6; font-weight: normal; margin-top: 2px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.nav { background: transparent; border: none; color: #e8e0d2; text-align: start; padding: 10px 12px; border-radius: 8px; font-size: 14px; }
.nav:hover { background: var(--side-hi); }
.nav.active { background: var(--gold); color: #2b2b2b; font-weight: 700; }
.nav-sec { font-size: 11px; opacity: .5; padding: 12px 12px 4px; letter-spacing: 1px; }

.content { flex: 1; padding: 18px 24px; max-width: 1100px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.topbar h2 { font-size: 22px; color: var(--frame); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
/* button の文字色（白）を そのまま受けつぐと 白い丸の上に白い字になって 読めなくなる */
.pill { background: var(--card); color: #2b2b2b; border: 1px solid var(--line); border-radius: 20px; padding: 7px 14px; font-size: 13px; }
.avatar-mini { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 30px; padding: 5px 14px 5px 8px; }
.avatar-mini span { font-size: 26px; }
.avatar-mini small { color: #8a7560; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: 0 2px 10px rgba(0,0,0,.04); margin-bottom: 16px; }

/* ---------- 級・段を選ぶ ---------- */
.grades-layout { display: grid; grid-template-columns: 1fr 260px; gap: 16px; align-items: start; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { background: #efe7d8; border: 1px solid var(--line); border-radius: 20px; padding: 8px 14px; font-size: 13px; font-weight: 700; color: var(--frame); }
.chip.active { background: var(--frame); color: #fff; border-color: var(--frame); }
.chip:disabled { opacity: .4; }

.grade-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.grade-cell { padding: 13px 4px; font-size: 16px; font-weight: 800; color: #fff; border: 3px solid transparent; border-radius: 10px; }
.grade-cell.g-dan { background: #d9a441; }
.grade-cell.locked { opacity: .45; }
.grade-cell.grade-lock-all { grid-column: 1 / -1; opacity: 1; background: #eee7d6; color: #6b5a3a; border: 2px dashed #c9b88f; font-size: 15px; }
.egg-ico { height: 28px; vertical-align: middle; margin-right: 4px; }
/* G-6：自己ベストの ゲージ・コンボ・カケルの 並走 */
.pace { position: relative; display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 13px; color: #555; }
.pace-bar { flex: 1; height: 10px; background: #eee6d6; border-radius: 6px; overflow: hidden; }
.pace-bar div { height: 100%; width: 0; background: linear-gradient(90deg, #7fb3d5, #2e7d5b); transition: width .3s; }
.pace.hot .pace-bar div { background: linear-gradient(90deg, #f5a623, #e0342b); box-shadow: 0 0 8px #f5a623; }
.pace.hot #paceTxt { color: #e0342b; font-weight: 800; }
.pace-kakeru { position: absolute; right: 0; top: 18px; display: flex; align-items: center; gap: 6px; background: #fff7e0; border: 2px solid #e6c46a; border-radius: 12px; padding: 4px 10px; font-weight: 800; color: #b3541e; animation: kakeruIn .5s ease-out; z-index: 5; }
.pace-kakeru img { height: 40px; }
@keyframes kakeruIn { from { transform: translateX(60px); opacity: 0; } to { transform: none; opacity: 1; } }
.combo-tag { position: fixed; left: 50%; top: calc(50% + 70px); transform: translateX(-50%); z-index: 46; background: #e0342b; color: #fff; font-weight: 900; padding: 4px 14px; border-radius: 999px; font-size: 18px; animation: comboPop .25s ease-out; }
@keyframes comboPop { from { transform: translateX(-50%) scale(.6); } to { transform: translateX(-50%) scale(1); } }
/* H-3：今週の 成長 */
.pcell small { display: block; font-size: 11px; color: #888; }
.pg-up { color: #2e7d5b; } .pg-dn { color: #e0342b; }
/* H-1：🔒 の 絵（ソロモン ＋ 王冠）と 約束の 文。H-2：お試しの 成果 */
.lock-pic { position: relative; text-align: center; margin: 4px 0 6px; }
.lock-pic .solo-pic.lock-solo img { height: 96px; }
.lock-crown { position: absolute; left: 50%; top: -6px; height: 40px; transform: translateX(-50%) rotate(-8deg); filter: drop-shadow(0 2px 3px rgba(0,0,0,.25)); }
.lock-promise { text-align: center; font-weight: 700; margin: 4px 0 8px; }
.lock-kid { text-align: center; font-size: 18px; font-weight: 900; margin: 6px 0 10px; }
.lock-adult { background: #f6f3ea; border-radius: 10px; padding: 8px 12px; font-size: 13px; line-height: 1.6; }
.lock-adult p { margin: 4px 0 0; }
.trial-sum { background: #fff7e0; border: 2px solid #e6c46a; border-radius: 12px; padding: 8px 12px; margin: 6px 0; font-size: 15px; }
.solo-top { position: relative; }
.solo-crown { position: absolute; left: 34px; top: -14px; height: 30px; transform: rotate(-10deg); pointer-events: none; }
.pp-plan { margin: 6px 0; padding: 8px 10px; border-radius: 10px; background: #eef5ee; font-size: 14px; }
.pp-plan.over { background: #fdeaea; }
.trial-banner { background: #fff7e0; border: 2px solid #e6c46a; }
.trial-banner .pp-btn { display: inline-block; margin-top: 6px; }
.lock-btn { margin-top: 10px; text-align: center; }
.lock-btn .pp-btn { display: inline-block; }
.pp-plan a { display: inline-block; margin-top: 4px; font-weight: 700; }
.grade-cell.g-kyu-a { background: #4a90d9; }
.grade-cell.g-kyu-b { background: #d9534f; }
.grade-cell.sel { border-color: #fff; box-shadow: 0 0 0 3px var(--frame), 0 4px 12px rgba(0,0,0,.3); transform: scale(1.05); }
/* 2026-10-04 ユーザー：級・段の ボタンを 宝石の 枠の 絵に（赤＝20〜11級・青＝10〜1級・金＝段）。
   絵には 文字が 無い → 文字は いまの まま 上に のせる（英語・先生が 作った 級の表でも 合う）。
   選ばれた ボタンは 冠と 月桂樹で 光る 絵（見本＝3級）。絵は 本体より 大きいので ::before で はみ出させる */
.grade-grid { row-gap: 16px; padding-top: 6px; }
.grade-cell.g-kyu-a, .grade-cell.g-kyu-b, .grade-cell.g-dan { position: relative; isolation: isolate; background: none; border: 0; border-radius: 0; padding: 0 6px; aspect-ratio: 249 / 116; display: flex; align-items: center; justify-content: center; font-size: 19px; letter-spacing: .02em; color: #fff; text-shadow: 0 2px 0 rgba(60,20,0,.55), 0 0 6px rgba(0,0,0,.35); transition: transform .12s; }
.grade-cell.g-kyu-a::before, .grade-cell.g-kyu-b::before, .grade-cell.g-dan::before { content: ""; position: absolute; z-index: -1; left: -.8%; top: -18%; width: 101.6%; height: 120%; background: center / 100% 100% no-repeat; filter: drop-shadow(0 3px 3px rgba(60,30,0,.25)); }
.grade-cell.g-kyu-b::before { background-image: url(assets/grade/btn_red.webp); }
.grade-cell.g-kyu-a::before { background-image: url(assets/grade/btn_blue.webp); }
.grade-cell.g-dan::before { background-image: url(assets/grade/btn_gold.webp); }
.grade-cell.g-dan { text-shadow: 0 2px 0 rgba(110,55,0,.75), 0 0 6px rgba(90,40,0,.45); }
.grade-cell.g-kyu-a:hover, .grade-cell.g-kyu-b:hover, .grade-cell.g-dan:hover { transform: translateY(-2px); }
.grade-cell.g-kyu-a.sel, .grade-cell.g-kyu-b.sel, .grade-cell.g-dan.sel { z-index: 1; box-shadow: none; transform: scale(1.06); color: #ffe85a; text-shadow: 0 2px 0 rgba(80,30,0,.7), 0 0 10px rgba(255,220,80,.9); }
.grade-cell.sel::before { left: -9.6%; top: -35.3%; width: 119.7%; height: 144.5%; filter: drop-shadow(0 0 8px rgba(255,214,80,.75)); }
.grade-cell.g-kyu-b.sel::before { background-image: url(assets/grade/btn_sel_red.webp); }
.grade-cell.g-kyu-a.sel::before { background-image: url(assets/grade/btn_sel_blue.webp); }
.grade-cell.g-dan.sel::before { background-image: url(assets/grade/btn_sel_gold.webp); }

.options { text-align: center; margin-top: 16px; }
.toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: #444; margin-bottom: 8px; }
#gradeInfo { font-size: 15px; margin: 6px 0; }
.note { color: #b5651d; font-size: 12px; }
#startBtn { background: var(--ok); color: #fff; border: none; border-radius: 10px; font-size: 18px; padding: 12px 34px; margin-top: 8px; }
button { background: var(--frame); color: #fff; border: none; border-radius: 8px; padding: 9px 16px; font-size: 14px; }
button.ghost { background: transparent; color: var(--frame); border: 1px solid var(--line); }
button:disabled { opacity: .5; cursor: default; }

/* ---------- 右パネル ---------- */
.stats-panel { display: flex; flex-direction: column; gap: 14px; }
.stats-panel .card { margin: 0; padding: 14px; }
.profile-card { display: flex; align-items: center; gap: 12px; }
.avatar-big { font-size: 44px; }
.rank-badge { display: inline-block; background: var(--gold); color: #2b2b2b; border-radius: 12px; padding: 2px 10px; font-size: 13px; font-weight: 700; }
.effort-card h4, .best-card h4 { font-size: 14px; margin-bottom: 10px; color: var(--frame); }
.effort-row { display: flex; justify-content: space-between; font-size: 14px; margin: 4px 0; }
.chart { display: flex; align-items: flex-end; gap: 4px; height: 46px; margin: 8px 0; }
.chart .bar { flex: 1; background: #b6d3f0; border-radius: 3px 3px 0 0; min-height: 2px; }
.chart .bar.today { background: var(--gold); }
.best-card .brow { display: flex; justify-content: space-between; font-size: 14px; padding: 5px 0; border-bottom: 1px solid #f0ece2; }
.best-card .brow b { font-variant-numeric: tabular-nums; }

/* ---------- プレイ ---------- */
.play-hud { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 18px; font-weight: 700; color: var(--frame); margin-bottom: 12px; }
/* 🔽 スクロールの 案内（問題4・2026-09-29） */
.scroll-hint { display: none; margin: 0 0 10px; padding: 8px 12px; border-radius: 10px; background: #fff6d6; border: 2px dashed #d4a017; color: #6b4a1a; font-weight: 800; font-size: 14px; line-height: 1.5; }
body.can-scroll .scroll-hint { display: block; }
/* 2026-09-30：「下に スクロールしてね」の 案内は やめた（多すぎた）。残すのは 何を 押すかの 1行だけ（いつも 見せる・目立たせない） */
.how-hint { margin: 0 0 10px; color: #6b4a1a; font-weight: 700; font-size: 14px; line-height: 1.5; }
.name-nudge { margin-left: 6px; padding: 2px 8px; font-size: 12px; border-radius: 999px; }
/* 2026-09-30 点検 A10：まん中だと「はじめる」「保存」に かぶった → 右下の すみに 小さく */
.scroll-more { position: fixed; right: max(10px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); z-index: 45; font: inherit;
  background: rgba(22,48,92,.9); color: #ffe38a; border: 2px solid #f3cf5c; border-radius: 999px; padding: 5px 11px; font-weight: 900; font-size: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,.3); cursor: pointer; animation: smore 1.2s ease-in-out infinite; }
@keyframes smore { 50% { transform: translateY(4px); } }
body.playing .scroll-more { bottom: calc(var(--hudPad, 0px) + var(--soroPad, 0px) + var(--bridgePad, 0px) + var(--kbd, 0px) + 10px); }
/* 結果の ボタン：前は 下に はりつけて 結果に 半透明で かぶった（2026-09-30 点検 A9）→ ふつうに いちばん下に 置く */
.res-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 8px 0 0; margin-top: 12px; }
.res-actions button { margin: 0; }
.btn-row.sticky-bottom { position: sticky; bottom: 10px; z-index: 5; background: rgba(255,255,255,.96); padding: 8px; border-radius: 12px; box-shadow: 0 -2px 10px rgba(0,0,0,.14); }
#saveProfileBtn { margin-top: 12px; }   /* 前は sticky で アバターの 2段目に かぶった（2026-09-30 点検）。文の とおり「いちばん下」に 置く */
/* 🧮 しゅもくの 札（問題3・2026-09-29）：カードの いちばん上。色は しゅもく ごと */
.mode-band { display: flex; align-items: center; gap: 10px; margin: -6px -6px 10px; padding: 8px 14px; border-radius: 12px; color: #fff; font-weight: 900; font-size: 20px;
  background: linear-gradient(90deg, #2f6fd6, #4a8df0); box-shadow: inset 0 -3px 0 rgba(0,0,0,.18), 0 2px 6px rgba(0,0,0,.15); }
.mode-band .mb-ic { font-size: 28px; line-height: 1; }
.mode-band small { font-weight: 800; font-size: 13px; opacity: .92; }
.mode-band .mb-how { margin-left: auto; font-size: 12.5px; font-weight: 700; opacity: .95; text-align: right; line-height: 1.3; }
.mode-band.mode-anzan { background: linear-gradient(90deg, #8e44ad, #a86bc9); }
.mode-band.mode-kake { background: linear-gradient(90deg, #1f8a4c, #2fae63); }
.mode-band.mode-wari { background: linear-gradient(90deg, #e67e22, #f39c3f); }
.mode-band.mode-flash { background: linear-gradient(90deg, #d4a017, #f3cf5c); color: #3a2a14; }
/* カードの ふちも 同じ 色に（文字を 読まなくても 分かる） */
body.mode-mitori #view-play > .card, body.mode-mitori #battleArena { border: 3px solid #2f6fd6; }
body.mode-anzan #view-play > .card, body.mode-anzan #battleArena { border: 3px solid #8e44ad; }
body.mode-kake #view-play > .card, body.mode-kake #battleArena { border: 3px solid #1f8a4c; }
body.mode-wari #view-play > .card, body.mode-wari #battleArena { border: 3px solid #e67e22; }
body.mode-flash #view-play > .card, body.mode-flash #battleArena { border: 3px solid #d4a017; }
/* 始まる ときの 合図（fxBanner の kind="mode …"） */
.fx-banner.mode .fx-main { color: #fff; -webkit-text-stroke: 8px #2f6fd6; }
.fx-banner.mode.mode-anzan .fx-main { -webkit-text-stroke-color: #8e44ad; }
.fx-banner.mode.mode-kake .fx-main { -webkit-text-stroke-color: #1f8a4c; }
.fx-banner.mode.mode-wari .fx-main { -webkit-text-stroke-color: #e67e22; }
.fx-banner.mode.mode-flash .fx-main { -webkit-text-stroke-color: #b8860b; }
.fx-banner.mode .fx-sub { -webkit-text-stroke: 5px #16305c; }
@media (max-width: 640px) {
  .mode-band { font-size: 17px; padding: 6px 10px; margin: -2px -2px 6px; gap: 8px; }
  .mode-band .mb-ic { font-size: 22px; }
  .mode-band .mb-how { font-size: 11px; max-width: 46%; }
}
#playTimer { color: var(--accent); font-variant-numeric: tabular-nums; }
.problem-wrap { position: relative; }
.problem { font-size: 38px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.42; letter-spacing: .02em; white-space: pre-line; text-align: right; margin-bottom: 16px; }
/* 見取算・あんざん：数字の 桁を そろえる（右そろえ）。かたまり ごと まん中に 置く。2列の ときは 列の 中で 右そろえ */
.problem:not(.two-col) { width: fit-content; margin-left: auto; margin-right: auto; }
/* 口数が 多くて 1列では 字が 小さくなりすぎる（22px 未満）とき：2列に 分ける（左の列 → 右の列）。app.js の fitProblem が つける。
   列の あいだに 点線を 引いて「つづき」と 分かるようにする */
.problem.two-col { column-count: 2; column-gap: 14px; column-fill: balance; column-rule: 2px dashed #d8cfb8; }
/* 見取算で「－」が ある 問題だけ 出す 注釈（2026-10-25・テスト家庭から「たすか ひくか わからない」の声） */
.sign-hint { font-size: 13px; color: #8a7560; text-align: center; margin: -8px 0 14px; }
/* 📖 先生の 一手ずつ 案内（2026-10-25）：スクロールせず、問題の すぐ下・そろばんの 上に 常に 見える 帯。1手だけ 見せる（ぜんぶは 出さない） */
.teach-strip { display: flex; align-items: center; gap: 6px; background: #eef5ff; border: 1px solid #c9ddf7; border-radius: 10px; padding: 6px 8px; margin: 0 0 12px; }
.teach-strip .ts-nav { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; border: 1px solid #c9ddf7; background: #fff; color: #2f5fa3; font-size: 13px; padding: 0; }
.teach-strip .ts-nav:disabled { color: #c3cedd; }
.teach-strip .ts-mid { flex: 1 1 auto; min-width: 0; text-align: center; line-height: 1.35; }
.teach-strip .ts-count { font-size: 11px; color: #6a84a8; margin-right: 5px; }
.teach-strip .ts-text { font-size: 14px; overflow-wrap: anywhere; color: #2b2b2b; }
.teach-strip .ts-hide { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; border: none; background: transparent; color: #8a98ad; font-size: 13px; padding: 0; }
.teach-strip .fg { font-size: 13px; }
/* 答え合わせの ◎ / ×：画面に「いま見えている 問題の部分」の まん中に 出す（位置は app.js の showMark が 決める）。
   問題の枠に はりつけると、画面が スクロールしているとき 見えなくなるため 画面基準にしてある */
.mark {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(.5); z-index: 45;
  font-size: 130px; font-weight: 900; color: var(--accent); pointer-events: none;
  text-shadow: 0 2px 6px rgba(0,0,0,.15); animation: markpop .3s ease forwards;
}
.mark.ng { color: var(--accent); }
.mark.ok { color: #e0322b; }
@keyframes markpop { to { transform: translate(-50%, -50%) scale(1); } }
.marks { font-size: 24px; letter-spacing: 4px; margin-bottom: 8px; }
.marks .mk.ok { color: #e0322b; } .marks .mk.ng { color: var(--accent); }
.sub { color: #8a7560; font-size: 14px; margin: 4px 0; }
.small { color: #8a7560; font-size: 14px; }
.btn-row { display: flex; gap: 8px; justify-content: center; margin-top: 8px; flex-wrap: wrap; }
.answer-row { display: flex; gap: 8px; justify-content: center; align-items: center; margin: 10px 0; }
input { border: 2px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 18px; }
.result { min-height: 26px; font-size: 18px; font-weight: 700; margin: 10px 0; text-align: center; }
.result.ok { color: var(--ok); } .result.ng { color: var(--accent); }
.result button { margin: 8px 4px 0; }
.flash-display { font-size: 72px; font-weight: 800; height: 140px; display: flex; align-items: center; justify-content: center; color: var(--frame); font-variant-numeric: tabular-nums; }
/* 数字ではなく 言葉のとき（「▶ を押してスタート」など）は 小さくして 1行におさめる */
.flash-display.msg { font-size: 26px; height: 72px; color: #6b5f4c; }
/* フラッシュ暗算中は BGM を 鳴らさないので、🎵 の 小さなボタンも しまう */
body.flashmode .snd-btn[data-kind="bgm"] { display: none; }
/* まん中の 表示が そのまま スタートボタンに なる（待っているとき） */
.flash-display.btn { cursor: pointer; background: var(--ok); color: #fff; border-radius: 16px; font-size: 30px; height: 84px; max-width: 420px; margin: 8px auto; box-shadow: 0 4px 0 #1d6a48, 0 6px 14px rgba(0,0,0,.18); user-select: none; -webkit-tap-highlight-color: transparent; }
.flash-display.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #1d6a48; }
.flash-display.ok { color: #2e7d5b; animation: flashpop .35s ease; }
.flash-display.ng { color: var(--accent); animation: flashpop .35s ease; }
@keyframes flashpop { from { transform: scale(.4); } to { transform: scale(1); } }
/* じぶんで きめる（何桁・何口・速さ・問数）。とじた状態では 1行だけ */
.flash-custom { margin: 6px auto 10px; max-width: 520px; text-align: start; border: 1px dashed var(--line); border-radius: 10px; padding: 6px 12px; background: #fffdf7; }
.flash-custom summary { cursor: pointer; font-size: 14px; color: var(--navy); font-weight: 700; }
.flash-custom[open] summary { margin-bottom: 6px; }
.fc-row { display: flex; gap: 10px 14px; flex-wrap: wrap; justify-content: center; font-size: 14px; }
.fc-row label { display: inline-flex; align-items: center; gap: 4px; }
.fc-row select { font-size: 16px; padding: 6px 8px; border: 2px solid var(--line); border-radius: 8px; background: #fff; }
.fc-level { text-align: center; margin: 8px 0 2px; font-size: 15px; font-weight: 700; color: var(--frame); min-height: 22px; }
.fc-level .sub { font-weight: 400; }
.flash-custom .btn-row { margin-top: 4px; }
.flash-custom .sub { text-align: center; }
.flash-dots { display: flex; gap: 7px; justify-content: center; min-height: 14px; margin-bottom: 8px; }
.flash-dots .dot { width: 11px; height: 11px; border-radius: 50%; background: #ddd6c6; transition: background .1s; }
.flash-dots .dot.on { background: var(--bead-hi); }
/* スタート信号（赤→黄→青）。数字を出さないので問題の数字と混同しない */
.signal { display: flex; gap: 14px; justify-content: center; margin-bottom: 8px; min-height: 40px; align-items: center; }
.signal .lamp { width: 34px; height: 34px; border-radius: 50%; background: #2a2a2a; opacity: .3; transition: opacity .1s, box-shadow .1s; }
.signal .lamp.on[data-c="red"] { background: #e74c3c; opacity: 1; box-shadow: 0 0 14px #e74c3c; }
.signal .lamp.on[data-c="yellow"] { background: #f1c40f; opacity: 1; box-shadow: 0 0 14px #f1c40f; }
.signal .lamp.on[data-c="green"] { background: #2ecc71; opacity: 1; box-shadow: 0 0 14px #2ecc71; }
.value-row { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 10px; flex-wrap: wrap; }
.soroban-value { font-size: 32px; font-weight: 800; color: var(--frame); font-variant-numeric: tabular-nums; word-break: break-all; }

/* 解き方 */
.steps { text-align: start; margin-top: 14px; background: #faf7f0; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 15px; }
.steps .term { margin: 10px 0; } .steps .term-head { font-weight: 700; color: var(--frame); margin-bottom: 4px; }
.steps .move { padding: 3px 0 3px 18px; position: relative; color: #444; }
.steps .move::before { content: "•"; position: absolute; left: 4px; color: var(--bead-hi); }
.steps .run { color: var(--ok); font-weight: 700; } .steps .hint { color: #b5651d; }
.fg { display: inline-block; font-size: 14px; }
.soro-legend { font-size: 12px; color: #8a7560; margin-bottom: 10px; }
.soro-wrap { display: flex; align-items: center; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.soro-fig { background: #efe9dd; border: 2px solid #1c1c1c; border-radius: 4px; }
.soro-val { font-weight: 800; color: var(--frame); font-variant-numeric: tabular-nums; }

/* ---------- そろばん ---------- */
.soroban { display: flex; justify-content: safe center; gap: calc(var(--cw) * 0.09); background: #e9e4d8; border: 12px solid var(--frame); border-radius: 6px; box-shadow: inset 0 0 0 2px #333; padding: 14px 12px; margin: 12px auto; width: fit-content; max-width: 100%; overflow-x: auto; }
/* flex-shrink を止める。止めないと 画面がせまいとき 桁がつぶれて 珠が重なってしまう */
.col { position: relative; flex: 0 0 var(--cw); width: var(--cw); height: calc(var(--bh) * 7 + 14px); margin-top: 15px; }   /* 上の 15px は 位の 字の 分（2026-09-29） */
/* 位の 字（定位点の 上）。一の位は 赤い 札で「一」 */
.unit-lab { position: absolute; left: 50%; top: -15px; transform: translateX(-50%); font-size: 10px; line-height: 13px; font-weight: 800; color: #6b5a3a; white-space: nowrap; pointer-events: none; z-index: 5; }
.unit-lab.ones { font-size: 12px; line-height: 14px; top: -16px; color: #fff; background: var(--accent); border-radius: 8px; padding: 0 6px; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.col .rod { position: absolute; left: 50%; top: 0; transform: translateX(-50%); width: 4px; height: 100%; background: linear-gradient(90deg, #999, #eee, #999); border-radius: 2px; }
.col .bar { position: absolute; left: -1px; right: -1px; top: calc(var(--bh) * 2 + 3px); height: 6px; background: linear-gradient(#333, #000); z-index: 3; }
.unit-dot { position: absolute; left: 50%; top: calc(var(--bh) * 2 + 3px); width: 7px; height: 7px; border-radius: 50%; background: #fff; box-shadow: 0 0 2px rgba(0,0,0,.6); transform: translate(-50%, -1px); z-index: 4; }
.unit-dot.ones { width: 14px; height: 14px; background: var(--accent); box-shadow: 0 0 6px rgba(0,0,0,.7), 0 0 0 2px #fff, 0 0 0 4px var(--accent); }
.col.ones-col .rod { background: linear-gradient(90deg, #c96, #ffe8b0, #c96); }   /* 一の位の 棒も 少し 目立たせる */
/* 珠は top ではなく transform で動かす。top だと 動かすたびに 画面を組み直すので
   スマホで かくかくする。transform なら 絵をずらすだけで すむ。 */
.bead { position: absolute; left: 50%; top: 2px; width: calc(var(--cw) * 0.82); height: calc(var(--bh) - 2px);
  transform: translate(-50%, var(--ty, 0px)); background: linear-gradient(180deg, var(--bead-hi), var(--bead));
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); cursor: pointer;
  transition: transform .12s ease; z-index: 2; touch-action: none; }
.bead:hover { filter: brightness(1.2); }
/* 📱 必要な けただけ 大きく（app.js の fit・2026-10-25）。縦に はじく ので 縦の スクロールは そろばんの 上では させない（横は 動かせる） */
.soroban { touch-action: pan-x; }
.soroban .col.col-off { display: none; }
.soroban.soro-fit { justify-content: center; }
.soroban.soro-fit .unit-lab { font-size: max(11px, calc(var(--cw) * 0.2)); }
/* ✋ 手もちの そろばん ⇄ 🧮 画面の そろばん（練習中に 切りかえる・2026-10-25） */
#playSorobanWrap .value-row { flex-wrap: wrap; }
#playInputWrap { flex-wrap: wrap; }
.ans-switch { font-size: 14px; padding: 7px 12px; border: 2px solid var(--navy); color: var(--navy); background: #fff; border-radius: 999px; font-weight: 800; white-space: nowrap; }
#playInputWrap .ans-switch, #playSorobanWrap .ans-switch { font-size: 14px; padding: 7px 12px; }
#playInputWrap .ans-switch { flex-basis: 100%; max-width: 320px; }
/* スマホの 練習中は 1行に 収める（そろばんの 帯が 高く なって 問題が かくれない ように）：「そろばん：」の 字を しまい、ボタンを 小さく */
@media (max-width: 640px) { body.playing #playSorobanWrap > .value-row > .small { display: none; } body.playing #playSorobanWrap .ans-switch { font-size: 12px; padding: 6px 9px; } body.playing #playSorobanWrap > .value-row { flex-wrap: nowrap; } body.playing #clearSoroban2 { white-space: nowrap; padding: 6px 8px; font-size: 12px; } }

/* レクチャー・設定 */
details { background: #fff; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; padding: 4px 14px; }
summary { cursor: pointer; font-weight: 700; padding: 10px 0; color: var(--frame); }
.lesson-body { padding: 4px 0 12px; line-height: 1.7; font-size: 15px; }
.lesson-body b { color: var(--accent); } .lesson-body ul { padding-inline-start: 20px; }
.field { display: block; margin: 12px 0; font-size: 14px; }
.field input { display: block; margin-top: 6px; width: 240px; max-width: 100%; }
.avatar-picker { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.avatar-picker button { background: #f0ece2; font-size: 26px; padding: 6px 10px; border-radius: 8px; }
.avatar-picker button.sel { outline: 3px solid var(--gold); }

/* テーブル */
.rec-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 8px; }
.rec-table th, .rec-table td { border: 1px solid var(--line); padding: 6px 8px; text-align: center; }
.rec-table th { background: #f5efe3; }

/* 本日の練習・休憩・グラフ */
.rest { text-align: center; padding: 24px 0; }
.rest-title { font-size: 24px; font-weight: 700; color: var(--frame); }
.rest-timer { font-size: 74px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; margin: 6px 0; }
.menu-list { margin: 10px 0 12px 22px; line-height: 1.9; }
.row2 { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin: 12px 0; }
.row2 label { display: flex; flex-direction: column; font-size: 12px; color: #8a7560; gap: 3px; align-items: center; }
.row2 select { padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; font-size: 16px; }
#todayStart { background: var(--accent); color: #fff; font-size: 18px; padding: 12px 28px; border-radius: 10px; margin-top: 4px; }
.graph { width: 100%; max-width: 560px; height: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; display: block; }
.marks { font-size: 20px; letter-spacing: 3px; margin-bottom: 8px; font-weight: 700; }

/* 採点結果の全問リスト */
.rest-result { max-width: 460px; margin: 14px auto 0; text-align: start; }
.section-score { font-size: 16px; font-weight: 700; color: var(--frame); margin: 6px 0; text-align: center; }
.qlist { max-height: 46vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.qrow { display: flex; align-items: center; gap: 8px; padding: 5px 10px; border-bottom: 1px solid #f0ece2; font-size: 15px; }
.qrow:last-child { border-bottom: none; }
.qrow .qn { color: #999; width: 22px; text-align: right; }
.qrow .qq { flex: 1; font-variant-numeric: tabular-nums; }
.qrow .qa { color: #555; font-variant-numeric: tabular-nums; }
.qrow .qa s { color: var(--accent); }
.qrow .qm { font-size: 20px; font-weight: 800; width: 26px; text-align: center; }
.qrow .qm.ok { color: #e0322b; }
.qrow .qm.ng { color: var(--accent); }

/* ============================================================ キングダム層 */
.brand { color: #fff; }
.brand small { color: var(--royal-gold); opacity: .9; letter-spacing: 1px; }
.pill.gold { background: linear-gradient(180deg,#fbf1cf,#f0d98a); border-color: #e0c463; color: #6b5416; font-weight: 800; }

/* ホーム */
.home-grid { display: grid; grid-template-columns: 1fr 260px; gap: 16px; align-items: start; }
.home-hero { background: linear-gradient(160deg,#1b3a6b,#16305c); color: #fff; border: none; }
.hero-top { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.hero-avatar { font-size: 46px; background: rgba(255,255,255,.12); border-radius: 16px; width: 68px; height: 68px; display: flex; align-items: center; justify-content: center; }
.hero-top b { font-size: 20px; }
.today-box { background: var(--card); color: #2b2b2b; border-radius: 14px; padding: 18px; }
.today-title { font-size: 15px; font-weight: 800; color: var(--navy); letter-spacing: 2px; border-bottom: 2px solid var(--royal-gold); display: inline-block; padding-bottom: 4px; margin-bottom: 12px; }
.today-menu { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; }
.menu-row { display: flex; justify-content: space-between; font-size: 16px; padding: 6px 4px; border-bottom: 1px dashed #eadfca; }
.menu-row b { color: var(--navy); }
.big-cta { width: 100%; background: linear-gradient(180deg,#e7b93c,#d4af37); color: #16305c; font-size: 20px; font-weight: 800; padding: 16px; border-radius: 12px; box-shadow: 0 4px 0 #b8912a; }
.big-cta:hover { filter: brightness(1.03); }
.today-status { text-align: center; margin-top: 12px; font-size: 15px; }
.home-side { display: flex; flex-direction: column; gap: 10px; }
.stat-tile { display: flex; align-items: center; justify-content: space-between; margin: 0; padding: 14px 16px; }
.stat-tile span { font-size: 14px; color: #6b5f4c; }
.stat-tile b { font-size: 22px; color: var(--navy); }
.wide-btn { width: 100%; padding: 12px; border-radius: 10px; font-size: 15px; background: var(--navy); }
.wide-btn.ghost { background: transparent; color: var(--navy); border: 1px solid var(--navy); }

/* 王国 */
.kingdom-head { display: flex; align-items: center; justify-content: space-between; background: linear-gradient(160deg,#1b3a6b,#16305c); color: #fff; border: none; }
.kd-title { font-size: 20px; font-weight: 800; }
.kd-lv { font-size: 14px; background: rgba(255,255,255,.15); padding: 3px 10px; border-radius: 12px; }
.gold-badge { background: linear-gradient(180deg,#fbf1cf,#f0d98a); color: #6b5416; font-weight: 800; padding: 8px 16px; border-radius: 20px; font-size: 16px; }

/* 結果画面の GOLD 演出 */
.gold-earn { margin: 12px auto; max-width: 420px; background: linear-gradient(180deg,#fdf6de,#f6e6b0); border: 1px solid #e6cf83; border-radius: 14px; padding: 12px 16px; color: #6b5416; }
.gold-earn > b { font-size: 24px; color: #a9791a; }
.gold-lines { font-size: 12px; margin: 4px 0; opacity: .85; }
.gold-earn .goal { font-size: 14px; font-weight: 800; color: var(--navy); margin-top: 4px; }
.result .hl { color: #d4820f; }

/* 保護者画面 */
.parent-summary .pgrid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 8px; }
.pcell { background: #f7f3ea; border-radius: 10px; padding: 12px; text-align: center; }
.pcell span { display: block; font-size: 12px; color: #6b5f4c; margin-bottom: 4px; }
.pcell b { font-size: 22px; color: var(--navy); }
.pbars { display: flex; align-items: flex-end; gap: 8px; height: 130px; padding: 8px 4px; }
.pbar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; }
.pbar { width: 70%; max-width: 40px; background: linear-gradient(180deg,#3a72c4,#16305c); border-radius: 5px 5px 0 0; min-height: 3px; }
.pbar-n { font-size: 12px; font-weight: 700; color: var(--navy); }
.pbar-l { font-size: 12px; color: #8a7560; }
.psub { display: flex; align-items: center; gap: 10px; margin: 6px 0; font-size: 14px; }
.psub > span { width: 76px; }
.psub-bar { flex: 1; background: #eee5d2; border-radius: 8px; height: 14px; overflow: hidden; }
.psub-bar > div { height: 100%; background: linear-gradient(90deg,#d4af37,#e7b93c); }
.psub > b { width: 44px; text-align: right; color: var(--navy); }

/* ============================================================ キャラクター素材 */
.brand { padding: 4px 4px 14px; }
.brand-mark { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.brand-logo { width: 88px; display: block; filter: drop-shadow(0 2px 4px rgba(0,0,0,.35)); }
.brand-name { color: var(--royal-gold); font-size: 17px; font-weight: 800; letter-spacing: .5px; white-space: nowrap; }

/* ホームのマスコット */
.hero-top { position: relative; flex-wrap: wrap; }
.hero-id { min-width: 120px; }
.hero-speech { background: #fff; color: #2b2b2b; border-radius: 14px; padding: 8px 14px; font-size: 13px; font-weight: 700; margin-left: auto; position: relative; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.hero-speech::after { content: ""; position: absolute; right: -8px; top: 50%; transform: translateY(-50%); border: 8px solid transparent; border-left-color: #fff; }
.hero-mascot { width: 96px; height: auto; filter: drop-shadow(0 4px 5px rgba(0,0,0,.35)); }
/* ホームの 右上：物語の 少年（丸く 切り抜き）＋ ソロモン（2026-09-25・レオ王から 変更） */
.hero-mascot.hero-duo { width: auto; display: flex; align-items: flex-end; filter: none; }
/* ホームでは 吹き出しが 左に ある → 少年を 左右 反転して 吹き出しと 子どもの 方を 向かせる（元の 絵は 右向き） */
.hero-duo .ph-boy { transform: scaleX(-1); }
.hero-duo .ph-boy { width: 78px; height: 78px; background-size: 144px 100px; background-position: -8px -20px; }
.hero-duo .ph-solo { width: 74px; height: 74px; margin-left: -8px; }

/* 王国ボードの建物画像 */

/* たいせん（CPU対戦ゲーム） */
.battle-opts { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; margin: 16px 0; }
.battle-opts label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #6b5f4c; }
.battle-opts select { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); font-size: 15px; }
.battle-setup { text-align: center; }
.battle-hud { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.fighter { flex: 1; text-align: center; }
.fighter img { width: 92px; height: auto; filter: drop-shadow(0 4px 4px rgba(0,0,0,.28)); }
.fighter.cpu img { transform: none; } /* 敵は専用イラストなので反転しない */
/* 敵の名前は「カンピロバクター」のように 長いので、はみ出さずに 折り返す */
.fname { font-weight: 700; font-size: 13px; color: var(--navy); line-height: 1.25; overflow-wrap: anywhere; }
@media (max-width: 640px) { .fname { font-size: 11px; } }
.battle-center { display: flex; flex-direction: column; align-items: center; }
.battle-timer { font-size: 28px; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; }
.vs { font-size: 14px; font-weight: 800; color: var(--royal-gold); letter-spacing: 2px; }
.battle-problem { text-align: right; font-size: 40px; font-weight: 800; white-space: pre-line; line-height: 1.15; min-height: 130px; display: flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
#battleForm { justify-content: center; }
.battle-fx { text-align: center; height: 26px; font-weight: 800; font-size: 16px; margin-top: 6px; }
.battle-fx.ok { color: var(--ok); }
.battle-fx.ng { color: var(--accent); }
#battleQuit { display: block; margin: 12px auto 0; }
.battle-verdict { display: flex; align-items: center; justify-content: center; gap: 16px; }
.bv-face { width: 120px; height: auto; }
.bv-badge { display: block; margin: 0 auto 6px; }
.battle-score-final { text-align: center; font-size: 22px; margin: 10px 0; }
.battle-score-final b { font-size: 30px; color: var(--navy); }
.battle-result { text-align: center; }

/* 結果画面のキャラクター＋バッジ */
.result-hero { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 10px; }
.rh-face { width: 88px; height: auto; }
/* 少年と ソロモン（上半身・下が 切れている 絵）：少し 大きく、下を ふわっと 消す */
.rh-face.rh-duo { width: 132px; -webkit-mask-image: linear-gradient(#000 82%, transparent); mask-image: linear-gradient(#000 82%, transparent); }
.rh-badge { display: inline-block; }

@media (max-width: 900px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; }
  .grades-layout { grid-template-columns: 1fr; }
  .home-grid { grid-template-columns: 1fr; }
  .parent-summary .pgrid { grid-template-columns: repeat(2,1fr); }
  .hero-mascot { width: 76px; }
  .hero-duo .ph-boy { width: 60px; height: 60px; background-size: 111px 77px; background-position: -7px -16px; }
  .hero-duo .ph-solo { width: 58px; height: 58px; }
  .hero-mascot.hero-duo { margin-left: auto; }
  .fighter img { width: 72px; }
}

/* ============================================================ 一時停止 / 休憩スキップ */
#pauseBtn { cursor: pointer; font-weight: 700; }
.pause-box { text-align: center; padding: 44px 20px; }
.pause-title { font-size: 32px; font-weight: 800; color: var(--navy); margin-bottom: 6px; }
#resumeBtn, .resume-btn { font-size: 20px; font-weight: 800; padding: 14px 44px; border-radius: 12px; background: var(--ok); margin-top: 14px; }
#battlePauseBtn { cursor: pointer; font-weight: 700; margin-top: 4px; }
.skip-btn { background: var(--ok); color: #fff; font-size: 16px; font-weight: 700; padding: 12px 26px; border-radius: 10px; margin-top: 10px; }

/* ============================================================ たいせん：HP制バトル */
.kill-count { font-size: 13px; color: var(--navy); margin-top: 2px; }
.kill-count b { font-size: 26px; font-variant-numeric: tabular-nums; }
.hpbar { width: 130px; max-width: 100%; height: 15px; margin: 6px auto 3px; background: #e9e0cc; border: 1px solid #d3c7ab; border-radius: 8px; overflow: hidden; }
.hpfill { height: 100%; width: 100%; background: linear-gradient(90deg, #5bc46a, #2e7d5b); transition: width .25s ease; }
.hpfill.low { background: linear-gradient(90deg, #e8a33d, #d9534f); }
.hptext { font-size: 12px; color: #6b5f4c; font-variant-numeric: tabular-nums; }
.fighter.cpu img.hit { animation: enemyHit .3s ease; }
@keyframes enemyHit {
  0%   { transform: translateX(0); }
  30%  { transform: translateX(12px) rotate(7deg); filter: brightness(1.8); }
  100% { transform: translateX(0); }
}
.fighter.cpu img.down { animation: enemyDown .7s ease forwards; }
@keyframes enemyDown {
  0%   { transform: rotate(0); opacity: 1; }
  100% { transform: rotate(75deg) translateY(14px); opacity: .2; }
}
/* たおしたあと、次の敵が出てくる */
.fighter.cpu img.appear { animation: enemyAppear .35s ease; }
@keyframes enemyAppear {
  0%   { transform: scale(.4); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.battle-fx.kill { color: var(--royal-gold); font-size: 20px; text-shadow: 0 1px 2px rgba(0,0,0,.2); }
.battle-fx.miss { color: #6b5f4c; }  /* 不正解は責めない色にする（赤にしない） */
.bs-sub { display: block; font-size: 14px; color: #8a7560; font-weight: normal; margin-top: 2px; }

/* ============================================================ 自分のHP / あんざんのコツ */
.myhp { font-size: 20px; color: #d9534f; letter-spacing: 2px; line-height: 1.2; }
.myhp.danger { animation: hpBlink .7s infinite; }
@keyframes hpBlink { 50% { opacity: .3; } }
/* ネコがしゃべっているセリフ（吹き出し） */
.anzan-tip { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 16px auto; max-width: 1000px; }
.tip-cat { width: 210px; height: auto; flex-shrink: 0; filter: drop-shadow(0 4px 7px rgba(0,0,0,.25)); }
/* 右側で寝ているネコ。勉強くささを消すための飾り */
.tip-cat2 { width: 200px; height: auto; flex-shrink: 0; align-self: flex-end; filter: drop-shadow(0 4px 7px rgba(0,0,0,.2)); }
.tip-balloon { position: relative; flex: 1; background: #fffaf0; border: 2px solid var(--royal-gold); border-radius: 18px; padding: 14px 18px; line-height: 1.9; font-size: 15px; text-align: start; }
/* 吹き出しのしっぽ（ネコの方を向く） */
.tip-balloon::before { content: ""; position: absolute; left: -14px; top: 50%; transform: translateY(-50%); border: 11px solid transparent; border-right-color: var(--royal-gold); }
.tip-balloon::after { content: ""; position: absolute; left: -11px; top: 50%; transform: translateY(-50%); border: 9px solid transparent; border-right-color: #fffaf0; }
.tip-balloon > b { display: block; font-size: 17px; color: var(--navy); margin-bottom: 6px; }
.tip-balloon p { margin: 8px 0; }
.tip-balloon p b { color: #c0392b; }
/* 画面が狭いときは、寝ているネコは隠して文章を読みやすくする */
@media (max-width: 940px) { .tip-cat2 { display: none; } }
@media (max-width: 620px) {
  .anzan-tip { flex-direction: column; gap: 6px; }
  .tip-cat { width: 150px; }
  .tip-balloon::before { left: 50%; top: -14px; transform: translateX(-50%); border-right-color: transparent; border-bottom-color: var(--royal-gold); }
  .tip-balloon::after { left: 50%; top: -11px; transform: translateX(-50%); border-right-color: transparent; border-bottom-color: #fffaf0; }
}

/* ============================================================ 自作バッジ（画像を使わないので文字が切れない） */
.badge-chip {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  padding: 10px 26px; border-radius: 999px;
  background: linear-gradient(180deg, #fbf1cf 0%, #f0d98a 45%, #dcb63f 100%);
  border: 3px solid var(--navy); color: var(--navy);
  font-size: 21px; font-weight: 800; letter-spacing: 1px;
  text-shadow: 0 1px 0 rgba(255,255,255,.75);
  box-shadow: 0 4px 0 #a8821c, 0 8px 16px rgba(0,0,0,.22);
}
.badge-chip.win { font-size: 26px; letter-spacing: 3px; }
.badge-chip.best {
  background: linear-gradient(180deg, #ffeec2 0%, #ffc857 45%, #e8a33d 100%);
  box-shadow: 0 4px 0 #b57a1c, 0 8px 16px rgba(0,0,0,.22);
}
.badge-chip.perfect {
  background: linear-gradient(180deg, #dff0ff 0%, #8fc6f5 45%, #4a90d9 100%);
  border-color: #0d2747; color: #0d2747;
  box-shadow: 0 4px 0 #2c5f96, 0 8px 16px rgba(0,0,0,.22);
}
@media (max-width: 620px) { .badge-chip { font-size: 17px; padding: 8px 18px; } .badge-chip.win { font-size: 21px; } }

/* ============================================================ 報酬の絵（金貨・王冠） */
.ico-coin, .ico-crown { height: 1.35em; width: auto; vertical-align: -0.28em; }
.gold-earn .ico-coin { height: 46px; vertical-align: -12px; filter: drop-shadow(0 2px 3px rgba(0,0,0,.25)); }
.stat-tile .ico-coin, .stat-tile .ico-crown { height: 26px; vertical-align: -7px; }
.gold-badge .ico-coin { height: 30px; vertical-align: -8px; }
.pill.gold .ico-coin { height: 22px; vertical-align: -6px; }
.gold-earn { animation: goldPop .45s ease; }
@keyframes goldPop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ============================================================ まちがえ方のクセ（1セット終わりの図解つき説明） */
.miss-report { text-align: start; margin: 14px 0; background: #fffdf6; border: 2px solid var(--line); border-radius: 14px; padding: 14px 16px; font-size: 15px; line-height: 1.7; }
.miss-report.all-ok { background: #f3fbf3; border-color: #8dc98d; }
.mr-acc { font-size: 18px; font-weight: 800; color: var(--navy); margin-bottom: 8px; }
.mr-acc b { font-size: 26px; }
.mr-acc .sub { font-size: 14px; font-weight: 400; }
.mr-h { font-weight: 800; color: var(--navy); border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 4px; }
.mr-top { font-size: 17px; margin: 6px 0; }
.mr-top b { color: #b5651d; }
.mr-tip { background: #fff6e0; border-left: 5px solid var(--gold, #d4af37); border-radius: 8px; padding: 8px 12px; margin: 8px 0; }
/* 図解：まちがえた1手を「前 ▶ あと」で並べて見せる */
.mr-fig { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; margin: 10px 0 4px; }
.mr-fig-1 { text-align: center; }
.mr-cap { font-size: 13px; font-weight: 700; color: #8a7560; margin-bottom: 3px; }
.mr-arrow { text-align: center; font-size: 13px; color: var(--navy); }
.mr-arrow span { display: block; font-size: 22px; color: var(--bead-hi); line-height: 1; }
.mr-moves .move { padding: 3px 0 3px 18px; position: relative; color: #444; font-size: 14px; }
.mr-moves .move::before { content: "•"; position: absolute; left: 4px; color: var(--bead-hi); }
.mr-moves .hint { color: #b5651d; font-weight: 700; }
.mr-others { font-size: 14px; color: #8a7560; margin-top: 8px; }
.mr-more { margin-top: 10px; }
.mr-steps { margin-top: 10px; }

/* ============================================================ にがて克服メニュー */
.weak-menu { margin-top: 14px; text-align: start; background: #fffdf6; border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.wm-h { font-weight: 800; color: var(--navy); margin-bottom: 6px; }
.wm-none { font-size: 13px; color: #8a7560; }
.wm-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.wm-row:last-of-type { border-bottom: none; }
.wm-em { font-size: 20px; }
.wm-n { font-weight: 700; flex: 1; font-size: 14px; }
.wm-c { font-size: 13px; color: #b5651d; background: #fff2e2; border-radius: 999px; padding: 1px 10px; }
.wm-go { font-size: 13px; padding: 6px 12px; background: var(--ok); }
.mr-drill { display: block; width: 100%; margin-top: 12px; background: var(--ok); font-size: 16px; padding: 12px; }

/* ============================================================ 問題が多い級（5級・4級など）で見切れないように */
/* 問題の字は、のこりの高さに合わせて JS が大きさを決める（fitProblem）。
   そろばんは 画面の幅をぜんぶ使って 大きく出す。 */
.problem { margin-bottom: 12px; }
#stepsRow { margin-top: 10px; }
/* 数字は右そろえの縦一列（そろばんの見取算と同じ並び）。字の大きさはJSが行数に合わせて決める */
.problem { max-width: 100%; overflow-wrap: anywhere; }

/* ============================================================ まちがえた問題の ていねいな解説（全問） */
.ex-h { font-weight: 800; color: var(--navy); font-size: 16px; margin: 16px 0 8px; border-top: 2px solid var(--line); padding-top: 12px; }
.ex-card { border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; background: #fff; }
.ex-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; border-bottom: 1px dashed var(--line); padding-bottom: 8px; margin-bottom: 10px; }
.ex-no { font-size: 12px; font-weight: 700; color: #fff; background: var(--navy); border-radius: 999px; padding: 2px 10px; }
.ex-head .ex-q { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ex-a { font-size: 14px; color: #666; }
.ex-a .ng { color: var(--accent); } .ex-a .ok { color: var(--ok); }
.ex-diag { background: #fff6e0; border-left: 5px solid var(--royal-gold); border-radius: 8px; padding: 8px 12px; font-size: 15px; line-height: 1.8; }
.ex-wrong { color: var(--accent); font-weight: 700; }
.ex-right { color: var(--ok); font-weight: 700; }
.ex-fix { font-size: 14px; background: #f2f8f4; border-radius: 8px; padding: 8px 12px; margin-top: 8px; }
.ex-all { margin-top: 10px; }
.ex-all-h { font-size: 13px; font-weight: 700; color: #8a7560; margin-bottom: 4px; }
.ex-all .steps { margin-top: 0; font-size: 14px; }
/* 正しい動き ／ きみの動き を左右に並べる */
.tb { display: flex; gap: 12px; flex-wrap: wrap; margin: 10px 0 0; }
.tb-side { flex: 1 1 300px; border: 2px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.tb-side.ok { border-color: #8dc98d; background: #f4fbf4; }
.tb-side.ng { border-color: #e2a79e; background: #fdf5f3; }
.tb-h { font-size: 13px; font-weight: 800; margin-bottom: 6px; }
.tb-side.ok .tb-h { color: var(--ok); } .tb-side.ng .tb-h { color: var(--accent); }
.tb-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tb-1 { text-align: center; }
.tb-cap { font-size: 12px; font-weight: 700; color: #8a7560; margin-bottom: 2px; font-variant-numeric: tabular-nums; }
.tb-ar { font-size: 20px; color: var(--bead-hi); }
/* きょうの見立て */
.as-box { background: #f7f9fd; border: 2px solid #cbd8ea; border-radius: 12px; padding: 12px 14px; margin: 12px 0; }
.as-h, .as-h2 { font-weight: 800; color: var(--navy); }
.as-h2 { margin-top: 10px; }
.as-list { margin: 6px 0 0 20px; font-size: 14px; }
.as-time { font-size: 13px; color: #8a7560; margin-top: 6px; }
.as-tips { margin: 6px 0 0 20px; font-size: 14px; line-height: 1.8; }
.as-tips li { margin-bottom: 4px; }

/* ============================================================ フラッシュ暗算 1セットの成績 */
.fs-stats { text-align: start; background: #f7f9fd; border: 2px solid #cbd8ea; border-radius: 12px; padding: 10px 14px; margin: 10px 0; font-size: 15px; }
.fs-acc { font-size: 17px; font-weight: 800; color: var(--navy); margin-bottom: 6px; }
.fs-acc b { font-size: 26px; }
.fs-row { display: flex; justify-content: space-between; padding: 2px 0; border-bottom: 1px dashed #dfe6f0; }
.fs-row:last-of-type { border-bottom: none; }
.fs-row b { font-variant-numeric: tabular-nums; }
.fs-best { margin-top: 6px; font-weight: 700; color: var(--ok); }
.fs-best.sub { font-weight: 400; }

/* ============================================================ そろばんパズル */
.pz-lobby { text-align: center; }
.pz-lv-big { font-size: 15px; color: #8a7560; }
.pz-lv-big b { font-size: 30px; color: var(--navy); }
.pz-goal-big { font-size: 18px; margin: 6px 0 12px; }
.pz-goal-big b { color: var(--accent); font-size: 22px; }
.pz-past-row { display: flex; gap: 10px; justify-content: center; font-size: 12px; color: #b58a2b; margin-bottom: 10px; flex-wrap: wrap; }
.pz-items-h { text-align: start; font-weight: 700; color: var(--navy); font-size: 14px; margin: 10px 0 6px; }
.pz-item { display: flex; align-items: center; gap: 10px; text-align: start; border: 2px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 8px; background: #fff; }
.pz-em { font-size: 26px; }
.pz-in { flex: 1; display: flex; flex-direction: column; }
.pz-in small { color: #8a7560; font-size: 12px; }
.pz-ic { font-weight: 700; color: #b58a2b; }
.pz-buy { padding: 4px 14px; font-size: 18px; line-height: 1; }
.pz-have { min-width: 26px; font-weight: 700; color: var(--ok); }
.pz-total { margin: 10px 0; font-size: 15px; }
.pz-total b { font-size: 20px; color: var(--accent); }
.pz-need { color: var(--accent); font-weight: 700; margin: 10px 0; }
/* 盤面 */
.pz-goal, .pz-moves { font-size: 17px; }
.pz-goal b, .pz-moves b { font-size: 22px; color: var(--navy); }
.pz-barwrap { height: 10px; background: #ece3d2; border-radius: 999px; overflow: hidden; margin-bottom: 6px; }
.pz-barwrap i { display: block; height: 100%; width: 0; background: linear-gradient(90deg,#e0b84a,#d4af37); transition: width .25s; }
.pz-msg { min-height: 22px; font-weight: 700; text-align: center; font-size: 15px; }
.pz-msg.ok { color: var(--ok); } .pz-msg.ng { color: var(--accent); }
.pz-board {
  --pzt: min(52px, calc((100vw - 120px) / 8));
  position: relative; width: calc(var(--pzt) * 8); height: calc(var(--pzt) * 8);
  /* 枠（border 4px）は 8マスの 外側に 足す。border-box だと 玉が 右と下で 8px はみ出て 切れる（2026-09-25） */
  box-sizing: content-box;
  margin: 0 auto; border-radius: 16px; overflow: hidden;
  touch-action: none; user-select: none;
  /* 盤のマス目＋うすい光。四角い板ではなく「場」に見せる */
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.055) 0 calc(var(--pzt)), rgba(0,0,0,.035) calc(var(--pzt)) calc(var(--pzt) * 2)),
    repeating-linear-gradient(90deg, rgba(255,255,255,.055) 0 calc(var(--pzt)), rgba(0,0,0,.035) calc(var(--pzt)) calc(var(--pzt) * 2)),
    radial-gradient(120% 90% at 50% 0%, #9fc0e8, #6d8fc4 55%, #4d6ea3);
  border: 4px solid #c9a227;
  box-shadow: inset 0 6px 18px rgba(0,0,0,.3), inset 0 -4px 10px rgba(0,0,0,.25), 0 6px 18px rgba(0,0,0,.2), 0 0 0 3px #8a6d14;
}
.pz-t {
  position: absolute; width: var(--pzt); height: var(--pzt); left: 0; top: 0;
  transform: translate3d(calc(var(--x) * var(--pzt)), calc(var(--y) * var(--pzt)), 0);
  /* 落ちるときに ほんの少し 行きすぎて もどる＝重さが出る */
  transition: transform .26s cubic-bezier(.34, 1.32, .5, 1);
  display: flex; align-items: center; justify-content: center; cursor: pointer; will-change: transform;
}
.pz-t::before {
  content: ""; position: absolute; inset: 2px; border-radius: 12px;
  background: rgba(255,255,255,.10);
  transition: transform .12s ease, box-shadow .12s ease;
}
/* 玉の絵（いただいた素材から作ったもの） */
.pz-img { position: relative; width: 96%; height: 96%; object-fit: contain; pointer-events: none;
  filter: drop-shadow(0 3px 3px rgba(0,0,0,.4)); }
.pz-t.k-spade { --c: #3a3a46; --g: #5b5b6b; }
.pz-t.k-heart { --c: #d0342c; --g: #e8695f; }
.pz-t.k-dia { --c: #2b6fd0; --g: #5d9ae8; }
.pz-t.k-club { --c: #2e7d5b; --g: #54a97f; }
.pz-t.k-bead { --c: #d99a2b; --g: #f0c364; }
/* えらんでいる玉：ふわっと ゆれる */
.pz-t.sel::after { content: ""; position: absolute; inset: 1px; border: 3px solid #fff; border-radius: 13px; box-shadow: 0 0 0 3px var(--royal-gold), 0 0 14px rgba(212,175,55,.7); }
.pz-t.sel { animation: pzsel .6s ease-in-out infinite alternate; z-index: 3; }
@keyframes pzsel { to { transform: translate3d(calc(var(--x) * var(--pzt)), calc(var(--y) * var(--pzt) - 3px), 0) scale(1.06); } }
/* だめな入れかえ：首をふる */
.pz-t.no { animation: pzno .38s ease; z-index: 4; }
@keyframes pzno {
  0%,100% { transform: translate3d(calc(var(--x) * var(--pzt)), calc(var(--y) * var(--pzt)), 0); }
  25% { transform: translate3d(calc(var(--x) * var(--pzt) - 6px), calc(var(--y) * var(--pzt)), 0) rotate(-6deg); }
  75% { transform: translate3d(calc(var(--x) * var(--pzt) + 6px), calc(var(--y) * var(--pzt)), 0) rotate(6deg); }
}
/* アイテムに変わった玉：ぽんっと出る */
.pz-t.sp::before { box-shadow: inset 0 0 0 3px #fff8d8, inset 0 -4px 0 rgba(0,0,0,.2), 0 0 12px rgba(255,225,140,.9); }
.pz-t.born::before { animation: pzborn .4s cubic-bezier(.2,1.6,.4,1); }
@keyframes pzborn { 0% { transform: scale(.4) rotate(-20deg); } 100% { transform: scale(1) rotate(0); } }
.pz-sp { position: absolute; font-size: calc(var(--pzt) * .44); filter: drop-shadow(0 1px 1px rgba(0,0,0,.45)); }
/* 消える：ふくらんで はじける */
.pz-t.pop { animation: pzpop .19s ease-in forwards; animation-delay: var(--d, 0ms); z-index: 2; }
@keyframes pzpop {
  35% { transform: translate3d(calc(var(--x) * var(--pzt)), calc(var(--y) * var(--pzt)), 0) scale(1.28); filter: brightness(1.6); }
  100% { transform: translate3d(calc(var(--x) * var(--pzt)), calc(var(--y) * var(--pzt)), 0) scale(.1); opacity: 0; }
}
/* 盤ゆれ */
.pz-board.shake { animation: pzsh .28s ease; }
.pz-board.shake-b { animation: pzsh .4s ease; }
@keyframes pzsh { 0%,100% { transform: translate(0,0); } 20% { transform: translate(-4px,2px); } 45% { transform: translate(4px,-2px); } 70% { transform: translate(-2px,1px); } }
/* れんさ の文字 */
.pz-msg.show { animation: pzmsg .5s cubic-bezier(.2,1.6,.4,1); font-size: 20px; }
@keyframes pzmsg { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); } }
/* 結果 */
.pz-over { margin-top: 14px; text-align: center; background: #fffdf6; border: 2px solid var(--royal-gold); border-radius: 14px; padding: 16px; }
.pz-res-h { font-size: 22px; font-weight: 800; }
.pz-res-h.ok { color: var(--ok); } .pz-res-h.ng { color: var(--accent); }
.pz-stars { font-size: 34px; color: var(--royal-gold); letter-spacing: 4px; }
.pz-res-btns { margin-top: 10px; }

/* ---- 特殊ピースの見た目 ---- */
.pz-t.sp-rh .pz-sp { transform: rotate(90deg); }
.pz-t.sp-rv .pz-sp { transform: rotate(0deg); }
.pz-t.sp-tnt::before { background: linear-gradient(160deg,#6b6b78,#2f2f38); }
.pz-t.sp-prop::before { background: linear-gradient(160deg,#8fd6ff,#2b8fd0); }
.pz-t.sp-prop .pz-sp { animation: pzrot 1.1s linear infinite; }
@keyframes pzrot { to { transform: rotate(360deg); } }
/* 光の玉：虹色にまわる */
.pz-t.sp-disco::before { background: conic-gradient(#ff8ac4,#ffd36b,#8ce99a,#74c0fc,#b197fc,#ff8ac4); animation: pzspin 2.4s linear infinite; }
@keyframes pzspin { to { transform: rotate(360deg); } }
.pz-disco { position: relative; width: calc(var(--pzt) * .42); height: calc(var(--pzt) * .42); border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #fff6c9 40%, rgba(255,255,255,.15) 70%);
  box-shadow: 0 0 12px rgba(255,255,255,.9); }

/* ---- 消したときの 気持ちよさ ---- */
.pz-fx { position: absolute; left: 0; top: 0; width: var(--pzt); height: var(--pzt);
  transform: translate3d(calc(var(--x) * var(--pzt)), calc(var(--y) * var(--pzt)), 0);
  display: flex; align-items: center; justify-content: center; pointer-events: none; z-index: 6; }
.pz-pts { font-weight: 800; color: #fff; font-size: calc(var(--pzt) * .34); text-shadow: 0 2px 4px rgba(0,0,0,.5); animation: pzup .85s ease-out forwards; }
@keyframes pzup { 0% { opacity: 0; transform: translate3d(calc(var(--x) * var(--pzt)), calc(var(--y) * var(--pzt)), 0) scale(.6); }
  25% { opacity: 1; transform: translate3d(calc(var(--x) * var(--pzt)), calc(var(--y) * var(--pzt) - 6px), 0) scale(1.15); }
  100% { opacity: 0; transform: translate3d(calc(var(--x) * var(--pzt)), calc(var(--y) * var(--pzt) - 34px), 0) scale(1); } }
.pz-praise { font-weight: 900; font-size: calc(var(--pzt) * .46); color: #ffd35b; -webkit-text-stroke: 2px #7a4a00;
  paint-order: stroke fill; white-space: nowrap; animation: pzpraise 1s cubic-bezier(.2,1.7,.4,1) forwards; z-index: 7; }
@keyframes pzpraise { 0% { opacity: 0; transform: translate3d(calc(var(--x) * var(--pzt)), calc(var(--y) * var(--pzt)), 0) scale(.3) rotate(-8deg); }
  35% { opacity: 1; transform: translate3d(calc(var(--x) * var(--pzt)), calc(var(--y) * var(--pzt) - 10px), 0) scale(1.2) rotate(3deg); }
  100% { opacity: 0; transform: translate3d(calc(var(--x) * var(--pzt)), calc(var(--y) * var(--pzt) - 40px), 0) scale(1) rotate(0); } }
.pz-p { position: absolute; left: 0; top: 0; width: calc(var(--pzt) * .2); height: calc(var(--pzt) * .2); border-radius: 50%;
  background: var(--pc); pointer-events: none; z-index: 5; animation: pzpart .6s ease-out forwards; animation-delay: var(--pd, 0ms);
  transform: translate3d(calc(var(--x) * var(--pzt) + var(--pzt) * .4), calc(var(--y) * var(--pzt) + var(--pzt) * .4), 0); }
@keyframes pzpart { 0% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(calc(var(--x) * var(--pzt) + var(--pzt) * .4 + var(--dx) * 46px), calc(var(--y) * var(--pzt) + var(--pzt) * .4 + var(--dy) * -46px + 30px), 0) scale(.4); } }
.pz-score-w { font-size: 15px; color: #8a7560; }
.pz-score-w b { font-size: 20px; color: var(--navy); display: inline-block; font-variant-numeric: tabular-nums; }
.pz-score-w b.pop, .pz-goal.pop { animation: pzbump .3s cubic-bezier(.2,1.8,.4,1); }
@keyframes pzbump { 50% { transform: scale(1.3); } }
/* ---- ごほうびの儀式 ---- */
.pz-star { font-size: 44px; color: #dcd6c8; display: inline-block; margin: 0 4px; }
.pz-star.on { color: var(--royal-gold); text-shadow: 0 0 18px rgba(212,175,55,.9); }
.pz-star.fly { animation: pzstar .5s cubic-bezier(.2,1.8,.4,1); }
@keyframes pzstar { 0% { transform: scale(0) rotate(-140deg); opacity: 0; } 70% { transform: scale(1.5) rotate(10deg); opacity: 1; } 100% { transform: scale(1) rotate(0); } }
.pz-tally { font-size: 17px; margin: 6px 0; }
.pz-tally b { font-size: 26px; color: var(--navy); font-variant-numeric: tabular-nums; }
.pz-meter { margin-top: 10px; font-size: 13px; color: #8a7560; }
.pz-meter b { font-size: 20px; color: var(--royal-gold); margin: 0 6px; }
.pz-meter-bar { display: block; height: 10px; background: #ece3d2; border-radius: 999px; overflow: hidden; margin: 4px 0; }
.pz-meter-bar u { display: block; height: 100%; background: linear-gradient(90deg,#e0b84a,#d4af37); }
.pz-chest { font-size: 54px; display: inline-block; animation: pzchest .5s ease-in-out infinite alternate; }
.pz-chest.open { animation: pzopen .6s cubic-bezier(.2,1.8,.4,1) forwards; }
@keyframes pzchest { to { transform: scale(1.08) rotate(3deg); } }
@keyframes pzopen { 0% { transform: scale(1); } 40% { transform: scale(1.5) rotate(-8deg); } 100% { transform: scale(1.15); } }
.pz-gift-item { font-size: 18px; font-weight: 800; color: var(--navy); margin-top: 6px; animation: pzstar .5s cubic-bezier(.2,1.8,.4,1); }
.pz-stock { font-weight: 700; color: var(--ok); font-size: 13px; }

/* ---- アイテムの爆発（飛ぶ絵と 崩れ方） ---- */
.pz-rk { position: absolute; left: 0; top: 0; width: var(--pzt); height: var(--pzt); z-index: 8; pointer-events: none;
  display: flex; align-items: center; justify-content: center; font-size: calc(var(--pzt) * .6);
  filter: drop-shadow(0 0 8px rgba(255,220,120,.9)); }
.pz-rk.h { animation: pzrkh .38s linear forwards; }
.pz-rk.v { animation: pzrkv .38s linear forwards; }
@keyframes pzrkh {
  0% { transform: translate3d(calc(var(--x) * var(--pzt)), calc(var(--y) * var(--pzt)), 0) rotate(calc(var(--s) * 90deg)); opacity: 1; }
  100% { transform: translate3d(calc((var(--x) + var(--s) * var(--far)) * var(--pzt)), calc(var(--y) * var(--pzt)), 0) rotate(calc(var(--s) * 90deg)); opacity: .2; } }
@keyframes pzrkv {
  0% { transform: translate3d(calc(var(--x) * var(--pzt)), calc(var(--y) * var(--pzt)), 0) rotate(calc(var(--s) * 90deg + 90deg)); opacity: 1; }
  100% { transform: translate3d(calc(var(--x) * var(--pzt)), calc((var(--y) + var(--s) * var(--far)) * var(--pzt)), 0) rotate(calc(var(--s) * 90deg + 90deg)); opacity: .2; } }
/* TNTの 輪が広がる */
.pz-ring { position: absolute; left: 0; top: 0; width: var(--pzt); height: var(--pzt); z-index: 7; pointer-events: none;
  border-radius: 50%; border: 4px solid rgba(255,230,150,.95); box-sizing: border-box;
  transform: translate3d(calc(var(--x) * var(--pzt)), calc(var(--y) * var(--pzt)), 0);
  animation: pzringx .5s cubic-bezier(.2,.8,.3,1) forwards; }
@keyframes pzringx {
  0% { opacity: 1; transform: translate3d(calc(var(--x) * var(--pzt)), calc(var(--y) * var(--pzt)), 0) scale(.2); }
  100% { opacity: 0; transform: translate3d(calc((var(--x) - (var(--r) - 1) / 2) * var(--pzt)), calc((var(--y) - (var(--r) - 1) / 2) * var(--pzt)), 0) scale(var(--r)); } }
/* プロペラが 飛んでいく */
.pz-fly { position: absolute; left: 0; top: 0; width: var(--pzt); height: var(--pzt); z-index: 9; pointer-events: none;
  display: flex; align-items: center; justify-content: center; font-size: calc(var(--pzt) * .62);
  filter: drop-shadow(0 3px 4px rgba(0,0,0,.35));
  animation: pzfly var(--dur, 260ms) cubic-bezier(.4,.1,.5,1) forwards; }
@keyframes pzfly {
  0% { transform: translate3d(calc(var(--x) * var(--pzt)), calc(var(--y) * var(--pzt)), 0) scale(.7) rotate(0); }
  60% { transform: translate3d(calc((var(--x) + (var(--tx) - var(--x)) * .6) * var(--pzt)), calc((var(--y) + (var(--ty) - var(--y)) * .6) * var(--pzt) - 18px), 0) scale(1.15) rotate(180deg); }
  100% { transform: translate3d(calc(var(--tx) * var(--pzt)), calc(var(--ty) * var(--pzt)), 0) scale(1) rotate(360deg); } }
/* 光の玉：盤ぜんたいが 光る */
.pz-flash { position: absolute; inset: 0; z-index: 6; pointer-events: none; background: #fff; animation: pzflash .4s ease-out forwards; }
@keyframes pzflash { 0% { opacity: .85; } 100% { opacity: 0; } }

/* ---- 盤のまわりを かざる（城の中に見えるように） ---- */
.pz-stage { position: relative; padding: 14px 10px 10px; border-radius: 18px; margin-top: 4px;
  background: linear-gradient(180deg, #7a1f34, #5d1728 60%, #4a1220); box-shadow: inset 0 2px 0 rgba(255,255,255,.15); }
.pz-stage::before { content: ""; position: absolute; inset: 6px; border: 2px solid rgba(255,215,120,.35); border-radius: 14px; pointer-events: none; }
/* 上の表示を りっぱな枠に */
.pz-goal, .pz-moves { background: linear-gradient(180deg,#fff8e6,#f0e0b8); border: 3px solid #c9a227; border-radius: 14px;
  padding: 6px 16px; box-shadow: 0 3px 0 #8a6d14, inset 0 2px 0 rgba(255,255,255,.7); color: #5d3a12; font-weight: 800; }
.pz-goal b, .pz-moves b { color: #b5300f; }
.pz-score-w { background: rgba(255,255,255,.7); border-radius: 12px; padding: 5px 12px; }

/* ---- 仕掛け（草・木箱・石の箱） ---- */
.pz-fl { position: absolute; left: 0; top: 0; width: var(--pzt); height: var(--pzt); z-index: 0; pointer-events: none;
  transform: translate3d(calc(var(--x) * var(--pzt)), calc(var(--y) * var(--pzt)), 0);
  background:
    radial-gradient(circle at 30% 70%, rgba(255,255,255,.35) 0 12%, transparent 13%),
    repeating-linear-gradient(115deg, #4faa46 0 4px, #3d8f38 4px 8px);
  box-shadow: inset 0 0 0 2px rgba(30,80,25,.55), inset 0 -4px 8px rgba(0,0,0,.25); border-radius: 4px; }
.pz-fl.sm { position: static; width: 22px; height: 22px; display: inline-block; vertical-align: -4px; transform: none; }
.pz-bk { position: absolute; left: 0; top: 0; width: var(--pzt); height: var(--pzt); z-index: 3; pointer-events: none;
  transform: translate3d(calc(var(--x) * var(--pzt)), calc(var(--y) * var(--pzt)), 0); border-radius: 8px; }
.pz-bk.box { background:
    linear-gradient(180deg, rgba(255,255,255,.35), rgba(0,0,0,.25)),
    repeating-linear-gradient(90deg, #b0783c 0 8px, #9a6631 8px 10px), #a86f36;
  box-shadow: inset 0 0 0 3px #6d4118, inset 0 -6px 10px rgba(0,0,0,.35), 0 3px 4px rgba(0,0,0,.3); }
.pz-bk.box::after { content: ""; position: absolute; inset: 22% 8%; border: 3px solid rgba(90,50,15,.65); border-radius: 3px; }
.pz-bk.stone { background:
    linear-gradient(180deg, rgba(255,255,255,.4), rgba(0,0,0,.3)),
    repeating-linear-gradient(45deg, #9c9c9c 0 7px, #8a8a8a 7px 14px), #939393;
  box-shadow: inset 0 0 0 3px #5d5d5d, inset 0 -6px 10px rgba(0,0,0,.4), 0 3px 4px rgba(0,0,0,.3); }
.pz-bk.stone.cracked { background:
    linear-gradient(35deg, transparent 46%, rgba(30,30,30,.75) 47% 52%, transparent 53%),
    linear-gradient(180deg, rgba(255,255,255,.3), rgba(0,0,0,.35)),
    repeating-linear-gradient(45deg, #8a8a8a 0 7px, #787878 7px 14px), #7d7d7d; }
.pz-bk.sm { position: static; width: 22px; height: 22px; display: inline-block; vertical-align: -4px; transform: none; }
.pz-mini { display: inline-block; width: 28px; height: 28px; vertical-align: -7px; object-fit: contain; }
.pz-ok { color: var(--ok); font-size: 20px; }

/* ============================================================ パズルの画面づくり（城の広間） */
.pz-top { display: flex; align-items: flex-end; justify-content: center; gap: 12px; margin-bottom: 6px; }
.pz-panel { position: relative; padding-top: 12px; }
.pz-ribbon { position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  background: linear-gradient(180deg,#e8542f,#b8331a); color: #fff; font-size: 11px; font-weight: 800;
  padding: 2px 14px; border-radius: 8px; border: 2px solid #8a2410; white-space: nowrap; z-index: 2;
  box-shadow: 0 2px 0 rgba(0,0,0,.25); }
.pz-panel .pz-goal, .pz-panel .pz-moves { min-width: 118px; text-align: center; padding: 14px 14px 8px; margin: 0; }
.pz-king-wrap { width: 92px; height: 92px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  background: radial-gradient(circle at 50% 30%, #ffe9a8, #d99a2b);
  border: 4px solid #c9a227; box-shadow: 0 4px 0 #8a6d14, inset 0 -6px 12px rgba(0,0,0,.25); }
.pz-king { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; transition: transform .2s; }
.pz-king.worry { animation: pzworry .8s ease-in-out infinite alternate; }
@keyframes pzworry { to { transform: scale(1.06) rotate(-3deg); } }
.pz-scoreline { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 4px; }
.pz-scoreline .ghost { margin-left: auto; }
/* 城の広間（盤のうしろの情景） */
.pz-hall { position: relative; padding: 16px 8px 10px; border-radius: 18px; overflow: hidden;
  background:
    linear-gradient(180deg, rgba(0,0,0,.25), transparent 22%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 3px, transparent 3px 34px),
    linear-gradient(180deg, #8d2a3d 0 14%, #6f1f30 14% 20%, #b9a48a 20% 78%, #8a765d 78% 100%); }
/* 左右の柱 */
.pz-hall::before, .pz-hall::after { content: ""; position: absolute; top: 8%; bottom: 6%; width: 26px; border-radius: 6px;
  background: linear-gradient(90deg, #6f5c45, #e6d7bd 35%, #fffaf0 50%, #d9c8ab 65%, #6f5c45);
  box-shadow: 0 0 0 2px rgba(80,60,35,.4); }
.pz-hall::before { left: 4px; } .pz-hall::after { right: 4px; }
.pz-stage { position: relative; z-index: 1; background: none; box-shadow: none; padding: 0; }
.pz-stage::before { display: none; }
/* 下の道具バー */
.pz-tools { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 12px; flex-wrap: wrap; }
.pz-tool { position: relative; width: 62px; height: 62px; border-radius: 50%; padding: 0;
  background: radial-gradient(circle at 50% 30%, #6fbf63, #2f7d33);
  border: 4px solid #c9a227; box-shadow: 0 4px 0 #8a6d14, inset 0 -6px 10px rgba(0,0,0,.3);
  display: flex; align-items: center; justify-content: center; transition: transform .12s; }
.pz-tool:active { transform: translateY(3px); box-shadow: 0 1px 0 #8a6d14, inset 0 -6px 10px rgba(0,0,0,.3); }
.pz-tool.on { background: radial-gradient(circle at 50% 30%, #ffe08a, #e0a92b); animation: pzToolOn .7s ease-in-out infinite alternate; }
@keyframes pzToolOn { to { transform: scale(1.09); } }
.pz-tool-em { font-size: 30px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.4)); }
.pz-tool-n { position: absolute; right: -6px; bottom: -4px; min-width: 24px; padding: 1px 5px;
  background: linear-gradient(180deg,#e8542f,#b8331a); color: #fff; font-size: 12px; font-weight: 800;
  border: 2px solid #fff; border-radius: 999px; box-shadow: 0 2px 3px rgba(0,0,0,.3); }
.pz-tool-tip { width: 100%; text-align: center; font-size: 13px; color: #8a7560; min-height: 18px; }

/* ============================================================ 祝福とねぎらい（全画面の演出） */
#fxLayer { position: fixed; inset: 0; pointer-events: none; z-index: 9999; overflow: hidden; }
/* 出来事の 絵（宝箱・ひみつの 道・光る 茂み）。白抜きの PNG */
.fx-ico { display: block; width: clamp(110px, 28vw, 170px); height: auto; margin: 0 auto 2px; filter: drop-shadow(0 4px 10px rgba(0,0,0,.35)); }
.fx-ico.pop { animation: evPop .45s cubic-bezier(.2,1.8,.4,1); }
@keyframes evPop { 0% { transform: scale(.8); } 100% { transform: scale(1); } }
.ev-ico { width: 1.9em; height: 1.9em; vertical-align: -0.6em; margin-right: 4px; }
.fx-banner { position: absolute; left: 0; right: 0; top: 26%; text-align: center; animation: fxban 2.2s cubic-bezier(.2,1.6,.4,1) forwards; }
.fx-main { font-size: clamp(32px, 8vw, 64px); font-weight: 900; letter-spacing: 1px;
  -webkit-text-stroke: 8px #3a1f00; paint-order: stroke fill; color: #ffd35b;
  text-shadow: 0 8px 0 rgba(0,0,0,.25); }
.fx-banner.ng .fx-main { color: #ffd9d2; -webkit-text-stroke: 8px #7a2318; }
.fx-sub { margin-top: 6px; font-size: clamp(14px, 3.6vw, 22px); font-weight: 800; color: #fff;
  -webkit-text-stroke: 5px #3a1f00; paint-order: stroke fill; }
.fx-banner.ng .fx-sub { -webkit-text-stroke: 5px #7a2318; }
@keyframes fxban {
  0% { opacity: 0; transform: scale(.4) rotate(-6deg); }
  12% { opacity: 1; transform: scale(1.15) rotate(2deg); }
  22% { transform: scale(1) rotate(0); }
  78% { opacity: 1; transform: scale(1) translateY(0); }
  100% { opacity: 0; transform: scale(.9) translateY(-40px); } }
/* 花火 */
.fx-p { position: absolute; left: var(--x); top: var(--y); width: 9px; height: 9px; border-radius: 50%;
  background: var(--c); box-shadow: 0 0 10px var(--c); animation: fxp 1.2s ease-out forwards; animation-delay: var(--d, 0ms); }
@keyframes fxp { 0% { opacity: 1; transform: translate(0,0) scale(1.2); }
  100% { opacity: 0; transform: translate(var(--dx), calc(var(--dy) + 70px)) scale(.3); } }
/* 紙ふぶき */
.fx-cf { position: absolute; left: var(--x); top: -20px; width: var(--w, 8px); height: calc(var(--w, 8px) * 1.6);
  background: var(--c); animation: fxcf 2.8s linear forwards; animation-delay: var(--d, 0ms); border-radius: 2px; }
@keyframes fxcf { 0% { opacity: 1; transform: translateY(0) rotate(0); }
  100% { opacity: .9; transform: translateY(105vh) rotate(var(--r, 360deg)); } }
/* はじめての説明 */
.tip-back { position: absolute; inset: 0; background: rgba(20,15,10,.62); display: flex; align-items: center; justify-content: center;
  pointer-events: auto; animation: fxfade .2s ease; padding: 16px; }
@keyframes fxfade { from { opacity: 0; } }
.tip-card { background: linear-gradient(180deg,#fffdf6,#f6efdd); border: 4px solid #c9a227; border-radius: 18px;
  padding: 20px 22px; max-width: 460px; box-shadow: 0 10px 30px rgba(0,0,0,.4); animation: fxpop .35s cubic-bezier(.2,1.7,.4,1); }
@keyframes fxpop { from { transform: scale(.7); opacity: 0; } }
.tip-title { font-size: 22px; font-weight: 900; color: var(--navy); text-align: center; margin-bottom: 10px; }
.tip-body { font-size: 15px; line-height: 1.9; color: #4a3a26; }
.tip-body p { margin: 6px 0; }
.tip-demo { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 6px 0 12px; }
.tip-demo .big { position: static; transform: none; width: 56px; height: 56px; display: inline-block; }
.tip-demo .gone { opacity: .18; }
.tip-ar { font-size: 26px; color: var(--bead-hi); }
.tip-ok { display: block; width: 100%; margin-top: 14px; font-size: 17px; padding: 12px; background: var(--ok); }

/* ---- 問題とそろばんを 大きく読みやすく ---- */
#playProblemWrap { min-height: 90px; }
.problem { color: #1e1e1e; }
#playInput, #flashInput { font-size: 30px; font-weight: 800; width: 240px; max-width: 100%; min-width: 0; flex: 1 1 110px; text-align: center; padding: 12px 14px; }   /* 2026-10-12 点検：360幅で「こたえる」が 1文字ずつ 縦に つぶれて いた → 欄が ゆずる・ボタンは 折り返さない */
.answer-row button { font-size: 18px; padding: 12px 24px; white-space: nowrap; flex: 0 0 auto; }
.value-row { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
#playSorobanWrap .sub { font-size: 13px; }
#answerBtn { font-size: 20px; padding: 14px 34px; }

/* ---- 3段階のえらびボタン（BGMの音量など） ---- */
.seg { display: inline-flex; gap: 0; border: 2px solid var(--line); border-radius: 999px; overflow: hidden; margin-left: 8px; vertical-align: middle; }
.seg button { background: #fff; color: #6b5a45; border: none; border-right: 2px solid var(--line); padding: 8px 18px; font-size: 15px; font-weight: 700; }
.seg button:last-child { border-right: none; }
.seg button.on { background: linear-gradient(180deg, var(--navy-hi), var(--navy)); color: #fff; }
/* 2026-10-12 点検：言語の ボタンが 5つに なり 360幅で 横に はみ出して「繁體中文」が 押せなかった → 折り返す */
.lang-seg { display: flex; flex-wrap: wrap; max-width: 100%; border-radius: 14px; margin-left: 0; }
.lang-seg button { flex: 1 1 auto; }
.field { display: block; margin: 10px 0; font-size: 15px; }

/* ---- 上のバーの 音量ボタン（GOLDのとなり） ---- */
.vol-pill { display: inline-flex; align-items: center; gap: 6px; background: var(--card);
  border: 1px solid var(--line); border-radius: 20px; padding: 3px 8px 3px 12px; }
.vol-pill > b { font-size: 15px; line-height: 1; }
.seg.sm { border-width: 1px; margin-left: 0; }
.seg.sm button { padding: 4px 9px; font-size: 12px; border-right-width: 1px; }
@media (max-width: 700px) { .vol-pill > b { font-size: 13px; } .seg.sm button { padding: 4px 7px; font-size: 11px; } }

/* ---- 曲えらび（設定画面） ---- */
.song { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border: 2px solid var(--line);
  border-radius: 12px; margin: 6px 0; background: #fff; }
.song.main { border-color: var(--royal-gold); background: #fffaf0; }
.song-play { width: 38px; height: 38px; padding: 0; border-radius: 50%; font-size: 15px; background: var(--navy); }
.song-n { flex: 1; font-weight: 700; font-size: 15px; color: #2b2b2b; }
.song-n small { color: var(--ok); font-weight: 400; }
.song-badge { font-size: 12px; font-weight: 800; color: #7a5a12; background: #ffe9a8;
  border: 1px solid var(--royal-gold); border-radius: 999px; padding: 3px 12px; }
.song-main { font-size: 12px; padding: 6px 12px; background: transparent; color: var(--frame); border: 1px solid var(--line); }
.song-badge.fixed { background: #e3ecff; border-color: #7ba0e0; color: #24487a; }
.pz-cont { margin-top: 10px; background: linear-gradient(180deg,#e0b84a,#c9a227); color: #3a2a00; }
.song.off { opacity: .5; background: #f2efe8; }
.song.off .song-use { background: var(--accent); color: #fff; border-color: var(--accent); }
.song-use { font-size: 12px; padding: 6px 12px; background: transparent; color: var(--ok); border: 1px solid var(--ok); }
.song-n small.ng { color: var(--accent); }

/* ============================================================ スマホ・iPad 対応
   ・iPhone / iPad の Safari で、指で気持ちよく使えるようにする
   ・ノッチや ホームバーに 文字が隠れないようにする（safe-area）
   ・そろばんの珠は 指でおせる大きさを 最優先にする */

/* --- ノッチ・ホームバーの内側に収める --- */
.sidebar { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
.content { padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right)); padding-bottom: max(18px, env(safe-area-inset-bottom)); }

/* --- 👤 ログイン（おとなの 入口・2026-10-04）。パソコンは ロゴの 下、スマホは ☰ の 左 --- */
.hdr-login { display: block; width: 100%; margin-top: 12px; background: var(--royal-gold, #d4a83a); color: #16305c; font-weight: 800;
  font-size: 14px; padding: 9px 10px; border: none; border-radius: 10px; cursor: pointer; font-family: inherit; white-space: nowrap; }
.hdr-login.hidden { display: none; }
.hdr-choose { display: grid; gap: 8px; margin: 4px 0 2px; }
.hdr-choose .pp-btn { margin-top: 0; max-width: none; width: 100%; box-sizing: border-box; }
.hdr-choose .pp-btn small { display: block; font-weight: 500; font-size: 12px; opacity: .85; }
.hdr-choose .pp-btn.alt { background: #fff; color: var(--navy); border: 2px solid var(--navy); }

/* --- メニューボタン（スマホのときだけ出る） --- */
.nav-toggle { display: none; background: var(--side-hi); color: #fff; font-size: 22px; line-height: 1;
  width: 46px; height: 46px; border-radius: 12px; padding: 0; flex-shrink: 0; }

/* ============================ iPad（たて）・小さめのノートPC ============================ */
@media (max-width: 900px) {
  /* --- メニューは しまっておいて、☰ で開く。
         開いたメニューが 画面より長いときは、メニューの中で なぞって動かせる（下が 見切れない） --- */
  .sidebar { padding: max(8px, env(safe-area-inset-top)) 12px 8px; position: sticky; top: 0; z-index: 60;
    height: auto; max-height: 100vh; max-height: 100dvh; overflow-y: auto; }
  .brand { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 2px 0; }
  .brand-mark { flex-direction: row; gap: 8px; }
  .brand-logo { width: 40px; }
  .brand-name { font-size: 16px; }
  .nav-toggle { display: block; }
  .hdr-login { width: auto; margin: 0 8px 0 auto; padding: 8px 10px; font-size: 13px; flex-shrink: 0; }
  .brand-mark { min-width: 0; }
  .side-nav { display: none; width: 100%; margin-top: 6px; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .side-nav.open { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
  .side-nav.open .nav-sec { display: block; grid-column: 1 / -1; padding: 6px 4px 0; }
  .nav { font-size: 15px; padding: 12px 10px; text-align: center; background: rgba(255,255,255,.08); }   /* 指でおせる高さにする */
  .content { padding: 14px 16px; max-width: none; }
  .topbar h2 { font-size: 19px; }
  .topbar-right { gap: 8px; flex-wrap: wrap; }
}

/* 360px ほどの スマホ：ロゴ・名前・ログイン・☰ が 1行に 入る ように（2026-10-04 測った：16px だと ☰ が はみ出す） */
@media (max-width: 400px) {
  .brand-name { font-size: 14px; letter-spacing: 0; }
  .brand-logo { width: 34px; }
  .hdr-login { padding: 7px 8px; font-size: 12px; margin-right: 6px; }
}

/* ============================ スマホ（iPhone） ============================ */
@media (max-width: 640px) {
  /* --- メニュー（☰ で開く）：せまいので 2列にする --- */
  .sidebar { padding: max(6px, env(safe-area-inset-top)) 10px 8px; }
  .side-nav.open { grid-template-columns: 1fr 1fr; }

  /* --- 本文まわり --- */
  .content { padding: 12px max(12px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
  .card { padding: 13px; border-radius: 12px; margin-bottom: 12px; }
  .topbar { margin-bottom: 10px; gap: 6px; align-items: center; }
  .topbar h2 { font-size: 17px; flex-shrink: 0; width: 100%; }
  .topbar-right { gap: 6px; }
  /* 名前と顔は ホーム画面にも出ているので、せまい画面では 上のバーから外す */
  .avatar-mini { display: none; }
  #examInfoBtn { font-size: 12px; padding: 6px 10px; }
  .pill { font-size: 12px; padding: 6px 10px; }

  /* --- 入力欄は 16px 以上にする（これ未満だと iPhone が 勝手に拡大する） --- */
  input, select, textarea { font-size: 16px !important; }

  /* --- 級・段えらび --- */
  .grade-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .grade-cell { padding: 14px 2px; font-size: 15px; }
  .grade-grid { row-gap: 14px; }
  .grade-cell.g-kyu-a, .grade-cell.g-kyu-b, .grade-cell.g-dan { padding: 0 4px; font-size: 15px; }
  .chip { padding: 9px 13px; font-size: 13px; }
  #startBtn { width: 100%; font-size: 19px; padding: 15px 0; }

  /* --- そろばん：珠の大きさを 指に合わせる。横にはみ出す分は なぞって動かす --- */
  :root { --bh: 27px; --cw: 40px; }
  .soroban { border-width: 7px; padding: 9px 7px; margin: 10px 0; border-radius: 4px;
    justify-content: flex-start; max-width: none; width: auto;
    -webkit-overflow-scrolling: touch; }
  .soroban-value { font-size: 26px; }
  .value-row { gap: 8px; }

  /* --- 問題 --- */
  .play-hud { font-size: 15px; gap: 6px; }
  .marks { font-size: 19px; letter-spacing: 2px; }
  .mark { font-size: 92px; }
  .btn-row button, .answer-row button { padding: 12px 18px; font-size: 16px; }
  #answerBtn, #battleAnswerBtn { font-size: 18px; padding: 13px 26px; }

  /* --- フラッシュ暗算 --- */
  .flash-display { font-size: 56px; height: 108px; }
  .signal .lamp { width: 28px; height: 28px; }

  /* --- パズル：盤を 画面いっぱいまで 大きくする（外わく・カードの余白ぶんを ひく） --- */
  .pz-board { --pzt: min(56px, calc((100vw - 60px) / 8)); border-width: 3px; }
  /* 王国の見出し：名前と GOLD が かさならないように 折り返す */
  .kingdom-head { flex-wrap: wrap; gap: 8px; row-gap: 6px; }
  .kd-title { font-size: 17px; }
  .gold-badge { font-size: 14px; padding: 6px 12px; white-space: nowrap; }
  .gold-badge .ico-coin { height: 22px; vertical-align: -6px; }
  .pz-goal, .pz-moves { font-size: 15px; }
  .pz-goal b, .pz-moves b { font-size: 19px; }
  .pz-item { padding: 7px 9px; gap: 7px; }
  .pz-em { font-size: 22px; }

  /* --- たいせん --- */
  .fighter img { width: 62px; }
  .hpbar { width: 108px; }

  /* --- 記録の表：はみ出す分は 横になぞる --- */
  .rec-table { display: block; overflow-x: auto; white-space: nowrap; }

  /* --- ネコの吹き出し・お祝いの文字 --- */
  .tip-card { padding: 16px 14px; }
  .fx-main { -webkit-text-stroke-width: 6px; }
}

/* ============================ さらに小さい端末（iPhone SE など） ============================ */
@media (max-width: 380px) {
  :root { --bh: 24px; --cw: 36px; }
  .grade-grid { grid-template-columns: repeat(3, 1fr); }
  .flash-display { font-size: 46px; height: 92px; }
}

/* ============================ スマホを 横にしたとき ============================
   横向きは そろばんが 全部見えるので いちばん練習しやすい。
   そのぶん 縦が短いので 上下の余白と 文字を つめる */
@media (max-height: 480px) and (orientation: landscape) {
  .sidebar { position: static; }
  .content { padding-top: 8px; }
  .topbar { margin-bottom: 6px; }
  :root { --bh: 20px; --cw: 32px; }
  .soroban { margin: 6px auto; padding: 6px 6px; border-width: 6px; }
  .flash-display { font-size: 52px; height: 76px; }
  .play-hud { margin-bottom: 6px; }
  .pz-board { --pzt: min(48px, calc((100vh - 190px) / 8)); }
}

/* ============================ 指で操作するとき ============================ */
@media (hover: none) {
  .bead:hover { filter: none; }                    /* 指では ホバーが 残ってしまうので 消す */
  .nav:hover { background: transparent; }
  .nav.active:hover { background: var(--gold); }
  /* 珠・パズルの玉は 長おしで 文字が選ばれたり メニューが出ないようにする */
  .bead, .pz-t, .pz-board, .col, .soroban { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
}

/* ============================================================ 練習中・たいせん中の スマホ画面
   スマホは 縦がせまい。問題を見ながら 珠を動かせないと そろばんにならないので、
   ・上のロゴや設定ボタンは いったん しまう
   ・そろばんは 画面の下に すえつける（＝いつでも 指がとどく）
   ・「こたえる」も そろばんと同じ場所に置く */
@media (max-width: 900px) {
  body.playing .sidebar { display: none; }
}
/* 横向きのスマホにも 同じことをする（縦がせまいのは 同じなので） */
@media (max-width: 640px), (max-height: 520px) and (orientation: landscape) {
  body.playing .topbar { display: none; }
  body.playing .content { padding-top: max(8px, env(safe-area-inset-top)); padding-bottom: 8px; }
  /* 下にすえつけた そろばんの ぶんだけ すきまを空ける。そうしないと ボタンが かくれる */
  body.playing .card { margin-bottom: 0; padding-bottom: calc(var(--soroPad, 300px) + var(--bridgePad, 0px) + var(--hudPad, 0px) + 8px); }
  /* 🌉 クエストの絵（正解するたびに かわる）は そろばんと 帯の あいだに すえつける（下から：帯 → 絵 → そろばん） */
  body.playing #storyBridge {
    position: fixed; left: 0; right: 0; bottom: calc(var(--hudPad, 0px) + var(--kbd, 0px)); z-index: 40; margin: 0;
    border-radius: 0; border-left: 0; border-right: 0; border-bottom: 0;
  }
  body.playing #storyBridge { height: auto; }
  body.playing #storyBridge .qscene { height: var(--qsceneH, 48px); }
  /* 2026-10-05 ユーザー「携帯で 絵に 回答欄が 毎回 隠れる」：数字を 打つ あいだ（キーボードが 出る）は 絵を しまう。
     測ると 390×844 で キーボードの 上に 持ち上がった 絵（322〜501）が 答えの 欄（308〜378）に かぶって いた */
  body.playing.typing #storyBridge { display: none !important; }
  /* 🐱 ネコの 説明（あんざん）は スマホでは しまう（2026-09-25・ユーザー指示。クエストの 絵に 場所を まわす） */
  body.playing #anzanTip { display: none; }
  body.playing #stepsRow { margin-top: 4px; }
  body.playing #stepsRow button { font-size: 13px; padding: 7px 12px; }
  /* 帯（もどる・級・時計・のこり）は 画面の いちばん下に すえつける。そろばんは その上に のる。
     --kbd は iPhone で キーボードが 出ているとき、その高さぶん 上に ずらす（app.js の updateKbd） */
  body.playing .play-hud {
    position: fixed; left: 0; right: 0; bottom: var(--kbd, 0px); z-index: 41; margin: 0;
    background: var(--card); border-top: 2px solid var(--navy);
    padding: 4px max(8px, env(safe-area-inset-right)) max(4px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  }

  body.playing #playSorobanWrap, body.playing #battleSorobanWrap {
    position: fixed; left: 0; right: 0; bottom: calc(var(--hudPad, 0px) + var(--bridgePad, 0px)); z-index: 40;
    background: var(--card); border-top: 3px solid var(--navy);
    box-shadow: 0 -4px 16px rgba(0,0,0,.22);
    padding: 3px max(4px, env(safe-area-inset-right)) max(3px, env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-left));
    display: grid; grid-template-columns: 1fr auto; grid-template-areas: "s s" "v b";
    align-items: center; column-gap: 8px;
  }
  body.playing #playSorobanWrap > .sub, body.playing #battleSorobanWrap > .sub { display: none; }
  body.playing #playSorobanWrap > .soroban, body.playing #battleSorobanWrap > .soroban { grid-area: s; margin: 2px 0; border-width: 5px; padding: 6px 5px; }
  body.playing #playSorobanWrap > .value-row, body.playing #battleSorobanWrap > .value-row { grid-area: v; margin: 0; justify-content: flex-start; gap: 6px; }
  body.playing #playSorobanWrap > .btn-row, body.playing #battleSorobanWrap > .btn-row { grid-area: b; margin: 0; }
  body.playing .soroban-value { font-size: 22px; }
  body.playing #answerBtn, body.playing #battleAnswerBtn { padding: 11px 18px; font-size: 17px; }
  body.playing #clearSoroban2, body.playing #clearSoroban3 { padding: 7px 10px; font-size: 13px; }
  /* 答えが正しいか出す ◎× は 問題の上に かぶせる */
  body.playing .mark { font-size: 84px; }
  /* フラッシュ暗算：スクロールなしで 最初の画面に おさめる。
     ネコの説明は しまう（成績が その下に かくれて 見えなくなるため）。設定の行は 詰める */
  body.playing.flashmode .card { padding-bottom: calc(var(--hudPad, 0px) + 8px); }
  body.playing.flashmode #anzanTip { display: none; }
  body.playing.flashmode #flashInfo { margin: 0 0 2px; font-size: 12px; }
  body.playing.flashmode .toggle { margin-bottom: 2px; font-size: 13px; }
  body.playing.flashmode .flash-custom { margin: 2px auto 4px; padding: 3px 10px; }
  body.playing.flashmode .flash-custom summary { font-size: 13px; }
  body.playing.flashmode .flash-display.btn { height: 74px; font-size: 26px; margin: 4px auto; }
  body.playing.flashmode #flashMeasure { font-size: 11px; }
}

/* 横向きスマホで 練習しているとき：そろばんの右に「こたえる」を置いて 下の帯を うすくする。
   （上の まとめて書いた指定より あとに置く。CSSは あとに書いたほうが 勝つため） */
@media (max-height: 520px) and (orientation: landscape) {
  body.playing #playSorobanWrap, body.playing #battleSorobanWrap {
    grid-template-columns: auto 1fr; grid-template-areas: "s v" "s b"; column-gap: 12px; align-items: center;
  }
  body.playing #playSorobanWrap > .soroban, body.playing #battleSorobanWrap > .soroban { margin: 0; border-width: 4px; padding: 4px; }
  body.playing #playSorobanWrap > .value-row, body.playing #battleSorobanWrap > .value-row { align-self: end; }
  body.playing #playSorobanWrap > .btn-row, body.playing #battleSorobanWrap > .btn-row { align-self: start; justify-content: flex-start; margin-top: 6px; }
  body.playing #answerBtn, body.playing #battleAnswerBtn { padding: 8px 14px; font-size: 15px; }
  body.playing .soroban-value { font-size: 18px; }
}

/* 縦がみじかい画面（ノートPC・iPadの横向き）では、練習中だけ 上のバーを しまう。
   そのぶん 問題の字を 大きくできる（「もどる」ボタンは 中に残っているので 出られる） */
@media (min-width: 901px) and (max-height: 900px) {
  body.playing .topbar { display: none; }
  body.playing .sidebar { display: none; }   /* 練習中は メニューも しまう（「← もどる」で出られる） */
  body.playing .content { max-width: none; }
}

/* ============================================================ 横長の画面（iPadの横向き・ノートPC・パソコン）
   問題を たてに ならべると そろばんの場所が なくなって、字がどんどん小さくなる。
   紙の問題を 左に置いて、右に そろばんを置く ＝ 本物と同じ ならべ方にする。
   2026-09-22：縦が 長い パソコン（1080px など）でも 同じに した（縦に 並べると クエストの絵が 帯の うしろに 見切れて スクロールが 要った）。
   右に あまる 場所は 使わず、カードは まん中に 置く */
@media (min-width: 1000px) {
  body.playing .content { max-width: 1500px; margin: 0 auto; }
  /* 2026-09-22：クエストの絵は そろばんの すぐ下（右の 列）に、あいている 高さ いっぱいで 出す（細い 帯では 何の絵か 分からなかった）。
     高さは app.js の fitBridge が はかって --bridgeH に 入れる。2行目を 1fr に して、問題が 長くても そろばんと 絵の あいだが あかない ように */
  body.playing #view-play > .card {
    display: grid; grid-template-columns: minmax(260px, 1fr) minmax(0, max-content);
    grid-template-rows: auto auto 1fr auto;
    grid-template-areas: "band band" "prob soro" "prob bridge" "steps .";   /* band＝しゅもくの 札（問題3）。横いっぱいの 1行目 */
    column-gap: 22px; align-items: start;
  }
  body.playing #playProblemWrap { grid-area: prob; }
  body.playing #modeBand { grid-area: band; }
  body.playing #storyBridge { grid-area: bridge; align-self: start; margin-top: 8px; min-width: 480px; height: var(--bridgeH, 64px); }
  body.playing #storyBridge .qscene img { object-position: center 50%; }
  body.playing #storyBridge .q-title { font-size: 14px; left: 8px; top: 8px; padding: 3px 12px; }
  body.playing #storyBridge .bridge-say { font-size: 14px; left: 8px; right: 8px; bottom: 8px; gap: 8px; }
  body.playing #storyBridge .bridge-say .bridge-txt { padding: 4px 12px; white-space: normal; }
  body.playing #storyBridge .bridge-pic { width: 44px; height: 44px; } body.playing #storyBridge .bridge-pic i { font-size: 32px; }
  body.playing #playSorobanWrap { grid-area: soro; align-self: start; min-width: 0; }
  body.playing #playSorobanWrap > .soroban { max-width: 100%; }
  body.playing #stepsRow { grid-area: steps; align-self: start; }
  /* 休憩・一時停止・答え・コツ などは 横いっぱいに置く */
  body.playing #playPause, body.playing #playRest, body.playing #playInputWrap,
  body.playing #playFlashWrap, body.playing #steps, body.playing #anzanTip,
  body.playing #playResult { grid-column: 1 / -1; }
}

/* ============================================================ 練習中の 帯（もどる・級・時計・のこり）を 画面の下へ
   問題の上に あると 問題が 下に 押されて、答えの欄が 画面の下に 見切れる。
   パソコン・タブレットでは 帯を 画面の下に すえつけ、問題を いちばん上から 出す。
   帯の高さぶんの すきま（--hudPad）は app.js の fitSoroPad が はかって 入れる。
   （スマホは そろばんが 下に すえつけてあるので、帯は 上のまま＝上の指定のとおり） */
@media (min-width: 641px) {
  body.playing .sidebar { display: none; }   /* 練習中は メニューも しまう（帯の「← もどる」で 出られる） */
  body.playing .play-hud {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; margin: 0;
    background: var(--card); border-top: 3px solid var(--navy);
    box-shadow: 0 -4px 16px rgba(0,0,0,.18);
    padding: 8px max(14px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  }
  body.playing #view-play > .card { margin-bottom: 0; padding-bottom: calc(var(--hudPad, 60px) + 14px); }
}
/* 横向きのスマホ（幅が 641px より 広いもの）は そろばんも 下に すえつけているので、そろばんの高さも 足す */
@media (min-width: 641px) and (max-height: 520px) and (orientation: landscape) {
  body.playing .play-hud { bottom: var(--kbd, 0px); border-top-width: 2px; box-shadow: none; padding: 3px max(8px, env(safe-area-inset-right)) max(3px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); }
  body.playing #view-play > .card { padding-bottom: calc(var(--soroPad, 300px) + var(--bridgePad, 0px) + var(--hudPad, 0px) + 8px); }
}

/* ============================================================ れんしゅう中の 音ボタン
   上のバーを しまっていても、ここから 効果音・BGM を 切れるようにする */
.snd-mini { display: inline-flex; gap: 6px; }
.snd-mini.center { display: flex; justify-content: center; margin: 8px 0; }
.snd-btn { display: inline-flex; align-items: center; gap: 3px; background: var(--card); color: #2b2b2b;
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 11px; font-size: 15px; line-height: 1; }
.snd-btn i { font-style: normal; font-size: 12px; font-weight: 800; color: var(--navy); }
.snd-btn.off { background: #efe9dd; color: #9a8d78; }
.snd-btn.off i { color: var(--accent); }

/* ============================================================ 記録：やった記録・ランキング */
.acc-hi { color: var(--ok); font-weight: 700; }
.acc-lo { color: var(--accent); font-weight: 700; }
.rec-miss { color: var(--accent); font-weight: 700; }
.rank-now { font-size: 18px; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.rank-now b { font-size: 26px; color: var(--accent); }
.rank-pt { font-size: 14px; color: #8a7560; font-weight: normal; margin-left: 8px; }
.rank-cheer { font-size: 14px; color: #b5651d; margin-bottom: 10px; }
.rank-h { font-size: 15px; color: var(--navy); margin: 16px 0 6px; }
.rec-table tr.rank-me { background: #fff7e0; }
.rec-table tr.rank-me td { font-weight: 700; }
.rk { display: inline-block; min-width: 26px; padding: 2px 8px; border-radius: 8px; font-weight: 800; color: #fff; }
.rk-S { background: linear-gradient(180deg,#ffd76a,#d99a2b); color: #4a3400; }
.rk-A { background: #d9534f; } .rk-B { background: #4a90d9; } .rk-C { background: #8a8071; }
#recFilter { margin-bottom: 10px; }
@media (max-width: 640px) {
  #recLog .rec-table, #recRank .rec-table { font-size: 12px; }
  #recLog .rec-table th, #recLog .rec-table td { padding: 5px 6px; }
  .rank-now { font-size: 16px; } .rank-now b { font-size: 22px; }
}

/* ============================================================ スマホで かくかくしないように
   iPhone は 「影をぼかす」「大きなものを 塗りなおす」のが とても苦手。
   動かすものは 別のレイヤーに のせて、影は かるいものに 置きかえる。 */
@media (hover: none) {
  /* 玉の絵に かけていた drop-shadow は 64個ぶん 毎コマ 計算されるので やめる */
  .pz-img { filter: none; }
  .pz-t { contain: layout style paint; }
  /* 下にすえつけた そろばんは 別レイヤーに のせる（スクロールのたびに 塗り直さない） */
  body.playing #playSorobanWrap, body.playing #battleSorobanWrap {
    transform: translateZ(0); will-change: transform; contain: paint;
  }
  /* 上のバーも 同じ（sticky は 塗り直しが おきやすい） */
  .sidebar, body.playing .play-hud { transform: translateZ(0); }
  /* 影の重ねがけを へらす */
  .pz-board { box-shadow: inset 0 4px 10px rgba(0,0,0,.28), 0 4px 10px rgba(0,0,0,.18), 0 0 0 3px #8a6d14; }
  .card { box-shadow: none; }
  .bead { will-change: transform; }
}
/* 動きを へらす設定にしている人には アニメを出さない（酔い・端末の負担どちらにも効く） */
@media (prefers-reduced-motion: reduce) {
  .pz-t, .bead, .hpfill { transition: none !important; }
  .pz-t.sel, .fx-banner, .fx-p, .fx-cf { animation: none !important; }
}

/* 練習中の帯（画面の下）：もどる・級・時計・一時停止・進み具合・音ボタン が 1行に入りきらないので、
   スマホでは 字を小さくして 折り返し、たてに つぶれないようにする */
@media (max-width: 640px) {
  /* 帯は 1行に おさめる（2行だと 80px も 取り、問題の 数字が 見切れる原因になる・2026-09-18）。
     級／しゅもくが 長いときは その部分だけ「…」で 切る。一時停止は app.js が ⏸ だけにする */
  .play-hud { flex-wrap: nowrap; gap: 5px; font-size: 12px; justify-content: flex-start; align-items: center; }
  .play-hud > * { flex: 0 0 auto; }
  #quitBtn { padding: 6px 8px; font-size: 12px; white-space: nowrap; }
  #playGrade { white-space: nowrap; font-size: 12px; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  #pauseBtn { padding: 6px 7px; font-size: 13px; white-space: nowrap; }
  #playTimer, #playProgress { white-space: nowrap; font-size: 12px; }
  .play-hud .snd-mini { margin-left: 0; }
  .snd-btn { padding: 5px 7px; font-size: 12px; }
}
/* 縦が短い スマホ（Safari の バーを 引くと 660px ほど）：そろばんの 珠を 少し小さくして 問題に 場所を 返す */
@media (max-width: 640px) and (max-height: 760px) {
  :root { --bh: 25px; --cw: 38px; }
  body.playing #playSorobanWrap > .soroban { padding: 4px 4px; border-width: 4px; margin: 1px 0; }
  body.playing #answerBtn { padding: 9px 14px; font-size: 16px; }
}

/* ============================================================ 説明用の そろばんの絵・はじめての案内 */
.sb-svg { display: inline-block; vertical-align: middle; max-width: 100%; height: auto; }
.sb-pair { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 6px 0 2px; flex-wrap: wrap; }
.sb-ar { font-size: 26px; color: var(--bead-hi); font-weight: 800; }
.sb-step { margin: 8px 0 12px; }
.sb-cap { text-align: center; font-size: 14px; color: #4a3a26; margin-top: 2px; }
.sb-cap b { color: var(--accent); }
.ls-key { background: #fff6e0; border: 2px solid var(--royal-gold); border-radius: 10px; padding: 6px 12px; text-align: center; font-size: 16px; margin: 8px 0; }
.ls-tbl { border-collapse: collapse; margin: 8px auto; font-size: 15px; }
.ls-tbl th, .ls-tbl td { border: 1px solid #d8cfb8; padding: 4px 10px; text-align: center; white-space: nowrap; }
.ls-tbl th { background: #fff6e0; }
.tip-steps { margin: 6px 0 8px; margin-inline-start: 22px; line-height: 1.9; }   /* 右から 左でも 番号が 切れない（2026-10-13） */
.tip-steps li { margin-bottom: 2px; }
.tip-card { max-height: 92vh; overflow-y: auto; }
#lessonBody details { margin-bottom: 8px; }
/* 2026-10-06 きまり 1行 ＋ なぜ の 絵 ＋ もっと くわしく */
.ls-rule { display: flex; align-items: center; gap: 8px; background: #fff6e0; border: 2px solid var(--royal-gold); border-radius: 12px; padding: 8px 12px; font-size: 16px; font-weight: 700; line-height: 1.5; margin: 6px 0 8px; }
.ls-rule .say-btn { flex: none; }
.ls-more { margin: 6px 0 0; } .ls-more > summary { font-size: 14px; color: #6b5a3a; cursor: pointer; } .ls-more[open] > summary { margin-bottom: 4px; }
.ls-whyq { margin: 8px 0 4px; font-weight: 800; color: var(--navy); } .ls-whya { margin: 6px 0 0; font-weight: 700; background: #eef7ee; border-radius: 10px; padding: 6px 10px; }
.ls-why { display: flex; align-items: center; justify-content: center; gap: 4px; flex-wrap: wrap; }
.ls-why-1 { display: flex; flex-direction: column; align-items: center; max-width: 150px; font-size: 13px; line-height: 1.4; text-align: center; }
.ls-why-1 .sb-svg { width: auto; height: 96px; }
@media (max-width: 640px) {   /* スマホ：なぜ の 3枚を 横 1列に */
  .ls-why { gap: 2px; flex-wrap: nowrap; }
  .ls-why-1 { max-width: 96px; font-size: 11.5px; line-height: 1.3; }
  .ls-why-1 .sb-svg { height: 76px; }
  .ls-why .sb-ar { font-size: 14px; margin: 0; }
  .ls-rule { font-size: 15px; padding: 7px 10px; }
}
#lessonBody summary { font-size: 16px; }
#lessonBody .lesson-body { font-size: 15px; }
#lessonBody .lesson-body ul { padding-inline-start: 20px; line-height: 1.9; }
@media (max-width: 640px) { .tip-card { padding: 16px 12px; } .sb-svg { width: 84px; } }

/* まちがえた問題の解説：問題の式が 長いとき（5級の10口など）、スマホで 横にはみ出さないように 折り返す */
.ex-card, .ex-head, .ex-diag, .ex-fix, .tb-side { overflow-wrap: anywhere; word-break: break-word; min-width: 0; max-width: 100%; }
.ex-head .ex-q { white-space: normal; font-size: clamp(14px, 4.2vw, 20px); }
.miss-report, .steps, .result { overflow-wrap: anywhere; }

/* ============================================================ 道具のプレゼント・級の解きかたボタン・パズルの つかい方 */
.drop-box { margin: 10px auto; max-width: 420px; background: linear-gradient(180deg,#fff7e0,#ffe9b3); border: 2px solid var(--royal-gold);
  border-radius: 14px; padding: 10px 14px; font-size: 16px; color: #5a4310; animation: goldPop .45s ease; }
.drop-box small { display: block; font-size: 12px; color: #8a7560; margin-top: 2px; }
.lesson-btn { font-size: 13px; padding: 6px 12px; margin-left: 6px; vertical-align: middle; }
.pz-howto { text-align: start; margin: -2px 0 8px; line-height: 1.8; }
@media (max-width: 640px) { .lesson-btn { display: block; margin: 8px auto 0; } }

/* ============================================================ アバターの絵（hero_1〜6）と ばいきんの敵 */
.av-img { display: block; object-fit: contain; object-position: center top; }
.avatar-mini .av-img { width: 30px; height: 40px; border-radius: 8px; }
.avatar-big .av-img { width: 52px; height: 74px; border-radius: 10px; }
.hero-avatar .av-img { width: 60px; height: 64px; border-radius: 12px; }
.avatar-picker button .av-img { width: 44px; height: 70px; border-radius: 8px; }
.avatar-picker button { padding: 4px 6px; }
.fighter img { width: 92px; height: 130px; object-fit: contain; object-position: center bottom; }
@media (max-width: 900px) { .fighter img { width: 72px; height: 104px; } }
@media (max-width: 640px) { .fighter img { width: 62px; height: 92px; } }

/* 絵の背景が 四角いので、カードのように 角を丸める */
.fighter img { border-radius: 14px; }

/* ============================================================ はやさメーター（ホーム） */
.speed-box { background: linear-gradient(180deg,#fff8e4,#ffefc4); color: #3a2a00; border-radius: 14px; padding: 12px 16px; margin-bottom: 12px; border: 2px solid var(--royal-gold); }
.sp-h { font-size: 14px; font-weight: 800; color: #7a5a12; letter-spacing: 1px; margin-bottom: 4px; }
.sp-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sp-big { font-size: 18px; font-weight: 700; }
.sp-big b { font-size: 38px; color: var(--navy); font-variant-numeric: tabular-nums; }
.sp-big small { font-size: 14px; margin-left: 2px; }
.spark { width: 220px; max-width: 100%; height: 44px; }
.sp-cmp { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 14px; margin-top: 4px; }
.sp-up { color: var(--ok); font-weight: 700; } .sp-dn { color: #b5651d; } .sp-eq { color: #8a7560; }
.sp-best { color: #7a5a12; font-weight: 700; }
.today-flow { margin-top: 6px; font-size: 14px; line-height: 1.8; color: #2b2b2b; }

/* ============================================================ 合格証 */
#certLayer { position: fixed; inset: 0; z-index: 10000; background: rgba(20,15,10,.7); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 16px; overflow: auto; }
.cert { background: #fffdf5; color: #2b2b2b; width: min(560px, 100%); border: 10px double var(--royal-gold); border-radius: 6px; padding: 26px 24px; text-align: center;
  box-shadow: 0 14px 40px rgba(0,0,0,.4); font-family: "Hiragino Mincho ProN", "Yu Mincho", serif; }
.cert-top { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 8px; }
.cert-crown { height: 44px; }
.cert-title { font-size: 34px; font-weight: 900; letter-spacing: 12px; color: var(--navy); }
.cert-name { font-size: 28px; font-weight: 800; margin: 14px 0 6px; border-bottom: 2px solid #2b2b2b; display: inline-block; padding: 0 18px 4px; }
.cert-name small { font-size: 16px; margin-left: 8px; }
.cert-body { font-size: 16px; line-height: 2; margin: 10px 0; }
.cert-body b { font-size: 22px; color: var(--accent); }
.cert-date { font-size: 14px; color: #555; margin-top: 6px; }
.cert-king { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 10px; font-size: 13px; }
.cert-king img { height: 56px; }
.cert-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.cert-list { display: flex; flex-wrap: wrap; gap: 8px; }
.cert-chip { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; background: #fff8e4; color: #2b2b2b; border: 2px solid var(--royal-gold); border-radius: 12px; padding: 8px 14px; font-weight: 800; }
.cert-chip small { font-weight: 400; font-size: 11px; color: #8a7560; }
@media (max-width: 640px) { .cert { padding: 18px 12px; } .cert-title { font-size: 26px; letter-spacing: 8px; } .cert-name { font-size: 22px; } }
/* 🎉 先行 100家庭（H-4） */
.fd-offer { margin: 8px 0; padding: 8px 12px; border-radius: 10px; background: #fff1ec; border: 2px solid #c8553d; color: #5a2518; font-size: 14px; line-height: 1.7; }
.fd-offer b { color: #a8412d; }
/* ============================================================ 📄 月の 成長レポート（H-5） */
#reportLayer { position: fixed; inset: 0; z-index: 10000; background: rgba(20,15,10,.7); display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 12px; padding: 16px; overflow: auto; }
.rp-tools { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: center; color: #fff; }
.rp-tools .seg { margin: 0; }
.rp-name { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.rp-name input { font-size: 15px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); width: 150px; }
.report { background: #fff; color: #2b2b2b; width: min(720px, 100%); border-radius: 8px; padding: 22px 24px; box-shadow: 0 14px 40px rgba(0,0,0,.4); }
.rp-head { display: flex; align-items: center; gap: 12px; border-bottom: 3px solid var(--navy); padding-bottom: 8px; margin-bottom: 12px; }
.rp-head img { height: 44px; }
.rp-title { font-size: 21px; font-weight: 900; color: var(--navy); }
.rp-sub { font-size: 13px; color: #666; }
.report .pgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.report h4 { margin: 14px 0 6px; color: var(--navy); font-size: 15px; border-inline-start: 4px solid var(--royal-gold); padding-inline-start: 8px; }
.report .psub small { color: #888; margin-left: 6px; font-size: 11px; }
.rp-king { display: flex; align-items: center; gap: 10px; margin-top: 12px; background: #fff8e4; border: 1px solid var(--royal-gold); border-radius: 12px; padding: 8px 12px; font-size: 14px; }
.rp-king img { height: 48px; }
.rp-miss { margin: 0; padding-inline-start: 20px; font-size: 14px; line-height: 1.9; }
.rp-foot { margin-top: 12px; padding-top: 6px; border-top: 1px solid #ccc; font-size: 11px; color: #777; text-align: right; }
.rp-new { font-size: 12px; }
#reportLayer .cert { box-shadow: none; }
@media (max-width: 640px) { .report { padding: 14px 12px; } .report .pgrid { grid-template-columns: repeat(2, 1fr); } }
@media print {
  body.print-report * { visibility: hidden !important; }
  body.print-report #reportLayer, body.print-report #reportLayer .rp-page, body.print-report #reportLayer .rp-page * { visibility: visible !important; }
  body.print-report > *:not(#reportLayer) { display: none !important; }
  body.print-report { background: #fff !important; padding: 0 !important; margin: 0 !important; min-height: 0 !important; }
  body.print-report #reportLayer { position: static; inset: auto; display: block; background: none; padding: 0; overflow: visible; }
  body.print-report .rp-tools, body.print-report .cert-btns { display: none !important; }
  body.print-report .report { box-shadow: none; width: 100%; max-width: 180mm; margin: 0 auto; padding: 0; }
  body.print-report .rp-page { break-after: page; page-break-after: always; }
  body.print-report .rp-page:last-of-type { break-after: auto; page-break-after: auto; }
  body.print-report .rp-cert-page { display: flex; justify-content: center; padding-top: 30mm; }
  body.print-report .cert { width: 100%; max-width: 180mm; }
}
/* 印刷は 合格証だけ */
@media print {
  body.print-cert * { visibility: hidden !important; }
  body.print-cert #certLayer, body.print-cert #certLayer .cert, body.print-cert #certLayer .cert * { visibility: visible !important; }
  /* ほかの 画面は 場所ごと 消す（visibility だけだと 見えない 画面が 場所を 取り、合格証が 2枚目・3枚目に またがった・2026-09-25） */
  body.print-cert > *:not(#certLayer) { display: none !important; }
  body.print-cert { background: #fff !important; padding: 0 !important; margin: 0 !important; min-height: 0 !important; }
  body.print-cert #certLayer { position: static; inset: auto; display: block; background: none; padding: 0; overflow: visible; }
  body.print-cert .cert { box-shadow: none; width: 100%; max-width: 180mm; margin: 0 auto; break-inside: avoid; page-break-inside: avoid; }
  .cert-btns { display: none !important; }
}

/* ============================================================ 🖨 きょうの プリント（自主学習ノート用・2026-10-20）
   画面では 紙の 見本、印刷では A4 横に A5 2枚（まん中に 切り取り線）。幅は mm で 決めて、スマホでも 紙と 同じ 形で 出す */
#hwLayer { position: fixed; inset: 0; z-index: 10000; background: rgba(20,15,10,.93); display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 10px; padding: 16px; overflow: auto; }
body.hw-open > *:not(#hwLayer):not(#fxLayer) { visibility: hidden; }   /* 裏の 画面が 透けて 見えた（合成レイヤーが 上に 出る）ので、開いて いる 間は 全部 かくす */
.hw-note { color: #fff; font-size: 13px; text-align: center; max-width: 560px; line-height: 1.6; }
.hw-note.hw-miss { color: #ffd36b; font-weight: 700; }
.hw-none { background: #fff; border-radius: 14px; padding: 18px 20px; font-size: 15px; max-width: 420px; line-height: 1.8; }
.hw-tools .seg button.on { background: var(--navy); color: #fff; }
#hwOut { width: 100%; max-width: 100%; overflow-x: auto; display: flex; flex-direction: column; align-items: center; gap: 12px; -webkit-overflow-scrolling: touch; }
.hw-page { background: #fff; color: #000; width: 281mm; height: 194mm; box-sizing: border-box; display: flex; flex-shrink: 0; box-shadow: 0 2px 12px rgba(0,0,0,.25); font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Yu Gothic", sans-serif; }
.hw-a5 { width: 50%; height: 100%; box-sizing: border-box; padding: 6mm 7mm; overflow: hidden; font-size: 11pt; line-height: 1.35; }
.hw-cut { width: 0; border-left: 1px dashed #999; height: 100%; }
.hw-empty { background: repeating-linear-gradient(135deg, #fff 0 8px, #f3f3f3 8px 9px); }
.hw-wide .hw-cut { border-left-color: transparent; border-top-color: transparent; }   /* A4 1枚の 2段組み（量が 多い 日）は 切らないので 線を 出さない */
.hw-wide .hw-empty { background: none; }
/* 紙の 上：エンブレム（ChatGPT の 盾）＋ 紺の 題 ＋ 金の 線 ＋ 数の 札 */
.hw-head { display: flex; align-items: center; gap: 4mm; padding-bottom: 2.5mm; margin-bottom: 3mm; border-bottom: 1.2mm double #16305c; }
.hw-emblem { width: 31mm; height: auto; flex-shrink: 0; display: block; }
.hw-hbody { flex: 1; min-width: 0; }
.hw-title { font-size: 16pt; font-weight: 800; color: #16305c; letter-spacing: .06em; line-height: 1.2; padding-bottom: 1mm; border-bottom: .6mm solid #c9a227; }
.hw-meta { display: flex; gap: 5mm; flex-wrap: wrap; align-items: baseline; font-size: 10.5pt; margin-top: 1.5mm; }
.hw-grade { font-weight: 800; color: #16305c; border: .4mm solid #16305c; border-radius: 1.5mm; padding: 0 2mm; }
.hw-stats { display: flex; gap: 2mm; margin-top: 2mm; }
.hw-stats span { flex: 1; text-align: center; border: .5mm solid #c9a227; border-radius: 2mm; background: #fff8e1; padding: .8mm 0; }
.hw-stats i { display: block; font-style: normal; font-size: 8pt; color: #6b5a1e; }
.hw-stats b { font-size: 14pt; color: #16305c; line-height: 1.1; }
.hw-cont { display: flex; align-items: center; gap: 2mm; font-size: 9pt; color: #555; border-bottom: .6mm solid #c9a227; margin-bottom: 2mm; padding-bottom: 1mm; }
.hw-cont img { width: 7mm; height: auto; }
/* 画面の ボタン：上の「🏠 ホームに もどる」と 日づけ・ホームの「🖨 きょうの プリント」 */
.hw-top { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; }
.hw-top .seg { margin: 0; }
.hw-home { background: #fff; color: var(--navy); border: 2px solid #c9a227; font-weight: 800; white-space: nowrap; }
/* 2026-10-23 ユーザー「印刷する ボタンが 見にくい」→ 暗い 背景でも 目立つ 金色・大きく */
#hwPrint { background: linear-gradient(180deg, #ffe27a, #e0b331); color: #2a1d05; border: 2px solid #fff3c4; font-size: 20px; font-weight: 900; padding: 14px 34px; border-radius: 14px; box-shadow: 0 4px 0 #9c7712, 0 0 18px rgba(255, 214, 90, .45); white-space: nowrap; }
#hwPrint:hover { filter: brightness(1.06); }
#hwPrint:active { transform: translateY(2px); box-shadow: 0 2px 0 #9c7712; }
.home-print { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 8px; background: #fff; color: var(--navy); border: 2px solid #c9a227; border-radius: 999px; font-weight: 800; font-size: 15px; padding: 9px 14px; }
.home-print.hidden { display: none; }
/* 🧭 何級から はじめる？（2026-11-05）：ホームの 小さな 入口 と 窓の 中の 4つの 道 */
.home-nav { display: block; width: 100%; margin-top: 8px; background: transparent; color: #163f96; border: none; font-weight: 800; font-size: 15px; padding: 6px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.gn-doors { display: grid; gap: 8px; margin-top: 4px; }
.gn-door { display: block; width: 100%; text-align: left; font-size: 16px; font-weight: 800; padding: 12px 14px; border-radius: 14px; background: #fff; color: var(--navy); border: 3px solid #d9c27a; cursor: pointer; }
.gn-door small { display: block; font-size: 13px; font-weight: 700; color: #7a5a12; margin-top: 2px; }
.gn-door.gn-main { background: linear-gradient(180deg, #ffe58a, #f2b632); border-color: #b8860b; }
.gn-note { font-size: 13px; color: #6b4a1a; margin: 8px 0 0; }
.home-print-sub { text-align: center; color: #8a7560; font-size: 12px; font-weight: 600; margin: 4px 0 0; }
.home-print-sub.hidden { display: none; }
.home-print b { background: #16305c; color: #fff; border-radius: 999px; padding: 1px 9px; font-size: 13px; }
.hw-sec { font-size: 10.5pt; font-weight: 800; border-left: 3px solid #000; padding-left: 2mm; margin: 2.5mm 0 1.5mm; }
.hw-sec.hw-fix { border-left-color: #d0342c; }
.hw-vrow { display: flex; gap: 2mm; margin-bottom: 2mm; }
.hw-vc { flex: 0 0 calc((100% - 8mm) / 5); min-width: 0; box-sizing: border-box; border-right: 1px dotted #bbb; padding: 0 1.5mm; text-align: right; font-variant-numeric: tabular-nums; }
.hw-vc:last-child { border-right: none; }
.hw-no { font-size: 8pt; color: #666; text-align: left; }
.hw-nl { font-size: 11pt; line-height: 1.3; white-space: nowrap; }
.hw-sum { border-top: 1.5px solid #000; margin-top: 1mm; }
.hw-ans { font-size: 11.5pt; font-weight: 700; white-space: nowrap; display: flex; justify-content: flex-end; align-items: center; gap: 1mm; }
.hw-ansline { height: 7mm; }
.hw-right { font-size: 8.5pt; color: #d0342c; white-space: nowrap; }
.hw-mk { font-weight: 800; font-size: 13pt; line-height: 1; }
.hw-mk.ok { color: #d0342c; }
.hw-mk.ng { color: #d0342c; }
.hw-lrow { display: flex; gap: 4mm; }
.hw-lr { flex: 1; min-width: 0; display: flex; align-items: center; gap: 1.5mm; border-bottom: 1px dotted #ccc; padding: 1mm 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hw-lr .hw-no { width: 5mm; text-align: right; }
.hw-q { font-size: 11pt; }
.hw-u { font-size: 11.5pt; font-weight: 700; }
.hw-blank { flex: 1; min-width: 14mm; border-bottom: 1px solid #666; height: 5mm; }
.hw-flash { font-size: 11pt; padding-left: 3mm; }
.hw-rest { font-size: 10.5pt; padding: .5mm 0 1.5mm 3mm; color: #333; }
.hw-adv { margin-top: 2mm; font-size: 10pt; line-height: 1.6; }
.hw-adv .hw-sec { margin-top: 2mm; }
.hw-sign { display: flex; align-items: flex-end; gap: 3mm; margin-top: 3mm; font-size: 9pt; color: #333; }
.hw-sign i { flex: 1; max-width: 45mm; border-bottom: 1px solid #333; height: 6mm; }
.hw-url { margin-left: auto; color: #777; font-size: 8pt; }
.hw-btn { white-space: nowrap; }
@media screen and (max-width: 699px) {
  #hwLayer { padding: 10px 6px; }
  #hwOut { align-items: center; overflow-x: hidden; }
  /* スマホは A5 を 縦に 2枚（切り取り線は 横線）。幅は homework.js が zoom で 合わせる */
  .hw-page { flex-direction: column; width: 140.5mm; height: auto; }
  .hw-a5 { width: 100%; height: 194mm; }
  .hw-cut { width: 100%; height: 0; border-left: none; border-top: 1px dashed #999; }
  .hw-empty { display: none; }
}
@media print {
  body.print-hw * { visibility: hidden !important; }
  body.print-hw #hwLayer, body.print-hw #hwOut, body.print-hw #hwOut * { visibility: visible !important; }
  body.print-hw > *:not(#hwLayer) { display: none !important; }
  body.print-hw { background: #fff !important; padding: 0 !important; margin: 0 !important; min-height: 0 !important; }
  body.print-hw #hwLayer { position: static; inset: auto; display: block; background: none; padding: 0; overflow: visible; }
  body.print-hw .hw-top, body.print-hw .hw-note, body.print-hw .cert-btns { display: none !important; }
  body.print-hw #hwOut { display: block; overflow: visible; zoom: 1 !important; }   /* スマホの 画面用の 縮小を 紙に 持ちこまない（2026-10-30 紙の 2/3 に 小さく 出て いた） */
  body.print-hw .hw-page { box-shadow: none; width: 100%; height: 190mm; margin: 0; break-after: page; page-break-after: always; break-inside: avoid; }
  body.print-hw .hw-page:last-child { break-after: auto; page-break-after: auto; }
  body.print-hw .hw-mk, body.print-hw .hw-right, body.print-hw .hw-empty, body.print-hw .hw-stats span, body.print-hw .hw-head, body.print-hw .hw-title { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* 合格証の「とじる」は 暗い背景の上なので 白くする */
.cert-btns .ghost { color: #fff; border-color: rgba(255,255,255,.7); }

/* ============================================================ 運指（ゆびの つかいかた） */
.un-lead { font-size: 15px; line-height: 1.9; }
.un-rule { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #faf7f0; border: 2px solid var(--line);
  border-radius: 12px; padding: 8px 12px; margin: 8px 0; font-size: 14px; line-height: 1.7; }
.un-tag { display: inline-block; color: #fff; font-weight: 800; font-size: 13px; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.un-svg { display: inline-block; vertical-align: middle; height: auto; max-width: 100%; }
.un-pair { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.un-ar { font-size: 28px; color: var(--bead-hi); font-weight: 800; }
.un-step { margin: 12px 0 16px; }
.un-tags { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 6px; }
.un-both { display: inline-block; background: var(--royal-gold); color: #3a2a00; font-weight: 800; font-size: 13px; padding: 3px 10px; border-radius: 999px; }
.un-cap { text-align: center; font-size: 14px; color: #4a3a26; margin-top: 4px; line-height: 1.7; }
.un-cap b { color: var(--accent); }
.un-h { font-weight: 800; color: var(--navy); font-size: 15px; margin: 18px 0 4px; border-top: 2px solid var(--line); padding-top: 10px; }
.un-list { margin: 6px 0 0 20px; line-height: 1.9; font-size: 14px; }
.un-note { background: #fff6e0; border-left: 5px solid var(--royal-gold); border-radius: 8px; padding: 8px 12px; font-size: 14px; line-height: 1.8; margin: 10px 0; }
@media (max-width: 640px) { .un-ar { font-size: 22px; } .un-cap { font-size: 13px; } }
.un-rule .un-txt { flex: 1 1 180px; min-width: 0; }

.un-pair .un-svg { flex: 0 1 auto; max-width: 44%; }
.un-no { font-weight: 900; color: var(--navy); font-size: 18px; }
.un-why { background: #f7f9fd; border: 2px solid #cbd8ea; border-radius: 10px; padding: 8px 12px; font-size: 13px; line-height: 1.9; margin: 8px auto 0; max-width: 560px; text-align: start; }
.un-why b { color: var(--accent); }
.un-ex { font-weight: 800; color: var(--navy); font-size: 15px; margin: 14px 0 2px; }
.un-ex b { font-size: 19px; color: var(--accent); }

/* 「そろばんの きほん」から、くわしい解説ページへの ご案内 */
.lesson-links { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px;
  background: #fff8e4; border: 2px solid var(--royal-gold); border-radius: 12px; padding: 12px 14px; }
.lesson-links b { color: var(--navy); width: 100%; margin-bottom: 2px; }
.lesson-links a { color: var(--navy); font-weight: 700; text-decoration: none; background: var(--card);
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font-size: 14px; }

/* ============================================================ 印刷プリント（宿題用紙）
   画面では 紙に 見えるように、印刷では この用紙だけが 出るように する。 */
#sheetOut { margin-top: 4px; }
.sh-page { background: #fff; color: #000; border: 1px solid var(--line); border-radius: 8px;
  padding: 20px 22px 14px; margin-bottom: 16px; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.sh-head { border-bottom: 3px solid #000; padding-bottom: 8px; margin-bottom: 14px; }
.sh-title { font-size: 20px; font-weight: 800; }
.sh-title small { font-size: 13px; font-weight: 400; margin-left: 8px; color: #555; }
.sh-fields { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; font-size: 13px; }
.sh-fields span { display: flex; align-items: flex-end; gap: 6px; }
.sh-fields i { display: block; width: 92px; border-bottom: 1px solid #666; height: 15px; }

/* みとり算・あんざん：たてに 数字を ならべる（検定の用紙と 同じ形） */
.sh-mt { width: 100%; border-collapse: collapse; margin-bottom: 16px; table-layout: fixed; }
.sh-mt th { font-size: 12px; font-weight: 700; border-bottom: 1px solid #000; padding: 2px 0; }
.sh-mt td { vertical-align: top; padding: 8px 6px 0; border-right: 1px dotted #bbb; }
.sh-mt td:last-child { border-right: none; }
.sh-n { text-align: right; font-size: 15px; line-height: 1.7; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sh-ans { border-top: 2px solid #000; margin-top: 6px; height: 34px; }

/* かけ算・わり算：1問1行 */
.sh-cols { display: flex; gap: 26px; }
.sh-col { flex: 1; }
.sh-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px dotted #ccc; }
.sh-no { width: 22px; font-size: 12px; color: #555; text-align: right; }
.sh-q { font-size: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sh-blank { flex: 1; min-width: 70px; border-bottom: 1px solid #666; height: 18px; margin-left: 6px; }

/* こたえの紙 */
.sh-akey { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; margin-bottom: 14px; font-size: 14px; }
.sh-akey > b { width: 100%; font-size: 15px; }
.sh-akey-i { font-variant-numeric: tabular-nums; }
.sh-akey-i b { font-size: 16px; }
.sh-foot { margin-top: 12px; padding-top: 6px; border-top: 1px solid #ccc; font-size: 10px; color: #777; text-align: right; }

@media (max-width: 640px) {
  .sh-page { padding: 14px 12px 10px; }
  .sh-title { font-size: 17px; }
  .sh-n { font-size: 13px; }
  .sh-cols { flex-direction: column; gap: 0; }
}

/* 印刷するときは この用紙だけ。1枚ずつ 改ページ */
@media print {
  @page { margin: 12mm; }
  body.print-sheet * { visibility: hidden !important; }
  body.print-sheet #sheetOut, body.print-sheet #sheetOut * { visibility: visible !important; }
  body.print-sheet #sheetOut { position: absolute; left: 0; top: 0; width: 100%; margin: 0; }
  body.print-sheet .sh-page { border: none; border-radius: 0; box-shadow: none; margin: 0; padding: 0;
    break-after: page; page-break-after: always; }
  body.print-sheet .sh-page:last-child { break-after: auto; page-break-after: auto; }
  body.print-sheet .sh-n { font-size: 14px; }
}

/* ============================================================ SK検定 */
/* 形式の ボタン（G-5）：押した ものが 紺 */
.ex-presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 4px; }
.ex-presets .pill.on { background: linear-gradient(180deg, var(--navy-hi), var(--navy)); color: #fff; border-color: var(--navy); font-weight: 800; }
.ex-preset-note { margin-top: 2px; }
.ex-table td.ok { color: #1f8a4c; font-weight: 800; white-space: nowrap; }
.ex-table td.ng { color: #c0392b; font-weight: 800; white-space: nowrap; }
.ex-table small { color: #777; font-weight: 400; }
.ex-result-h { font-size: 20px; margin: 6px 0 10px; }
.ex-sec { margin-top: 12px; padding-top: 8px; border-top: 1px dashed var(--line); }
#exGo:disabled { opacity: .5; cursor: not-allowed; }

/* ============================================================ 教室に参加 */
.join-row { display: flex; gap: 8px; align-items: center; margin: 10px 0; flex-wrap: wrap; }
#joinCode { flex: 1; min-width: 160px; font-size: 28px; font-weight: 800; letter-spacing: .22em; text-align: center;
  padding: 10px 12px; border: 2px solid var(--line); border-radius: 12px; font-family: inherit; text-transform: uppercase; }
#joinCode:focus { border-color: var(--royal-gold); outline: none; }
.join-names { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.join-name { font-size: 17px; font-weight: 800; padding: 12px 20px; border-radius: 999px;
  border: 2px solid var(--line); background: #fff; color: var(--navy); cursor: pointer; font-family: inherit; }
.join-name:hover { border-color: var(--royal-gold); background: #fff8e4; }
.join-on { background: linear-gradient(180deg, #fff8e4, #ffefc4); border: 3px solid var(--royal-gold);
  border-radius: 14px; padding: 14px 16px; }
.join-on-h { font-size: 19px; font-weight: 900; color: var(--navy); margin-bottom: 6px; }

/* 教室に参加：先生の 入口 */
.teacher-box { border: 2px solid var(--royal-gold); }
.btn-link { display: inline-block; text-decoration: none; background: var(--navy); color: #fff; font-weight: 800;
  padding: 10px 18px; border-radius: 12px; }
.btn-link.ghost { background: #fff; color: var(--navy); border: 2px solid var(--line); }

/* ---- 🐣 ソロモン（ホームの カード・図鑑・物語） ---- */
.solo-card { background: linear-gradient(180deg, #fffaf0, #fff3d6); border: 2px solid var(--royal-gold); padding: 12px 14px; }
.solo-top { display: flex; align-items: center; gap: 10px; }
.solo-top b { font-size: 17px; color: var(--navy); display: block; }
.solo-top small { color: #6b5a45; font-weight: 700; font-size: 12px; }
.solo-pic { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; flex-shrink: 0; }
.solo-pic img { width: 100%; height: 100%; object-fit: contain; }
.solo-pic i { display: none; font-style: normal; font-size: 44px; line-height: 1; }
.solo-pic.nopic img { display: none; } .solo-pic.nopic i { display: block; }
.solo-speech { background: #fff; border-radius: 12px; padding: 8px 12px; margin: 8px 0; font-weight: 700; color: #2b2b2b; font-size: 14px; }
.solo-row { display: flex; justify-content: space-between; align-items: center; font-size: 14px; color: #6b5a45; }
.solo-row b { color: #b8860b; letter-spacing: 2px; font-size: 16px; }
.solo-row.big { justify-content: center; gap: 12px; font-size: 16px; } .solo-row.big b { font-size: 22px; }
.solo-next { font-size: 13px; color: var(--navy); font-weight: 700; margin: 4px 0 8px; }
.solo-valley { background: #f1ede4; border: 2px dashed #b9ad95; border-radius: 10px; padding: 8px 10px; margin: 0 0 8px; font-size: 13px; font-weight: 700; color: #6b5a45; }
.solo-valley b { color: var(--accent); font-size: 16px; }
.solo-valley.open { background: #e7f5ec; border: 2px solid #1f8a4c; color: #1f8a4c; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.solo-valley .hw-go { font-size: 14px; padding: 6px 12px; }
.solo-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.solo-main { text-align: center; }
.solo-main .solo-pic { width: 180px; height: 180px; } .solo-main .solo-pic i { font-size: 120px; }
.solo-main h4 { margin: 12px 0 4px; color: var(--navy); }
.solo-lvname { font-size: 20px; font-weight: 900; color: var(--navy); margin: 6px 0 2px; }
.solo-quote { font-size: 15px; color: #4a3a26; margin-bottom: 10px; }
.solo-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 6px; }
.solo-stats div { background: #fffaf0; border: 1px solid var(--line); border-radius: 10px; padding: 8px 4px; }
.solo-stats b { display: block; font-size: 20px; color: var(--navy); } .solo-stats span { font-size: 12px; color: #6b5a45; }
.solo-skill { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px dashed var(--line); font-size: 14px; text-align: start; }
.solo-skill b { color: #b8860b; letter-spacing: 2px; margin-left: auto; } .solo-skill small { color: #999; width: 44px; text-align: right; }
.solo-cond { background: #fff8e4; border-left: 4px solid var(--royal-gold); padding: 8px 12px; border-radius: 6px; text-align: start; font-size: 14px; margin-top: 10px; line-height: 1.7; }
.solo-ep { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; margin: 6px 0; background: #fff; }
.solo-ep.locked { opacity: .55; } .solo-ep b { flex: 1; color: var(--navy); font-size: 14px; }
.solo-ep button { font-size: 13px; padding: 6px 12px; } .solo-ep small { color: #777; white-space: nowrap; }
.story-card { text-align: center; max-width: 480px; position: relative; }
.story-quit { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; border-radius: 50%; border: 2px solid #cfc3a8; background: #fff; color: #6b5a45; font-size: 18px; font-weight: 800; line-height: 1; padding: 0; cursor: pointer; z-index: 2; box-shadow: 0 2px 4px rgba(0,0,0,.15); }
.story-quit:hover { background: #fff3d6; }
.story-h { font-size: 14px; font-weight: 800; color: #b8860b; margin-bottom: 6px; }
/* 場面：絵が あれば それを 出す。無ければ 空・草原・お城の 世界の 上に ソロモン（切り抜きだけに ならないように） */
.story-scene { position: relative; width: 100%; aspect-ratio: 3 / 2; border-radius: 14px; overflow: hidden; border: 3px solid #c9a227;
  background: linear-gradient(180deg, #8fd0ff 0%, #d9efff 52%, #a9dd6a 52%, #6fbf45 100%); }
.story-scene::before { content: ""; position: absolute; left: -10%; right: -10%; bottom: -30%; height: 60%; border-radius: 50%;
  background: radial-gradient(ellipse at center, #8fd35a, #63b43c 70%); }
.story-scene::after { content: "🏰"; position: absolute; right: 8%; top: 24%; font-size: 44px; opacity: .9; filter: drop-shadow(0 2px 2px rgba(0,0,0,.2)); }
.story-scene-img { position: relative; z-index: 2; width: 100%; height: 100%; object-fit: contain; display: block; background: #2b2b2b; }   /* 字や 吹き出しが 切れないよう 全体を 見せる */
.story-scene.noscene .story-scene-img { display: none; }
.story-scene .story-pic { display: none; }
.story-scene.noscene .story-pic { display: inline-flex; position: absolute; left: 50%; bottom: 4%; transform: translateX(-50%); z-index: 3; }
.story-pic { width: 160px; height: 160px; margin: 0 auto; animation: soloPop .5s ease; } .story-pic i { font-size: 110px; }
@keyframes soloPop { 0% { transform: scale(.85) translateY(6px); opacity: .4; } 60% { transform: scale(1.05); } 100% { transform: none; opacity: 1; } }
.story-who { font-weight: 900; color: var(--navy); margin-top: 6px; min-height: 1.2em; }
.story-text { font-size: 17px; line-height: 1.8; color: #2b2b2b; min-height: 3.6em; margin: 4px 0; }
.story-skip { font-size: 12px; color: #999; margin-top: 6px; }
.story-skip-btn { display: block; margin: 8px auto 0; background: transparent; color: #8a7a5c; border: 1px solid #cfc3a8; border-radius: 999px; padding: 6px 14px; font-size: 13px; }
/* 🌉 クエスト：そろばん・答えの欄の 下の 場面（2026-09-18 に 問題の上から 移した）。before の上に after が 左から あらわれる（正解の ぶんだけ） */
/* 帯は 細く（問題の 文字を 小さく しないため）。ことばと ソロモンは 帯の 中に 重ねる */
.story-bridge { position: relative; border: 2px solid #c9a227; border-radius: 12px; padding: 0; margin: 6px 0 0; text-align: center; overflow: hidden; background: #fff; height: 64px; }
.qscene { position: relative; width: 100%; height: 100%; background: linear-gradient(180deg, #8fd0ff, #d9efff); overflow: hidden; }
.qscene img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 58%; display: block; }
.qscene .q-after { transition: clip-path .7s ease; }
.qscene.noimg img { display: none; }
.q-title { position: absolute; left: 6px; top: 5px; background: rgba(22,48,92,.82); color: #fff; font-weight: 800; font-size: 12px; padding: 2px 9px; border-radius: 999px; line-height: 1.4; }
.bridge-say { position: absolute; left: 6px; right: 6px; bottom: 4px; display: flex; align-items: center; justify-content: flex-start; gap: 6px; font-size: 12px; font-weight: 800; color: var(--navy); padding: 0 8px 0 2px; min-height: 0; line-height: 1.3; text-align: start; }
.bridge-say .bridge-txt { background: rgba(255,253,247,.92); border-radius: 999px; padding: 2px 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bridge-say .bridge-txt:empty { display: none; }
.bridge-pic { width: 30px; height: 30px; animation: soloPop .4s ease; filter: drop-shadow(0 1px 1px rgba(0,0,0,.35)); } .bridge-pic i { font-size: 22px; }
/* スマホ：絵は 細い帯（48px）にして、ことばは 絵の 上に 重ねる（絵の下に 出すと 帯が 126px になり 問題が 見切れる・2026-09-18）。
   ことばは 1行で「…」。見出し（船の名前 0/10）は 左上、ことばは 左下 */
@media (max-width: 640px) {
  .story-bridge .qscene { height: var(--qsceneH, 48px); }
  /* 絵が 大きい とき（90px 以上）：見出し・ことば・ソロモンも 大きく */
  .story-bridge.big .q-title { font-size: 13px; top: 6px; left: 6px; padding: 2px 9px; }
  .story-bridge.big .bridge-say { font-size: 13px; bottom: 6px; left: 6px; right: 6px; gap: 6px; }
  .story-bridge.big .bridge-say .bridge-txt { padding: 3px 10px; white-space: normal; }
  .story-bridge.big .bridge-pic { width: 36px; height: 36px; } .story-bridge.big .bridge-pic i { font-size: 26px; }
  .q-title { font-size: 11px; left: 4px; top: 3px; padding: 1px 7px; }
  .bridge-say { left: 4px; right: 4px; bottom: 2px; font-size: 11px; gap: 4px; padding: 0 4px 0 0; }
  .bridge-say .bridge-txt { padding: 1px 7px; }
  .bridge-pic { width: 22px; height: 22px; } .bridge-pic i { font-size: 16px; }
}
.quest-done { margin: 8px 0; padding: 8px 12px; background: #e7f5ec; border: 2px solid #1f8a4c; border-radius: 10px; font-weight: 800; color: #1f8a4c; }
.solo-toast { position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); background: #fffaf0; border: 3px solid var(--royal-gold);
  border-radius: 999px; padding: 10px 18px; font-weight: 800; color: var(--navy); z-index: 9500; box-shadow: 0 6px 18px rgba(0,0,0,.2); max-width: calc(100% - 24px); text-align: center; font-size: 14px; }
@media (max-width: 900px) { .solo-layout { grid-template-columns: 1fr; } }

/* ---- 🏆 ランキング ---- */
.rank-setup { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; background: #fffdf7; border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; font-size: 14px; }
.rank-setup-t { flex: 1 0 100%; }
.rank-setup label { display: inline-flex; align-items: center; gap: 6px; }
.rank-setup select, .rank-setup input { font-size: 15px; padding: 6px 8px; border: 2px solid var(--line); border-radius: 8px; background: #fff; }
.rank-setup input { width: 200px; max-width: 100%; }
/* 保護者の 画面の ランキングの 同意（2026-10-06） */
#ppRank label { display: inline-flex; align-items: center; gap: 6px; margin: 4px 10px 4px 0; }
#ppRank select, #ppRank input[type="text"], #ppRank input:not([type]) { font-size: 15px; padding: 6px 8px; border: 2px solid var(--line); border-radius: 8px; background: #fff; max-width: 100%; }
#ppRank .pp-consent, #ppHome .pp-consent { display: flex; align-items: flex-start; gap: 8px; margin: 12px 0 4px; padding: 10px 12px; border: 2px solid var(--line); border-radius: 10px; background: #fffaf0; font-weight: 700; line-height: 1.5; }
#ppRank .pp-consent input, #ppHome .pp-consent input { width: 22px; height: 22px; flex: 0 0 auto; margin-top: 1px; }
/* 🔒 の 案内の 中の「わたしは この 子の 保護者です」（登録なしの お試し・2026-10-25） */
.lock-btn .lock-consent { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 10px; padding: 10px 12px; border: 2px solid var(--line); border-radius: 10px; background: #fffaf0; font-weight: 700; line-height: 1.5; text-align: start; }
.lock-btn .lock-consent input { width: 22px; height: 22px; flex: 0 0 auto; margin-top: 1px; }
.lock-btn .pp-btn[disabled] { opacity: .5; cursor: not-allowed; }
#ppRank button[disabled], #ppHome button[disabled] { opacity: .45; cursor: not-allowed; }
/* 記録を ぜんぶ 消す（2026-10-06） */
#ppErase .pp-warn { width: 100%; margin: 0 0 6px; font-weight: 800; color: #b3261e; text-align: center; }
#ppErase button.danger { background: linear-gradient(180deg, #ef5350, #c62828); color: #fff; border: none; box-shadow: 0 4px 0 #8e1c1c; font-weight: 800; padding: 10px 22px; border-radius: 12px; cursor: pointer; }
.rank-tabs { display: flex; gap: 6px; margin: 8px 0; flex-wrap: wrap; }
.rank-tabs button { background: #fff; color: var(--navy); border: 2px solid var(--line); border-radius: 999px; padding: 6px 14px; font-weight: 700; }
.rank-tabs button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.rank-me { margin: 6px 0; font-weight: 800; color: var(--navy); }
.rank-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid #eee5d0; font-size: 15px; }
.rank-row.me { background: #fff4d6; border-radius: 8px; font-weight: 800; }
.rank-no { width: 2.6em; text-align: right; font-weight: 800; color: var(--frame); white-space: nowrap; }
.rank-no.top { font-size: 22px; }
.rank-flag { font-size: 20px; }
.rank-nick { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-nick small { color: #7a6a50; font-weight: 400; margin-left: 6px; font-size: 12px; }
.rank-val { font-weight: 800; color: var(--navy); white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .rank-row { font-size: 14px; gap: 6px; padding: 7px 4px; } .rank-nick small { display: block; margin-left: 0; } }

/* ---- 先生からの 宿題（ホーム・教室に参加） ---- */
.hw-box { background: linear-gradient(180deg, #fff8e4, #ffefc4); border: 3px solid var(--royal-gold); border-radius: 14px; padding: 12px 14px; margin: 10px 0; }
.hw-h { font-size: 18px; font-weight: 900; color: var(--navy); margin-bottom: 6px; }
.hw-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #fff; border-radius: 10px; padding: 9px 12px; margin: 6px 0; }
.hw-row.ok { background: #e7f5ec; }
.hw-t { flex: 1; min-width: 150px; font-size: 15px; } .hw-t b { font-size: 17px; color: var(--navy); } .hw-t small { color: #666; }
.hw-p { font-weight: 800; color: var(--navy); white-space: nowrap; } .hw-row.ok .hw-p { color: #1f8a4c; }
.hw-late { color: var(--accent); font-weight: 800; }
.hw-go { font-size: 16px; font-weight: 800; padding: 9px 16px; border-radius: 10px; background: var(--navy); color: #fff; border: none; }
.hw-sub { font-size: 12px; color: #6b5a45; margin-top: 4px; }
/* 🙋 先生よんで（2026-11-06） */
.ask-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.ask-btn { font-size: 16px; font-weight: 800; padding: 9px 16px; border-radius: 999px; background: #ff9f1c; color: #2b1d00; border: 2px solid #e08a00; cursor: pointer; }
.ask-btn:disabled { background: #e7f5ec; color: #1f8a4c; border-color: #bfe3cc; cursor: default; }
.ask-sub { font-size: 12px; color: #6b5a45; flex: 1; min-width: 160px; }
.ask-call { background: #2d8cf0; color: #fff; border-color: #1b6fc9; text-decoration: none; display: inline-block; }
/* 🖥 Zoom の 授業（2026-11-09）：ホームの 札。時間に なると「Zoom に 入る」 */
.zm-box { background: linear-gradient(180deg, #eef6ff, #dcecff); border-color: #2d8cf0; }
.zm-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.zm-when { font-size: 15px; color: #1d2a44; flex: 1; min-width: 160px; } .zm-when b { color: var(--navy); } .zm-left { color: #1d4e89; font-weight: 800; }
.zm-join { display: inline-block; font-size: 18px; font-weight: 800; padding: 12px 22px; border-radius: 999px; background: #1f8a4c; color: #fff; text-decoration: none; border: 2px solid #166b3a; animation: callPulse 1.6s ease-in-out infinite; }
.zm-wait { font-size: 13px; color: #6b5a45; }
/* 📞 先生と Zoom（2026-11-07）：よんで いる あいだ・出た・出なかった */
.call-box { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: #eef6ff; border: 2px solid #6ea8e8; }
.call-wait { font-size: 15px; font-weight: 800; color: #1d4e89; animation: callPulse 1.6s ease-in-out infinite; }
@keyframes callPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
.call-ok { font-size: 17px; font-weight: 800; color: #1f8a4c; }
.call-miss { font-size: 14px; color: #7a4a00; }
.call-join { background: #1f8a4c; color: #fff; border-color: #166b3a; font-size: 18px; padding: 12px 22px; text-decoration: none; display: inline-block; }
.call-stop { background: #fff; color: #555; border-color: #ccc; font-size: 14px; padding: 6px 14px; }
.call-banner { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 60; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2); }
.ask-box { background: linear-gradient(180deg, #eef6ff, #dcecff); border-color: #6ea8e8; }
.ask-card { background: #fff; border-radius: 10px; padding: 10px 12px; margin: 6px 0; }
.ask-q { font-size: 13px; color: #555; } .ask-q b { color: var(--navy); }
.ask-reply { font-size: 17px; line-height: 1.6; margin: 6px 0; color: #1d2a44; overflow-wrap: anywhere; }
.ask-act { text-align: right; }
.ask-thumb { font-size: 16px; font-weight: 800; padding: 8px 16px; border-radius: 999px; background: var(--navy); color: #fff; border: none; }
.ask-wait { font-size: 13px; color: #3a5a8a; margin-top: 4px; }

/* ---- はじめて開いたときの「音楽を 流しますか？」（画面の下に 出る） ---- */
.bgm-ask { position: fixed; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: min(520px, calc(100% - 24px)); background: #fffaf0; border: 3px solid var(--royal-gold); border-radius: 16px;
  padding: 14px 16px; box-shadow: 0 8px 24px rgba(0,0,0,.25); z-index: 9000; text-align: center; }
.bgm-ask-t { font-size: 18px; font-weight: 900; color: var(--navy); }
.bgm-ask-s { font-size: 13px; color: #6b5a45; margin: 6px 0 10px; }
.bgm-ask-b { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.bgm-ask-b button { font-size: 16px; font-weight: 800; padding: 11px 18px; border-radius: 12px; border: none; background: var(--navy); color: #fff; }
.bgm-ask-b button.ghost { background: #fff; color: var(--navy); border: 2px solid var(--line); }

/* ============================================================ 脱・文字依存（フェーズA-3）
   文字が まだ 読めない子でも わかるよう、主な ボタンは 大きな 絵（▶ ✓ 🔊）が 主役で、文字は そえもの。
   説明の 文には 🔊 が つき、押すと 読み上げる（ブラウザ内蔵） */
.ic-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.ic-btn .ic { font-size: 1.6em; line-height: 1; }
.ic-btn .ic-lb { font-size: .9em; }
#startBtn.ic-btn { padding: 10px 30px; }
#startBtn.ic-btn .ic { font-size: 30px; }
.big-cta.ic-btn .ic { font-size: 32px; }
/* 2026-10-04 ユーザー：練習画面の「はじめる」を 緑の 宝石の 枠の 絵に。絵の 文字は 消して あり、文字（英語でも）は 上に のせる */
#startBtn.ic-btn { display: flex; width: min(100%, 400px); aspect-ratio: 753 / 207; margin: 14px auto 4px; padding: 0 0 2px; gap: 14px; border: 0; border-radius: 0; background: url(assets/grade/btn_start.webp) center / 100% 100% no-repeat; color: #fffbea; font-size: 38px; font-weight: 900; letter-spacing: .06em; text-shadow: 0 1px 0 #c9921f, 0 3px 0 #8a5a0c, 0 0 2px #8a5a0c, 0 5px 8px rgba(0,40,0,.45); filter: drop-shadow(0 4px 6px rgba(40,60,0,.25)); transition: transform .12s, filter .12s; }
#startBtn.ic-btn .ic { font-size: 46px; transform: scaleX(.9); }
#startBtn.ic-btn .ic-lb { font-size: 1em; }
#startBtn.ic-btn:hover { transform: translateY(-2px); filter: drop-shadow(0 6px 10px rgba(40,60,0,.3)) brightness(1.06); }
#startBtn.ic-btn:active { transform: translateY(1px) scale(.98); }
@media (max-width: 700px) { #startBtn.ic-btn { font-size: 33px; padding: 0 0 2px; } #startBtn.ic-btn .ic { font-size: 40px; } }
.say-btn { background: #fff; color: var(--navy); border: 2px solid var(--line); border-radius: 999px; width: 34px; height: 34px; padding: 0; font-size: 17px; line-height: 1; vertical-align: middle; margin-left: 6px; cursor: pointer; flex: 0 0 auto; }
.say-btn:hover { background: #fff7dd; }
.say-btn.say-inline { width: 30px; height: 30px; font-size: 15px; }
.say-btn.say-big { width: 44px; height: 44px; font-size: 22px; }
#gradeInfo .say-btn { margin-left: 8px; }
.hero-speech .say-btn { margin-left: 8px; width: 28px; height: 28px; font-size: 14px; }
.result .say-btn { margin: 4px 0 0 6px; }

/* ============================================================ 子どもの メニューは 4つ（フェーズA-4）
   ホーム・本日の練習・れんしゅう・あそぶ を 大きな 絵で。ほかは「▸ もっと」に たたむ */
.nav.nav-main { display: flex; align-items: center; gap: 12px; padding: 12px 12px; font-size: 16px; font-weight: 800; }
.nav.nav-main .nav-ic { font-size: 26px; line-height: 1; width: 32px; text-align: center; }
.nav-more { margin-top: 8px; border-top: 1px solid rgba(255,255,255,.12); padding-top: 6px; }
.nav-more summary { cursor: pointer; font-size: 12px; opacity: .65; padding: 6px 12px; list-style: none; letter-spacing: .5px; }
.nav-more summary::-webkit-details-marker { display: none; }
.nav-more[open] summary { opacity: .9; }
.nav-more .nav { display: block; width: 100%; font-size: 13px; padding: 8px 12px 8px 20px; }
.asobu-card { max-width: 720px; }
/* 🗺 アドベンチャーの 入口（あそぶ の いちばん上・2026-09-28） */
.adv-banner { display: flex; align-items: center; gap: 12px; margin: 6px 0 12px; padding: 12px 14px; border-radius: 18px; text-decoration: none; color: #fff;
  background: url(assets/adventure/title.jpg) 70% 40% / cover no-repeat, #16305c; border: 3px solid var(--royal-gold); box-shadow: 0 6px 0 #8a6a1a, 0 10px 24px rgba(0,0,0,.3); position: relative; overflow: hidden; }
.adv-banner::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10,25,60,.85) 0%, rgba(10,25,60,.7) 60%, rgba(10,25,60,.35) 100%); }
.adv-banner > * { position: relative; }
.adv-chars { display: flex; align-items: flex-end; flex: none; }
.adv-chars img { height: 74px; }
.adv-chars img + img { height: 60px; margin-left: -14px; }
.adv-txt { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.adv-txt b { font-size: clamp(16px, 2.6vw, 21px); text-shadow: 0 2px 0 #12305c; }
.adv-txt small { font-size: 12.5px; font-weight: 800; color: #ffe9b0; line-height: 1.4; }
.adv-txt em { font-style: normal; align-self: flex-start; font-size: 12px; font-weight: 900; color: #16305c; background: #ffd23f; border-radius: 999px; padding: 2px 10px; }
.adv-go { flex: none; background: linear-gradient(180deg, #ffe27a, #e8a200); color: #4a2c00; font-weight: 900; font-size: 16px; padding: 10px 16px; border-radius: 14px; box-shadow: 0 4px 0 #a06a00; white-space: nowrap; }
.adv-banner:active .adv-go { transform: translateY(3px); box-shadow: 0 1px 0 #a06a00; }
.nav-help { display: block; text-decoration: none; font-size: 13px; opacity: .8; }
/* 2026-10-05：保護者の 画面の 落ちついた お知らせ枠に（前は 子どもの 画面で 赤い 下線の リンク＝広告に 見えた） */
.adv-contest { margin: 12px 0 0; font-size: 14px; } .adv-contest a { display: block; padding: 10px 14px; border-radius: 12px; background: #fff8e6; border: 1px solid #e2cd97; color: var(--navy); font-weight: 700; text-decoration: none; } .adv-contest a::after { content: " ›"; color: #b8860b; }
@media (max-width: 560px) { .adv-banner { flex-wrap: wrap; } .adv-go { width: 100%; text-align: center; } }
.asobu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 10px; }
.asobu-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 12px; border-radius: 16px; background: linear-gradient(180deg, #fff8e4, #ffefc4); color: var(--navy); border: 3px solid var(--royal-gold); font-size: 20px; font-weight: 900; box-shadow: 0 4px 0 #b8912a; }
.asobu-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #b8912a; }
.asobu-btn .asobu-ic { font-size: 56px; line-height: 1; }
.asobu-btn small { font-size: 12px; font-weight: 500; color: #6b5a45; }
@media (max-width: 900px) {
  .side-nav.open .nav-more { grid-column: 1 / -1; border-top: none; margin-top: 4px; padding-top: 0; }
  .side-nav.open .nav-more summary { text-align: start; }
  .side-nav.open .nav-more .nav { display: inline-block; width: auto; margin: 3px 4px 3px 0; text-align: start; }
  .nav.nav-main { justify-content: center; flex-direction: column; gap: 4px; padding: 10px 6px; }
  .nav.nav-main .nav-ic { font-size: 30px; width: auto; }
  .nav.nav-main .nav-lb { font-size: 13px; }
}
@media (max-width: 640px) { .asobu-grid { grid-template-columns: 1fr; } }
/* たたむ 部分は サイドバーの 色の まま（ほかの details の 白い 箱の 見た目を 打ち消す） */
.side-nav details.nav-more, .side-nav.open details.nav-more { background: transparent; border: none; border-top: 1px solid rgba(255,255,255,.12); border-radius: 0; padding: 6px 0 0; margin: 8px 0 0; box-shadow: none; color: #e8e0d2; }
.side-nav details.nav-more > summary { background: transparent; color: #e8e0d2; border: none; padding: 6px 12px; font-weight: 700; }
.side-nav details.nav-more .nav { color: #e8e0d2; background: transparent; }
.side-nav details.nav-more .nav:hover { background: var(--side-hi); }
.side-nav details.nav-more .nav.active { background: var(--gold); color: #2b2b2b; }
@media (max-width: 900px) { .side-nav.open details.nav-more .nav { background: rgba(255,255,255,.08); } }

/* ============================================================ 🔍 弱点しんだん（フェーズB-1） */
.weak-diag { margin-top: 12px; background: #fffdf7; border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.wd-h { font-weight: 900; color: var(--navy); display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.wd-all { font-size: 12px; font-weight: 700; color: #6b5a45; background: #f3ecd9; border-radius: 999px; padding: 2px 10px; }
.wd-lead { font-size: 14px; color: #2b2b2b; margin-bottom: 6px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.wd-row { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 8px; font-size: 13px; }
.wd-row.weak { background: #fff1ea; }
.wd-row.good { opacity: .85; }
.wd-em { width: 22px; text-align: center; font-size: 15px; }
.wd-n { flex: 0 0 auto; min-width: 150px; font-weight: 700; color: var(--frame); }
.wd-bar { flex: 1; height: 10px; background: #eee5d0; border-radius: 999px; overflow: hidden; min-width: 60px; }
.wd-bar > div { height: 100%; background: linear-gradient(90deg, #3d8e6a, #62b88f); border-radius: 999px; }
.wd-row.weak .wd-bar > div { background: linear-gradient(90deg, #c0392b, #e57a5f); }
.wd-rate { width: 44px; text-align: right; color: var(--navy); font-variant-numeric: tabular-nums; }
.wd-c { font-size: 11px; color: #7a6a50; white-space: nowrap; }
.wd-tag { font-size: 11px; color: #c0392b; font-weight: 800; white-space: nowrap; }
.wd-go { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--ok); color: #fff; border: none; white-space: nowrap; }
.wd-none { font-size: 13px; color: #7a6a50; }
@media (max-width: 640px) { .wd-n { min-width: 0; flex: 1 1 100%; } .wd-row { flex-wrap: wrap; row-gap: 2px; } }
/* 今日の練習の 自動編成：まちがい直し・にがて特訓の 行は 少し 目立たせる */
.menu-row.auto span { color: #b5651d; font-weight: 800; }

/* ============================================================ 📒 まちがいノート（フェーズB-3） */
.note-home { margin-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; background: #fff8e4; border: 2px solid var(--royal-gold); border-radius: 12px; padding: 8px 12px; font-size: 14px; color: var(--navy); font-weight: 700; }
.note-home .nt-open { font-size: 13px; padding: 6px 12px; border-radius: 999px; }
#notesBox h4 { margin: 12px 0 6px; color: var(--navy); font-size: 15px; }
.nt-row { display: grid; grid-template-columns: 1.4fr 1.2fr 1fr auto auto; gap: 6px 12px; align-items: center; padding: 8px 10px; border-bottom: 1px solid #eee5d0; font-size: 14px; }
.nt-row.done { opacity: .8; background: #f2faf5; border-radius: 8px; }
.nt-q { font-weight: 800; color: var(--frame); font-variant-numeric: tabular-nums; word-break: break-all; }
.nt-a { color: #444; } .nt-a s { color: #c0392b; } .nt-a b { color: #1f8a4c; }
.nt-k { font-size: 13px; color: #6b5a45; }
.nt-try { font-size: 12px; color: #7a6a50; white-space: nowrap; }
.nt-done { color: #1f8a4c; font-weight: 800; white-space: nowrap; }
.nt-go { font-size: 13px; padding: 6px 12px; border-radius: 999px; background: var(--ok); color: #fff; border: none; white-space: nowrap; }
.nt-d { font-size: 11px; color: #9a8a70; white-space: nowrap; }
@media (max-width: 640px) { .nt-row { grid-template-columns: 1fr 1fr; } .nt-q { grid-column: 1 / -1; } }

/* ============================================================ 🌳 スキルツリー（フェーズB-4） */
.sk-group { margin: 6px 0 12px; }
.sk-gh { font-weight: 800; color: var(--navy); font-size: 14px; margin-bottom: 4px; }
.sk-row { display: flex; align-items: stretch; gap: 6px; flex-wrap: wrap; }
.sk-ar { align-self: center; color: #b8a888; font-weight: 800; }
.sk-node { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 118px; padding: 8px 10px; border-radius: 12px; background: #f6f0e1; border: 2px solid #e6dcc4; font-size: 12px; text-align: center; }
.sk-node .sk-em { font-size: 22px; line-height: 1; }
.sk-node .sk-n { font-weight: 700; color: var(--frame); line-height: 1.25; }
.sk-node .sk-st { font-size: 15px; letter-spacing: 1px; color: #c9a227; }
.sk-node.s0 { opacity: .55; } .sk-node.s0 .sk-st { color: #9a8a70; }
.sk-node.s1 .sk-st, .sk-node.s2 .sk-st { color: #c0392b; }
.sk-node.s5 { background: linear-gradient(180deg, #fff8e4, #ffefc4); border-color: var(--royal-gold); box-shadow: 0 2px 0 #b8912a; }
.sk-node .sk-c { font-size: 11px; color: #7a6a50; }
@media (max-width: 640px) { .sk-node { min-width: 96px; padding: 6px; } .sk-ar { display: none; } }

/* ============================================================ 🎯 進級の めやす（フェーズB-5） */
.rd-box { background: #fffdf7; border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 10px 0; }
.rd-box.home { background: #f3f7ff; border-color: #c9d6ee; }
.rd-head { font-weight: 800; color: var(--navy); font-size: 14px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.rd-head b { color: #1f8a4c; font-size: 16px; }
.rd-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.rd-chip { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: #f6f0e1; color: #444; }
.rd-chip.ok { background: #e7f5ec; color: #1f6b3f; }
.rd-chip.ng { background: #fff1ea; color: #a13a2a; }
.rd-chip.none { background: #eee; color: #777; }
.rd-go { margin-top: 8px; font-size: 14px; padding: 8px 16px; border-radius: 999px; background: var(--ok); color: #fff; border: none; font-weight: 800; }
.rd-note { font-size: 11px; color: #8a7a5c; margin-top: 6px; }

/* ---- 🏫 教室の パソコン（段階4）：名前の 画面・おわり・自動おわりの 帯 ---- */
.cm-layer { position: fixed; inset: 0; z-index: 60; background: linear-gradient(180deg, #16305c, #23407a); display: flex; align-items: center; justify-content: center; padding: 20px; overflow: auto; }
.cm-card { background: linear-gradient(180deg,#fffdf6,#f6efdd); border: 4px solid #c9a227; border-radius: 22px; padding: 26px 28px; max-width: 720px; width: 100%; box-shadow: 0 12px 34px rgba(0,0,0,.45); text-align: center; }
.cm-h { font-size: 24px; font-weight: 900; color: var(--navy); margin-bottom: 6px; }
.cm-ask { font-size: 20px; font-weight: 800; color: #4a3a26; margin-bottom: 16px; }
.cm-names { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin: 8px 0 16px; }
.cm-name { font-size: 24px; font-weight: 900; padding: 18px 30px; min-width: 150px; border-radius: 999px; background: #fff; color: var(--navy); border: 3px solid var(--line); box-shadow: 0 4px 0 #d9cfb5; }
.cm-name:hover { border-color: var(--royal-gold); background: #fff8e4; }
.cm-name:disabled { opacity: .5; }
.cm-note { font-size: 15px; color: #4a3a26; line-height: 1.8; margin: 8px 0 0; }
.cm-note.cm-warn { color: var(--accent); font-weight: 800; }
/* 🖼 あいず（絵の 暗証）：9つの 絵（3×3）と、おした ぶんの ● */
.cm-dots { display: flex; justify-content: center; gap: 12px; margin: 6px 0 12px; }
.cm-dot { width: 48px; height: 48px; border-radius: 50%; border: 3px dashed #c9bda0; background: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 28px; }
.cm-dot.on { border-style: solid; border-color: var(--royal-gold); background: #fff8e4; }
.cm-pics { display: grid; grid-template-columns: repeat(3, 96px); gap: 12px; justify-content: center; margin: 6px 0 14px; }
.cm-pic { font-size: 46px; line-height: 1; padding: 14px 0; border-radius: 18px; background: #fff; color: var(--navy); font-weight: 900; font-variant-numeric: tabular-nums; border: 3px solid var(--line); box-shadow: 0 4px 0 #d9cfb5; }
.cm-pic:hover { border-color: var(--royal-gold); background: #fff8e4; }
.cm-pic:active { transform: translateY(3px); box-shadow: 0 1px 0 #d9cfb5; }
.cm-pic.empty { visibility: hidden; }                       /* 0 の 左の 空きます */
.cm-pic.back { font-size: 30px; color: #8a7560; }           /* ⌫ 1つ けす */
.cm-dot { font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .cm-pics { grid-template-columns: repeat(3, 84px); gap: 10px; } .cm-pic { font-size: 40px; padding: 12px 0; } .cm-dot { width: 42px; height: 42px; font-size: 24px; } }
.cm-teacher { font-size: 12px; color: #8a7560; margin: 12px 0 0; }
.pill.cm-end { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 800; font-size: 15px; }
.cm-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; background: linear-gradient(180deg, #fff8e4, #ffefc4); border: 3px solid var(--royal-gold); border-radius: 14px; padding: 10px 14px; margin: 0 0 10px; font-size: 16px; }
.cm-end-inline { background: var(--accent); color: #fff; font-weight: 800; font-size: 16px; padding: 10px 18px; border-radius: 10px; border: none; }
.cm-idle { position: fixed; left: 0; right: 0; top: 0; z-index: 70; background: var(--accent); color: #fff; font-size: 18px; font-weight: 800; text-align: center; padding: 10px 14px; display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; box-shadow: 0 4px 14px rgba(0,0,0,.3); }
.cm-idle b { font-size: 24px; }
.cm-idle .cm-end-inline { background: #fff; color: var(--accent); }
.tip-ok.cm-end-no { background: transparent; color: var(--navy); border: 2px solid var(--navy); margin-top: 8px; }
/* 🚪 家の 端末の ログアウト（2026-10-07） */
.hs-who .lo-btn { margin: 4px 0 0; display: inline-block; }
.pill.top-switch { white-space: nowrap; }
@media (max-width: 900px) { #topSwitchBtn { display: none !important; } }
@media (min-width: 901px) { .hs-who .lo-btn { display: none !important; } }   /* パソコンは 上の 帯の 1つ だけ（2026-10-08 ユーザー「近くに 2つ ある、1つに して」） */   /* スマホ・タブレットは 上の 列が せまい → ホームの 名前の 札と 設定から */
.tip-ok.lo-kid { background: var(--navy); margin-top: 8px; }
.tip-ok.lo-kid small { font-weight: 600; opacity: .85; }
.lo-new { margin-top: 10px; }
.lo-new input { width: 100%; box-sizing: border-box; font-size: 18px; padding: 10px 12px; border: 2px solid #c9b88a; border-radius: 10px; }
.lo-msg { color: var(--accent); font-weight: 700; min-height: 1em; margin: 6px 0 0; }
.lo-sep { margin: 16px 0 0; padding-top: 10px; border-top: 1px dashed #c9b88a; }
.tip-ok.lo-key { background: #fff8e4; color: #4a2c00; border: 2px solid var(--royal-gold); margin-top: 10px; }
.tip-ok.lo-full { background: transparent; color: var(--navy); border: 2px solid var(--navy); margin-top: 6px; }
.pp-sw { margin-top: 12px; } .pp-sw summary { cursor: pointer; font-weight: 700; } .pp-sw ul { padding-inline-start: 1.3em; } .pp-sw li { margin: 4px 0; }

/* ============================================================ ➕ たし算クロス（計算パズル・2026-09-22）
   たて・よこの 合計が 合うように あいた マスを うめる。数独と 同じ「1通りだけ」の 気もちよさを、
   ぜんぶ たし算・ひき算で 作る。級が 上がると 数が 大きく（1けた → 2けた → 3けた）、マスも 増える。 */
.cross-card { max-width: 760px; }
.cross-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-bottom: 2px solid var(--line); padding-bottom: 10px; margin-bottom: 12px; }
.cross-title { font-size: 20px; font-weight: 900; color: var(--navy); }
.cross-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.cross-chip { background: #f3efe3; border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; font-size: 13px; font-weight: 700; color: var(--navy); }
.cross-chip.gold { background: #fff6e0; border-color: var(--royal-gold); color: #8a6b12; }
.cross-chip:empty { display: none; }

.cross-lead { font-size: 15px; line-height: 1.8; margin-bottom: 12px; }
.cross-lvrow { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.cross-lv { background: var(--card); border: 2px solid var(--line); border-radius: 12px; padding: 8px 16px; font-size: 14px; font-weight: 800; color: var(--navy); }
.cross-lv.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.cross-note { margin-top: 10px; }
.cross-sub { font-size: 12px; font-weight: 700; color: #8a7560; margin: 2px 0 6px; }
.cross-lv.lock { opacity: .55; cursor: default; background: #f3efe3; }   /* まだ 使えない しゅもく（○級から） */
.cross-lv small { font-weight: 600; }
/* たしひき：− の ついた 数は 引く。記号は 赤で 小さく */
.cross-cell .cx-sign { color: var(--accent); font-size: 17px; margin-right: 2px; }
.cross-cell.sum .cx-eq { letter-spacing: 0; }

/* 盤：右の列に よこの合計、下の行に たての合計。はみ出す ときは 中で よこに なぞって 動かす */
.cross-wrap { overflow-x: auto; padding: 4px 0 8px; }
.cross-grid { display: grid; gap: 6px; justify-content: center; margin: 0 auto; width: max-content; }
.cross-cell { display: flex; align-items: center; justify-content: center; border-radius: 10px; font-variant-numeric: tabular-nums;
  min-width: 64px; height: 58px; font-size: 22px; font-weight: 800; padding: 0 8px; }
/* 動かせない数（もとから 見えている） */
.cross-cell.fix { background: #f7f4ec; border: 2px solid var(--line); color: #2b2b2b; }
/* あいている マス（ここに 入れる） */
.cross-cell.blank { background: #fff; border: 3px dashed #b9a97f; color: var(--navy); cursor: pointer; }
.cross-cell.blank:active { transform: translateY(2px); }
.cross-cell.blank.on { border-style: solid; border-color: var(--navy); background: #eef3fb; box-shadow: 0 0 0 3px rgba(22,48,92,.15); }
.cross-cell.blank.filled { border-style: solid; border-color: var(--navy-hi); background: #eef3fb; }
.cross-cell.blank.ng { border-color: var(--accent); background: #fdecea; color: var(--accent); animation: cxShake .3s; }
.cross-cell.blank.ok { border-color: var(--ok); background: #e7f5ec; color: var(--ok); }
@keyframes cxShake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
/* 合計のマス（＝○○） */
.cross-cell.sum { background: var(--navy); color: #fff; font-size: 19px; border: 2px solid var(--navy); }
.cross-cell.sum.done { background: var(--ok); border-color: var(--ok); }
.cross-cell.corner { background: transparent; }
.cross-cell .cx-eq { opacity: .75; font-size: 13px; margin-right: 3px; font-weight: 700; }   /* → ＝よこの合計、↓ ＝たての合計 */

/* 数を 入れる ボタン（0〜9・⌫）。そろばんの 答えの欄と 同じ 出し方 */
.cross-pad { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; max-width: 460px; margin: 14px auto 0; }
.cross-pad button { background: var(--card); border: 2px solid var(--line); border-radius: 12px; color: var(--navy);
  font-size: 22px; font-weight: 900; padding: 12px 0; box-shadow: 0 3px 0 #ddd3bd; }
.cross-pad button:active { transform: translateY(3px); box-shadow: 0 0 0 #ddd3bd; }
.cross-pad button.wide { grid-column: 1 / -1; font-size: 18px; }   /* ✓できた！ は 横いっぱい（いちばん 押す ボタン） */
.cross-pad button.go { background: var(--ok); border-color: var(--ok); color: #fff; box-shadow: 0 3px 0 #1d5d41; }
.cross-pad button.del { background: #f7f4ec; }
.cross-pad button:disabled { opacity: .4; box-shadow: none; }

.cross-btnrow { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.cross-msg { text-align: center; font-size: 15px; font-weight: 800; margin-top: 10px; min-height: 24px; color: var(--navy); }
.cross-msg.ng { color: var(--accent); }
.cross-msg.ok { color: var(--ok); }

.cross-over { text-align: center; }
.cross-over .cx-big { font-size: 26px; font-weight: 900; color: var(--ok); margin: 8px 0; }
.cross-over .cx-stat { font-size: 15px; color: #6b5a45; margin-bottom: 12px; }

/* スマホ：マスを 小さく、ボタンを 押しやすく */
@media (max-width: 640px) {
  .cross-cell { min-width: 52px; height: 50px; font-size: 19px; padding: 0 5px; }
  .cross-cell.sum { font-size: 16px; }
  .cross-grid { gap: 5px; }
  .cross-pad { grid-template-columns: repeat(5, 1fr); gap: 6px; }
  .cross-pad button { font-size: 20px; padding: 11px 0; }
}

/* ============================================================ 🏠 おうちで 使う 方へ（保護者の 画面の いちばん上・2026-09-23） */
.pill.back { background: var(--navy); color: #fff; border-color: var(--navy); font-weight: 800; }
.parent-plan h3 { margin-bottom: 10px; }
.pp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pp-box { border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.7; }
.pp-box p { margin: 6px 0 0; }
.pp-box.free { background: #e7f5ec; border: 2px solid #1f8a4c; }
.pp-box.paid { background: #fff6e0; border: 2px solid var(--royal-gold); }
.pp-h { font-weight: 900; color: var(--navy); font-size: 15px; }
.pp-when { background: #fff; border-radius: 8px; padding: 6px 10px; }
.pp-home { border: 3px solid #1f8a4c; background: #f3fbf6; }
.pp-home h3 { margin-bottom: 6px; }
.pp-home p { margin: 6px 0; line-height: 1.7; }
.pp-home .result:empty { display: none; }
.pp-nick { display: flex; flex-direction: column; gap: 4px; margin: 10px 0 0; font-weight: 800; color: var(--navy); font-size: 14px; }
.pp-nick input { font-size: 18px; padding: 10px 12px; border: 2px solid #c9d3e0; border-radius: 10px; max-width: 320px; }
button.pp-btn { border: none; width: 100%; max-width: 420px; font-size: 17px; cursor: pointer; font-family: inherit; }
button.pp-btn:disabled { opacity: .6; cursor: wait; }
.pp-btn { display: block; margin-top: 10px; text-align: center; background: var(--navy); color: #fff; text-decoration: none; font-weight: 800; padding: 11px 14px; border-radius: 10px; }
.pp-learn ul { margin: 6px 0 0; padding-inline-start: 1.2em; line-height: 1.9; font-size: 15px; }
.pp-learn a { color: var(--navy); font-weight: 700; }
.pp-more { display: inline-block; margin-top: 8px; font-size: 14px; }
.pp-class { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 14px; line-height: 1.7; }
.pp-class .pp-h { margin-bottom: 2px; }
.pp-class button { margin-top: 8px; }
@media (max-width: 640px) { .pp-grid { grid-template-columns: 1fr; } }

/* ============================================================ 📘 級の基準（れんしゅうの 画面の 上・2026-09-23） */
.preset-line { font-size: 14px; color: var(--navy); margin: 0 0 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.preset-line small { color: #8a7560; }
.preset-pick { border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; background: #fffdf6; }
.preset-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0 10px; }
.preset-card { display: flex; gap: 10px; align-items: flex-start; border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; cursor: pointer; }
.preset-card.on { border-color: var(--navy); background: #eef3fb; box-shadow: 0 0 0 3px rgba(22,48,92,.12); }
.preset-card input { margin-top: 4px; }
.preset-card .pc-em { font-size: 24px; line-height: 1; }
.preset-card .pc-body { display: flex; flex-direction: column; gap: 2px; font-size: 13px; line-height: 1.5; }
.preset-card .pc-body b { font-size: 15px; color: var(--navy); }
.preset-card .pc-body small { color: #6b5a45; }
.preset-card .pc-what { color: #8a7560; }
.preset-card:active { transform: scale(.98); }
.preset-hint { margin: 0 0 6px; }
.pp-preset { font-size: 14px; line-height: 1.7; }
/* 保護者の 画面の いちばん上：レオ王の 一言（2026-09-25） */
.parent-hero .ph-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.ph-duo { display: flex; align-items: flex-end; flex-shrink: 0; }
/* 物語の 主人公：物語の 3コマ目（scene_1_3.png・370×256）から 顔の まわり 約200×200 を 丸く 見せる */
.ph-boy { width: 92px; height: 92px; border-radius: 50%; flex-shrink: 0; background: url(assets/solomon/scene_1_3.png) no-repeat;
  background-size: 170px 118px; background-position: -10px -24px;
  border: 3px solid var(--royal-gold); box-shadow: 0 3px 6px rgba(0,0,0,.2); }
.ph-solo { width: 88px; height: 88px; object-fit: contain; margin-left: -6px; filter: drop-shadow(0 3px 4px rgba(0,0,0,.25)); }
.ph-speech { flex: 1; min-height: 44px; display: flex; align-items: center; background: #fff8e4; border: 2px solid var(--royal-gold); border-radius: 14px; padding: 10px 14px; font-size: 15px; font-weight: 700; color: #2b2b2b; position: relative; line-height: 1.6; }
.ph-speech::before { content: ""; position: absolute; left: -12px; top: 50%; transform: translateY(-50%); border: 7px solid transparent; border-right-color: var(--royal-gold); }
/* 級の基準の カード：ラジオを 隠し、押すだけ。えらんでいる カードに「✓ いま これ」の 帯 */
.preset-card { position: relative; align-items: center; padding: 12px 14px; transition: border-color .12s, background .12s; }
.preset-card input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.preset-card .pc-em { font-size: 34px; }
.preset-card .pc-what { display: none; }
.preset-card.on .pc-what { display: block; }
.preset-card:not(.on):hover { border-color: #b9c6dc; background: #f8fafd; }
.pc-now { display: none; position: absolute; top: -11px; right: 10px; background: var(--navy); color: #fff; font-size: 12px; font-weight: 800; padding: 2px 10px; border-radius: 999px; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.preset-card.on .pc-now { display: inline-block; }
.preset-cards { margin-top: 12px; }
.pp-preset .pp-h { margin-bottom: 4px; }
.pp-preset .preset-cards { margin-bottom: 0; }
@media (max-width: 640px) { .preset-cards { grid-template-columns: 1fr; } }

/* 2026-09-23：メニューは たたまず 全部 出す。見出し（きろく・おとなの方へ）は 薄い 文字、項目は 少し 小さめの 同じ ボタン */
.side-nav .nav-more .nav-sec { font-size: 11px; opacity: .55; padding: 8px 12px 4px; letter-spacing: 1px; }
.side-nav .nav-more .nav { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 9px 12px 9px 14px; color: #e8e0d2; }
@media (max-width: 900px) {
  .side-nav.open .nav-more { grid-column: 1 / -1; }
  .side-nav.open .nav-more .nav-sec { width: 100%; }
  .side-nav.open .nav-more .nav { display: inline-flex; width: auto; margin: 3px 4px 3px 0; background: rgba(255,255,255,.08); border-radius: 8px; }
}

/* 保護者の 画面：広い 画面では 2列（左＝ようす・記録、右＝級の基準・教室・プラン）。中身の 幅も 広げて 右の 余白を 埋める（2026-09-25） */
@media (min-width: 1300px) {
  .content:has(#view-parent:not(.hidden)) { max-width: 1500px; }
  .parent-cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 18px; align-items: start; }
  .pc-side .preset-cards { grid-template-columns: 1fr; }
  .pc-side .pp-grid { grid-template-columns: 1fr; }
}

/* 各画面の いちばん上の ソロモンの 一言・空っぽの 画面の ソロモン（2026-09-25） */
.solo-say { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.solo-say-pic { width: 64px; height: 64px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.solo-say-pic img { width: 64px; height: 64px; object-fit: contain; filter: drop-shadow(0 3px 4px rgba(0,0,0,.18)); }
.solo-say-pic i, .solo-empty-pic i { display: none; font-style: normal; }
.solo-say-pic.nopic i, .solo-empty-pic.nopic i { display: inline; font-size: 40px; }
.solo-say-b { position: relative; background: #fff; border: 2px solid var(--royal-gold); border-radius: 14px; padding: 8px 14px; font-size: 14px; font-weight: 700; color: #3a2e1f; line-height: 1.6; box-shadow: 0 2px 6px rgba(0,0,0,.06); }
.solo-say-b::before { content: ""; position: absolute; left: -12px; top: 50%; transform: translateY(-50%); border: 6px solid transparent; border-right-color: var(--royal-gold); }
.solo-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0 4px; text-align: center; }
.solo-empty-pic { width: 110px; height: 110px; display: inline-flex; align-items: center; justify-content: center; position: static; }
.solo-empty-pic img { position: static; width: 110px; height: 110px; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0,0,0,.18)); }
@media (max-width: 640px) { .solo-say-pic, .solo-say-pic img { width: 52px; height: 52px; } .solo-say-b { font-size: 13px; } }

/* 🌅 終わり方（設計図 8.）：今日は ここまででも 大成功 ＋ つぎが 気になる 1〜2行 ＋ あしたの 冒険 */
.next-adv { margin: 12px auto 6px; max-width: 460px; background: linear-gradient(180deg,#fffaf0,#f6ecd2); border: 2px solid var(--royal-gold); border-radius: 14px; padding: 12px 14px; text-align: center; color: #4a3b2a; }
.next-adv .na-h { font-size: 17px; font-weight: 900; color: var(--navy); margin-bottom: 6px; }
.next-adv .na-hook { font-size: 14px; font-weight: 800; line-height: 1.7; margin-bottom: 8px; }
.next-adv .na-hook b { color: var(--accent); font-size: 17px; }
/* 2026-10-23 ユーザー「小さくて 絵が 見えない」→ 横いっぱいに 大きく・文字は 絵の 下・暗く しない */
.next-adv .na-tomorrow { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 15px; font-weight: 800; color: #6b5a45; margin-bottom: 10px; }
.next-adv .na-tomorrow img { display: block; width: 100%; height: auto; aspect-ratio: 1536 / 431; object-fit: cover; border-radius: 10px; border: 2px solid #c9a227; }
.next-adv .na-btns button { margin: 2px 3px 0; }
/* 🗺️ ホーム：今日の 冒険の 名前 */
.home-quest { text-align: center; margin-top: 6px; font-size: 14px; font-weight: 800; color: #6b5a45; }

/* 🌉 絵の 中の 文字を 出さない（物語の 中の 練習 以外）。2026-09-25 ユーザー指示 */
.story-bridge.nocap .q-title, .story-bridge.nocap .bridge-txt { display: none; }
/* 級の基準の カード：※非公式（いつも 出す）と、カードの 下の 一文（2026-09-26） */
.preset-card .pc-uno { color: #a0522d; font-weight: 700; font-size: 12px; }
.preset-uno-all { font-size: 12px; color: #8a7560; line-height: 1.6; margin: 6px 0 10px; }

/* ============================================================ ホームの 新しい デザイン（2026-10-03）
   見本「冒険UIコレクション」の ホーム：王都の 絵の 上に 羊皮紙の 札＋大きな 青い ボタン、
   右に 少年と ソロモン。その 下に 数字の 札 5つ。絵は 今 ある もの（adventure/title.jpg）で */
.home-stage { position: relative; display: grid; grid-template-columns: minmax(280px, 400px) 1fr; align-items: center; gap: 12px;
  min-height: 380px; padding: 64px 28px 24px; margin-bottom: 14px; border-radius: 18px; overflow: hidden;
  background: url(assets/adventure/title.jpg) center 40% / cover no-repeat, #6fa8d8;
  border: 3px solid #c9a14a; box-shadow: 0 6px 18px rgba(22,48,92,.25), inset 0 0 0 2px rgba(255,255,255,.35); }
/* 名前の 札（左上） */
.hs-who { position: absolute; left: 14px; top: 12px; display: flex; align-items: center; gap: 10px;
  background: rgba(22,48,92,.82); color: #fff; border: 2px solid #d4af37; border-radius: 14px; padding: 5px 14px 5px 6px; }
.hs-who .hero-avatar { width: 42px; height: 42px; font-size: 28px; border-radius: 10px; }
.hs-who .hero-id { min-width: 0; line-height: 1.25; }
.hs-who b { font-size: 16px; }
.hs-who .rank-badge { font-size: 11px; padding: 1px 8px; }
.hs-who .name-nudge { color: #fff; border-color: rgba(255,255,255,.6); background: transparent; }
/* 羊皮紙の 札 */
.hs-scroll { position: relative; text-align: center; color: #3b2a14; padding: 26px 26px 22px; border-radius: 16px;
  background: radial-gradient(ellipse at 50% 40%, #fffaf0 0%, #f7ead0 70%, #ecd6a8 100%);
  border: 3px solid #c9a14a; box-shadow: 0 8px 20px rgba(60,40,10,.35), inset 0 0 0 4px rgba(255,255,255,.55), inset 0 0 0 6px rgba(201,161,74,.35); }
.hs-title { font-size: 36px; font-weight: 800; color: #2a1d0b; letter-spacing: 3px; line-height: 1.2; }
.hs-title::before, .hs-title::after { content: "✦"; font-size: 16px; color: #c9a14a; vertical-align: middle; margin: 0 10px; }
.hs-scroll .home-quest { margin-top: 4px; font-size: 15px; color: #7a5a12; }
.hs-lead { margin: 10px 0 16px; font-size: 15px; font-weight: 700; line-height: 1.7; color: #4b3a20; }
.hs-cta { width: 100%; display: flex; align-items: center; justify-content: center; gap: 14px; padding: 16px 20px;
  font-size: 22px; font-weight: 800; color: #fff; letter-spacing: 2px; border-radius: 999px;
  background: linear-gradient(180deg, #3f7be0 0%, #1d4fb8 55%, #163f96 100%);
  border: 3px solid #f1d27a; box-shadow: 0 5px 0 #0f2d6e, 0 8px 16px rgba(15,45,110,.35); }
.hs-cta:hover { filter: brightness(1.07); }
.hs-cta:active { transform: translateY(3px); box-shadow: 0 2px 0 #0f2d6e; }
.hs-cta .hs-arrow { font-size: 30px; line-height: 1; }
/* 2026-11-05 主役は ⚡ 1分チャレンジ（金）。練習は 2番目（紺の 細い 枠） */
.hs-cta-main { text-decoration: none; margin: 6px 0 10px; color: #3a2a00; background: linear-gradient(180deg, #ffe27a 0%, #e3b341 70%, #c9962a 100%); border-color: #fff4c2; box-shadow: 0 5px 0 #8f6a14, 0 8px 16px rgba(143,106,20,.35); }
.hs-cta-main:active { box-shadow: 0 2px 0 #8f6a14; }
.hs-cta-main .ic-lb { display: flex; flex-direction: column; align-items: center; line-height: 1.15; min-width: 0; text-align: center; }
/* 2026-11-05 点検：英語「1-Minute Challenge」が 360px で 2行に 折れて 下の 小さい 字に かぶった → 日本語 以外は 字間を つめる */
html:not([lang="ja"]) .hs-cta-main { letter-spacing: 0; }
.hs-cta-main small { font-size: 12px; font-weight: 700; letter-spacing: 0; opacity: .85; }
.hs-cta2 { font-size: 18px; padding: 12px 18px; color: #163f96; background: #fff; border: 2px solid #1d4fb8; box-shadow: 0 3px 0 #0f2d6e; }
.hs-cta2:active { box-shadow: 0 1px 0 #0f2d6e; }
.hs-scroll .today-status { margin-top: 10px; font-size: 14px; }
.hs-scroll .today-status:empty { display: none; }
/* 少年と ソロモン＋吹き出し */
.hs-chars { position: relative; align-self: end; display: flex; align-items: flex-end; justify-content: center; gap: 0; min-height: 260px; }
.hs-chars .hs-boy { height: 206px; filter: drop-shadow(0 6px 6px rgba(0,0,0,.35)); }
.hs-chars .hs-solo { width: 210px; margin-left: -18px; filter: drop-shadow(0 6px 6px rgba(0,0,0,.35)); }
.hs-chars .hero-speech { position: absolute; top: 0; right: 4%; margin: 0; white-space: nowrap; font-size: 14px; border: 2px solid #e8d7ae; }
.hs-chars .hero-speech::after { left: 30%; right: auto; top: auto; bottom: -16px; transform: none; border-color: transparent; border-top-color: #fff; }
/* 数字の 札 5つ */
.home-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.hs-tile { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 14px;
  background: linear-gradient(180deg, #fffdf7, #f8efdc); border: 2px solid #e2cd97; box-shadow: 0 3px 8px rgba(60,40,10,.08); }
.hs-tile span { font-size: 13px; font-weight: 700; color: #6b5f4c; }
.hs-tile b { font-size: 26px; color: var(--navy); line-height: 1.2; }
.hs-tile small { font-size: 11px; color: #8a7560; }
.hs-tile .ico-coin, .hs-tile .ico-crown { height: 22px; vertical-align: -6px; }
.hs-bar { display: block; height: 8px; border-radius: 99px; background: #e7dcc4; overflow: hidden; margin: 3px 0 2px; }
.hs-bar > i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, #3f7be0, #1d4fb8); }
/* 下の 段：今日の メニュー などは 白い カードに（前は 紺の 箱） */
.home-hero { background: var(--card); color: #2b2b2b; border: 1px solid var(--line); }
.home-hero .today-box { padding: 4px 2px 0; }
@media (max-width: 760px) {
  .home-stage { grid-template-columns: 1fr; padding: 10px 10px 0; min-height: 0; gap: 0; background-position: 62% 30%; }
  .hs-who { position: static; justify-self: start; margin-bottom: 10px; }
  .hs-scroll { padding: 18px 16px 16px; }
  .hs-title { font-size: 28px; }
  .hs-title::before, .hs-title::after { margin: 0 6px; }
  .hs-cta { font-size: 19px; padding: 14px 16px; }
  html:not([lang="ja"]) .hs-cta-main { font-size: 17px; }
  .hs-chars { min-height: 0; padding-top: 52px; }
  .hs-chars .hs-boy { height: 116px; }
  .hs-chars .hs-solo { width: 118px; }
  .hs-chars .hero-speech { top: 6px; right: 50%; transform: translateX(50%); white-space: nowrap; font-size: 13px; }
  .home-stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .home-stats .hs-tile:first-child { grid-column: 1 / -1; }
  .hs-tile b { font-size: 22px; }
}

/* ============================================================ しゅもく えらびの 新しい デザイン（2026-10-03）
   見本「冒険UIコレクション」の 右上：色つきの 大きな カード 5枚（緑・赤・紫・青・だいだい）＋ 金の ふち。
   下の 記録（なまえ・今月・じこベスト）は 右の 列 → 下に 横 3つ */
.sj-head { text-align: center; margin: 2px 0 12px; }
.sj-head span { display: inline-block; font-size: 22px; font-weight: 800; color: var(--navy); letter-spacing: 2px; padding: 0 34px; position: relative; }
.sj-head span::before, .sj-head span::after { content: "✦"; position: absolute; top: 50%; transform: translateY(-50%); color: #c9a14a; font-size: 14px; }
.sj-head span::before { left: 6px; } .sj-head span::after { right: 6px; }
.chips.sj-cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 16px; }
.chip.sj-card { --c1: #2f9a55; --c2: #17663a; position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 14px 8px 12px; min-height: 196px; border-radius: 14px; color: #fff; text-align: center;
  background: radial-gradient(ellipse at 50% 22%, rgba(255,255,255,.28), transparent 55%), linear-gradient(180deg, var(--c1), var(--c2));
  border: 3px solid #d9b65c; box-shadow: inset 0 0 0 2px rgba(255,255,255,.25), 0 4px 10px rgba(0,0,0,.18);
  transition: transform .12s, box-shadow .12s, filter .12s; }
.chip.sj-kake { --c1: #d04545; --c2: #8e1f22; }
.chip.sj-wari { --c1: #8a4fd0; --c2: #4e2290; }
.chip.sj-anzan { --c1: #3b82e0; --c2: #1a4a9e; }
.chip.sj-flash { --c1: #f0a23a; --c2: #b8560f; }
.sj-card .sj-ic { font-size: 40px; line-height: 1.1; width: 64px; height: 64px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: rgba(255,255,255,.16); border: 2px solid rgba(255,230,160,.8); filter: drop-shadow(0 2px 3px rgba(0,0,0,.3)); }
.sj-card .sj-name { font-size: 19px; font-weight: 800; letter-spacing: 1px; text-shadow: 0 2px 2px rgba(0,0,0,.35); margin-top: 2px; }
.sj-card .sj-desc { font-size: 12px; line-height: 1.45; opacity: .95; min-height: 2.9em; }
.sj-card .sj-ex { margin-top: auto; padding: 5px 10px; border-radius: 8px; font-size: 15px; font-weight: 800; color: #3b2a14; white-space: nowrap;
  background: linear-gradient(180deg, #fff8e6, #efdcae); border: 1px solid #c9a14a; box-shadow: 0 2px 3px rgba(0,0,0,.2); }
.chip.sj-card:hover:not(:disabled) { transform: translateY(-2px); }
/* えらんでいる カード：金に 光る＋ ✓ */
.chip.sj-card.active { background: radial-gradient(ellipse at 50% 22%, rgba(255,255,255,.28), transparent 55%), linear-gradient(180deg, var(--c1), var(--c2));
  border-color: #ffd65a; box-shadow: 0 0 0 3px #ffd65a, 0 0 18px rgba(255,200,60,.75), 0 6px 14px rgba(0,0,0,.25); transform: translateY(-3px); }
.chip.sj-card.active::after { content: "✓"; position: absolute; top: -10px; right: -10px; width: 28px; height: 28px; border-radius: 50%;
  background: #ffd65a; color: #3b2a14; font-weight: 900; font-size: 17px; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 4px rgba(0,0,0,.3); }
.chips.sj-cards:has(.active) .chip.sj-card:not(.active):not(:disabled) { filter: saturate(.75) brightness(.95); }
.chip.sj-card:disabled { opacity: 1; filter: grayscale(.85) brightness(.9) !important; cursor: not-allowed; }
.chip.sj-card:disabled .sj-ex { visibility: hidden; }
/* 記録は 下に 横 3つ */
.grades-layout { grid-template-columns: 1fr; }
.grades-layout .stats-panel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grades-layout .stats-panel .card { background: linear-gradient(180deg, #fffdf7, #f8efdc); border: 2px solid #e2cd97; }
@media (max-width: 1000px) { .chips.sj-cards { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) {
  /* スマホ：横長の 小さい 札（アイコン＋名前）。5つめは 横 いっぱい */
  .chips.sj-cards { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .chip.sj-card { min-height: 0; padding: 8px 10px; flex-direction: row; justify-content: flex-start; gap: 8px; text-align: start; }
  .chip.sj-card:last-child { grid-column: 1 / -1; justify-content: center; }
  .sj-card .sj-ic { width: 40px; height: 40px; font-size: 24px; flex-shrink: 0; }
  .sj-card .sj-name { font-size: 16px; margin: 0; }
  .sj-card .sj-desc, .sj-card .sj-ex { display: none; }
  .chip.sj-card.active::after { top: -8px; right: -6px; width: 24px; height: 24px; font-size: 14px; }
  .sj-head span { font-size: 17px; padding: 0 22px; white-space: nowrap; letter-spacing: 1px; }
  .grades-layout .stats-panel { grid-template-columns: 1fr; }
}

/* しゅもくえらび：見本を できるだけ 再現（2026-10-03・ユーザー指示）。
   見本の 広間の 背景（ぼかし）＋ 見本から 切りぬいた カードの 絵。カードの 中の 文字は 絵に 入っているので、
   日本語の ときは HTML の 文字を 見えなくする（読み上げ用には 残す）。英語の ときは 上の 色つき カード（絵文字）の まま */
.sj-stage { margin: 4px -6px 16px; padding: 14px 14px 16px; border-radius: 16px;
  background: linear-gradient(180deg, rgba(10,24,52,.25), rgba(10,24,52,.55)), url(assets/ui/sj_bg.webp) center / cover no-repeat, #1b2f57;
  border: 2px solid #c9a14a; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.sj-stage .sj-head span { color: #fff; text-shadow: 0 2px 4px rgba(0,0,0,.6); }
.sj-stage .sj-head span::before, .sj-stage .sj-head span::after { color: #f1d27a; }
.sj-stage .chips.sj-cards { margin-bottom: 0; }
html .chip.sj-card { aspect-ratio: 290 / 651; min-height: 0; padding: 0; border: none; border-radius: 10px;
  background: center / 100% 100% no-repeat; box-shadow: 0 6px 14px rgba(0,0,0,.4); }
/* 2026-10-03 ChatGPT で 作った 文字なしの カード（帯と 巻物が 空っぽ）→ 名前・一言・例の 式を コードで のせる。英語も 同じ 絵 */
html .chip.sj-card { container-type: inline-size; }
html .chip.sj-card .sj-ic { display: none; }
html .chip.sj-card .sj-name { position: absolute; left: 10%; right: 10%; top: 46%; height: 9.5%; margin: 0; display: flex; align-items: center; justify-content: center;
  font-size: min(13cqw, 21px); white-space: nowrap; color: #fff; text-shadow: 0 2px 3px rgba(0,0,0,.6); }
html .chip.sj-card .sj-desc { position: absolute; left: 9%; right: 9%; top: 57%; min-height: 0; font-size: min(7.6cqw, 13px); font-weight: 700; line-height: 1.45; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.7); }
html .chip.sj-card .sj-ex { position: absolute; left: 16%; right: 16%; top: 76%; height: 15%; margin: 0; padding: 0; display: flex; align-items: center; justify-content: center;
  background: none; border: none; box-shadow: none; font-size: min(10.5cqw, 18px); color: #3b2a14; }
html .chip.sj-mitori { background-image: url(assets/ui/card_mitori.webp); }
html .chip.sj-kake { background-image: url(assets/ui/card_kake_v2.webp); }
html .chip.sj-wari { background-image: url(assets/ui/card_wari.webp); }
html .chip.sj-anzan { background-image: url(assets/ui/card_anzan.webp); }
html .chip.sj-flash { background-image: url(assets/ui/card_flash.webp); }
html .chip.sj-card.active { background-color: transparent; box-shadow: 0 0 0 3px #ffd65a, 0 0 22px rgba(255,200,60,.85), 0 8px 16px rgba(0,0,0,.4); }
html .chip.sj-card.active::after { z-index: 1; }
html .chips.sj-cards:has(.active) .chip.sj-card:not(.active):not(:disabled) { filter: none; }
@media (max-width: 1000px) { html .chips.sj-cards { grid-template-columns: repeat(5, 1fr); } }
@media (max-width: 760px) {
  /* スマホ：絵を 小さく しすぎない よう 横に なぞって 見る（3枚 ＋ 4枚目が 少し 見える） */
  .sj-stage { margin: 4px -4px 14px; padding: 10px 8px 12px; }
  html .chips.sj-cards { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 8px; padding: 6px 4px 8px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
  html .chip.sj-card { flex: 0 0 31%; aspect-ratio: 290 / 651; scroll-snap-align: start; flex-direction: column; }
  html .chip.sj-card:last-child { grid-column: auto; }
}

/* その 級に 無い しゅもく：色は そのまま（見本どおり）で 少し 暗く＋「○級から」の 札（2026-10-03・前は 灰色で 白黒に 見えた） */
.chip.sj-card:disabled, html[lang="ja"] .chip.sj-card:disabled { filter: brightness(.72) !important; opacity: 1; }
.chip.sj-card:disabled::before { content: attr(data-from); position: absolute; left: 50%; top: 80%; transform: translate(-50%, -50%) rotate(-6deg); z-index: 1;
  white-space: nowrap; padding: 6px 14px; border-radius: 8px; font-size: 15px; font-weight: 800; color: #3b2a14;
  background: linear-gradient(180deg, #fff6d8, #f1d27a); border: 2px solid #b8912a; box-shadow: 0 3px 8px rgba(0,0,0,.45); }
.chip.sj-card:disabled[data-from=""]::before { display: none; }
/* 背景は 明るめに（見本の 広間に 近づける。本物の 背景の 絵は 絵の発注リスト ★★ 4） */
.sj-stage { background: linear-gradient(180deg, rgba(255,240,200,.10), rgba(10,24,52,.30)), url(assets/ui/sj_bg.webp) center / cover no-repeat, #2a4473; }
/* 文字なしの カードの 絵（2026-10-03）：えらんだ カードでも 絵を 消さない（.active の 色の グラデーションに 負けていた） */
html .chip.sj-card, html .chip.sj-card.active { background: transparent center / 100% 100% no-repeat; }
html .chip.sj-card.sj-mitori { background-image: url(assets/ui/card_mitori.webp); }
html .chip.sj-card.sj-kake { background-image: url(assets/ui/card_kake_v2.webp); }
html .chip.sj-card.sj-wari { background-image: url(assets/ui/card_wari.webp); }
html .chip.sj-card.sj-anzan { background-image: url(assets/ui/card_anzan.webp); }
html .chip.sj-card.sj-flash { background-image: url(assets/ui/card_flash.webp); }
html .chip.sj-card .sj-desc { display: block; }
html .chip.sj-card .sj-ex { display: flex; }
@media (max-width: 760px) { html .chip.sj-card .sj-desc { display: none; } }
html[lang="en"] .chip.sj-card .sj-name { font-size: min(10.5cqw, 17px); }

/* 2026-10-04 ユーザー「スマホは 級を えらんだ あと スクロール しないと はじめるが 出ない」：
   測ると 390×844 で はじめるが 1221px（画面の 外）→ スマホでは 画面の 下に いつも 出しておく */
@media (max-width: 700px) {
  #view-grades .grades-main { padding-bottom: 120px; min-width: 0; }
  /* 同日：1fr は 中身の 幅（約 400px）より 細く ならず、390px の 画面で 横に はみ出して いた */
  .grades-layout { grid-template-columns: minmax(0, 1fr); }
  #view-grades #startBtn.ic-btn { position: fixed; left: 0; right: 0; bottom: max(8px, env(safe-area-inset-bottom)); z-index: 44; width: min(calc(100% - 32px), 340px); margin: 0 auto; font-size: 28px; }
  #view-grades #startBtn.ic-btn .ic { font-size: 34px; }
  body:has(#view-grades:not(.hidden)) .scroll-more { display: none !important; }
  /* 同日 360×640 で 測ると 今日の練習・たし算クロスの はじめるも 画面の 外 → 画面の 下に はりつけ */
  #todayStart, #cxStart { position: sticky; bottom: max(8px, env(safe-area-inset-bottom)); z-index: 44; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
}
/* 2026-10-05 ユーザー「練習問題 スクロールなしで スタートボタンが 出るように」：
   測ると 768×1024 で はじめるの 下が 1164px・1024×768 で 1095px（画面の 外）。スマホ だけ 直して いた →
   広い 画面でも カードの 中で 画面の 下に くっつける（カードの 直下に 出したので sticky が 効く） */
@media (min-width: 701px) {
  #view-grades #startBtn.ic-btn { position: sticky; bottom: max(10px, env(safe-area-inset-bottom)); z-index: 44; }
  body:has(#view-grades:not(.hidden)) .scroll-more { display: none !important; }
}
/* 2026-10-05 ユーザー「携帯・タブレットは 左の メニューが 出ず、☰ から ゲームを 出すけど 気づかない」：
   ☰ を 押さなくても、上の 帯の 下に 子どもの 4つ（ホーム・れんしゅう・けんてい・あそぶ）を いつも 出す。
   きろく・おとなの方へ は 今まで どおり ☰ の 中。練習中は 帯ごと しまう（body.playing .sidebar） */
@media (max-width: 900px) {
  .side-nav:not(.open) { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 6px; padding-bottom: 0; }
  .side-nav:not(.open) .nav-more { display: none; }
  /* 同日 ユーザー「大きく しなければ いい」：絵と 文字を 横 1行に（高さ 約 30px） */
  .side-nav:not(.open) { gap: 4px; margin-top: 4px; }
  .side-nav:not(.open) .nav.nav-main { flex-direction: row; gap: 3px; padding: 5px 2px; border-radius: 9px; min-height: 0; }
  .side-nav:not(.open) .nav.nav-main .nav-ic { display: none; }   /* 同日 ユーザー「マークを 消せば 狭く 感じない」 */
  .side-nav:not(.open) .nav.nav-main .nav-lb { font-size: 13px; white-space: nowrap; }
}
@media (max-width: 400px) {
  .side-nav:not(.open) .nav.nav-main .nav-lb { font-size: 12px; }
}
@media (max-width: 900px) {
  /* あそぶ は 目立たせる（ゲームの 入口だと 分かるように） */
  .side-nav .nav.nav-main[data-view="asobu"]:not(.active) { background: linear-gradient(180deg, #ff7f8e, #d93a5a); color: #fff; box-shadow: inset 0 0 0 2px #ffd765; }
}
/* 2026-10-05 今日の冒険：級を えらぶ 窓（app.js pickRoutineGrade） */
.rt-grades { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; margin-top: 4px; }
.rt-g { font-size: 18px; font-weight: 900; padding: 12px 4px; border-radius: 12px; background: #fff; color: var(--navy); border: 3px solid #d9c27a; }
.rt-g.rt-def { background: linear-gradient(180deg, #ffe58a, #f2b632); border-color: #b8860b; }
.rt-g.rt-lock { background: #eee6d4; color: #8a7a5a; border-style: dashed; font-size: 15px; }
/* 2026-10-05 デザイン見直し①：スマホ・タブレットの 上の 列を すっきり。
   音・English・そろばんの きほん は ☰ の「せってい」へ（#navMorePhone）。上には 題と GOLD だけ。
   ← ホーム は 上の 4つの ボタンと 同じ なので しまう */
.nav-phone { display: none; }
@media (max-width: 900px) {
  .topbar-right .vol-pill, .topbar-right #langBtn, .topbar-right #examInfoBtn, .topbar-right .avatar-mini, #homeBackBtn { display: none !important; }
  .topbar { flex-wrap: nowrap; margin-bottom: 8px; gap: 8px; }
  .topbar h2 { width: auto !important; flex: 1 1 auto; min-width: 0; margin: 0; }
  .topbar-right { flex-wrap: nowrap; }
  .side-nav.open .nav-phone { display: block; }
  .side-nav.open .nav-x { display: inline-block; width: auto; margin: 3px 4px 3px 0; font-size: 14px; padding: 9px 12px; border-radius: 10px; background: rgba(255,255,255,.08); color: #e8e0d2; border: 0; }
  .nav-vol { display: inline-flex; align-items: center; gap: 8px; margin: 3px 0; padding: 6px 10px; border-radius: 10px; background: rgba(255,255,255,.08); color: #e8e0d2; font-size: 14px; }
}
/* 2026-10-05 デザイン見直し③のつづき：ミスモンスターは「やみに つつまれて 暗い」→ 正解の たびに 明るく →
   さいごに 金色に 光って なかまに なる（前は 殴られて ゆれ、たおれて 消えた＝討伐の 動き。決まり「討伐に しない」） */
.fighter.cpu img { --dark: 1; filter: grayscale(calc(var(--dark) * .8)) brightness(calc(1 - var(--dark) * .3)) drop-shadow(0 0 calc(var(--dark) * 12px) rgba(70, 30, 110, .85)); transition: filter .45s ease; }
.fighter.cpu img.hit { animation: enemyLight .45s ease; }
@keyframes enemyLight {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.06); filter: brightness(1.7) drop-shadow(0 0 16px rgba(255, 220, 120, .95)); }
  100% { transform: scale(1); }
}
.fighter.cpu img.down { animation: enemyFriend .7s ease forwards; }
@keyframes enemyFriend {
  0%   { transform: scale(1) translateY(0); filter: brightness(1.2) drop-shadow(0 0 8px rgba(255, 220, 120, .8)); }
  50%  { transform: scale(1.15) translateY(-10px); filter: brightness(1.6) drop-shadow(0 0 24px rgba(255, 215, 90, 1)); }
  100% { transform: scale(1.05) translateY(-4px); filter: none; opacity: 1; }
}
.hpfill { background: linear-gradient(90deg, #8a6bc2, #4b3478); }
.hpfill.low { background: linear-gradient(90deg, #c7b3ec, #8a6bc2); }
/* 2026-10-05 デザイン見直し⑥：絵文字の アイコンを 絵に（assets/ui/nav/）。あそぶ の カードも 表紙絵に（assets/asobu/） */
.nav-ic img { width: 34px; height: 34px; object-fit: contain; display: block; }
.nav-mini { width: 24px; height: 24px; object-fit: contain; vertical-align: middle; margin-right: 6px; flex-shrink: 0; }
.side-nav:not(.open) .nav-more .nav .nav-mini { margin-right: 0; }
@media (max-width: 900px) { .side-nav.open .nav.nav-main .nav-ic img { width: 46px; height: 46px; } }
.asobu-btn.asobu-cv { position: relative; padding: 0; overflow: hidden; gap: 0; background: #1d2b5c; border: 3px solid var(--royal-gold, #d9b04a); box-shadow: 0 4px 0 #8a6a1e; }
.asobu-btn.asobu-cv .asobu-cover { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: center 35%; }
.asobu-btn.asobu-cv .asobu-cover-txt { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 10px 10px; background: linear-gradient(transparent, rgba(10, 12, 40, .88)); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.asobu-btn.asobu-cv .asobu-cover-txt b { color: #fff; font-size: 21px; letter-spacing: .05em; text-shadow: 0 0 8px rgba(255, 215, 90, .9), 0 2px 2px #000; }
.asobu-btn.asobu-cv .asobu-cover-txt small { color: #ffeec0; }
/* 2026-10-05 🎬 うごきで 見る（app.js sbAnimInit）：珠が 1手ずつ 動く お手本 */
.sb-anim { text-align: center; }
.sba-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 4px 0 10px; }
.sba-chip { font-size: 14px; padding: 7px 12px; border-radius: 999px; background: #fff; color: var(--navy); border: 2px solid #d9c27a; font-weight: 700; }
.sba-chip.on { background: linear-gradient(180deg, #ffe58a, #f2b632); border-color: #b8860b; }
/* 2026-10-06 種類の タブ ＋ さがす 欄（34本に ふえて ごちゃごちゃ → えらんだ 種類だけ 出す） */
.sba-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin: 2px 0 8px; }
.sba-tab { font-size: 14px; padding: 7px 12px; border-radius: 10px; background: #f3ecd9; color: var(--navy); border: 2px solid transparent; font-weight: 800; }
.sba-tab.on { background: var(--navy); color: #fff; }
.sba-tab b { display: inline-block; min-width: 20px; height: 20px; line-height: 20px; border-radius: 50%; background: #d9c27a; color: #3a2c18; font-size: 12px; margin-right: 5px; text-align: center; }
.sba-tab.on b { background: #ffe58a; } .sba-tab.done b { background: var(--ok); color: #fff; } .sba-tab.now { box-shadow: 0 0 0 2px #f2b632; }
.sba-prog { display: block; font-size: 11px; font-weight: 700; opacity: .8; line-height: 1.1; margin-top: 2px; }
.sba-next-up { font-size: 13px; color: #6b5a3a; margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; }
.sba-go-next { font-size: 14px; padding: 6px 12px; border-radius: 999px; border: 0; background: var(--ok); color: #fff; font-weight: 800; }
.sba-q { display: block; width: 100%; max-width: 360px; margin: 0 auto 8px; box-sizing: border-box; font-size: 16px; padding: 8px 12px; border-radius: 999px; border: 2px solid #d9c27a; background: #fff; }
.sba-chip.sba-auto { background: #2e7d4f; color: #fff; border-color: #1f5a37; }
.sba-chip.sba-auto.on { background: linear-gradient(180deg, #4fbf7f, #2e7d4f); }
.sba-wmode { margin: 0; } .sba-wmode small { display: block; font-size: 12px; color: #6b5a3a; margin-top: 4px; }
@media (max-width: 640px) {   /* スマホ：切りかえの 説明は しまう（ボタンだけ）。長い 説明は 少し 小さく（360×640 で 1画面に） */
  .sba-wmode small { display: none; }
  .sba-wmode { margin-bottom: 4px; }
  .sba-cap.long { font-size: 13px; line-height: 1.4; min-height: 0; }
  .sba-fingers:empty { min-height: 0; margin-top: 0; }
  /* 操作の ボタンが 6つ に ふえた（いっしょに・ひとりで）→ 2列の ます目で 詰める（360×640 で 1画面） */
  .sba-ctl { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; max-width: 348px; margin: 0 auto; }
  .sba-ctl > * { margin: 0; justify-self: stretch; }
  .sba-ctl .sba-play { font-size: 16px; padding: 8px 6px; grid-column: span 2; }
  .sba-ctl .sba-next, .sba-ctl .sba-reset { padding: 8px 4px; font-size: 13px; }
  .sba-ctl .sba-try { font-size: 13px; padding: 8px 4px; }
  .sba-ctl .sba-speed, .sba-ctl .sba-wmode { justify-self: center; align-self: center; }
  .sba-ctl .sba-wmode { margin: 0; }
  .sba-cap { min-height: 40px; margin: 4px auto 6px; }
  .sba-eq { margin: 0 0 4px; }
}
.sba-try { font-size: 15px; padding: 9px 14px; border-radius: 12px; border: 0; font-weight: 900; color: #fff; background: #2b6fd0; } .sba-try.alone { background: #c0392b; } .sba-try.on { box-shadow: 0 0 0 3px #ffe58a; }
.sba-prac { margin-top: 12px; padding: 10px 6px 6px; border-top: 2px dashed #d9c27a; }
.sba-prac-head { font-size: 16px; font-weight: 800; color: var(--navy); } .sba-prac-eq { display: block; font-size: 22px; font-weight: 900; margin-top: 2px; }
.sba-prac .soroban { margin: 8px auto; }
.sba-prac-cap { min-height: 44px; margin: 4px auto 6px; max-width: 460px; font-size: 16px; font-weight: 700; color: #3a2c18; line-height: 1.5; }
.sba-prac-done { color: var(--ok); font-size: 20px; font-weight: 900; }
.sba-prac-next { font-size: 17px; padding: 10px 18px; border-radius: 12px; border: 0; font-weight: 900; color: #fff; background: #c0392b; }
.sba-prac-ctl { display: flex; gap: 8px; justify-content: center; margin-top: 8px; }
.bead.hint { animation: beadHint .8s ease-in-out infinite; z-index: 6; }
@keyframes beadHint { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.6) drop-shadow(0 0 6px #ffd36b); } }
.sba-none { font-size: 14px; color: #6b5a3a; padding: 8px 0; }
@media (max-width: 640px) {   /* スマホ：タブは 3つ × 2段（かくさない） */
  .sba-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
  .sba-tab { font-size: 12.5px; padding: 6px 2px; white-space: nowrap; letter-spacing: -.02em; }
  .sba-tab b { min-width: 16px; height: 16px; line-height: 16px; font-size: 11px; margin-right: 3px; }
  .sba-next-up { font-size: 12px; margin-bottom: 6px; }
  .sba-q { padding: 6px 12px; margin-bottom: 6px; }
}
/* スマホ：お手本が 16本に ふえたので、ボタンは 横 1列で すべらせる（そろばんを 1画面に のこす・2026-10-05） */
@media (max-width: 640px) {
  .sba-chips { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding: 2px 2px 6px; margin: 2px -4px 8px; }
  .sba-chips::-webkit-scrollbar { display: none; }
  .sba-chip { flex: none; white-space: nowrap; }
}
.sba-eq { font-size: 24px; font-weight: 900; color: var(--navy); letter-spacing: .04em; margin: 2px 0 6px; }
.sba-eq.long { font-size: 17px; letter-spacing: 0; }
.sba-svg { height: 190px; width: auto; max-width: 100%; display: block; margin: 0 auto; }
.sba-svg.wide { width: 100%; height: auto; max-height: 190px; }   /* けたが 多い（6列〜）ときは 横幅に 合わせる（スマホで 上下に 空きが できない） */
.sba-svg .bd { transition: transform .45s cubic-bezier(.3, .7, .3, 1); }
.sba-svg .bd polygon { fill: #a5552a; stroke: #5a2d12; stroke-width: 1.5; transition: fill .3s; }
.sba-svg .bd.mv polygon { fill: #ff9f2e; stroke: #c0392b; }
.sba-fingers { min-height: 30px; margin-top: 8px; display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.sba-cap { min-height: 48px; margin: 6px auto 10px; max-width: 460px; font-size: 16px; font-weight: 700; color: #3a2c18; line-height: 1.5; }
.sba-no { display: inline-block; margin-right: 8px; padding: 1px 8px; border-radius: 999px; background: var(--navy); color: #fff; font-size: 12px; vertical-align: 2px; }
.sba-ctl { display: flex; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap; }
.sba-ctl .sba-play { font-size: 18px; padding: 10px 22px; background: var(--ok); color: #fff; border: 0; border-radius: 12px; font-weight: 900; }
.sba-ctl .sba-speed { margin-left: 0; }
@media (prefers-reduced-motion: reduce) { .sba-svg .bd { transition: none; } }
/* 2026-10-05 指の 印（珠と いっしょに 動く）・くり上がりの 連続 */
.sba-svg .bd { transition-duration: .35s; }
.sba-svg .fg { transition: transform .35s cubic-bezier(.3, .7, .3, 1); }
.sba-svg .fg text { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.sba-svg { height: 210px; }
/* 2026-10-05 🍓 じゅんび（junbi.js）：すうじを かく まえの 子。ボタンは 大きく、字は 少なく */
/* 2026-10-05 そろばんデビューの 入口は 絵の ボタン（assets/ui/junbi_entry.webp・文字も 矢印も 絵の 中） */
.junbi-entry { display: block; width: 100%; margin: 4px 0 12px; padding: 0; border: 0; border-radius: 18px; background: none; box-shadow: none; cursor: pointer; }
.junbi-entry img { display: block; width: 100%; height: auto; border-radius: 18px; }
.junbi-entry:active img { transform: translateY(2px); }
.jb-card { min-height: 60vh; }
.jb-head h3 { margin: 0 0 4px; }
.jb-menu { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 10px; }
.jb-stage { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 8px 12px; border-radius: 18px; background: linear-gradient(180deg, #fffaf0, #ffeccc); border: 3px solid var(--royal-gold, #d9b04a); box-shadow: 0 4px 0 #b8912a; color: var(--navy); }
.jb-stage:active { transform: translateY(3px); box-shadow: 0 1px 0 #b8912a; }
.jb-stage.lock { filter: grayscale(.55); opacity: .8; }
.jb-stage .jb-st-ic { font-size: 44px; line-height: 1.1; }
.jb-stage .jb-st-ic .jb-fr { font-size: 44px; }
.jb-stage b { font-size: 17px; }
.jb-stage small { font-size: 14px; font-weight: 800; color: #8a6a1e; }
.jb-stars { min-height: 20px; font-size: 14px; letter-spacing: -2px; }
.jb-free { position: absolute; top: 6px; right: 6px; font-size: 11px; font-weight: 800; background: #2e9a4a; color: #fff; padding: 2px 8px; border-radius: 999px; }
.jb-note { margin-top: 10px; }
.jb-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.jb-prog { display: flex; gap: 6px; }
.jb-prog i { width: 14px; height: 14px; border-radius: 50%; background: #e9e0cc; display: block; }
.jb-prog i.done { background: #f2b632; } .jb-prog i.now { background: #ff8a2e; box-shadow: 0 0 0 3px rgba(255, 138, 46, .3); }
.jb-q { text-align: center; font-size: 20px; font-weight: 900; color: var(--navy); margin: 4px 0 8px; }
.jb-fruits { display: grid; grid-template-columns: repeat(5, auto); justify-content: center; gap: 4px 6px; margin: 4px auto 6px; }
.jb-fr { font-size: 44px; line-height: 1.1; display: inline-block; }
img.jb-fr { width: 48px; height: 48px; object-fit: contain; }
.jb-fr.sm { font-size: 30px; } img.jb-fr.sm { width: 32px; height: 32px; }
.jb-fr.xs { font-size: 22px; } img.jb-fr.xs { width: 24px; height: 24px; }
.jb-soro { display: flex; justify-content: center; }
.jb-svg { height: min(300px, 42vh); width: auto; touch-action: none; }
.jb-svg .jbb { cursor: pointer; transition: transform .25s cubic-bezier(.3, .7, .3, 1); }
.jb-svg .jbb polygon { fill: #a5552a; stroke: #5a2d12; stroke-width: 2.5; }
.jb-svg .jbb.in polygon { fill: #ff9f2e; stroke: #c0392b; }
.jb-hint { text-align: center; min-height: 22px; font-weight: 800; color: #b8331a; }
.jb-ctl { display: flex; justify-content: center; gap: 8px; margin-top: 6px; }
.jb-trace-fr { text-align: center; min-height: 36px; }
.jb-zero { font-size: 15px; color: #8a7a5a; }
.jb-canvas { display: flex; justify-content: center; }
.jb-canvas canvas { width: min(280px, 72vw); height: auto; aspect-ratio: 1; background: #fffdf6; border: 3px dashed #d9c27a; border-radius: 18px; touch-action: none; }
.jb-match { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 22px; max-width: 420px; margin: 6px auto 0; }
.jb-col { display: flex; flex-direction: column; gap: 12px; }
.jb-l, .jb-r { min-height: 74px; border-radius: 16px; background: #fff; border: 3px solid #d9c27a; box-shadow: 0 3px 0 #c9b06a; color: var(--navy); }
.jb-l { display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: 0 2px; padding: 6px; }
.jb-r { font-size: 40px; font-weight: 900; }
.jb-l.sel { background: #fff3c4; border-color: #f2b632; box-shadow: 0 0 0 4px rgba(242, 182, 50, .45); }
.jb-l.ok, .jb-r.ok { background: #f2fff0; }
.jb-r.ng { animation: jbShake .35s; }
@keyframes jbShake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.jb-good { position: fixed; left: 50%; top: 40%; transform: translate(-50%, -50%); z-index: 90; font-size: 40px; font-weight: 900; color: #fff; background: linear-gradient(180deg, #ffb52e, #f07a1a); padding: 14px 30px; border-radius: 22px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); animation: jbPop .4s ease; pointer-events: none; }
@keyframes jbPop { 0% { transform: translate(-50%, -50%) scale(.4); opacity: 0; } 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
.jb-end { text-align: center; padding: 20px 0; }
.jb-end-st { font-size: 48px; }
.jb-end-btns { display: flex; justify-content: center; gap: 10px; margin-top: 10px; }
.jb-end-btns button { font-size: 18px; padding: 12px 22px; }
/* 同日 360×640 で そろばんが 画面の 外 → くだものと そろばんを 横に ならべる */
.jb-count-row { display: flex; align-items: center; justify-content: center; gap: 14px; }
.jb-count-row .jb-fruits { grid-template-columns: repeat(3, auto); margin: 0; }
.jb-count-row .jb-svg { height: min(280px, 44vh); }
@media (max-width: 400px) { .jb-count-row .jb-fr { font-size: 36px; } .jb-q { font-size: 18px; } }
body:has(#view-junbi:not(.hidden)) .scroll-more { display: none !important; }
.jb-l.ok, .jb-r.ok { opacity: 1; color: var(--navy); }
/* 2026-10-05 ソロモンの 反応（app.js soloReact）：画面の 右下に 出て、すぐ 消える */
#soloReact { position: fixed; right: 10px; bottom: calc(var(--hudPad, 0px) + var(--soroPad, 0px) + var(--bridgePad, 0px) + 12px); width: 96px; height: auto; z-index: 70; pointer-events: none; opacity: 0; transform: translateY(20px) scale(.6); }
#soloReact.sr-show { opacity: 1; }
#soloReact.sr-joy { animation: srJoy 1.1s ease forwards; }
#soloReact.sr-shock { animation: srShock 1.5s ease forwards; }
#soloReact.sr-despair { animation: srDespair 1.5s ease forwards; }
@keyframes srJoy { 0% { opacity: 0; transform: translateY(30px) scale(.6); } 25% { opacity: 1; transform: translateY(-26px) scale(1.08) rotate(-6deg); } 45% { transform: translateY(0) scale(1) rotate(4deg); } 60% { transform: translateY(-12px) rotate(-3deg); } 75% { transform: translateY(0) rotate(0); opacity: 1; } 100% { opacity: 0; transform: translateY(0); } }
@keyframes srShock { 0% { opacity: 0; transform: translateX(0) scale(.7); } 15% { opacity: 1; transform: translateX(0) scale(1.05); } 30% { transform: translateX(22px) rotate(12deg) scale(.92); } 38% { transform: translateX(18px) rotate(9deg); } 46% { transform: translateX(22px) rotate(12deg); } 80% { opacity: 1; transform: translateX(16px) rotate(8deg) scale(.95); } 100% { opacity: 0; transform: translateX(16px) rotate(8deg); } }
@keyframes srDespair { 0% { opacity: 0; transform: translateY(-10px) scale(.8); } 15% { opacity: 1; transform: translateY(0) scale(1); } 35% { transform: translateY(14px) scale(1, .9); } 45% { transform: translateY(14px) translateX(-3px) scale(1, .9); } 52% { transform: translateY(14px) translateX(3px) scale(1, .9); } 59% { transform: translateY(14px) translateX(-3px) scale(1, .9); } 85% { opacity: 1; transform: translateY(16px) scale(1, .88); } 100% { opacity: 0; transform: translateY(20px) scale(1, .88); } }
@media (max-width: 640px) { #soloReact { width: 76px; } }
@media (prefers-reduced-motion: reduce) { #soloReact.sr-joy, #soloReact.sr-shock, #soloReact.sr-despair { animation-duration: .01s; opacity: 1; } }
/* 2026-10-05 🍓 たまっこひろば（こどもちゃれんじ・Khan Academy Kids の ように かわいく）：パステル・ソロモンの 吹き出し・すうじの みち・シール帳・紙ふぶき */
#view-junbi .jb-card { background: linear-gradient(180deg, #fff5f8 0%, #fffbea 55%, #effbf3 100%); border: 3px solid #ffd3df; border-radius: 26px; }
.jb-guide { display: flex; align-items: flex-end; gap: 8px; margin: 2px 0 8px; }
.jb-guide img { width: 70px; height: auto; flex-shrink: 0; animation: jbBob 2.4s ease-in-out infinite; }
@keyframes jbBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.jb-bubble { position: relative; background: #fff; border: 3px solid #ffb3c6; border-radius: 18px; padding: 8px 14px; font-size: 18px; font-weight: 900; color: #6a3a4a; line-height: 1.4; }
.jb-bubble::before { content: ""; position: absolute; left: -11px; bottom: 12px; border: 8px solid transparent; border-right: 10px solid #ffb3c6; }
.jb-hero h3 { margin: 4px 0 2px; font-size: 24px; color: #e2557a; letter-spacing: .04em; }
.jb-hero p { margin: 0 0 8px; color: #7a5a62; font-size: 14px; }
.jb-path { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 10px; padding: 10px 6px 4px; }
.jb-stone { position: relative; aspect-ratio: 1; border-radius: 50%; border: 4px solid #fff; background: radial-gradient(circle at 35% 30%, #ffe9a8, #ffc54d); box-shadow: 0 5px 0 #e3a12a, 0 8px 14px rgba(200, 120, 40, .25); display: flex; flex-direction: column; align-items: center; justify-content: center; color: #8a4a00; }
.jb-stone.low { transform: translateY(14px); }
.jb-stone:nth-child(3n+2) { background: radial-gradient(circle at 35% 30%, #ffd1dc, #ff8fab); box-shadow: 0 5px 0 #e0607f, 0 8px 14px rgba(220, 80, 120, .25); color: #7a1e3a; }
.jb-stone:nth-child(3n) { background: radial-gradient(circle at 35% 30%, #cdf5e0, #6fd6a4); box-shadow: 0 5px 0 #3fae78, 0 8px 14px rgba(60, 160, 110, .25); color: #11573a; }
.jb-stone:active { transform: translateY(4px); }
.jb-stone.low:active { transform: translateY(18px); }
.jb-stone .jb-num { font-size: 34px; font-weight: 900; line-height: 1; }
.jb-stone .jb-st-fr { font-size: 18px; }
.jb-stone.lock { filter: grayscale(.7); opacity: .75; }
.jb-stone .jb-badge { position: absolute; top: -6px; right: -4px; font-size: 22px; }
.jb-stone.done { outline: 3px dashed #fff; outline-offset: -9px; }
.jb-book { margin-top: 26px; padding: 10px 12px; border-radius: 18px; background: #fff; border: 3px dashed #c9e8ff; }
.jb-stickers { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; min-height: 40px; align-items: center; }
.jb-sticker { position: relative; width: 48px; height: 48px; border-radius: 50%; background: #fff7d6; border: 3px solid #ffd36b; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 0 #e8b84a; }
.jb-sticker i { position: absolute; right: -4px; bottom: -4px; font-style: normal; font-size: 12px; font-weight: 900; background: #e2557a; color: #fff; border-radius: 999px; padding: 0 6px; }
.jb-extra { display: block; width: 100%; margin-top: 14px; padding: 14px; border-radius: 18px; font-size: 18px; font-weight: 900; background: linear-gradient(180deg, #e9e2ff, #c9b8ff); border: 3px solid #fff; box-shadow: 0 4px 0 #9a85e0; color: #3a2a7a; }
.jb-extra.lock { filter: grayscale(.6); opacity: .8; }
.jb-steps { display: flex; gap: 8px; }
.jb-steps i { font-style: normal; width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; background: #fff; border: 3px solid #eee3c8; opacity: .55; }
.jb-steps i.done { background: #d8f6e6; border-color: #6fd6a4; opacity: 1; }
.jb-steps i.now { background: #fff2b8; border-color: #ffc54d; opacity: 1; transform: scale(1.12); }
.jb-tree { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 12px 8px; margin: 0 auto; max-width: 340px; border-radius: 50% 50% 22px 22px / 34% 34% 22px 22px; background: radial-gradient(circle at 50% 40%, #b9efc9, #7fd39b); border: 4px solid #fff; box-shadow: 0 6px 0 #5fb57c; }
/* 2026-10-05 テストユーザー「スマホで ドラッグ すると 画面が 動く」→ 木・かご・くだものは 指で 動かしても 画面を スクロール させない。長押しの 吹き出しも 出さない */
.jb-tree, .jb-basket, .jb-pick, .jb-took { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.jb-pick { background: none; border: 0; padding: 2px; min-width: 56px; min-height: 56px; display: inline-flex; align-items: center; justify-content: center; transition: transform .15s; cursor: grab; }
.jb-pick:active { transform: scale(.85); }
.jb-pick.gone { visibility: hidden; }
.jb-pick.lift { opacity: .25; }
.jb-pick.hint { animation: jbWiggle .7s ease-in-out infinite; }
@keyframes jbWiggle { 0%, 100% { transform: rotate(-10deg) scale(1.1); } 50% { transform: rotate(10deg) scale(1.2); } }
.jb-flyer { position: fixed; z-index: 95; pointer-events: none; transform: translate(-50%, -50%); filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .25)); }
.jb-flyer.drag { transform: translate(-50%, -50%) scale(1.3); }
.jb-basket.shake { animation: jbShake .4s; }
.jb-svg .jbb.hint polygon { animation: jbGlow .8s ease-in-out infinite; }
@keyframes jbGlow { 0%, 100% { fill: #a5552a; } 50% { fill: #ffd36b; stroke: #e2557a; } }
.jb-canvas canvas.hint { animation: jbBorder .9s ease-in-out infinite; }
@keyframes jbBorder { 0%, 100% { border-color: #ffb3c6; } 50% { border-color: #e2557a; box-shadow: 0 0 0 6px rgba(226, 85, 122, .25); } }
/* 🌞 きょうの おてつだい・あそびの ひろば（2026-10-05 学びの 道すじ） */
.jb-day { margin: 10px 0 4px; padding: 12px 14px; border-radius: 22px; background: linear-gradient(180deg, #fff8dc, #ffeaa7); border: 3px solid #fff; box-shadow: 0 4px 0 #e3b94a; }
.jb-day-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.jb-day-head b { white-space: nowrap; }
.jb-day-head b { font-size: 19px; color: #7a4a00; } .jb-day-head small { color: #8a6a1e; font-weight: 800; }
.jb-day-ring { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.jb-day-dot { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.jb-day-dot i { width: 54px; height: 54px; border-radius: 50%; background: #fff; border: 3px solid #f0d680; display: flex; align-items: center; justify-content: center; font-size: 26px; font-style: normal; font-weight: 900; color: #2e9a4a; }
.jb-day-dot.now i { border-color: #ff8a2e; box-shadow: 0 0 0 4px rgba(255, 138, 46, .3); animation: jbPulse 1.2s ease-in-out infinite; }
.jb-day-dot.done i { background: #d8f6e6; border-color: #6fd6a4; }
.jb-day-dot small { font-size: 12px; font-weight: 800; color: #6a4a10; text-align: center; line-height: 1.2; }
.jb-day-go { width: 100%; font-size: 20px; font-weight: 900; padding: 14px; border-radius: 999px; border: 4px solid #fff; color: #fff; background: linear-gradient(180deg, #ffb52e, #f07a1a); box-shadow: 0 5px 0 #b85a0a; }
.jb-h4 { margin: 18px 0 4px; font-size: 17px; color: #7a4a62; }
.jb-hiroba { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.jb-act { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-radius: 18px; background: #fff; border: 3px solid #ffd3df; box-shadow: 0 4px 0 #ffb3c6; color: #6a3a4a; min-height: 96px; }
.jb-act:active { transform: translateY(3px); box-shadow: 0 1px 0 #ffb3c6; }
.jb-act-ic { font-size: 34px; line-height: 1.1; } .jb-act b { font-size: 13px; line-height: 1.2; } .jb-act small { font-size: 12px; color: #e2a800; letter-spacing: 1px; }
.jb-parent-b { display: block; width: 100%; margin-top: 10px; }
.jb-pm-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 8px 0; border-bottom: 1px dashed #e0d4c0; }
.jb-pm-row span { font-weight: 800; } .jb-pm-row b { color: #e2a800; letter-spacing: 2px; } .jb-pm-row small { grid-column: 1 / -1; color: #6a5a4a; line-height: 1.5; }
.jb-qdots { display: flex; gap: 6px; }
.jb-qdots i { width: 12px; height: 12px; border-radius: 50%; background: #eee3c8; display: block; }
.jb-qdots i.done { background: #6fd6a4; } .jb-qdots i.now { background: #ff8a2e; box-shadow: 0 0 0 3px rgba(255, 138, 46, .3); }
.jb-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px auto 0; max-width: 420px; }
.jb-ch { min-height: 76px; font-size: 40px; font-weight: 900; border-radius: 18px; background: #fff; border: 4px solid #ffd3df; box-shadow: 0 5px 0 #ffb3c6; color: var(--navy); touch-action: manipulation; }
.jb-ch:active { transform: translateY(3px); box-shadow: 0 2px 0 #ffb3c6; }
.jb-ch.ok { background: #e9fff1; border-color: #6fd6a4; box-shadow: 0 0 0 5px rgba(111, 214, 164, .4); }
.jb-ch.ng { animation: jbShake .35s; opacity: .45; }
.jb-ch.hint { animation: jbBorder .9s ease-in-out infinite; }
.jb-ch[disabled]:not(.ok) { opacity: .45; }
.jb-choices.cards .jb-ch { font-size: 16px; padding: 8px 4px; min-height: 110px; display: flex; align-items: center; justify-content: center; }
.jb-choices.two { grid-template-columns: 1fr 1fr; }
.jb-bignum-s { font-size: 56px; color: #e2557a; }
.jb-f5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; padding: 4px; border-radius: 12px; background: #fff7e6; border: 2px solid #e8d6a8; max-width: 300px; margin: 0 auto; }
.jb-f5c { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border: 2px dashed #ecdcb8; border-radius: 8px; }
.jb-f5c.on { border-style: solid; background: #fff; }
.jb-f5.mini { max-width: 100%; gap: 2px; padding: 2px; } .jb-f5.mini .jb-fr.sm { font-size: 26px; } .jb-f5.mini img.jb-fr.sm { width: 26px; height: 26px; }
/* 2026-10-16 ユーザー「幼児が やるには 絵が 小さくて 見づらい。大きく」：どっちが おおい？ は 画面いっぱいの 大きな かご 2つ */
.jb-choices.cmp { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(12px, 4vw, 40px); max-width: 820px; margin: 18px auto 0; }
@media (max-width: 640px) { .jb-choices.cmp { grid-template-columns: minmax(0, 1fr); max-width: 330px; gap: 14px; margin-top: 10px; } }
.jb-f5.big { width: 100%; max-width: 380px; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(3px, 1vw, 7px); padding: clamp(4px, 1vw, 9px); box-sizing: border-box; }
.jb-f5.big .jb-f5c { min-width: 0; overflow: hidden; }
.jb-f5.big .jb-fr.sm { font-size: clamp(30px, 7vw, 54px); } .jb-f5.big img.jb-fr.sm { width: 84%; height: auto; max-width: none; }
.jb-scatter { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; min-height: 120px; align-content: center; padding: 8px; border-radius: 18px; background: radial-gradient(circle at 50% 40%, #b9efc9, #7fd39b); border: 4px solid #fff; box-shadow: 0 6px 0 #5fb57c; }
.jb-cnt { position: relative; background: none; border: 0; padding: 4px; min-width: 56px; min-height: 56px; transform: rotate(var(--r, 0deg)); touch-action: manipulation; }
.jb-cnt.hit { opacity: .6; } .jb-cnt.hit .jb-fr { filter: grayscale(.3); }
.jb-cnt.hint { animation: jbWiggle .7s ease-in-out infinite; }
.jb-cnt-n { position: absolute; right: -2px; top: -2px; font-style: normal; font-size: 16px; font-weight: 900; background: #e2557a; color: #fff; border-radius: 999px; min-width: 24px; padding: 0 6px; line-height: 24px; }
.jb-empty { font-weight: 800; color: #3a6a4a; }
.jb-peek { text-align: center; }
.jb-peek-in { min-height: 120px; display: flex; justify-content: center; align-items: center; transition: opacity .25s; }
.jb-peek-in.hide { opacity: 0; }
.jb-peek-in .jb-svg { height: min(200px, 30vh); pointer-events: none; }
.jb-peek-again { margin-top: 6px; font-size: 15px; font-weight: 800; padding: 8px 14px; border-radius: 999px; background: #fff; border: 2px solid #ffb3c6; color: #6a3a4a; }
.jb-soro.mini .jb-svg { height: 96px; pointer-events: none; }
.jb-seq { display: flex; justify-content: center; gap: 8px; margin: 8px 0; }
.jb-seq-st { width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 900; background: radial-gradient(circle at 35% 30%, #ffe9a8, #ffc54d); border: 3px solid #fff; box-shadow: 0 4px 0 #e3a12a; color: #8a4a00; }
.jb-seq-st.q { background: radial-gradient(circle at 35% 30%, #fff, #ffd1dc); color: #e2557a; border-style: dashed; border-color: #e2557a; }
.jb-bond { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: start; margin-top: 6px; }
.jb-bond-side { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.jb-bond-who { font-size: 34px; }
.jb-bond-basket { min-height: 60px; min-width: 70px; display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; padding: 6px; border-radius: 0 0 24px 24px; background: linear-gradient(180deg, #f4d39a, #d9a55a); border: 3px solid #b9803a; }
.jb-bond-side b { font-size: 28px; color: var(--navy); } .jb-bond-side b.q { color: #e2557a; }
.jb-bond-mid { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; max-width: 120px; padding-top: 30px; }
.jb-bond-fr { background: none; border: 0; padding: 4px; min-width: 48px; min-height: 48px; touch-action: manipulation; }
.jb-bond-fr.gone { visibility: hidden; } .jb-bond-fr.hint { animation: jbWiggle .7s ease-in-out infinite; }
.jb-sand { display: flex; align-items: center; justify-content: center; gap: 14px; }
.jb-sand-tree { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.jb-sand-fr { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; width: 150px; min-height: 150px; align-content: center; padding: 10px; border-radius: 50% 50% 22px 22px / 34% 34% 22px 22px; background: radial-gradient(circle at 50% 40%, #b9efc9, #7fd39b); border: 4px solid #fff; box-shadow: 0 6px 0 #5fb57c; }
.jb-sand-n { font-size: 44px; font-weight: 900; color: #e2557a; line-height: 1; }
@media (max-width: 400px) { .jb-day-head b { font-size: 17px; } .jb-day-head small { font-size: 11px; } .jb-ch { font-size: 34px; min-height: 68px; } .jb-day-dot i { width: 48px; height: 48px; font-size: 22px; } .jb-hiroba { grid-template-columns: repeat(3, 1fr); } .jb-act b { font-size: 12px; } }
/* 👀 おてほん */
.jb-demo-b { font-size: 22px; padding: 4px 10px; }
.jb-tree.demo .jb-pick { pointer-events: none; }
.jb-demo-row { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 10px; }
.jb-demo-row .jb-svg { height: min(220px, 34vh); pointer-events: none; }
.jb-bignum { font-size: 96px; font-weight: 900; color: #e2557a; line-height: 1; min-width: 70px; text-align: center; opacity: 0; }
.jb-bignum.pop { opacity: 1; animation: jbNumPop .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes jbNumPop { 0% { transform: scale(.2); } 100% { transform: scale(1); } }
.jb-demo-ctl { display: flex; justify-content: center; margin-top: 12px; }
.jb-yourturn { font-size: 22px; font-weight: 900; padding: 16px 28px; border-radius: 999px; border: 4px solid #fff; color: #fff; background: linear-gradient(180deg, #8fe3b8, #3fae78); box-shadow: 0 5px 0 #2a8a5c; animation: jbPulse 1.2s ease-in-out infinite; }
@keyframes jbPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.jb-basket { position: relative; margin: 12px auto 0; max-width: 300px; min-height: 76px; border-radius: 0 0 40px 40px; background: linear-gradient(180deg, #f4d39a, #d9a55a); border: 4px solid #b9803a; display: flex; align-items: center; justify-content: center; }
.jb-basket-ic { position: absolute; left: 8px; top: -16px; font-size: 28px; }
.jb-in { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; padding: 6px 30px; }
.jb-took { background: none; border: 0; padding: 0; animation: jbDrop .35s ease; }
@keyframes jbDrop { 0% { transform: translateY(-40px) scale(1.3); opacity: 0; } 100% { transform: none; opacity: 1; } }
.jb-good { position: fixed; left: 50%; top: 38%; transform: translate(-50%, -50%); z-index: 90; font-size: 44px; font-weight: 900; color: #fff; background: linear-gradient(180deg, #ff8fab, #e2557a); padding: 14px 34px; border-radius: 999px; border: 5px solid #fff; box-shadow: 0 10px 26px rgba(226, 85, 122, .35); animation: jbPop .45s cubic-bezier(.3, 1.6, .5, 1); pointer-events: none; white-space: nowrap; }
.jb-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 89; overflow: hidden; }
.jb-confetti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 3px; animation: jbFall 1.8s ease-in forwards; }
@keyframes jbFall { 0% { transform: translateY(0) rotate(0); opacity: 1; } 100% { transform: translateY(105vh) rotate(540deg); opacity: .8; } }
.jb-end-sticker { position: relative; display: inline-flex; width: 110px; height: 110px; border-radius: 50%; align-items: center; justify-content: center; background: #fff7d6; border: 5px solid #ffd36b; box-shadow: 0 4px 0 #e8b84a; margin: 6px auto; animation: jbPop .5s cubic-bezier(.3, 1.6, .5, 1); }
.jb-end-sticker .jb-fr { font-size: 60px; }
.jb-end-sticker i { position: absolute; right: -6px; bottom: -6px; font-style: normal; font-size: 18px; font-weight: 900; background: #e2557a; color: #fff; border-radius: 999px; padding: 2px 10px; }
.jb-end .jb-guide { justify-content: center; }
.jb-end-btns .jb-next { background: linear-gradient(180deg, #8fe3b8, #3fae78); color: #fff; border: 0; border-radius: 999px; font-weight: 900; }
.jb-canvas canvas { border-color: #ffb3c6; background: #fff; }
@media (max-width: 400px) { .jb-guide img { width: 56px; } .jb-bubble { font-size: 16px; } .jb-stone .jb-num { font-size: 28px; } .jb-tree .jb-fr { font-size: 36px; } }

/* ============================================================
   2026-10-05 🍓 そろばんデビューの 見た目を 王国の 絵に そろえる
   （ユーザー「今までの 絵の 素材で 見た目を 整えないと 誰も 課金して 遊んで くれない」）
   使う 絵：ui/palace_bg.jpg（王宮の テラス）・battle/solomon_cheer／joy／worry.webp（大きい ソロモン）・
            battle/panel_gold／orange／green.webp（すうじの 石）・battle/ui_button.webp（金の ボタン）・
            pz_star.png（星）・battle/fx_star.webp（ごほうびの 光）。新しい 絵は 作っていない
   ============================================================ */
#view-junbi .jb-card { position: relative; overflow: hidden; border: 4px solid #e3b94a; border-radius: 26px; box-shadow: 0 6px 0 #b8892a, 0 10px 24px rgba(120, 80, 20, .25);
  background: linear-gradient(180deg, rgba(255, 252, 240, .55) 0%, rgba(255, 252, 240, .82) 45%, rgba(255, 252, 240, .94) 100%), url("assets/ui/palace_bg.jpg") center top / cover no-repeat; }
/* 吹き出し＝羊皮紙に 金の ふち */
.jb-guide { align-items: flex-end; gap: 6px; }
.jb-guide img { width: 112px; filter: drop-shadow(0 4px 6px rgba(80, 50, 0, .3)); }
.jb-bubble { background: linear-gradient(180deg, #fffdf4, #fff3d2); border: 3px solid #e3b94a; color: #5a3a10; box-shadow: 0 3px 0 #c9992a; }
.jb-bubble::before { border-right-color: #e3b94a; }
.jb-hero { text-align: center; }
.jb-hero .jb-guide { text-align: start; }
.jb-hero h3.jb-title { display: inline-block; margin: 6px auto 2px; padding: 8px 26px; font-size: 24px; color: #7a4a00; letter-spacing: .06em; border-radius: 999px;
  background: linear-gradient(180deg, #fff2b8, #ffd36b); border: 3px solid #fff; box-shadow: 0 4px 0 #c9992a, 0 0 0 3px #e3b94a; }
.jb-hero p { color: #5a4a30; font-weight: 800; }
/* 問いの 中身は 石の 台に のせる */
.jb-stage { padding: 12px 10px 14px; border-radius: 22px; background: linear-gradient(180deg, #fbf4e3, #f1e4c6); border: 3px solid #e3b94a; box-shadow: inset 0 2px 0 #fff, 0 5px 0 #c9992a, 0 10px 20px rgba(120, 80, 20, .18); }
.jb-top .ghost { background: rgba(255, 253, 244, .9); border: 2px solid #e3b94a; color: #5a3a10; font-weight: 900; }
/* すうじの 石＝宝石の パネル */
.jb-stone { aspect-ratio: 256 / 241; border-radius: 0; border: 0; background: url("assets/battle/panel_gold.webp") center / contain no-repeat; box-shadow: none; color: #fff; filter: drop-shadow(0 4px 4px rgba(80, 50, 0, .3)); }
.jb-stone:nth-child(3n+2) { background: url("assets/battle/panel_orange.webp") center / contain no-repeat; box-shadow: none; color: #fff; }
.jb-stone:nth-child(3n) { background: url("assets/battle/panel_green.webp") center / contain no-repeat; box-shadow: none; color: #fff; }
.jb-stone .jb-num { font-size: 38px; text-shadow: 0 2px 0 rgba(0, 0, 0, .35), 0 0 6px rgba(0, 0, 0, .25); }
.jb-stone .jb-st-fr { background: rgba(255, 255, 255, .85); border-radius: 999px; padding: 1px 8px; margin-top: 2px; }
.jb-stone.done { outline: 0; }
.jb-stone.done::after { content: ""; position: absolute; inset: 0; background: url("assets/pz_star.png") 88% 8% / 30px no-repeat; }
.jb-stone .jb-badge { display: none; }
.jb-stone.lock { filter: grayscale(.85) drop-shadow(0 4px 4px rgba(80, 50, 0, .3)); opacity: .8; }
/* 金の ボタン（ui_button.webp）：はじめる・こんどは きみの ばん・つぎの n へ */
.jb-day-go, .jb-yourturn, .jb-end-btns .jb-next { background: url("assets/battle/ui_button.webp") center / 100% 100% no-repeat; border: 0; border-radius: 0; box-shadow: none; color: #6a3a00; text-shadow: 0 1px 0 #fff6c8; font-size: 22px; padding: 0; width: 100%; max-width: 300px; aspect-ratio: 768 / 332; display: flex; align-items: center; justify-content: center; margin: 0 auto; filter: drop-shadow(0 4px 4px rgba(80, 50, 0, .3)); }
.jb-day-go { padding-top: 14px; } .jb-yourturn { padding-top: 14px; } .jb-end-btns .jb-next { padding-top: 12px; }
.jb-day-go:active, .jb-yourturn:active, .jb-end-btns .jb-next:active { transform: translateY(3px) scale(.98); }
/* おてつだい・ひろば・シール帳の 箱も 金の ふち */
.jb-day { background: linear-gradient(180deg, #fffdf4, #fff3d2); border: 3px solid #e3b94a; box-shadow: 0 4px 0 #c9992a; }
.jb-day-dot i { border-color: #e3b94a; }
.jb-act { background: linear-gradient(180deg, #fffdf4, #fff3d2); border: 3px solid #e3b94a; box-shadow: 0 4px 0 #c9992a; color: #5a3a10; }
.jb-act:active { box-shadow: 0 1px 0 #c9992a; }
.jb-book { background: rgba(255, 253, 244, .92); border: 3px solid #e3b94a; }
.jb-h4 { color: #6a3a00; text-shadow: 0 1px 0 #fff; }
.jb-extra { background: linear-gradient(180deg, #e9e2ff, #c9b8ff); border: 3px solid #fff; box-shadow: 0 4px 0 #9a85e0, 0 0 0 3px #e3b94a; }
/* 進みの 星：金の 星（pz_star.png）。まだの ものは うすく */
.jb-steps i, .jb-qdots i, .jb-prog i { background: url("assets/pz_star.png") center / contain no-repeat; border: 0; border-radius: 0; box-shadow: none; filter: grayscale(1) opacity(.35); font-size: 0; }
.jb-steps i { width: 34px; height: 34px; } .jb-qdots i, .jb-prog i { width: 20px; height: 20px; }
.jb-steps i.done, .jb-qdots i.done, .jb-prog i.done { background: url("assets/pz_star.png") center / contain no-repeat; filter: none; transform: none; }
.jb-steps i.now, .jb-qdots i.now, .jb-prog i.now { background: url("assets/pz_star.png") center / contain no-repeat; box-shadow: none; filter: none; transform: scale(1.2); animation: jbPulse 1.2s ease-in-out infinite; }
/* 答えの ボタン・5の枠・なぞる 紙も 金の ふち */
.jb-ch { border-color: #e3b94a; box-shadow: 0 5px 0 #c9992a; background: linear-gradient(180deg, #fffdf4, #fff3d2); }
.jb-ch:active { box-shadow: 0 2px 0 #c9992a; }
.jb-f5 { background: #fffdf4; border-color: #e3b94a; }
.jb-canvas canvas { border: 3px dashed #e3b94a; background: #fffdf4; }
.jb-l, .jb-r { border-color: #e3b94a; box-shadow: 0 3px 0 #c9992a; }
.jb-basket { background: linear-gradient(180deg, #f1c98a, #c98a3e); border-color: #9a6428; box-shadow: inset 0 6px 10px rgba(80, 40, 0, .25), 0 4px 0 #7a4a1a; }
/* ごほうび：シールの うしろに 光の 星（fx_star.webp） */
.jb-end-sticker { border-color: #e3b94a; box-shadow: 0 4px 0 #c9992a; }
.jb-end-sticker::before { content: ""; position: absolute; inset: -70px; z-index: -1; background: url("assets/battle/fx_star.webp") center / contain no-repeat; animation: jbSpin 6s linear infinite; opacity: .9; }
.jb-end { position: relative; z-index: 0; }
.jb-end h3 { color: #7a4a00; font-size: 26px; }
@keyframes jbSpin { to { transform: rotate(360deg); } }
.jb-bignum { color: #7a4a00; text-shadow: 0 3px 0 #ffd36b; }
.jb-good { background: linear-gradient(180deg, #ffd36b, #f0a81a); border-color: #fff; color: #6a3a00; text-shadow: 0 1px 0 #fff6c8; }
@media (max-width: 400px) { .jb-guide img { width: 88px; } .jb-stone .jb-num { font-size: 30px; } .jb-day-go, .jb-yourturn, .jb-end-btns .jb-next { font-size: 19px; } }
@media (prefers-reduced-motion: reduce) { .jb-end-sticker::before { animation: none; } .jb-guide img { animation: none; } }

/* ============================================================
   2026-10-05 デビューの 見た目 その2（ユーザー「背景の 画面 何枚も あるよ。キャラとか どうなってるんだよ。やっすぽい」）
   白で 消していた 王宮を やめ、森の 絵に。上は 森の 看板（ソロモン・主人公・クイナ）。あそびごとに キャラ。宝石は 小さく
   使う 絵：quests/forest_after.jpg・battle/bg_forest.webp・battle/hero_joy／kuina_happy／dodo.webp・friends/*.png（手持ちだけ）
   ============================================================ */
#view-junbi .jb-card { background: linear-gradient(180deg, rgba(255, 250, 232, .30), rgba(255, 250, 232, .55)), url("assets/battle/bg_forest.webp") center top / cover no-repeat; }
.jb-banner { position: relative; min-height: 210px; margin: -6px -6px 6px; border-radius: 20px; overflow: hidden; border: 3px solid #e3b94a; box-shadow: 0 4px 0 #c9992a;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 55%, rgba(60, 40, 0, .28)), url("assets/quests/forest_after.jpg") center 60% / cover no-repeat; }
.jb-banner .jb-guide { position: absolute; left: 10px; top: 10px; right: 140px; margin: 0; }
.jb-banner .jb-guide img { width: 120px; }
.jb-b-kid { position: absolute; right: 54px; bottom: 6px; height: 170px; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .3)); animation: jbBob 2.8s ease-in-out infinite; }
.jb-b-kuina { position: absolute; right: 6px; bottom: 4px; height: 82px; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .3)); animation: jbBob 2.2s ease-in-out infinite .4s; }
.jb-banner h3.jb-title { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); margin: 0; white-space: nowrap; font-size: 26px; }
.jb-hero > p { margin: 6px auto 4px; display: table; padding: 4px 14px; border-radius: 999px; background: rgba(255, 253, 244, .92); border: 2px solid #e3b94a; font-size: 13px; }
/* 🥷 にんにん！そろばん（2026-11-05）：バナー＋しゅぎょうの 里の 地図（9つの 場所に 石の ボタン・主人公の しるし） */
.jb-nn { position: relative; margin: -6px -6px 6px; }
.jb-nn-banner { display: block; width: 100%; height: auto; border-radius: 20px; border: 3px solid #e3b94a; box-shadow: 0 4px 0 #c9992a; }
.jb-nn .jb-guide { margin: 8px 4px 0; }
.jb-map { position: relative; max-width: 520px; margin: 0 auto; border-radius: 22px; overflow: hidden; border: 3px solid #e3b94a; box-shadow: 0 4px 0 #c9992a; }
.jb-map-bg { display: block; width: 100%; height: auto; }
.jb-map .jb-stone, .jb-map .jb-stone.low { position: absolute; width: 17%; transform: translate(-50%, -50%); margin: 0; }
.jb-map .jb-stone:active, .jb-map .jb-stone.low:active { transform: translate(-50%, calc(-50% + 3px)); }
.jb-map .jb-stone .jb-num { font-size: 26px; transform: none; }
.jb-map .jb-stone .jb-st-fr { font-size: 15px; padding: 0 5px; bottom: 6%; }
.jb-map .jb-stone .jb-st-fr .jb-fr.xs { font-size: 15px; }
.jb-map .jb-stone.done::after { background-size: 20px; }
.jb-map-hero { position: absolute; width: 15%; transform: translate(-50%, -112%); pointer-events: none; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .3)); animation: jbBob 2.4s ease-in-out infinite; }
@media (max-width: 400px) { .jb-map .jb-stone .jb-num { font-size: 20px; } .jb-map .jb-stone .jb-st-fr { font-size: 12px; } .jb-map .jb-stone .jb-st-fr .jb-fr.xs { font-size: 12px; } }
.jb-h4 { display: table; padding: 4px 16px; border-radius: 999px; background: rgba(255, 253, 244, .94); border: 2px solid #e3b94a; box-shadow: 0 2px 0 #c9992a; }
/* キャラの 顔（あそびの カード・きょうの おてつだい） */
img.jb-host { display: block; width: 100%; height: 100%; object-fit: contain; }
.jb-act-ic { width: 72px; height: 72px; margin-bottom: 2px; }
.jb-act-ic img.jb-host { filter: drop-shadow(0 3px 3px rgba(80, 50, 0, .25)); }
.jb-act { min-height: 124px; }
.jb-day-dot i { position: relative; width: 72px; height: 72px; padding: 4px; overflow: visible; background: radial-gradient(circle at 50% 40%, #fffdf4, #ffe9a8); }
.jb-day-dot.done i img { filter: grayscale(.2) opacity(.75); }
.jb-ok { position: absolute; right: -6px; bottom: -6px; width: 26px; height: 26px; border-radius: 50%; background: #3fae78; color: #fff; font-style: normal; font-size: 16px; line-height: 26px; text-align: center; border: 2px solid #fff; }
.jb-end-sticker img.jb-host { width: 84%; height: 84%; }
/* すうじの みち：宝石を 小さく（パソコン 5列・携帯 3列）。くだものを 大きく */
.jb-path { grid-template-columns: repeat(5, 1fr); max-width: 600px; margin: 0 auto; gap: 18px 12px; padding: 8px 10px 22px; border-radius: 22px; background: rgba(255, 253, 244, .55); }
.jb-stone .jb-num { font-size: 34px; }
.jb-stone .jb-st-fr { font-size: 24px; padding: 0 6px; }
.jb-stone .jb-st-fr .jb-fr.xs { font-size: 24px; }
/* 問題の 台：草の 上 */
.jb-scatter { background: linear-gradient(rgba(255, 255, 255, .25), rgba(255, 255, 255, .25)), url("assets/quests/forest_after.jpg") center 75% / cover no-repeat; border: 4px solid #fff; box-shadow: 0 6px 0 #c9992a, 0 0 0 3px #e3b94a; }
.jb-cnt { filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .3)); }
.jb-extra { background: linear-gradient(180deg, #fff2b8, #ffd36b); color: #6a3a00; border: 3px solid #fff; box-shadow: 0 4px 0 #c9992a, 0 0 0 3px #e3b94a; }
.jb-parent-b { background: rgba(255, 253, 244, .94); }
@media (max-width: 560px) {
  .jb-path { grid-template-columns: repeat(3, 1fr); }
  .jb-banner { min-height: 190px; }
  .jb-banner .jb-guide { right: 96px; } .jb-banner .jb-guide img { width: 84px; }
  .jb-b-kid { height: 140px; right: 30px; } .jb-b-kuina { height: 64px; }
  .jb-banner h3.jb-title { font-size: 21px; padding: 6px 18px; }
  .jb-act-ic { width: 60px; height: 60px; } .jb-act { min-height: 112px; }
  .jb-day-dot i { width: 62px; height: 62px; }
}
.jb-stone { padding: 0; }
.jb-stone .jb-num { transform: translateY(-10px); }
.jb-stone .jb-st-fr { position: absolute; left: 50%; bottom: 15%; transform: translateX(-50%); margin: 0; line-height: 1.1; }
.jb-hiroba { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
@media (max-width: 560px) {
  .jb-banner .jb-guide { right: 64px; } .jb-banner .jb-guide img { width: 72px; }
  .jb-banner .jb-bubble { font-size: 14px; padding: 6px 10px; }
  .jb-b-kid { height: 118px; right: 4px; bottom: 30px; } .jb-b-kuina { display: none; }
  .jb-stone .jb-num { transform: none; font-size: 28px; }
  .jb-stone .jb-st-fr { bottom: 9%; font-size: 18px; } .jb-stone .jb-st-fr .jb-fr.xs { font-size: 18px; }
  .jb-act[data-act="sandbox"] { grid-column: 1 / -1; flex-direction: row; justify-content: center; gap: 10px; min-height: 0; }
}

/* 2026-10-05 ChatGPT の 素材（preschool/）：数字カード・星・かご・ソロモンの 表情 */
.jb-ch.card, .jb-r.card { background: none; border: 0; box-shadow: none; padding: 0; min-height: 0; display: flex; align-items: center; justify-content: center; }
.jb-ch.card img.jb-ncard { width: min(92px, 100%); height: auto; filter: drop-shadow(0 4px 0 rgba(140, 90, 20, .45)); transition: transform .12s; }
.jb-r.card img.jb-ncard { width: 72px; height: auto; filter: drop-shadow(0 3px 0 rgba(140, 90, 20, .45)); }
.jb-ch.card:active img.jb-ncard { transform: translateY(3px) scale(.96); }
.jb-ch.card.ok { box-shadow: none; } .jb-ch.card.ok img.jb-ncard { filter: drop-shadow(0 0 10px #3fae78) drop-shadow(0 0 4px #3fae78); transform: scale(1.12); }
.jb-r.card.ok { background: none; } .jb-r.card.ok img.jb-ncard { filter: drop-shadow(0 0 8px #3fae78); }
.jb-ch.card.hint img.jb-ncard { animation: jbWiggle .7s ease-in-out infinite; }
.jb-steps i, .jb-qdots i, .jb-prog i { background-image: url("assets/preschool/common/star-empty.png"); filter: none; opacity: .8; }
.jb-steps i.done, .jb-qdots i.done, .jb-prog i.done, .jb-steps i.now, .jb-qdots i.now, .jb-prog i.now { background-image: url("assets/preschool/common/star-gold.png"); opacity: 1; }
.jb-basket { background: url("assets/preschool/count/basket-empty.png") center bottom / contain no-repeat; border: 0; box-shadow: none; border-radius: 0; min-height: 120px; max-width: 260px; align-items: flex-end; }
.jb-basket .jb-in { padding: 0 34px 38px; }
.jb-basket-ic { display: none; }

/* 右から 左の 言語（アラビア語・2026-10-12）でも、そろばん・数・式・「前 → 後」の 図は 左から 右の まま
   （位取りと 矢印の 向きが 逆に なると 意味が 変わる） */
html[dir="rtl"] .soroban, html[dir="rtl"] .soro-wrap, html[dir="rtl"] .soro-fig, html[dir="rtl"] .soro-val, html[dir="rtl"] .soroban-value,
html[dir="rtl"] .problem, html[dir="rtl"] .problem-wrap, html[dir="rtl"] .answer-row, html[dir="rtl"] .battle-problem, html[dir="rtl"] .cross-pad,
html[dir="rtl"] .flash-display, html[dir="rtl"] .pz-flash, html[dir="rtl"] .jb-soro, html[dir="rtl"] .jb-bignum, html[dir="rtl"] .jb-bignum-s, html[dir="rtl"] .sh-cols,
html[dir="rtl"] .sb-pair, html[dir="rtl"] .un-pair, html[dir="rtl"] .sk-row, html[dir="rtl"] .ls-why, html[dir="rtl"] svg, html[dir="rtl"] canvas { direction: ltr; }
/* 右から 左：吹き出しの しっぽは ソロモン（右側）の ほうへ（2026-10-13 測定で 見つけた） */
html[dir="rtl"] .solo-say-b::before, html[dir="rtl"] .ph-speech::before { left: auto; right: -12px; border-right-color: transparent; border-left-color: var(--royal-gold); }
@media (min-width: 641px) {
  html[dir="rtl"] .tip-balloon::before { left: auto; right: -14px; border-right-color: transparent; border-left-color: var(--royal-gold); }
  html[dir="rtl"] .tip-balloon::after { left: auto; right: -11px; border-right-color: transparent; border-left-color: #fffaf0; }
}

/* 📣 大人向けの もの（日本語だけ）。教室の パソコンでは 出さない */
html:not([lang="ja"]) .ja-only, body.cm-on .ja-only { display: none !important; }
/* メニューの 中の コンテスト・仲間（👤 おうちの方・先生へ の 中） */
.side-nav .nav-more a.nav { text-decoration: none; }
.nav-round { border-radius: 50%; object-fit: cover !important; }
.nav-hot { background: #e0314f; color: #fff; font-size: 10.5px; font-weight: 900; border-radius: 999px; padding: 1px 7px; margin-left: 4px; }

/* ============================================================ 2026-10-13 ホームは 子どもの 1枚（ユーザー決定・ご主人「ごちゃごちゃして 何を して いいか わからない」）
   上から：今日の冒険（メニュー＋ボタン）→ 数字 3つ（練習してから）→ ソロモン＋あそぶ → 記録が たまってからの カード → おしらせ 1行ずつ */
.hs-scroll .today-menu { margin: 10px 0 14px; text-align: start; }
.hs-scroll .menu-row { font-size: 15px; padding: 5px 2px; border-bottom-color: #d9c48f; }
.home-stats { grid-template-columns: repeat(3, 1fr); }
.home-next { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; align-items: stretch; }
.home-next .solo-card { margin: 0; }
.home-play { display: flex; flex-direction: column; gap: 8px; }
.home-play h3 { margin: 0; }
.home-play .sub { margin: 0; }
.home-play-btns { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; margin: 4px 0 auto; }
.home-play-btns > * { display: flex; flex-direction: row; align-items: center; justify-content: center; min-height: 52px; padding: 8px 4px; border-radius: 12px; font-size: 14px; font-weight: 800; white-space: nowrap;
  background: linear-gradient(180deg, #fff8e6, #f6e3b3); border: 2px solid #e2cd97; box-shadow: 0 3px 0 #d2b86a; color: var(--navy); text-decoration: none; text-align: center; line-height: 1.3; cursor: pointer; }
.home-play-btns > *:hover { filter: brightness(1.04); }
.home-more .today-box { padding: 4px 2px 0; }
.home-notice { display: flex; flex-direction: column; gap: 6px; margin: 0 0 16px; }
.home-notice a { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; background: #fff8e6; border: 1px solid #e2cd97; color: var(--navy); font-weight: 700; font-size: 14px; text-decoration: none; }
.home-notice a i { margin-left: auto; font-style: normal; color: #b8860b; font-size: 18px; line-height: 1; }
/* 👤 おうちの方・先生へ：見える ボタン 1つ（奥に 隠さない）。たたんだ 印つき */
.side-nav details.nav-more > summary { font-size: 14px; opacity: .95; padding: 10px 10px; margin: 6px 4px 0; border: 1px solid rgba(255,255,255,.35); border-radius: 10px; background: rgba(255,255,255,.06); white-space: nowrap; }
.side-nav details.nav-more[open] > summary { margin-bottom: 4px; }
.side-nav details.nav-more > summary::after { content: " ▾"; opacity: .7; }
.side-nav details.nav-more[open] > summary::after { content: " ▴"; }
@media (max-width: 900px) {
  .home-next { grid-template-columns: 1fr; gap: 12px; }
}
@media (max-width: 760px) {
  .home-stats { grid-template-columns: repeat(2, 1fr); }
  .home-play-btns > * { font-size: 14px; min-height: 48px; }
}
/* 👑 キングダム仲間の 入口（保護者の 画面・2026-10-13：海外の 言葉でも 出す。見た目は .adv-contest と 同じ） */
.nk-entry { margin: 12px 0 0; font-size: 14px; } .nk-entry a { display: block; padding: 10px 14px; border-radius: 12px; background: #fff8e6; border: 1px solid #e2cd97; color: var(--navy); font-weight: 700; text-decoration: none; } .nk-entry a::after { content: " ›"; color: #b8860b; }

/* どっちが おおい？ の かごは 押せる ボタンに 見せる（.jb-ch.card の あとで 上書き） */
.jb-choices.cmp .jb-ch.card { width: 100%; padding: clamp(6px, 1.5vw, 12px); border-radius: 20px; background: #fffdf4; border: 3px solid #e3b94a; box-shadow: 0 6px 0 #c9992a; transition: transform .1s; }
.jb-choices.cmp .jb-ch.card:active { transform: translateY(3px); box-shadow: 0 3px 0 #c9992a; }
.jb-choices.cmp .jb-ch.card.ok { border-color: #3fae78; box-shadow: 0 0 0 5px #3fae78; }

/* ============ 2026-10-23 左メニューを ユーザーの 見本の 形に（パソコン・タブレットの 横）============
   絵は 見本（ChatGPT）から 切った 2枚：side_top.webp（城・紋章・キツネ）／side_bottom.webp（キツネと ふきだし）。
   題と ふきだしの 文字は 絵から 消して 画面の 文字で 出す（ほかの 言語でも 使える） */
.side-art-top, .side-fox { display: none; }
@media (min-width: 901px) {
  .sidebar { width: 250px; padding: 0 10px 12px; background: linear-gradient(180deg, #0338a2 0, #0a2f8f 45%, #0b2470 100%);
    border-right: 3px solid #e9b949; box-shadow: inset -2px 0 0 #8a5a0c; scrollbar-width: thin; scrollbar-color: #e9b949 transparent; }
  .brand { padding: 0; margin: 0 -10px; }
  .brand-mark { position: relative; display: block; }
  .brand-mark .brand-logo { display: none; }
  .side-art-top { display: block; width: 100%; height: auto;
    -webkit-mask-image: linear-gradient(#000 90%, transparent); mask-image: linear-gradient(#000 90%, transparent); }
  .brand-mark .brand-name { position: absolute; left: 10px; right: 46px; bottom: 6px; text-align: center; font-size: 17px; line-height: 26px;
    font-weight: 900; letter-spacing: .5px; color: #ffe27a; text-shadow: 0 2px 0 #6b3d00, 0 0 6px rgba(0,0,0,.5); -webkit-text-stroke: .6px #7a4a06; }
  .hdr-login { width: auto; margin: 4px 22px 8px; background: linear-gradient(180deg, #fff1b8, #f3cf6a 55%, #e2ab3c); color: #3a2a08;
    border: 2px solid #b07a1e; box-shadow: inset 0 1px 0 #fff8d8, 0 2px 4px rgba(0,0,0,.35); font-size: 15px; padding: 6px 10px; }

  /* 子どもの 4つ：青い ボタン＋金の ふち・右に ›。いま いる 所は 金 */
  .side-nav { gap: 0; }
  .side-nav .nav.nav-main { position: relative; display: flex; align-items: center; gap: 8px; margin: 4px 0; padding: 5px 30px 5px 8px; min-height: 54px;
    border-radius: 14px; color: #fff; font-size: 18px; font-weight: 900; text-shadow: 0 2px 0 rgba(0,0,0,.35);
    background: linear-gradient(180deg, #3d7af5 0%, #1a4fd0 42%, #0d2f95 100%); border: 2px solid #f4c64a;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.3), inset 0 3px 0 rgba(255,255,255,.25), 0 3px 0 #7a4f0a, 0 5px 8px rgba(0,0,0,.35); }
  .side-nav .nav.nav-main::after { content: "›"; position: absolute; right: 12px; top: 50%; transform: translateY(-54%); font-size: 30px; font-weight: 700; line-height: 1; }
  .side-nav .nav.nav-main:hover { filter: brightness(1.12); background: linear-gradient(180deg, #3d7af5 0%, #1a4fd0 42%, #0d2f95 100%); }
  .side-nav .nav.nav-main.active { color: #3a2300; text-shadow: 0 1px 0 rgba(255,255,255,.6); border-color: #fff2b0;
    background: linear-gradient(180deg, #fff6b8 0%, #ffd54d 45%, #f0a51a 100%);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.6), 0 3px 0 #8a5a0c, 0 0 12px rgba(255,214,90,.75); }
  .side-nav .nav.nav-main .nav-ic { width: 44px; flex-shrink: 0; }
  .side-nav .nav.nav-main .nav-ic img { width: 44px; height: 44px; }
  .side-nav .nav.nav-main .nav-lb { flex: 1; text-align: center; white-space: nowrap; }

  /* きろくのもり：金の 札＋紺の ボタン */
  .side-nav #navMore1 { border-top: none; margin-top: 10px; padding-top: 0; }
  .side-nav #navMore1 .nav-sec { opacity: 1; margin: 0 8px 6px; padding: 5px 8px; text-align: center; font-size: 16px; font-weight: 900; letter-spacing: 1px;
    color: #4a2c05; background: linear-gradient(180deg, #fff3c4, #ecc96e); border: 2px solid #b9822a; border-radius: 8px;
    box-shadow: inset 0 1px 0 #fffbe8, 0 2px 4px rgba(0,0,0,.35); }
  .side-nav #navMore1 .nav { display: flex; align-items: center; gap: 10px; margin: 5px 0; padding: 5px 10px; min-height: 46px; border-radius: 12px;
    color: #fff; font-size: 16px; font-weight: 900; text-shadow: 0 1px 0 rgba(0,0,0,.4);
    background: linear-gradient(180deg, #1e46ab, #102b78); border: 2px solid #4f86e6;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.12), 0 2px 4px rgba(0,0,0,.4); }
  .side-nav #navMore1 .nav:hover { filter: brightness(1.15); background: linear-gradient(180deg, #1e46ab, #102b78); }
  .side-nav #navMore1 .nav.active { color: #3a2300; text-shadow: none; border-color: #fff2b0; background: linear-gradient(180deg, #fff6b8, #f0b62e); }
  .side-nav #navMore1 .nav .nav-mini { width: 34px; height: 34px; margin-right: 2px; }

  /* キツネと ふきだし */
  .side-fox { display: block; position: relative; margin: 8px -10px -8px; }
  .side-fox img { display: block; width: 100%; height: auto;
    -webkit-mask-image: linear-gradient(transparent, #000 22%); mask-image: linear-gradient(transparent, #000 22%); }
  .side-fox-say { position: absolute; left: 46%; right: 9%; top: 16%; bottom: 13%; display: flex; align-items: center; justify-content: center;
    text-align: center; font-size: 12px; line-height: 1.4; font-weight: 800; color: #1d2f6b; word-break: keep-all; overflow-wrap: anywhere; }

  /* おとなの方へ：むらさきの ボタン（見える 所に 1つ） */
  .side-nav details#navMore2 { border-top: none; margin-top: 0; padding-top: 0; position: relative; z-index: 1; }
  .side-nav details#navMore2 > summary { margin: 0; padding: 12px 30px 12px 12px; text-align: center; position: relative; color: #fff; font-size: 16px; font-weight: 900; opacity: 1;
    background: linear-gradient(180deg, #6a4be0, #3b25a6); border: 2px solid #f4c64a; border-radius: 14px;
    box-shadow: inset 0 2px 0 rgba(255,255,255,.25), 0 3px 0 #7a4f0a, 0 5px 8px rgba(0,0,0,.35); }
  .side-nav details#navMore2 > summary::after { content: "›"; position: absolute; right: 12px; top: 50%; transform: translateY(-54%); font-size: 28px; opacity: 1; }
  .side-nav details#navMore2[open] > summary::after { content: "▴"; font-size: 16px; transform: translateY(-50%); }
}
/* 背が 低い 画面は キツネを しまい、詰める（おとなの方へ が いつも 見える ように） */
@media (min-width: 901px) {
  .sidebar { scrollbar-width: none; }
  .sidebar::-webkit-scrollbar { display: none; }
  .hdr-login { width: calc(100% - 44px); }
}
@media (min-width: 901px) and (max-height: 939px) { .side-fox { display: none; } .side-nav details#navMore2 { margin-top: 10px; } }
@media (min-width: 901px) and (max-height: 860px) {
  .side-art-top { height: 180px; object-fit: cover; object-position: 50% 100%; }
  .brand-mark .brand-name { bottom: 4px; }
  .hdr-login { margin: 2px 22px 4px; padding: 4px 10px; font-size: 14px; }
  .side-nav .nav.nav-main { min-height: 46px; margin: 3px 0; padding-top: 2px; padding-bottom: 2px; font-size: 17px; }
  .side-nav .nav.nav-main .nav-ic img { width: 38px; height: 38px; }
  .side-nav #navMore1 { margin-top: 8px; }
  .side-nav #navMore1 .nav-sec { padding: 3px 8px; font-size: 15px; margin-bottom: 4px; }
  .side-nav #navMore1 .nav { min-height: 38px; margin: 3px 0; padding: 2px 10px; font-size: 15px; }
  .side-nav #navMore1 .nav .nav-mini { width: 30px; height: 30px; }
  .side-nav details#navMore2 > summary { padding: 9px 30px 9px 12px; }
}

/* 👣 はじめの 一歩（2026-10-26）：ホームの いちばん上の 小さな 帯。1手だけ 言う */
.fs-band { background: linear-gradient(180deg, #eef6ff, #dbeafe); border: 3px solid var(--navy); border-radius: 14px; padding: 10px 12px; margin: 10px 0; }
.fs-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 17px; font-weight: 900; color: var(--navy); }
.fs-x { background: none; border: none; font-size: 18px; line-height: 1; cursor: pointer; color: var(--navy); padding: 2px 6px; }
.fs-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #fff; border-radius: 10px; padding: 9px 12px; margin: 6px 0; }
.fs-em { font-size: 22px; }
.fs-t { flex: 1 1 180px; min-width: 0; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.fs-go { white-space: nowrap; }
.fs-help { display: inline-block; font-size: 14px; font-weight: 800; color: var(--navy); text-decoration: underline; margin-top: 2px; }

/* 🚪 ホームで ← を 押した ときの「このサイトから はなれますか？」（2026-10-26） */
#leaveAsk { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.55); padding: 16px; }
#leaveAsk .leave-box { background: #fff; color: #222; border-radius: 16px; padding: 22px 18px; max-width: 360px; width: 100%; box-shadow: 0 8px 30px rgba(0,0,0,.3); text-align: center; }
#leaveAsk .leave-msg { font-size: 1.15rem; font-weight: 700; margin-bottom: 16px; line-height: 1.5; }
#leaveAsk .cert-btns button { min-width: 130px; padding: 12px 14px; font-size: 1rem; border-radius: 12px; }
#leaveAsk .cert-btns .ghost { color: #333; border-color: #999; background: #fff; }

/* 🦊 手もちの そろばんの 案内（2026-10-30・問題の 下に 1回だけ） */
.my-soro-tip { display: flex; align-items: flex-start; gap: 8px; margin: 0 auto 6px; max-width: 520px; background: #fff8dc; border: 2px solid #e8d7ae; border-radius: 12px; padding: 8px 10px; font-size: 13px; font-weight: 800; color: #16305c; line-height: 1.45; text-align: start; }
.my-soro-tip .mst-t { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.my-soro-tip .mst-x { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; border: 2px solid #16305c; background: #fff; color: #16305c; font-weight: 900; padding: 0; font-size: 14px; line-height: 1; }
@media (max-width: 640px) { body.playing .my-soro-tip { font-size: 12px; padding: 6px 8px; margin-top: 4px; } }

/* ============================================================ 余白（2026-11-08 ユーザー「詰め込みすぎて 見づらい。各項目ごとの 余白を 十分に」）
   箱と 箱の すき間を 16px → 28px、ホームの 左右の 列の すき間・横の 道具の 間も 広げる。箱の 中の 詰め方（padding）は 変えない（そろばんの 画面が 狭く ならない ように） */
.content { padding: 26px 32px 56px; }
.topbar { margin-bottom: 28px; }
.card { margin-bottom: 28px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 2px; }
.home-grid { gap: 28px; }
.home-side { gap: 18px; }
.sidebar { padding-top: 20px; }
.side-nav { gap: 6px; }
.today-menu { gap: 8px; }
.menu-row { padding: 9px 4px; }
@media (max-width: 720px) {
  .content { padding: 18px 16px 44px; }
  .card { margin-bottom: 22px; }
  .home-grid { gap: 22px; }
  .home-side { gap: 14px; }
}
.home-notice { margin: 8px 0 28px; display: grid; gap: 10px; }

/* ============================================================ 余白 その2（2026-11-10 ユーザー「ホームの 数字の 札・ソロモン＋あそびに いく・はやさの 箱が くっついて 詰め込みすぎに 見える」）
   11/8は .card 同士（縦の 並び）だけ 広げた。ホームは .home-stats・.home-next・#homeMore（はやさ・弱点しんだんを 入れた 1枚）の 中が
   まだ 個別の 余白（16px・14px・12px）の ままだったので、ここを そろえて 広げる。箱の 大きさ・色・並び順は 変えない */
.home-stats { gap: 14px; margin-bottom: 26px; }
.home-next { gap: 20px; margin-bottom: 26px; }
#homeMore.card { padding: 22px 20px 24px; }
#homeMore .speed-box { margin-bottom: 22px; }
#homeMore .rd-box { margin: 18px 0; }
#homeMore .weak-menu { margin-top: 22px; }
#homeMore .weak-diag { margin-top: 20px; }
@media (max-width: 760px) {
  .home-stats { gap: 10px; margin-bottom: 20px; }
  .home-next { gap: 14px; margin-bottom: 20px; }
  #homeMore.card { padding: 18px 16px 20px; }
}
