/* =====================================================================
   ぶれいんすとれっち — 見た目（版 0.7：明るくゲームらしく）
   地は白〜淡い空色のグラデーションにうっすら水玉。カードは白、ボタンは角の丸い立体（下に同じ色の濃い「厚み」。押すと沈む）
   光り・にじみ・グロー（ぼかしの影・文字の光・影の光）・和風の要素・パステルのピンク・暗い地は使わない
   影はすべて「ぼかし 0」のずらした面（厚み）だけ
   色は変数（theme.js の applyTheme・setAcc がここの値を上書きする）。書体はシステムの丸ゴシック（無ければ太いゴシック）
   ===================================================================== */
:root {
  --bg: #EAF5FF; --tx: #1E2B45; --sub: #55627A; --dim: #8A95A8; --line: rgba(30,43,69,0.16); --panel: #FFFFFF; --panel2: #F2F7FC;
  --acc: #2D7FF9; --acc-d: #205bb3; --on-acc: #FFFFFF; --ok: #1FA855; --ng: #E5483E;
  --c-calc: #2D7FF9; --c-memory: #8B5CF6; --c-attention: #FF8A1F; --c-space: #16A35A; --c-reason: #E9437A;
  --edge: #C9D6E6;            /* 白いボタンの厚み */
  --edge2: rgba(30,43,69,0.10); /* カードの厚み */
  --shadow: 0 4px 0 var(--edge2);
  --st: env(safe-area-inset-top, 0px); --sb: env(safe-area-inset-bottom, 0px); --sl: env(safe-area-inset-left, 0px); --sr: env(safe-area-inset-right, 0px);
  --gothic: "Hiragino Maru Gothic ProN", "Hiragino Maru Gothic Pro", "Arial Rounded MT Bold", -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Segoe UI", "Noto Sans", "Noto Sans JP", "Noto Sans Thai", Roboto, sans-serif;
  --num: var(--gothic); --brand: var(--gothic); --head: var(--gothic);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* 横のずれ止め：hidden だと html と body の両方が縦に動く箱になり、PC のホイールで画面が動かなくなる（2026-11-18 報告）→ clip を使う */
html, body { margin: 0; min-height: 100%; color: var(--tx); overflow-x: hidden; overflow-x: clip; }
html { background: #EAF5FF; }
/* 地：上が淡い空色、下が白。うっすら水玉 */
body { background-color: #EAF5FF;
  background-image: radial-gradient(rgba(45,127,249,0.10) 2.2px, transparent 2.8px), linear-gradient(180deg, #D9EEFF 0%, #EEF7FF 40%, #FFFFFF 100%);
  background-size: 26px 26px, 100% 100%; background-position: 0 0, 0 0;
  font-family: var(--gothic); font-size: 19px; line-height: 1.5; font-weight: 700; -webkit-text-size-adjust: 100%; overscroll-behavior: none; }
#app { position: relative; min-height: 100%; }
button, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; touch-action: manipulation; position: relative; }
.num, .mono { font-family: var(--num); font-variant-numeric: tabular-nums; }
svg.ic { display: block; flex: none; }

/* 画面の切り替え（短いフェード） */
.screen { min-height: 100dvh; padding: calc(var(--st) + 10px) calc(var(--sr) + 14px) calc(var(--sb) + 22px) calc(var(--sl) + 14px); max-width: 680px; margin: 0 auto; animation: scrIn .22s ease-out; }
@keyframes scrIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.play { display: flex; flex-direction: column; height: 100dvh; min-height: 0; overflow: hidden; padding-bottom: calc(var(--sb) + 10px); position: relative; }
.play.wide { max-width: 1240px; }

/* 白いカード：角を大きく丸め、下に薄い厚み */
.card, .glass { background: var(--panel); border: 2px solid rgba(30,43,69,0.07); border-radius: 22px; box-shadow: var(--shadow); }
.card { padding: 18px; margin: 16px 0; color: var(--tx); }
.card h2, .sec { margin: 0 0 12px; font-family: var(--head); font-size: 22px; font-weight: 800; letter-spacing: 0.04em; color: var(--tx); display: flex; align-items: center; gap: 8px; }
.sec::before { content: ''; flex: none; width: 8px; height: 22px; border-radius: 4px; background: var(--c-attention); }
.sub { color: var(--sub); font-size: 16px; }
.note { font-size: 15px; color: var(--sub); margin-top: 10px; }
.big { font-size: 24px; font-weight: 800; line-height: 1.45; }

/* ===== 立体のボタン：下の「厚み」の分だけ押すと沈む ===== */
.pbtn, .sbtn, .ib, .ans, .key, .swb, .tobj, .gcell, .tcard, .tab, .gatebtn { -webkit-user-select: none; user-select: none; transition: transform .06s, box-shadow .06s; }
.pbtn { display: flex; width: 100%; align-items: center; justify-content: center; gap: 10px; min-height: 66px; padding: 10px 18px; margin: 14px 0 6px; border-radius: 20px; font-family: var(--head); font-size: 24px; font-weight: 800; letter-spacing: 0.04em;
  color: var(--on-acc); background: var(--acc); border: 0; box-shadow: 0 6px 0 var(--acc-d); }
.pbtn:active { transform: translateY(6px); box-shadow: 0 0 0 var(--acc-d); }
.sbtn { display: flex; width: 100%; align-items: center; justify-content: center; gap: 8px; min-height: 56px; padding: 8px 16px; margin: 12px 0 5px; border-radius: 18px; font-size: 20px; font-weight: 800;
  color: var(--tx); background: var(--panel); border: 2px solid var(--edge); box-shadow: 0 5px 0 var(--edge); }
.sbtn:active { transform: translateY(5px); box-shadow: 0 0 0 var(--edge); }
.ib { background: var(--panel); border: 2px solid var(--edge); color: var(--tx); border-radius: 14px; min-width: 48px; height: 46px; padding: 0 11px; font-size: 16px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; box-shadow: 0 4px 0 var(--edge); margin-bottom: 4px; }
.ib:active { transform: translateY(4px); box-shadow: 0 0 0 var(--edge); }
.ib.off { color: var(--dim); }
.ib.on { color: var(--c-calc); }
.row2 { display: flex; gap: 12px; align-items: flex-start; } .row2 > * { flex: 1; }
.row2 .pbtn, .row2 .sbtn { margin-top: 12px; }

/* ===== ホーム ===== */
.home .head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.head .ctl { order: -1; flex: 1 0 100%; display: flex; gap: 8px; justify-content: flex-end; }
.brandbox { order: 0; flex: 1 0 100%; display: flex; flex-direction: column; align-items: center; margin: 2px 0 0; }
/* ロゴ：色の付いた太い丸文字（1 文字ずつ分野の色。光らせない） */
.brand { font-family: var(--brand); font-size: 36px; font-weight: 900; letter-spacing: 0.02em; color: var(--tx); white-space: nowrap; line-height: 1.15; display: flex; align-items: flex-end; }
.brand .ch { display: inline-block; transform-origin: 50% 90%; }
.brand .ch:nth-child(odd) { transform: translateY(-2px) rotate(-3deg); } .brand .ch:nth-child(even) { transform: translateY(1px) rotate(3deg); }
.brand .dot { display: none; }
.brandsub { font-size: 13px; font-weight: 800; letter-spacing: 0.32em; color: var(--sub); margin-top: 4px; }
.langb { position: relative; padding: 0 10px; }
.langb select { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; font-size: 16px; cursor: pointer; }
/* 脳年齢のメーター */
.gaugecard { background: linear-gradient(180deg, #FFFFFF 0%, #F4F9FF 100%); }
.gauge { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; }
.ring { position: relative; width: 168px; height: 168px; }
.ring svg { position: absolute; inset: 0; }
.ring .val { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring .val .num { font-family: var(--head); font-size: 60px; font-weight: 900; line-height: 1; color: var(--tx); }
.ring .val .u { font-size: 15px; font-weight: 800; color: var(--sub); margin-top: 4px; text-align: center; max-width: 110px; line-height: 1.2; }
.gauge .gside { display: flex; flex-direction: column; gap: 8px; min-width: 0; align-items: flex-start; }
.gauge .gt { font-family: var(--head); font-size: 16px; font-weight: 800; color: #fff; background: var(--c-calc); border-radius: 999px; padding: 3px 14px; max-width: 100%; }
.gnote { font-size: 15px; color: var(--sub); line-height: 1.45; }
.gaugecard > .pbtn { margin-top: 16px; }
.spark { margin-top: 14px; }
.spark canvas { background: var(--panel2); border-radius: 12px; }
/* 今日のトレーニング：大きな色のタイル 3 枚 */
.today3 { display: grid; grid-template-columns: 1fr; gap: 14px; }
.tcard { display: grid; grid-template-columns: 60px 1fr auto; align-items: center; gap: 14px; text-align: left; padding: 12px 14px; border-radius: 20px; min-height: 88px; margin-bottom: 6px;
  color: var(--con, #fff); background: var(--c); border: 0; box-shadow: 0 6px 0 var(--cd); }
.tcard:active { transform: translateY(6px); box-shadow: 0 0 0 var(--cd); }
.tcard .tic { width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--c); background: #fff; }
.tcard .tnm { font-family: var(--head); font-size: 23px; font-weight: 900; line-height: 1.2; overflow-wrap: anywhere; }
.tcard .tin { font-size: 14px; font-weight: 800; opacity: .9; overflow-wrap: anywhere; }
.tcard .tst { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.28); color: var(--con, #fff); }
.tcard.done .tst { width: 54px; height: 54px; background: #fff; color: var(--ok); border: 4px solid var(--ok); }
.tcard.done .tst .ic { width: 32px; height: 32px; stroke-width: 3.2; }
.tcard.done::after { content: ''; position: absolute; inset: 0; border-radius: 20px; background: rgba(255,255,255,0.22); pointer-events: none; }
/* 連続日数とスタンプ */
.streak { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.streak .num { font-size: 44px; font-weight: 900; color: var(--c-attention); font-variant-numeric: tabular-nums; line-height: 1; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.calt { grid-column: 1 / -1; font-family: var(--head); font-size: 16px; color: var(--sub); text-align: left; margin-bottom: 2px; }
.cal .wd { font-size: 13px; color: var(--dim); font-weight: 800; }
.cal .d { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; position: relative; font-size: 15px; color: var(--sub); font-variant-numeric: tabular-nums; border-radius: 50%; background: var(--panel2); }
.cal .d:empty { background: none; }
.cal .d span { position: relative; z-index: 1; }
/* スタンプ：明るい黄色の星 */
.cal .d.st { color: #5A3A00; font-weight: 900; background: none; }
.cal .d.st::before { content: ''; position: absolute; inset: -4%; background: #FFC21A; clip-path: polygon(50% 2%, 62% 35%, 97% 36%, 69% 57%, 79% 92%, 50% 72%, 21% 92%, 31% 57%, 3% 36%, 38% 35%); }
.cal .d.today { outline: 3px solid var(--c-calc); outline-offset: -1px; color: var(--tx); }
/* 自由に練習：40 種目を 1 つの格子に（分野はカードの色で） */
.ggrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 620px) { .ggrid { grid-template-columns: repeat(4, 1fr); } }
.gcell { display: flex; flex-direction: column; text-align: left; padding: 0; border-radius: 18px; min-height: 132px; margin-bottom: 5px; overflow: hidden; color: var(--tx); background: var(--panel); border: 2px solid var(--c); box-shadow: 0 5px 0 var(--cd); }
.gcell:active { transform: translateY(5px); box-shadow: 0 0 0 var(--cd); }
.gcell .gtop { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 8px 10px; background: var(--c); color: var(--con, #fff); min-height: 52px; }
.gcell .gic { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #fff; color: var(--c); flex: none; }
.gcell .gbadge { display: flex; align-items: center; gap: 4px; }
.gcell .gnm { font-family: var(--head); font-size: 18px; font-weight: 900; line-height: 1.25; padding: 8px 10px 0; overflow-wrap: anywhere; }
.gcell .gfoot { display: flex; align-items: center; gap: 6px; margin-top: auto; padding: 6px 10px 9px; color: var(--sub); font-size: 13px; font-weight: 800; min-width: 0; }
.gcell .gfoot .gin { display: inline-flex; align-items: center; gap: 4px; min-width: 0; overflow-wrap: anywhere; line-height: 1.2; }
.gcell .gfoot .gin .ic { color: var(--c); flex: none; }
.newtag { font-size: 12px; font-weight: 900; letter-spacing: 0.04em; color: #fff; background: var(--ng); border: 2px solid #fff; border-radius: 999px; padding: 0 7px; line-height: 18px; white-space: nowrap; }
.lvchip { font-size: 13px; color: var(--c); border: 2px solid var(--c); border-radius: 999px; padding: 0 7px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.gcell.lock { opacity: 0.5; }
.arh { font-family: var(--head); font-size: 16px; font-weight: 800; color: var(--c); margin: 14px 0 6px; }

/* ===== 説明 ===== */
.bar { display: flex; align-items: center; gap: 8px; min-height: 56px; }
.bar .ttl { flex: 1; min-width: 0; font-family: var(--head); font-size: 21px; font-weight: 900; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: clip; letter-spacing: 0.02em; }
.bar .ttl.two { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.bar .stat { font-size: 24px; font-weight: 900; white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 2.2em; text-align: right; }
.bar .clk { color: var(--acc); display: inline-flex; margin-right: -4px; }
.bar .lv { font-size: 15px; font-weight: 900; color: var(--acc); background: #fff; border: 2px solid var(--acc); border-radius: 999px; padding: 1px 9px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.intro .hero { display: flex; align-items: center; gap: 14px; margin: -18px -18px 6px; padding: 16px 18px; border-radius: 20px 20px 0 0; background: var(--acc); color: var(--on-acc); }
.intro .hic { width: 66px; height: 66px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--acc); background: #fff; flex: none; }
.intro .hero > div:last-child { min-width: 0; flex: 1; }
.intro .hnm { font-family: var(--head); font-size: 30px; font-weight: 900; line-height: 1.2; overflow: hidden; letter-spacing: 0.03em; }
.intro .hin { font-size: 15px; font-weight: 800; opacity: .95; }
.howto { font-size: 21px; font-weight: 800; line-height: 1.6; margin: 14px 0 6px; }
.demo { position: relative; height: 230px; border-radius: 18px; overflow: hidden; background: var(--panel2); border: 2px solid rgba(30,43,69,0.08); margin: 10px 0; }
.demo canvas { display: block; width: 100%; height: 100%; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.fact { font-size: 15px; font-weight: 800; color: var(--sub); border-radius: 999px; padding: 3px 12px; background: var(--panel2); border: 2px solid rgba(30,43,69,0.06); }
.fact b { color: var(--tx); }

/* ===== 遊ぶ画面 ===== */
/* 上の帯：分野の色 */
.play > .bar { background: var(--acc); color: var(--on-acc); border-radius: 0 0 22px 22px; box-shadow: 0 5px 0 var(--acc-d);
  margin: calc(-10px - var(--st)) calc(-14px - var(--sr)) 12px calc(-14px - var(--sl)); padding: calc(var(--st) + 8px) calc(var(--sr) + 12px) 8px calc(var(--sl) + 12px); }
.play > .bar .clk { color: var(--on-acc); }
.play > .bar .ib { border-color: transparent; box-shadow: 0 4px 0 var(--acc-d); }
/* 残り時間：太いバー */
.tbar { height: 14px; border-radius: 8px; background: #DCE6F2; margin: 0 0 10px; overflow: hidden; border: 2px solid #fff; box-sizing: content-box; }
.tbar > i { display: block; height: 100%; width: 100%; border-radius: 8px; background: var(--acc); transition: width .25s linear; }
.play .qtext { overflow-wrap: anywhere; min-height: 30px; margin: 2px 0 8px; font-size: 21px; line-height: 1.35; font-weight: 800; text-align: center; color: var(--tx); }
.stage { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; }
/* 正解は ○ が短く弾む、まちがいは × が小さく揺れる（CSS のアニメーションだけ） */
.mark { position: absolute; top: 42%; left: 50%; margin: -44px 0 0 -44px; width: 88px; height: 88px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 50px; font-weight: 900; line-height: 1; pointer-events: none; z-index: 30;
  background: #fff; border: 5px solid currentColor; box-shadow: 0 5px 0 rgba(30,43,69,0.12); }
.mark.ok { color: var(--ok); animation: markPop .45s cubic-bezier(.3,1.6,.5,1); }
.mark.ng { color: var(--ng); animation: markShake .42s ease-out; }
@keyframes markPop { 0% { transform: scale(.3); opacity: 0; } 55% { transform: scale(1.18); opacity: 1; } 100% { transform: scale(1); } }
@keyframes markShake { 0% { transform: translateX(0); opacity: 0; } 15% { opacity: 1; } 30% { transform: translateX(-9px); } 50% { transform: translateX(8px); } 70% { transform: translateX(-5px); } 90% { transform: translateX(3px); } 100% { transform: none; } }
.okglow { display: none; }
.bottom { display: flex; flex-direction: column; gap: 8px; }
.foot { display: flex; justify-content: flex-end; }
.foot .pass { height: 42px; font-size: 15px; margin-top: 6px; color: var(--sub); gap: 6px; }
.qcard { background: var(--panel); border: 2px solid rgba(30,43,69,0.07); border-radius: 20px; color: var(--tx); padding: 10px; display: flex; align-items: center; justify-content: center; box-shadow: 0 5px 0 var(--edge2); }
.calcq { font-size: 56px; font-weight: 900; padding: 18px 26px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.calcq.small { font-size: 28px; padding: 16px 14px; white-space: normal; text-align: center; }
/* 3・2・1：白い丸に分野の色の大きな数字 */
.countdown { position: absolute; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; font-size: 120px; font-weight: 900; font-variant-numeric: tabular-nums; color: var(--acc); background: rgba(234,245,255,0.90); pointer-events: none; }
.countdown::before { content: ''; position: absolute; left: 50%; top: 50%; width: 200px; height: 200px; margin: -100px 0 0 -100px; border-radius: 50%; background: #fff; border: 8px solid var(--acc); box-shadow: 0 8px 0 var(--acc-d); z-index: -1; }
.countdown:empty { display: none; }
.countdown.pop { animation: cdpop .6s cubic-bezier(.3,1.5,.5,1); }
@keyframes cdpop { from { transform: scale(.6); } 40% { transform: scale(1.08); } to { transform: scale(1); } }
/* 案内の札（core.js の .gate.typecard / .gate.readycue。タップまで待つ）：白い大きな札、上に分野の色の帯、下寄りに大きな立体のボタン */
.play .gate { position: absolute; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 14px; padding: 26px 18px 20px; text-align: center; cursor: pointer;
  background: var(--panel); border-radius: 22px; border: 2px solid rgba(30,43,69,0.07); box-shadow: 0 5px 0 var(--edge2); overflow: hidden; animation: gateIn .25s cubic-bezier(.3,1.4,.5,1); }
.play .gate::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 10px; background: var(--acc); }
@keyframes gateIn { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
.play .gate > :first-child { margin-top: auto; }
.play .gate .tnext { align-self: center; font-family: var(--head); font-size: 16px; font-weight: 900; letter-spacing: 0.12em; color: var(--on-acc); background: var(--acc); border-radius: 999px; padding: 3px 16px; }
.play .gate .thow { font-family: var(--head); font-size: 27px; font-weight: 900; line-height: 1.45; color: var(--tx); }
.play .gate .gatebtn { margin-top: auto; align-self: stretch; min-width: 0; min-height: 76px; padding: 12px 20px; border-radius: 22px; font-family: var(--head); font-size: 25px; font-weight: 900; letter-spacing: 0.03em; line-height: 1.25;
  color: var(--on-acc); background: var(--acc); box-shadow: 0 7px 0 var(--acc-d); margin-bottom: 7px; }
.play .gate .gatebtn:active { transform: translateY(7px); box-shadow: 0 0 0 var(--acc-d); }
.play .gate.readycue .thow { font-size: 26px; }
/* 古い札の名前（念のため） */
.typecard:not(.gate) { position: absolute; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 20px; text-align: center; background: var(--panel); border-radius: 20px; }
.typecard .tnext { font-family: var(--head); font-size: 17px; letter-spacing: 0.2em; color: var(--acc); font-weight: 800; }
.typecard .thow { font-family: var(--head); font-size: 27px; font-weight: 800; line-height: 1.45; color: var(--tx); }
.typecard .ttap { font-size: 14px; color: var(--sub); }
.readycue:not(.gate) { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.readycue .rtxt { font-size: 22px; font-weight: 800; text-align: center; }
.readycue .rdot { width: 16px; height: 16px; border-radius: 50%; background: var(--acc); animation: rdot .9s ease-in-out infinite; }
@keyframes rdot { 50% { opacity: .3; } }
/* 4 択・数字キー：立体のボタン */
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding-top: 6px; }
.ans { min-height: 80px; border-radius: 18px; font-size: 32px; font-weight: 900; color: var(--tx); background: var(--panel); border: 2px solid var(--edge); box-shadow: 0 5px 0 var(--edge); margin-bottom: 5px; display: flex; align-items: center; justify-content: center; padding: 4px 8px; text-align: center; line-height: 1.15; font-variant-numeric: tabular-nums; }
.ans:active { transform: translateY(5px); box-shadow: 0 0 0 var(--edge); }
.ans.word { font-size: 23px; }
.ans.ok { border: 3px solid var(--ok); background: #E8F8EE; box-shadow: 0 5px 0 #9FDDB6; } .ans.ng { border: 3px solid var(--ng); background: #FDECEB; box-shadow: 0 5px 0 #F3B3AE; }
.ans canvas { display: block; }
.kpad { display: flex; flex-direction: column; gap: 7px; }
.kdisp { border-radius: 16px; height: 58px; display: flex; align-items: center; justify-content: center; font-size: 38px; font-weight: 900; color: var(--tx); background: var(--panel); border: 3px solid var(--acc); font-variant-numeric: tabular-nums; }
.kdisp.empty { color: var(--dim); }
.kdisp.ok { border-color: var(--ok); background: #E8F8EE; } .kdisp.ng { border-color: var(--ng); background: #FDECEB; }
.kdisp .kcor { color: var(--ok); font-size: 28px; }
.kgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 8px; }
.key { height: 54px; border-radius: 14px; font-size: 30px; font-weight: 900; color: var(--tx); background: var(--panel); border: 2px solid var(--edge); box-shadow: 0 4px 0 var(--edge); margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.key:active { transform: translateY(4px); box-shadow: 0 0 0 var(--edge); }
.key.del { font-size: 22px; color: var(--sub); background: var(--panel2); }
.key.blank { visibility: hidden; }
@media (max-height: 700px) { .key { height: 48px; } .kdisp { height: 50px; } }
/* 左右にはじく */
.swcard { touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; will-change: transform; }
.swcard[data-lean="R"] { outline: 4px solid var(--ok); } .swcard[data-lean="L"] { outline: 4px solid var(--ng); }
.swrow { display: flex; gap: 12px; }
.swb { flex: 1; min-height: 74px; border-radius: 18px; font-size: 21px; font-weight: 900; line-height: 1.2; background: var(--panel); border: 2px solid var(--edge); box-shadow: 0 5px 0 var(--edge); margin-bottom: 5px; padding: 4px 8px; }
.swb:active { transform: translateY(5px); box-shadow: 0 0 0 var(--edge); }
.swb.no { color: var(--ng); } .swb.yes { color: var(--ok); }
.swb.on { border: 3px solid currentColor; }
/* おつり：硬貨 */
.chinfo { flex-direction: column; gap: 2px; padding: 10px 20px; min-width: 62%; }
.chl { display: flex; justify-content: space-between; gap: 16px; width: 100%; font-size: 18px; color: var(--sub); } .chl b { font-size: 26px; color: var(--tx); font-variant-numeric: tabular-nums; } .chl.big b { font-size: 36px; color: var(--acc); }
.tray { position: relative; margin-top: 12px; width: min(100%, 460px); min-height: 120px; border: 3px dashed color-mix(in srgb, var(--acc) 55%, #fff); border-radius: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px; background: #fff; }
.tray.over { border-color: var(--acc); border-style: solid; background: color-mix(in srgb, var(--acc) 8%, #fff); }
.traycoins { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.traysum { font-size: 32px; font-weight: 900; margin-top: 4px; font-variant-numeric: tabular-nums; }
.trayhint { position: absolute; top: 8px; left: 14px; font-size: 13px; color: var(--sub); }
.tray.has .trayhint { display: none; }
.wallet { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.coin { width: 58px; height: 58px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 900; color: #5A3A00; user-select: none; -webkit-user-select: none; touch-action: none; flex: none;
  background: radial-gradient(circle at 35% 30%, #FFF1B8, #F0C23A); border: 3px solid #C79600; box-shadow: 0 4px 0 #A87E00; }
.coin.c1 { background: radial-gradient(circle at 35% 30%, #FFFFFF, #DDE3EA); border-color: #9AA4B0; box-shadow: 0 4px 0 #8A94A0; color: #334155; width: 52px; height: 52px; }
.coin.c5 { width: 54px; height: 54px; }
.coin.c10 { background: radial-gradient(circle at 35% 30%, #F6C49A, #D07A3E); border-color: #9E5422; box-shadow: 0 4px 0 #84471F; color: #fff; }
.coin.c50, .coin.c100 { background: radial-gradient(circle at 35% 30%, #FFFFFF, #CBD3DC); border-color: #8D97A3; box-shadow: 0 4px 0 #7A8490; color: #334155; }
.coin.c500 { width: 64px; height: 64px; }
.coin.c1000 { width: 82px; height: 52px; border-radius: 8px; background: linear-gradient(#F1F7E6, #CFE0B3); border-color: #6F8F4B; box-shadow: 0 4px 0 #5C7A3C; color: #23361A; }
.traycoins .coin { width: 44px; height: 44px; font-size: 14px; box-shadow: 0 2px 0 rgba(30,43,69,0.25); }
.traycoins .coin.c1000 { width: 58px; height: 38px; }
.coin.ghost { position: fixed; z-index: 50; transform: translate(-50%, -50%) scale(1.08); pointer-events: none; }
.undo { height: 50px; color: var(--sub); }
.okb { margin-top: 0; min-height: 54px; }
/* 散らばった数字 */
.field { position: relative; }
.field .num { position: absolute; transform: translate(-50%, -50%); border-radius: 14px; min-width: 64px; min-height: 56px; padding: 6px 12px; font-size: 28px; font-weight: 900; color: var(--tx); background: var(--panel); border: 2px solid var(--edge); box-shadow: 0 4px 0 var(--edge); }
.field .num.ok { border: 3px solid var(--ok); background: #E8F8EE; } .field .num.ng { border: 3px solid var(--ng); background: #FDECEB; }
.field .num.frac { display: flex; flex-direction: column; align-items: center; line-height: 1.05; font-size: 26px; }
.field .num.frac .fu { border-bottom: 2px solid var(--tx); padding: 0 6px; }
/* 推理 */
.tboard { border-radius: 18px; touch-action: none; background: var(--panel); border: 2px solid rgba(30,43,69,0.08); box-shadow: 0 5px 0 var(--edge2); }
.touchrow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tobj { background: var(--panel); border: 2px solid var(--edge); border-radius: 16px; min-height: 76px; display: flex; align-items: center; justify-content: center; padding: 4px; box-shadow: 0 5px 0 var(--edge); margin-bottom: 5px; }
.tobj:active { transform: translateY(5px); box-shadow: 0 0 0 var(--edge); }
.tobj.ok { border: 3px solid var(--ok); background: #E8F8EE; } .tobj.ng { border: 3px solid var(--ng); background: #FDECEB; }
.tobj canvas { max-width: 100%; height: auto; }
.seqrow { flex-wrap: wrap; gap: 4px; font-size: 34px; font-weight: 900; padding: 16px 14px; font-variant-numeric: tabular-nums; }
.seqrow .sep { color: var(--dim); }
.seqrow .hole { color: var(--acc); border: 3px dashed var(--acc); border-radius: 10px; padding: 0 12px; }
.pgrid { display: grid; gap: 6px; }
.pcell { background: var(--panel); border: 2px solid rgba(30,43,69,0.10); border-radius: 12px; display: flex; align-items: center; justify-content: center; padding: 4px; }
.pcell.hole { border: 3px dashed var(--acc); }
.cyc { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; align-items: center; }
.cyc .hole { border-radius: 8px; outline: 3px dashed var(--acc); }
/* 間違い探し（絵は色付きのまま） */
.spotwrap { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.spotwrap.side { flex-direction: row; }
.pic { position: relative; border-radius: 16px; overflow: hidden; border: 3px solid #fff; box-shadow: 0 5px 0 var(--edge2); touch-action: manipulation; }
.pic canvas { display: block; }
.pic canvas.ov { position: absolute; left: 0; top: 0; }
.shud { display: flex; align-items: center; gap: 10px; width: 100%; justify-content: space-between; margin-bottom: 4px; }
.shud .lft { font-size: 18px; font-weight: 800; }
.shud .lft span { white-space: nowrap; display: inline-block; }
.shud .pn { color: var(--acc); font-size: 16px; }
.shud .ib { flex: none; padding: 0 9px; }

/* ===== 結果 ===== */
.resbox { text-align: center; padding: 22px 18px; position: relative; overflow: hidden; }
.resbox::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 10px; background: var(--acc); }
.score { font-family: var(--head); font-size: 84px; font-weight: 900; line-height: 1; color: var(--tx); font-variant-numeric: tabular-nums; }
.scoreu { font-family: var(--head); font-size: 17px; font-weight: 900; letter-spacing: 0.2em; color: var(--sub); margin-top: 6px; }
.reslines { display: flex; justify-content: center; gap: 10px; margin-top: 12px; color: var(--sub); font-size: 16px; flex-wrap: wrap; }
.reslines > span { background: var(--panel2); border-radius: 999px; padding: 3px 14px; }
.reslines b { color: var(--tx); font-size: 22px; font-variant-numeric: tabular-nums; }
.rankbox { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 20px 0 8px; }
.rankbox .nm { font-family: var(--head); font-size: 28px; font-weight: 900; color: var(--tx); text-align: left; overflow-wrap: anywhere; }
.newbest { display: inline-flex; align-items: center; gap: 6px; color: #5A3A00; background: #FFC21A; border-radius: 999px; padding: 4px 16px; font-size: 16px; font-weight: 900; margin-top: 10px; box-shadow: 0 4px 0 #D99A00; }
.stamp { display: inline-flex; align-items: center; gap: 10px; color: var(--tx); font-weight: 900; margin-top: 14px; }
.stamp i { width: 36px; height: 36px; background: #FFC21A; clip-path: polygon(50% 2%, 62% 35%, 97% 36%, 69% 57%, 79% 92%, 50% 72%, 21% 92%, 31% 57%, 3% 36%, 38% 35%); animation: markPop .5s cubic-bezier(.3,1.6,.5,1) .5s both; }
/* 評価 S〜D：大きなメダルの丸 */
.rk { font-family: var(--gothic); font-weight: 900; line-height: 1; color: var(--acc); }
.rk.big { width: 124px; height: 124px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 70px; flex: none; margin-bottom: 7px;
  color: #fff; background: var(--mdl, #2D7FF9); border: 6px solid var(--mdl2, #7DB0FF); box-shadow: 0 7px 0 var(--mdld, #1E5FC0); animation: markPop .55s cubic-bezier(.3,1.6,.5,1) .3s both; }
.rankbox[data-rank="S"] .rk.big { --mdl: #FFC21A; --mdl2: #FFE38A; --mdld: #C98F00; color: #5A3A00; }
.rankbox[data-rank="A"] .rk.big { --mdl: #A9B6C6; --mdl2: #E3E9F1; --mdld: #76849A; color: #1E2B45; }
.rankbox[data-rank="B"] .rk.big { --mdl: #D9833F; --mdl2: #F5C19A; --mdld: #A65A1F; }
.rankbox[data-rank="C"] .rk.big { --mdl: #2D7FF9; --mdl2: #9CC3FF; --mdld: #1E5FC0; }
.rankbox[data-rank="D"] .rk.big { --mdl: #8A95A8; --mdl2: #C9D0DB; --mdld: #646F82; }
.rk.mini { min-width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; padding: 0 4px; color: #5A3A00; background: #FFC21A; border: 2px solid #fff; }
.rk.mini[data-rank="A"] { background: #E3E9F1; color: #1E2B45; } .rk.mini[data-rank="B"] { background: #F5C19A; color: #5A2A00; } .rk.mini[data-rank="C"] { background: #D6E6FF; color: #1E4FA0; } .rk.mini[data-rank="D"] { background: #E5E9EF; color: #55627A; }
/* 脳年齢の結果 */
.agewrap { position: relative; width: 190px; height: 190px; margin: 10px auto 4px; border-radius: 50%; background: #fff; border: 10px solid var(--acc); box-shadow: 0 8px 0 var(--acc-d); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.agebig { font-family: var(--head); font-size: 88px; font-weight: 900; line-height: 1; color: var(--tx); font-variant-numeric: tabular-nums; }
.agewrap .sub { font-weight: 900; }
.lines div { padding: 10px 0; border-bottom: 2px dashed rgba(30,43,69,0.10); display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.lines div:last-child { border-bottom: 0; }
.lines div span { min-width: 0; overflow-wrap: anywhere; }
.lines div span:first-child { flex: 0 1 auto; color: var(--sub); display: inline-flex; align-items: center; gap: 8px; } .lines div span:last-child { flex: 1 1 0; text-align: right; font-weight: 900; }
.lines .ic { color: var(--acc); }
.toast { position: fixed; left: 50%; bottom: calc(var(--sb) + 20px); transform: translateX(-50%); background: var(--tx); color: #fff; padding: 12px 18px; border-radius: 16px; font-weight: 800; z-index: 90; max-width: 90vw; text-align: center; box-shadow: 0 4px 0 rgba(30,43,69,0.25); }
.pbtn .ic, .sbtn .ic { width: 22px; height: 22px; }
.xbtn { --acc: #1E2B45; --acc-d: #000000; --on-acc: #fff; }
/* 自己ベストのときだけ小さな紙吹雪 */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 80; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 9px; height: 14px; border-radius: 2px; animation: cfFall 1.8s ease-in forwards; }
@keyframes cfFall { 0% { transform: translate(0, 0) rotate(0); opacity: 1; } 100% { transform: translate(var(--dx), 70vh) rotate(540deg); opacity: 0; } }
/* 鍛える力（説明の画面の 1 行） */
.skill { display: flex; align-items: baseline; gap: 10px; margin: 4px 0 8px; font-size: 17px; font-weight: 800; color: var(--tx); }
.skill .skl { flex: none; font-size: 13px; font-weight: 900; color: var(--on-acc); background: var(--acc); border-radius: 999px; padding: 1px 10px; }
.chl .chic { color: var(--sub); display: inline-flex; align-items: center; }
/* 問題の場所が足りないとき、上の指示の文に重ならないよう、下へはみ出す */
.stage { justify-content: safe center; }

/* ===== 投稿（X）：画像の確かめ・アプリの中のブラウザの案内 ===== */
.modal { position: fixed; inset: 0; z-index: 85; background: rgba(30,43,69,0.45); display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: calc(var(--st) + 14px) 14px calc(var(--sb) + 14px); }
.modal .mbox { width: min(100%, 520px); background: var(--panel); border-radius: 22px; padding: 16px; box-shadow: 0 6px 0 rgba(30,43,69,0.2); margin: auto 0; }
.modal .mtitle { font-size: 21px; font-weight: 900; margin: 2px 0 10px; text-align: center; }
.modal .shareimg { display: block; width: 100%; max-width: 360px; margin: 0 auto; border-radius: 14px; border: 2px solid rgba(30,43,69,0.08); -webkit-touch-callout: default; }
.modal .mnote { font-size: 16px; color: var(--tx); margin: 10px 2px 0; line-height: 1.5; }
.modal .mnote.em { background: #FFF4D6; border-radius: 12px; padding: 10px 12px; }
.sharescreen .card { text-align: center; }
.sharescreen .shareimg { display: block; width: 100%; max-width: 380px; margin: 0 auto; border-radius: 16px; border: 2px solid rgba(30,43,69,0.08); -webkit-touch-callout: default; }
/* PC：ホームは広めに（4 列のカードで種目名が途中で折れないように） */
@media (min-width: 900px) { .screen.home { max-width: 940px; } .gcell .gnm { font-size: 19px; } }
/* 注意の追加種目（1〜25 タップ・片方にしかない物・1 つだけ裏返し・影絵はどれ）。光らせない・色は変数 */
.t25hud { display: flex; align-items: center; justify-content: space-between; width: 100%; max-width: 560px; height: 40px; font-family: var(--num); font-size: 20px; color: var(--sub); padding: 0 6px; flex: none; }
.t25hud .t25l { display: flex; align-items: center; gap: 8px; }
.t25nx { font-size: 26px; font-weight: 400; margin-right: 8px; }
.t25life { width: 12px; height: 12px; border-radius: 50%; background: var(--line); display: block; }
.t25life.on { background: var(--acc); }
.t25grid { display: grid; gap: 8px; flex: none; }
.t25c { display: flex; align-items: center; justify-content: center; padding: 0; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); box-shadow: 0 2px 0 rgba(60,40,10,0.14); color: var(--tx); font-family: var(--num); font-weight: 400; line-height: 1; touch-action: manipulation; }
.t25c.done { opacity: 0.18; pointer-events: none; }
.t25c.bad { border-color: var(--ng); background: color-mix(in srgb, var(--ng) 16%, transparent); }
.t25c.hint { border-color: var(--ok); border-width: 2px; }
.t25c.sw { animation: t25sw 0.3s ease-out; }
@keyframes t25sw { from { background: color-mix(in srgb, var(--acc) 30%, transparent); transform: scale(0.92); } to { transform: none; } }

.oddwrap { display: flex; flex-direction: column; gap: 10px; align-items: center; flex: none; }
.oddwrap.row { flex-direction: row; align-items: flex-start; }
.oddp { display: block; touch-action: manipulation; }

.ans.shp { min-height: 112px; padding: 4px; }
.ans.shp canvas { display: block; pointer-events: none; }
.shpq { display: block; flex: none; }
/* ===== 計算の追加の種目（10 をつくる・虫食い算・フラッシュ暗算・買い物計算）。和紙の札・墨の線。光らせない ===== */
/* 10 をつくる */
.m10row { display: flex; gap: 8px; width: 100%; max-width: 480px; align-items: stretch; }
.m10expr { position: relative; flex: 1; min-width: 0; min-height: 112px; padding: 8px; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px; background: var(--panel2); border: 1.5px dashed var(--line); border-radius: 12px; }
.m10expr.over { border-color: var(--acc); border-style: solid; }
.m10expr.warn { border-color: var(--ng); border-style: solid; }
.m10expr.good { border: 2px solid var(--ok); border-style: solid; } .m10expr.bad { border: 2px solid var(--ng); border-style: solid; }
.m10hint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 15px; color: var(--dim); pointer-events: none; }
.m10tgt { flex: none; width: 92px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 1px 2px rgba(60,40,10,0.08); }
.m10tgt .m10eq { font-size: 22px; color: var(--sub); line-height: 1; }
.m10tgt b { font-size: 44px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--tx); }
.m10t { min-width: 40px; height: 44px; padding: 0 6px; display: flex; align-items: center; justify-content: center; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 2px 0 rgba(60,40,10,0.14); font-size: 26px; font-weight: 700; color: var(--tx); font-variant-numeric: tabular-nums; cursor: pointer; user-select: none; -webkit-user-select: none; }
.m10t.op { min-width: 36px; color: var(--acc); } .m10t.pa { min-width: 28px; padding: 0 3px; color: var(--sub); }
.m10res { min-height: 30px; margin-top: 8px; font-size: 20px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; color: var(--tx); }
.m10res.ok { color: var(--ok); }
.m10tiles { display: flex; gap: 8px; justify-content: center; }
.m10s { flex: 1; max-width: 68px; height: 54px; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 2px 0 rgba(60,40,10,0.14); font-size: 30px; font-weight: 700; color: var(--tx); font-variant-numeric: tabular-nums; touch-action: none; user-select: none; -webkit-user-select: none; }
.m10s.op { color: var(--acc); height: 50px; } .m10s.pa { color: var(--sub); }
.m10s.used { opacity: .28; pointer-events: none; box-shadow: none; }
.m10s.ghost { position: fixed; z-index: 50; transform: translate(-50%, -50%) scale(1.08); pointer-events: none; flex: none; width: 56px; max-width: none; opacity: 1; }
/* 虫食い算 */
.mkgrid { --mkw: 44px; display: grid; gap: 4px 3px; justify-content: center; padding: 14px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 1px 2px rgba(60,40,10,0.08); }
.mkc { width: var(--mkw); height: 52px; display: flex; align-items: center; justify-content: center; font-size: 38px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--tx); border-radius: 6px; }
.mkc.op { color: var(--acc); }
.mkrule { height: 0; border-top: 2px solid var(--tx); margin: 2px 0; }
.mkc.blank { border: 1.5px dashed var(--sub); background: var(--panel2); cursor: pointer; color: var(--acc); }
.mkc.blank.fill { border: 1px solid var(--line); background: var(--panel); }
.mkc.blank.cur { border: 3px solid var(--tx); background: var(--panel); }
.mkc.blank.ok { border: 2px solid var(--ok); color: var(--ok); } .mkc.blank.ng { border: 2px solid var(--ng); color: var(--ng); }
/* フラッシュ暗算 */
.fcbox { width: 100%; min-height: 200px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; }
.fcnum { min-height: 130px; line-height: 130px; font-family: var(--num); font-size: 118px; font-weight: 700; color: var(--tx); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; white-space: nowrap; }
.fcnum.q { color: var(--dim); }
.fcdots { display: flex; gap: 7px; flex-wrap: wrap; justify-content: center; }
.fcdots i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--sub); }
.fcdots i.on { background: var(--sub); }
/* 買い物計算 */
.shwrap { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; }
.shrow { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.shitem { position: relative; width: 80px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 4px 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 2px 0 rgba(60,40,10,0.14); }
.shtag { position: relative; min-width: 62px; padding: 2px 6px 2px 16px; text-align: center; border: 1px solid var(--line); border-radius: 4px 10px 10px 4px; background: var(--panel2); font-size: 22px; font-weight: 700; color: var(--tx); font-variant-numeric: tabular-nums; }
.shtag::before { content: ''; position: absolute; left: 6px; top: 50%; width: 5px; height: 5px; margin-top: -3px; border: 1px solid var(--sub); border-radius: 50%; background: var(--bg); }
.shcnt { position: absolute; top: -9px; right: -6px; padding: 0 7px; border-radius: 12px; background: var(--panel); border: 1.5px solid var(--acc); color: var(--acc); font-size: 17px; font-weight: 700; line-height: 22px; }
.shseal { position: absolute; top: -10px; left: -6px; padding: 0 5px; border-radius: 6px; background: var(--panel); border: 1.5px solid var(--p0); color: var(--p0); font-size: 15px; font-weight: 700; line-height: 20px; }
.shpaid { display: flex; align-items: center; gap: 10px; padding: 6px 18px; background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; }
.shpaid b { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }
.shcoin { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--sub); position: relative; }
.shcoin::after { content: ''; position: absolute; left: 7px; top: 7px; width: 8px; height: 8px; border: 1.5px solid var(--sub); }
/* 計算・記憶の追加の種目（10 をつくる・虫食い算・フラッシュ暗算・買い物計算・神経衰弱・光ったマス・出なかった物・道順） */

/* ---- 10 をつくる ---- */
.m10goal { flex-direction: row; gap: 14px; padding: 8px 22px; min-width: 56%; }
.m10goal .gl { font-size: 16px; color: var(--sub); letter-spacing: 0.1em; }
.m10goal b { font-family: var(--num); font-size: 52px; font-weight: 400; color: var(--acc); line-height: 1; }
.m10tray { position: relative; margin-top: 10px; width: min(100%, 470px); min-height: 118px; border: 1px dashed color-mix(in srgb, var(--acc) 55%, transparent); border-radius: 20px;
  display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 6px; padding: 10px 8px; background: var(--panel); }
.m10tray.over { border-style: solid; }
.m10hint { position: absolute; top: 6px; left: 12px; font-size: 13px; color: var(--dim); letter-spacing: 0.08em; }
.m10tray.has .m10hint { display: none; }
.m10val { position: absolute; right: 12px; bottom: 6px; font-family: var(--num); font-size: 20px; color: var(--sub); }
.m10val.ok { color: var(--ok); }
.tk { min-width: 44px; height: 54px; padding: 0 8px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-family: var(--num); font-size: 30px; color: var(--tx); flex: none;
  background: var(--panel2); border: 1px solid var(--line); touch-action: none; user-select: none; -webkit-user-select: none; line-height: 1; }
.tk.n { border-color: color-mix(in srgb, var(--acc) 60%, transparent); background: color-mix(in srgb, var(--acc) 14%, transparent); min-width: 52px; }
.tk.p { min-width: 36px; color: var(--sub); }
.tk.o { color: var(--acc); }
.tk.used { opacity: 0.25; }
.tk.ghost { position: fixed; z-index: 50; transform: translate(-50%, -50%) scale(1.12); pointer-events: none; }
.tk.bad { border-color: var(--ng); }
.m10nums, .m10ops { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.m10nums .tk { height: 62px; min-width: 62px; font-size: 34px; }
.m10ops .tk { height: 52px; min-width: 52px; font-size: 28px; }

/* ---- 虫食い算 ---- */
.mkq { display: grid; gap: 4px; padding: 14px 18px; justify-content: center; align-items: center; font-family: var(--num); }
.mkc { width: 46px; height: 54px; display: flex; align-items: center; justify-content: center; font-size: 42px; line-height: 1; color: var(--tx); }
.mkc.op { color: var(--acc); font-size: 34px; }
.mkc.b { border: 1px dashed color-mix(in srgb, var(--acc) 55%, transparent); border-radius: 10px; color: var(--acc); background: var(--panel); }
.mkc.b.cur { border-style: solid; border-color: var(--acc); background: color-mix(in srgb, var(--acc) 18%, transparent);  }
.mkc.b.ok { border-style: solid; border-color: var(--ok); color: var(--ok);  }
.mkc.b.ng { border-style: solid; border-color: var(--ng); color: var(--ng);  }

.mkline { grid-column: 1 / -1; height: 3px; border-radius: 2px; background: var(--acc); margin: 2px 0; }

/* ---- フラッシュ暗算 ---- */
.fcbox { width: min(86%, 340px); height: 190px; flex-direction: column; gap: 6px; }
.fcnum { font-family: var(--num); font-size: 104px; line-height: 1; color: var(--tx); white-space: nowrap; }
.fcnum.neg { color: var(--ng); }
.fcnum.small { font-size: 84px; }
.fcmsg { min-height: 26px; font-size: 18px; font-weight: 800; color: var(--acc); text-align: center; }
.fcdots { display: flex; gap: 6px; justify-content: center; min-height: 12px; flex-wrap: wrap; }
.fcdots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); display: block; }
.fcdots i.on { background: var(--acc); }

/* ---- 買い物計算 ---- */
.shop { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: min(100%, 440px); }
.shop.one { grid-template-columns: 1fr; width: min(70%, 250px); }
.shitem { position: relative; display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); min-height: 64px; }
.shitem canvas { display: block; flex: none; }
.shitem .shr { display: flex; flex-direction: column; gap: 2px; min-width: 0; align-items: flex-start; }
.shtag { display: inline-flex; align-items: center; font-family: var(--num); font-size: 24px; color: var(--tx); padding: 1px 10px 1px 14px; border-radius: 6px 12px 12px 6px; background: color-mix(in srgb, var(--acc) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--acc) 55%, transparent); position: relative; line-height: 1.25; }
.shtag::before { content: ''; position: absolute; left: 4px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: var(--acc); }
.shtag.old { text-decoration: line-through; color: var(--sub); font-size: 18px; border-color: var(--line); background: none; }
.shtag.old::before { display: none; }
.shqty { font-family: var(--num); font-size: 24px; color: var(--acc); margin-left: auto; padding-right: 4px; }
.shoff { font-size: 15px; font-weight: 900; color: var(--bg); background: var(--p3); border-radius: 8px; padding: 0 8px; line-height: 1.5; white-space: nowrap; }
.shpay { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; width: min(100%, 440px); margin-top: 8px; padding: 6px 16px; border-radius: 14px; border: 1px dashed color-mix(in srgb, var(--acc) 55%, transparent); color: var(--sub); }
.shpay b { font-family: var(--num); font-size: 32px; color: var(--tx); font-weight: 400; }

/* ---- 神経衰弱 ---- */
.cgrid { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; flex: none; }
.ccard { padding: 0; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex: none; font-family: var(--num); color: var(--tx); touch-action: manipulation;
  background: var(--acc); border: 1px solid color-mix(in srgb, var(--acc) 70%, var(--tx)); box-shadow: 0 2px 0 rgba(60,40,10,0.14); transition: transform .12s, background .12s; }
.ccard canvas { display: block; opacity: 0; transition: opacity .1s; }
.ccard.up { background: var(--panel); border-color: var(--tx); transform: scale(1.03); }
.ccard.up canvas { opacity: 1; }
.ccard.got { background: color-mix(in srgb, var(--ok) 14%, var(--panel)); border: 2px solid var(--ok); transform: none; }
.ccard.got canvas { opacity: 0.8; }
.ccard.bad { border-color: var(--ng); }
.clife { display: flex; gap: 6px; justify-content: center; min-height: 14px; margin-top: 10px; flex-wrap: wrap; }
.clife i { width: 11px; height: 11px; border-radius: 50%; background: var(--acc); display: block; }
.clife i.off { background: var(--line); }

/* ---- 光ったマス ---- */
.lgrid { display: grid; gap: 8px; flex: none; }
.lcell { min-width: 48px; min-height: 48px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 2px 0 rgba(60,40,10,0.14); transition: background .08s, transform .08s; padding: 0; touch-action: manipulation; }
.lcell.lit { background: var(--pc, var(--acc)); border: 3px solid var(--tx); transform: scale(1.03); box-shadow: none; }
.lcell.hit { background: color-mix(in srgb, var(--ok) 28%, var(--panel)); border: 2px solid var(--ok); }
.lcell.ngc { background: color-mix(in srgb, var(--ng) 20%, var(--panel)); border: 2px solid var(--ng); }
.lcell.show { background: color-mix(in srgb, var(--pc, var(--acc)) 45%, var(--panel)); border-color: color-mix(in srgb, var(--pc, var(--acc)) 80%, var(--tx)); }
.lswatch { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 30px; margin-bottom: 8px; }
.lswatch i { width: 26px; height: 26px; border-radius: 50%; background: var(--pc); border: 2px solid var(--tx); display: block; }
.lswatch span { font-family: var(--num); font-size: 22px; color: var(--sub); }

/* ---- 出なかった物 ---- */
.msbox { width: min(78%, 280px); height: 190px; flex-direction: column; gap: 4px; position: relative; }
.msround { position: absolute; top: 8px; right: 12px; font-family: var(--num); font-size: 18px; color: var(--sub); }
.msph { min-height: 26px; font-size: 18px; font-weight: 800; color: var(--acc); text-align: center; margin-top: 8px; }
.msph2 { height: 190px; }
.ans.pic { min-height: 88px; }

/* ---- 道順 ---- */
.rtboard { border-radius: 12px; touch-action: none; background: var(--panel); border: 1px solid var(--line); }
.rtmsg { min-height: 28px; font-size: 20px; font-weight: 800; color: var(--acc); text-align: center; margin: 0 0 6px; }
/* =====================================================================
   分かりやすさの見直し（版 0.7）：画面の部品に言葉の見出しを付ける
   色は CSS 変数（--tx・--sub・--acc・--panel・--panel2・--line）だけを使う
   ===================================================================== */
/* 見出しの小さな札（どの種目でも使う） */
.lbl { display: inline-block; font-size: 14px; font-weight: 700; color: var(--sub); line-height: 1.25; text-align: center; overflow-wrap: anywhere; }
.lblbox { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.draghint { font-size: 13px; color: var(--sub); text-align: center; margin: 4px 0 2px; line-height: 1.3; overflow-wrap: anywhere; }

/* おつり：お店のやりとり */
.chscene { display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 10px 16px; min-width: min(100%, 300px); }
.chrow { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 8px; }
.chrow .chpic { display: flex; align-items: center; justify-content: center; color: var(--acc); }
.chrow .chlbl { font-size: 16px; font-weight: 700; color: var(--sub); line-height: 1.2; overflow-wrap: anywhere; }
.chrow .chval { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--tx); text-align: right; }
.chrow.given .chval { font-size: 30px; }
.charrow { text-align: center; font-size: 18px; color: var(--sub); line-height: 1; }
/* 硬貨を運ぶ枠 */
.tray .trayhead { display: flex; align-items: baseline; justify-content: center; gap: 8px; flex-wrap: wrap; width: 100%; }
.tray .traytitle { font-size: 22px; font-weight: 800; color: var(--acc); line-height: 1.2; text-align: center; }
.tray .trayfew { font-size: 13px; font-weight: 700; color: var(--sub); border: 1.5px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.tray .traysum { display: flex; align-items: baseline; gap: 2px; font-size: 28px; }
.tray .traysum .tslbl { font-size: 15px; font-weight: 700; color: var(--sub); }
.tray .traycoins:empty { min-height: 8px; }
.fingerdemo { position: fixed; z-index: 60; pointer-events: none; color: var(--tx); transform: translate(-30%, -10%); opacity: 0; }
.fingerdemo .ic { stroke-width: 2; fill: var(--panel); }

/* 案内の札（タップまで待つ）：見た目の仕上げは style.css 側。ここは動くための最低限 */
.gate { position: absolute; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 20px; text-align: center; cursor: pointer; }
.gate .thow { font-size: 24px; font-weight: 700; line-height: 1.45; color: var(--tx); text-wrap: balance; overflow-wrap: anywhere; }
.gate .tnext { font-size: 16px; font-weight: 700; color: var(--acc); letter-spacing: 0.1em; }
.gate .gatebtn { margin-top: 10px; min-width: 220px; min-height: 60px; padding: 12px 24px; border-radius: 18px; border: 0; font: inherit; font-size: 20px; font-weight: 800; background: var(--acc); color: #fff; cursor: pointer; }

/* 答えの欄：左に見出し（答え・合計・おつり など）、真ん中に打った数 */
.kdisp { position: relative; }
.kdisp .klbl { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); max-width: 34%; font-size: 15px; font-weight: 700; line-height: 1.15; color: var(--sub); text-align: left; overflow-wrap: anywhere; }

/* 数えて：見本の行（見出し＋絵） */
.clegrow { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 46px; }
.clegrow .lbl { font-size: 16px; }
.lswatch .lbl { font-size: 16px; font-family: inherit; }

/* 道順：スタートとゴールの目印の見出し */
.rtleg { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.rtleg i { display: inline-block; width: 22px; height: 22px; border-radius: 6px; flex: none; }
.rtleg .rtls { border: 3px solid var(--acc); }
.rtleg .rtlg { border-radius: 50%; border: 3px solid var(--tx); background: radial-gradient(circle, var(--tx) 0 3px, transparent 4px); margin-left: 10px; }
.rtleg .lbl { font-size: 15px; color: var(--tx); }

/* 投稿の小さな画面：「画像を保存」と「X の投稿画面を開く」を横に並べる（狭いときは縦） */
.modal .mrow { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; width: 100%; }
.modal .mrow > button { flex: 1 1 160px; min-width: 0; font-size: 17px; line-height: 1.25; text-wrap: balance; word-break: keep-all; overflow-wrap: anywhere; }
/* 投稿の小さな画面：画像の見本は画面の高さに合わせて小さく（PC の 800px でも「閉じる」まで見える） */
.modal .shareimg { max-height: 44vh; width: auto; max-width: 100%; }

/* 3・2・1：数字は円（.countdown::before）と同じ中心に置いたキャンバス（.cdnum）に、外形の中心をそろえて描く */
.countdown .cdnum { position: absolute; left: 50%; top: 50%; width: 200px; height: 200px; transform: translate(-50%, -50%); pointer-events: none; }
.countdown::before { box-sizing: border-box; }

/* 高さの低い画面（iPhone SE・ブラウザの帯で高さが減ったとき）：答えのボタンを低くして、盤の場所を残す */
@media (max-height: 660px) {
  .play .key { height: 42px; font-size: 26px; margin-bottom: 3px; }
  .play .kdisp { height: 44px; font-size: 32px; }
  .play .ans { min-height: 62px; font-size: 28px; }
  .play .pbtn { min-height: 52px; margin: 8px 0 4px; font-size: 21px; }
}
@media (max-height: 590px) {
  .play .key { height: 38px; font-size: 24px; }
  .play .kdisp { height: 40px; font-size: 28px; }
  .play .ans { min-height: 56px; }
}

/* 間違い探しの上の列：狭い画面でも「ヒント」が画面の外に出ないよう、左の文字を折り返す */
.shud { max-width: 100%; }
.shud .lft { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; column-gap: 8px; row-gap: 0; line-height: 1.25; }
@media (max-width: 360px) { .shud .lft { font-size: 16px; } }

/* おつり：高さの低い画面では、お店のやりとりの札・枠・硬貨を詰める */
@media (max-height: 700px) {
  .chscene { padding: 6px 12px; gap: 0; }
  .chrow .chval { font-size: 28px; }
  .chrow.given .chval { font-size: 24px; }
  .chrow .chpic .ic { width: 24px; height: 24px; }
  .charrow { font-size: 14px; }
  .tray { min-height: 76px; margin-top: 6px; padding: 4px 8px; }
  .tray .traytitle { font-size: 18px; }
  .tray .traysum { font-size: 22px; }
  .play .coin { width: 48px; height: 48px; font-size: 16px; }
  .play .coin.c500 { width: 54px; height: 54px; }
  .play .coin.c1000 { width: 70px; height: 44px; }
  .play .draghint { margin: 2px 0 0; font-size: 12px; }
}

/* おつり：狭い画面（幅 380px 以下）では硬貨を小さくして 1 段に収める（2 段になると上の段が枠の裏に隠れた） */
@media (max-width: 380px) {
  .play .wallet { gap: 4px; flex-wrap: nowrap; }
  .play .wallet .coin { width: 36px; height: 36px; font-size: 13px; border-width: 2px; }
  .play .wallet .coin.c500 { width: 40px; height: 40px; }
  .play .wallet .coin.c1000 { width: 50px; height: 34px; }
}
/* 狭くて低い画面では、指示の 1 行を少し小さく */
@media (max-height: 600px) { .play .qtext, .play .prompt { font-size: 17px; line-height: 1.35; } }
/* =====================================================================
   分かりやすさの見直し（版 0.7・その 2）：空間と推理の種目の見出しと操作の案内
   影合わせ・時計・スライドパズル・迷路・点図形を写す・数独・お絵かきロジック・重い順・ナンバーリンク
   色は CSS 変数（--tx・--sub・--acc・--panel・--panel2・--line）だけ。光らせない
   ===================================================================== */

/* 影合わせ：札の中の上の帯に見出し（絵とは重ならない） */
.spcard .splbl { display: block; padding: 5px 10px 0; font-size: 14px; }
.spcard.me .splbl { color: var(--acc); }

/* 時計：上の箱の各行の左に見出し（時刻・たつ時間・もどす時間）。箱全体を 2 列の格子にして、行どうしの列をそろえる */
.clkinfo.clkinfo2 { display: grid; grid-template-columns: auto auto; justify-content: center; align-items: center; column-gap: 14px; height: auto; padding: 4px 18px; max-width: 100%; }
.clkrow { display: contents; }
.clkrow > .lbl { text-align: right; max-width: 8.5em; justify-self: end; }
.clkrow > .clkbig { text-align: left; justify-self: start; }
.clkrow > canvas { display: block; justify-self: start; margin: 4px 0; }
.clkrow.clkcol { display: flex; flex-direction: column; align-items: center; grid-column: 1 / -1; }
.clkrow.clkcol > .lbl { text-align: center; max-width: none; padding-top: 2px; }
/* 時計の案内：時計の絵の下の余白（つかむ所の分）にかからないよう少し下げる */
.draghint.clkhint { margin-top: 8px; }
/* 時計（時計の時刻から＋）：横並び。上の段に見出し、下の段に小さな時計と時間 */
.clkinfo.clkinfo2.clkh { grid-template-columns: auto auto; row-gap: 0; column-gap: 22px; justify-items: center; padding: 4px 18px 6px; }
.clkinfo.clkh > .lbl { padding-top: 2px; }
.clkinfo.clkh > .clkbig { font-size: 44px; }

/* スライドパズル：下の行［見本］［案内］［1 手戻す］ */
.sprow.sprow2 { align-items: center; gap: 10px; }
.sprow2 .sprev2 { flex: none; gap: 2px; }
.sprow2 .sprev2 canvas { display: block; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.sprow2 .sphint { flex: 1; min-width: 0; margin: 0; text-wrap: balance; }
.sprow2 .undo { flex: none; }

/* 案内の文は行の長さをそろえて、言葉の途中で 1〜2 文字だけ次の行に落ちないように */
.draghint { text-wrap: balance; }

/* 迷路：盤の下の凡例（● 入口・■ 出口） */
.mzleg { display: flex; justify-content: center; align-items: center; gap: 22px; flex-wrap: wrap; }
.mzitem { display: inline-flex; align-items: center; gap: 6px; }
.mzitem canvas { display: block; flex: none; }
.mzitem .lbl { font-size: 15px; color: var(--tx); }

/* 点図形を写す：盤の上に見出し。盤の下をそろえる */
.dcwrap.dcwrap2 { align-items: flex-end; }
.dccol { flex: none; gap: 4px; }
.dccol .lbl { max-width: 100%; }
.dcwrap2 .dcmid { align-self: flex-end; }

/* 数独：数字キーは 1 行（6×6 まで）。小さい画面ではキーを低く */
.sdpad .key { min-width: 0; }
@media (max-height: 700px) { .sdpad .key { height: 46px; font-size: 26px; } }

/* お絵かきロジック：「× を付ける」の切り替え。入っているときは分野の色の枠と文字で、押されているのが分かるように */
.ngmode { min-width: 150px; }
.ngmode.on { border-color: var(--acc); color: var(--acc); background: var(--panel2); }

/* 数独・お絵かきロジック・重い順：マスの地と線を変数の色に（css_reason2.css の色は暗い地の前提で、明るい地では空きマスと線が見えない）
   css_reason2.css より前に連結されるので、.play を前に付けて強くする */
.play .sdk .sc { background: var(--panel); color: var(--tx); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.play .sdk .sc.given { background: var(--panel2); color: var(--acc); }
.play .ngcell { background: var(--panel); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.play .ngcell.on { background: var(--acc); }
.play .ngcell.x::after { color: var(--sub); }
.play .oslot { background: var(--panel2); }
/* 記憶・注意の種目の画面（style.css の後ろにつながる）
   和風：和紙の白い札に墨の細い縁。分野の色（var(--acc)）は面の色だけ（光らせない・にじませない）。正解 var(--ok)・不正解 var(--ng)。数字は var(--num) */
.mphase, .pmsg { min-height: 28px; font-size: 20px; font-weight: 800; color: var(--acc); text-align: center; margin: 0 0 6px; line-height: 1.3; }
.pmsg { color: var(--tx); font-size: 19px; }

/* 瞬間記憶：和紙の札のマス。伏せたマスは分野の色の面（塗るだけ） */
.mgrid { display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, 1fr); gap: 8px; flex: none; }
.tile { display: flex; align-items: center; justify-content: center; padding: 0; overflow: hidden; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); box-shadow: 0 2px 0 rgba(60,40,10,0.14);
  color: var(--tx); font-family: var(--num); font-weight: 400; line-height: 1; touch-action: manipulation; }
.tile canvas { display: block; }
.tile.cov { background: var(--acc); border-color: color-mix(in srgb, var(--acc) 70%, var(--tx)); box-shadow: 0 2px 0 rgba(60,40,10,0.14); }
.tile.num { background: var(--panel); border-color: var(--line); }
.tile.num.hit { background: color-mix(in srgb, var(--ok) 16%, var(--panel)); border: 2px solid var(--ok); }
.tile.ngt { background: color-mix(in srgb, var(--ng) 12%, var(--panel)); border: 2px solid var(--ng); }
.tile.num.dim { opacity: 0.7; }

/* 光った順：和紙の札のパッド。光るときは色の面に変わる（にじませない） */
.fgrid { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 10px; flex: none; }
.pad { min-width: 48px; min-height: 48px; border-radius: 12px; background: color-mix(in srgb, var(--pc, #888) 24%, var(--panel)); border: 1px solid color-mix(in srgb, var(--pc, #888) 55%, var(--panel)); box-shadow: 0 2px 0 rgba(60,40,10,0.14);
  transition: background .08s, transform .08s, border-color .08s; }
.pad.lit { background: var(--pc, var(--acc)); border: 3px solid var(--tx); transform: scale(1.03); box-shadow: none; }
.pad.ngp { border: 3px solid var(--ng); }
.fdots { display: flex; gap: 8px; justify-content: center; min-height: 16px; margin-top: 10px; flex-wrap: wrap; }
.fdots i { width: 12px; height: 12px; border-radius: 50%; background: var(--line); display: block; }
.fdots i.on { background: var(--acc); }

/* 人数数え・さっきと同じ？・数えて：数字キーやはじくボタンの場所取り */
.pbox { padding: 6px; flex: none; }
.pbox canvas { display: block; border-radius: 12px; }
.nbarea { position: relative; display: flex; align-items: center; justify-content: center; flex: none; }
.nbsmall { padding: 0; border-radius: 12px; }
.nbbig { padding: 0; }
.swph { min-height: 78px; }
.nbarea .qcard { background: var(--panel); border: 1px solid var(--line); box-shadow: 0 2px 0 rgba(60,40,10,0.14); }

/* 色と文字：和紙の札のカード（字の色が問題の中身。ここでは色を変えない） */
.stroopq { display: flex; flex-direction: column; gap: 6px; align-items: center; justify-content: center; min-height: 150px; padding: 14px 26px; min-width: 60%; }
.stroopq .sw { font-weight: 900; line-height: 1.15; white-space: nowrap; }

/* 間違い探し：絵は色付きのまま。枠・表示だけ和紙と墨に */
.shud .pn { color: var(--tx); }
.shud .lft { color: var(--tx); }

/* ペア探し：和紙の札のタイル */
.ptgrid { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; flex: none; }
.ptile { background: var(--panel); color: var(--tx); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 2px 0 rgba(60,40,10,0.14); font-family: var(--num); font-weight: 400; padding: 0; display: flex; align-items: center; justify-content: center; flex: none; line-height: 1; }
.ptile canvas { display: block; }
.ptile.sel { border: 3px solid var(--acc); background: color-mix(in srgb, var(--acc) 16%, var(--panel)); }
.ptile.ok { border: 3px solid var(--ok); background: color-mix(in srgb, var(--ok) 14%, var(--panel)); }
.ptile.ng { border: 3px solid var(--ng); background: color-mix(in srgb, var(--ng) 10%, var(--panel)); }
.ptile.right { border: 3px solid var(--ok); }

/* 数えて：和紙の札の枠 */
.cfield { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; flex: none; box-shadow: 0 1px 2px rgba(60,40,10,0.08); }
.cfield canvas { display: block; }
.cask { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 34px; font-weight: 800; color: var(--acc); }

/* 問題の上の 1 行・型が変わるときの大きな 1 行：途中で 1 文字だけ折り返さない */
.play .qtext, .typecard .thow, .readycue .rtxt { text-wrap: balance; word-break: keep-all; overflow-wrap: break-word; }
/* 推理の追加：数独・お絵かきロジック・重い順（版 0.4：光り・にじみは使わない。色は変数だけ） */
.sdk { display: grid; gap: 0; border: 1px solid color-mix(in srgb, var(--acc) 60%, transparent); border-radius: 10px; overflow: hidden; }
.sdk .sc { border: 0; border-right: 1px solid rgba(255,255,255,0.08); border-bottom: 1px solid rgba(255,255,255,0.08); border-radius: 0; background: rgba(255,255,255,0.03); color: #fff; font-family: var(--num); display: flex; align-items: center; justify-content: center; padding: 0; }
.sdk .sc.given { color: var(--acc); background: rgba(255,255,255,0.07); }
.sdk .sc.bl { border-left: 2px solid color-mix(in srgb, var(--acc) 55%, transparent); }
.sdk .sc.bt { border-top: 2px solid color-mix(in srgb, var(--acc) 55%, transparent); }
.sdk .sc.sel { background: color-mix(in srgb, var(--acc) 25%, transparent); outline: 2px solid var(--acc); outline-offset: -2px; }
.sdk .sc.bad { color: var(--ng); background: rgba(255,84,112,0.15); }
.sdk .sc.cdot::after, .sdpad .cd { content: ''; display: block; width: 52%; height: 52%; border-radius: 50%; background: var(--dot); }
.sdpad .cd { width: 28px; height: 28px; margin: auto; }
.sdpad { display: grid; gap: 6px; }
.sdmsg { min-height: 24px; margin-top: 6px; font-size: 16px; color: var(--acc); text-align: center; font-weight: 800; }
.ngw { display: grid; gap: 4px; align-items: end; }
.ngtop { display: grid; align-items: end; }
.ngc { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; font-family: var(--num); color: var(--sub); line-height: 1.05; padding-bottom: 3px; }
.ngleft { display: flex; flex-direction: column; }
.ngr { display: flex; align-items: center; justify-content: flex-end; padding-right: 5px; font-family: var(--num); color: var(--sub); white-space: nowrap; }
.nggrid { display: grid; border: 1px solid color-mix(in srgb, var(--acc) 55%, transparent); }
.ngcell { border: 0; border-right: 1px solid rgba(255,255,255,0.08); border-bottom: 1px solid rgba(255,255,255,0.08); border-radius: 0; background: rgba(255,255,255,0.025); padding: 0; }
.ngcell.bl { border-left: 1px solid color-mix(in srgb, var(--acc) 45%, transparent); } .ngcell.bt { border-top: 1px solid color-mix(in srgb, var(--acc) 45%, transparent); }
.ngcell.on { background: var(--acc); }
.ngcell.x::after { content: '×'; color: var(--dim); font-size: 70%; }
.ngmode { align-self: center; }
.olane { display: flex; align-items: center; gap: 6px; justify-content: center; }
.oend { font-size: 13px; color: var(--sub); writing-mode: horizontal-tb; width: 34px; text-align: center; line-height: 1.1; }
.oslot { width: 58px; height: 58px; border-radius: 14px; border: 1px dashed color-mix(in srgb, var(--acc) 60%, transparent); background: rgba(0,0,0,0.25); display: flex; align-items: center; justify-content: center; }
.otray { display: flex; gap: 8px; justify-content: center; min-height: 58px; }
.otile { width: 54px; height: 54px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; touch-action: none; user-select: none; -webkit-user-select: none; }
.otile.ghost { position: fixed; z-index: 50; transform: translate(-50%, -50%) scale(1.1); pointer-events: none; }
.ohome { width: 58px; height: 58px; border-radius: 14px; border: 1px dashed var(--line); display: flex; align-items: center; justify-content: center; }
/* ===== 分野「空間」：積み木・影合わせ・時計・スライドパズル =====
   和風：和紙の札に墨の細い縁・分野の色（常磐色＝var(--acc)）は面と縁だけ（光らせない）。正解 var(--ok)・不正解 var(--ng) */
/* 積み木 */
.bpic { display: block; }
.ans.topc { min-height: 124px; padding: 4px; }
.ans.topc canvas { display: block; pointer-events: none; }
/* 影合わせ：上に影（墨の淡い面）、下に回す形 */
.spbox { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.spcard { border-radius: 12px; position: relative; overflow: hidden; width: 100%; background: var(--panel); border: 1px solid var(--line); }
.spcard.sh { background: var(--panel2); }
.spcard.me { background: var(--panel); touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; border: 2px solid var(--acc); }
.spcard.me.ok { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, var(--panel)); }
.spcard canvas { display: block; touch-action: none; }
.flipb { width: 100%; height: 52px; font-size: 20px; }
/* 時計 */
.clkinfo { display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--panel); border: 1px solid var(--line); color: var(--tx); border-radius: 10px; padding: 4px 28px; min-width: 56%; margin-bottom: 8px; flex: none; box-shadow: 0 1px 2px rgba(60,40,10,0.08); }
.clkbig { font-family: var(--num); font-size: 50px; font-weight: 400; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: 0.04em; color: var(--tx); }
.clkbig.plus { color: var(--acc); }
.clkinfo canvas { display: block; }
.clkwrap { padding: 18px; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; flex: none; margin: -18px 0; }
.clkwrap canvas { display: block; background: transparent; }
/* スライドパズル：和紙の札のタイル（白い札に墨の数字・細い縁）。盤は少し濃い和紙 */
.sboard { position: relative; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; touch-action: none; user-select: none; -webkit-user-select: none; flex: none; overflow: hidden; }
.sboard.ok { border: 2px solid var(--ok); }
.stile { position: absolute; left: 0; top: 0; padding: 3px; }
.stile.anim { transition: transform 0.1s ease-out, opacity 0.25s; }
.stile .si { position: relative; width: 100%; height: 100%; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--tx); font-family: var(--num); font-weight: 400; line-height: 1; overflow: hidden;
  background: var(--panel); box-shadow: 0 1px 0 rgba(60,40,10,0.18); }
.stile .si::after { content: ''; position: absolute; inset: 0; border-radius: inherit; border: 1px solid var(--line); pointer-events: none; }
.stile .si canvas { width: 100%; height: 100%; display: block; }
.stile.ghostp { opacity: 0; } .stile.ghostp.show { opacity: 1; }
.stile.shake { animation: sshake 0.25s; }
@keyframes sshake { 25% { margin-left: -5px; } 75% { margin-left: 5px; } }

/* ===== 版 0.4 追加（光らせない。色は変数）===== */
/* スライドパズル：見本（そろった色）を小さく見せる行 */
.sprow { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sprev { display: flex; align-items: center; gap: 8px; color: var(--sub); font-size: 14px; }
.sprev canvas { display: block; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
/* 点図形を写す：左に見本・真ん中に記号・右に盤 */
.dcwrap { display: flex; align-items: center; justify-content: center; gap: 0; flex: none; }
.dccard { border-radius: 10px; border: 1px solid var(--line); background: var(--panel); overflow: hidden; flex: none; }
.dccard.me { border-color: var(--acc); }
.dccard canvas { display: block; }
.dcmid { width: 44px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--acc); line-height: 1.1; flex: none; }
.dcmid .dcm1 { font-size: 24px; font-weight: 800; }
.dcmid .dcm2 { font-size: 12px; color: var(--sub); font-family: var(--num); }
