/* ===== 色やサイズの「変数」（あとで一か所を変えれば全体が変わる） ===== */
:root {
  /* 空と雲の色：ブルー・水色・白。目立たせたい所（ふくしゅう・れんぞく・ぬかした！など）だけ、オレンジを少し使う */
  --blue: #2b7de9;        /* 選ばれている枠・メインの色（空のブルー） */
  --blue-dark: #1b5bb3;   /* 押したときの影など、こいブルー */
  --sky: #8fcaf5;         /* 水色 */
  --blue-light: #e3f3ff;  /* うすい水色（ボタンや枠の地） */
  --ink: #1e2b3c;         /* 文字の色（こい紺） */
  --bg: #f3faff;          /* 背景（ほとんど白の水色） */
  --white: #ffffff;
  --red: #e0484f;         /* まちがい */
  --green: #2fa36b;       /* せいかい */
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Hiragino Maru Gothic ProN", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
  /* ダブルタップでの拡大や、長押しの文字選択を止める（ゲーム中の誤操作防止） */
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#app {
  max-width: 560px;        /* タブレットでも横に広がりすぎない */
  min-height: 100%;
  margin: 0 auto;
  padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom);
  display: flex;
  flex-direction: column;
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px 0;
}

.title {
  margin: 24px 0 0;
  font-size: 2rem;
  text-align: center;
  color: var(--blue);
}

.lead { text-align: center; font-size: 1.2rem; margin: 0; }
.note { text-align: center; color: #777; }

/* ===== ボタンの共通 ===== */
button {
  font: inherit;
  color: inherit;
  border: none;
  cursor: pointer;
}
.big {
  display: block;
  width: 100%;
  padding: 16px;
  font-size: 1.3rem;
  font-weight: bold;
  border-radius: var(--radius);
  background: var(--blue);
  color: var(--white);
}
.big.sub { background: var(--white); color: var(--blue); border: 2px solid var(--blue); }
.big[hidden] { display: none; } /* .big の display: block が hidden（かくす）に かたないように */
.buttons { display: flex; flex-direction: column; gap: 12px; margin-top: auto; }

/* ===== 設定画面 ===== */
.setup { gap: 14px; padding-bottom: 32px; }
.setup .title { margin-top: 12px; }
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 14px 14px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.step { font-size: 1.1rem; margin: 0 0 10px; }
.step small { font-size: 0.8rem; font-weight: normal; color: #777; }
.grid { display: grid; gap: 8px; }
.grade-grid { grid-template-columns: repeat(3, 1fr); }
.dan-grid { grid-template-columns: repeat(5, 1fr); }
.single-grid { grid-template-columns: repeat(3, 1fr); }
.option-hint { margin: 10px 2px 0; font-size: 0.85rem; color: #4a5a70; }
.choice {
  min-height: 52px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--blue-light);
  font-size: 1.1rem;
  font-weight: bold;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  line-height: 1.2;
}
.choice.on { background: var(--blue); color: var(--white); }
.choice:disabled { background: #eee; color: #aaa; }
.choice small { font-size: 0.65rem; font-weight: normal; }
.unit-group + .unit-group { margin-top: 12px; }
.unit-group h3 { font-size: 0.95rem; margin: 0 0 6px; color: var(--blue); }
.unit-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.choice.unit { font-size: 1rem; flex: 1 1 40%; }
.choice.unit.wide { flex-basis: 100%; } /* 名前が 長い 単元（unit.wide）。半分の はばだと 5行に おれるため */
.start-area { display: flex; flex-direction: column; gap: 10px; scroll-margin-bottom: calc(90px + env(safe-area-inset-bottom)); } /* 下のタブバーに かくれないところまで スクロール */
.start-info { margin: 0; text-align: center; color: #555; }
.big:disabled { opacity: .45; }

/* ===== プレイ画面 ===== */
.play {
  height: 100dvh;           /* dvh（dynamic viewport height）：スマホのアドレスバーを除いた高さ */
  padding: 8px 0 12px;
  gap: 8px;
  position: relative;
}
.play-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 1rem;
}
.quit {
  background: var(--white); border-radius: 999px; padding: 6px 14px;
  font-size: 0.9rem; box-shadow: 0 1px 3px rgba(0,0,0,.1);
}
.play-count { font-weight: bold; }
.play-time { font-variant-numeric: tabular-nums; min-width: 6.5em; text-align: right; }
.quit, .play-count, .play-time { white-space: nowrap; } /* せまい画面でも2行にしない */
@media (max-width: 340px) { .play-head { font-size: 0.85rem; } .play-time { min-width: 0; } }

.progress { height: 10px; background: var(--blue-light); border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--blue); transition: width .25s; }

.problem-area {
  position: relative;
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px;
  min-height: 0;
}
.problem {
  display: flex; flex-wrap: nowrap; align-items: center; justify-content: center;
  max-width: 100%; white-space: nowrap;
  gap: 0.25em;
  font-size: clamp(2rem, 9vw, 3.2rem);
  font-weight: bold;
  font-variant-numeric: tabular-nums;
}
.problem.hidden { visibility: hidden; }
.token.small { font-size: 0.6em; }
.answer { display: inline-flex; align-items: center; gap: 0.2em; }
.slot {
  /* 数字を枠のまん中に置く。
     iPhone の文字（ヒラギノ丸ゴ）は行の上下に広い余白を持つので、
     ボタン任せにすると数字が下にずれる。flex（フレックス＝伸び縮みする並べ方）で
     上下・左右のまん中にそろえ、行の高さ（line-height）を文字の大きさぴったり（1）にする */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  -webkit-appearance: none;
  appearance: none;
  min-width: calc(var(--digits, 2) * 0.7em + 0.6em);
  height: 1.4em;
  padding: 0 0.2em;
  font-size: 1em; font-weight: bold;
  background: var(--white);
  border: 3px solid #bfd6ea;
  border-radius: 12px;
}
.slot.selected { border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-light); }
.problem.ok .slot { border-color: var(--green); color: var(--green); }
.problem.revealed .slot { border-color: #ff9f43; color: #b25400; background: #fff6ec; } /* こうさん：こたえを 見せる */
/* ひとり練習の「こうさん」：1回 まちがえたら 問題の 右上に 出る（テンキーから はなれた場所。screens/play.js） */
.quit.giveup.play-giveup { position: absolute; top: 4px; right: 0; z-index: 2; }
.quit.giveup.play-giveup[hidden] { display: none; }
/* 文と図の問題：ヒントの カードの いちばん上の 行に、オレンジで ぬって 目立たせる（「ヒント：…」の しるしの 右） */
.hint-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; align-self: stretch; width: 100%; }
.hint-top .hint-tag { align-self: auto; }
.quit.giveup.play-giveup.on-hint {
  position: static; padding: 6px 18px; font-size: 1rem; font-weight: 900;
  background: #ff9f43; color: var(--white); border: none; box-shadow: 0 3px 0 #d9771f;
  animation: pop .3s ease-out;
}

.message {
  height: 1.6em; margin: 0;
  font-size: 1.2rem; font-weight: bold;
  opacity: 0; transition: opacity .15s;
}
.message.show { opacity: 1; }
.message.ng { color: var(--red); }
.message.ok { color: var(--green); }
.message.info { color: #b26b00; }

.shake { animation: shake .35s; }
@keyframes shake {
  20% { transform: translateX(-10px); }
  40% { transform: translateX(10px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

/* テンキー：3列のマス目（grid＝格子） */
.pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.key {
  height: clamp(56px, 9dvh, 84px);
  font-size: 1.8rem; font-weight: bold;
  background: var(--white);
  border-radius: 14px;
  box-shadow: 0 3px 0 #cfe3f3;
  transition: transform .05s;
}
.key.pressed { transform: translateY(3px); box-shadow: 0 0 0 #cfe3f3; }
.key-clear { font-size: 1.2rem; color: #7f8ea0; }
.key-submit { font-size: 1.2rem; background: var(--blue); color: var(--white); box-shadow: 0 3px 0 var(--blue-dark); }
/* 枠が 2つ以上 ある 問題で、つぎの 枠へ うつる ときの「つぎへ ▶」（せまい スマホでも 1行に） */
.key-submit.key-next { white-space: nowrap; font-size: min(1.2rem, 4.6vw); }

.countdown {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 9rem; font-weight: bold; color: var(--blue);
  background: rgba(243, 250, 255, .88);
}
.count-num {
  display: flex; align-items: center; justify-content: center;
  width: 1.5em; height: 1.5em; border-radius: 50%;
  background: var(--white); box-shadow: 0 6px 24px rgba(43, 125, 233, .25);
  line-height: 1; animation: count-pop .6s ease-out both;
}
.count-num.start {
  width: auto; height: auto; padding: .25em .6em; border-radius: 999px;
  font-size: 2.4rem; background: var(--blue); color: var(--white);
  animation: count-go .65s ease-out both;
}
/* 「スタート！」のときは、うしろの問題が見えて、タップもできるように */
.countdown.go { background: transparent; pointer-events: none; }
@keyframes count-pop {
  0% { transform: scale(1.8); opacity: 0; }
  35% { transform: scale(.92); opacity: 1; }
  60% { transform: scale(1.04); }
  100% { transform: scale(1); }
}
@keyframes count-go {
  0% { transform: scale(.5); opacity: 0; }
  30% { transform: scale(1.1); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: scale(1.3); opacity: 0; }
}
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 50; }
@media (prefers-reduced-motion: reduce) {
  .count-num, .count-num.start, .runner.hop .avatar, .podium-step { animation: none !important; }
}

/* ===== 結果画面 ===== */
.result-time { text-align: center; font-size: 2.6rem; font-weight: bold; margin: 0; font-variant-numeric: tabular-nums; }
.wrong-list { background: var(--white); border-radius: var(--radius); padding: 12px 16px; }
.wrong-list h2 { font-size: 1rem; margin: 0 0 6px; }
.wrong-list ul { margin: 0; padding-left: 1.2em; font-size: 1.2rem; }
.given { font-size: 0.85rem; color: var(--red); margin-left: 6px; }
.big small { font-size: 0.75rem; font-weight: normal; margin-left: 4px; }
/* ことばの途中で改行しない（空白のところでだけ折り返す） */
.choice { word-break: keep-all; overflow-wrap: anywhere; }

/* ===== 自己ベスト・ふくしゅう ===== */
.start-best { margin: 0; text-align: center; font-weight: bold; color: var(--blue); }
.big.review { background: var(--white); color: #b35500; border: 2px solid #ef7a1a; } /* ふくしゅうは 白地に オレンジの わく（ぬった オレンジは スタートだけ） */

/* スタート：えらぶ ボタンの ブルーと 見分けるため オレンジ。下の こい かげで「おせる」感じに */
.big.start { background: #ee6f00; box-shadow: 0 4px 0 #b35500; margin-bottom: 4px; }
.big.start:active { transform: translateY(3px); box-shadow: 0 1px 0 #b35500; }

/* えらんだ たんげん（スタートの すぐ上）。えらんだ 単元の ボタンと 同じ ブルーで ぬって 目立たせる（2026-11-21 案3） */
.chosen-card {
  background: var(--blue); color: var(--white); box-shadow: 0 0 0 4px var(--sky);
  border-radius: var(--radius); padding: 10px 14px; display: flex; flex-direction: column; gap: 2px;
}
.chosen-card p { margin: 0; }
.chosen-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .85rem; font-weight: bold; }
.chosen-tag { background: var(--white); color: var(--blue); padding: 1px 8px; border-radius: 999px; font-size: .75rem; }
.chosen-name { font-size: 1.25rem; font-weight: bold; word-break: keep-all; overflow-wrap: anywhere; }
.chosen-cond { font-size: .9rem; font-weight: bold; }
.chosen-card .start-info { text-align: left; font-size: .85rem; margin-top: 4px; color: var(--white); }
.result-unit { margin: 0; text-align: center; color: #666; }
.best { margin: 0; text-align: center; font-size: 1.1rem; font-weight: bold; color: var(--blue); }
.best.new { color: #e67e00; font-size: 1.3rem; }
.best.giveup-line { color: #b25400; }
.best small { display: block; font-size: 0.85rem; font-weight: normal; color: #777; }
.cleared { margin: 0; text-align: center; font-weight: bold; color: var(--green); }

/* ===== 横向きの案内 =====
   縦向きが基本なので、スマホ（高さが低い画面）を横にしたときだけ案内を出す。
   タブレットは横でも高さが足りるので、そのまま使える */
.rotate-hint { display: none; }
@media (orientation: landscape) and (max-height: 500px) {
  .rotate-hint {
    display: flex; align-items: center; justify-content: center;
    position: fixed; inset: 0; z-index: 10;
    background: var(--bg); color: var(--blue);
    font-size: 1.5rem; font-weight: bold;
  }
}

/* ===== オンライン対戦 ===== */
.online-bar { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.join-button {
  width: 100%; padding: 12px; border-radius: var(--radius);
  background: var(--white); color: var(--blue); font-weight: bold; font-size: 1.05rem;
  border: 2px dashed var(--blue);
}
.name-link { background: none; color: #777; font-size: 0.9rem; text-decoration: underline; }
.title.small { font-size: 1.5rem; }
.online .card { display: flex; flex-direction: column; gap: 8px; }
.nickname-input {
  font: inherit; font-size: 1.6rem; font-weight: bold; text-align: center;
  padding: 10px; border-radius: 12px; border: 3px solid var(--blue); width: 100%;
  -webkit-user-select: text; user-select: text;
}
.form-message { min-height: 1.4em; margin: 0; text-align: center; color: var(--red); font-weight: bold; }
.lead.error { color: var(--red); font-weight: bold; }
.spinner {
  width: 48px; height: 48px; margin: 24px auto 0; border-radius: 50%;
  border: 5px solid var(--blue-light); border-top-color: var(--blue);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.code-box { display: flex; gap: 10px; }
.code-digit {
  display: inline-flex; align-items: center; justify-content: center; line-height: 1;
  width: 1.4em; height: 1.6em; font-size: clamp(2rem, 10vw, 3rem); font-weight: bold;
  background: var(--white); border: 3px solid #bfd6ea; border-radius: 12px;
}
.code-digit.next { border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-light); }

.lobby { gap: 10px; }
.code-label { margin: 8px 0 0; text-align: center; color: #666; }
.code-big {
  margin: 0; text-align: center; font-size: 3.6rem; font-weight: bold;
  letter-spacing: 0.3em; padding-left: 0.3em; color: var(--blue); font-variant-numeric: tabular-nums;
}
.player-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.player-list li {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: 12px; background: var(--blue-light); font-size: 1.2rem; font-weight: bold;
}
.player-list li.me { outline: 3px solid var(--blue); }
.player-list li small { margin-left: auto; font-size: 0.8rem; font-weight: normal; color: #666; }
.wait { color: #666; }

/* ===== ホスト役（2026-11-24。じぶんは たいせんせず、みまもる。sql/013） ===== */
/* 部屋を つくる 前の 2択（教室の 生徒・先生 だけ）。前に えらんだ ほうが 上で ブルー */
.role-choices { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.big.role-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 14px 16px; }
.role-title { font-size: 1.25rem; font-weight: 900; }
.role-note { font-size: 0.85rem; font-weight: normal; line-height: 1.4; opacity: .92; }
/* ロビーの ホスト役の 行（はしる子とは べつ。人数に 数えない） */
.player-list li.host-role { background: var(--white); border: 2px dashed var(--sky); }
.player-list li.host-role .player-name { white-space: nowrap; }
/* みまもり画面（battle-watch.js） */
.watch { gap: 12px; }
.watch .race.course { padding: 10px 10px; }
.watch .race-lane { height: 40px; font-size: 0.9rem; grid-template-columns: 5.2em 1fr 1.4em 2.8em; }
.watch-status { margin: 0; text-align: center; font-weight: bold; color: var(--blue-dark); }
.watch-cheer-label { margin: 0 0 4px; font-size: 0.85rem; font-weight: bold; color: #667; }
.watch .buttons { margin-top: 4px; }
/* はしる子の 画面に 出る ホスト役の おうえん（レースコースの まん中に 重ねる。問題・テンキーには かぶせない） */
.race.course { position: relative; }
.host-cheer {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  z-index: 3; pointer-events: none; max-width: calc(100% - 16px);
  padding: 6px 14px; border-radius: 999px; background: #ff9f43; color: var(--white);
  font-weight: bold; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .18); animation: cheer-in .25s ease-out;
}
@keyframes cheer-in { from { opacity: 0; transform: translate(-50%, -30%); } to { opacity: 1; transform: translate(-50%, -50%); } }
@media (prefers-reduced-motion: reduce) { .host-cheer { animation: none; } }

.hub { gap: 10px; }
.hub-step .note.left { text-align: left; margin: 0; color: #555; }
.hub-arrow { text-align: center; color: var(--blue); font-size: 1.4rem; line-height: 1; }
.online .card.hub-me { flex-direction: row; align-items: center; gap: 12px; padding: 12px 14px; border: 2px solid var(--sky); }
.hub-me-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.hub-me-label { font-size: 0.8rem; font-weight: bold; color: #667; }
.hub-me-name { font-size: 1.45rem; font-weight: 900; color: var(--ink); overflow-wrap: anywhere; line-height: 1.2; }
.hub-me-edit {
  flex: none; white-space: pre-line; line-height: 1.25; font-weight: bold; font-size: 0.95rem;
  padding: 8px 12px; border-radius: 12px; border: 2px solid var(--blue); background: var(--white); color: var(--blue);
}
.hint-banner {
  margin: 0; padding: 12px 14px; border-radius: 12px;
  background: var(--white); color: var(--blue-dark); font-weight: bold; text-align: center; border: 2px solid var(--sky);
}
.big.highlight { background: var(--blue); color: var(--white); border: none; box-shadow: 0 0 0 5px var(--sky); }

/* ===== レース（対戦中の、みんなの進み具合） ===== */
.race { display: flex; flex-direction: column; gap: 4px; }
/* レースコース：名前 ｜ コース（どうぶつが走る） ｜ ゴールの旗 ｜ 順位 */
.race.course { padding: 6px 8px; border-radius: 14px; background: var(--blue-light); gap: 2px; }
.race-lane {
  display: grid; grid-template-columns: 4.6em 1fr 1.2em 2.4em; align-items: center; gap: 4px;
  height: 30px; font-size: 0.72rem;
}
.race-lane + .race-lane { border-top: 1px dashed #b9defa; }
.race-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #4a5b70; }
.race-lane.me .race-name { font-weight: bold; color: var(--blue); }
.race-track { position: relative; height: 100%; }
.race-track::before { /* 走る道（点線） */
  content: ''; position: absolute; left: 0; right: 0; top: 50%;
  border-top: 2px dotted var(--sky);
}
.runner {
  --p: 0; position: absolute; top: 2px;
  left: calc((100% - 26px) * var(--p));
  transition: left .35s ease-out;
}
.runner .avatar { display: block; }
.race-lane.me .runner .avatar { box-shadow: 0 0 0 2px var(--blue); }
.runner.hop .avatar { animation: hop .35s ease-out; }
@keyframes hop { 0% { transform: translateY(0); } 40% { transform: translateY(-7px); } 100% { transform: translateY(0); } }
.race-goal { font-size: 0.9rem; text-align: center; }
.race-tail { text-align: right; font-weight: bold; font-variant-numeric: tabular-nums; white-space: nowrap; }
.race-lane.finished .race-tail { color: var(--blue); font-size: 0.85rem; }
.race-lane.finished:not(.me) .runner .avatar { box-shadow: 0 0 0 2px var(--green); }
.race-lane.retired { opacity: .45; }
.race-lane.retired .race-goal { display: none; }
.race-lane.retired .race-tail { grid-column: 3 / 5; font-size: 0.65rem; font-weight: normal; }
.pass {
  position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  padding: 1px 8px; border-radius: 999px; background: #ff9f43; color: var(--white);
  font-size: 0.7rem; font-weight: bold; white-space: nowrap; z-index: 2;
  animation: pass-pop .25s ease-out;
}
@keyframes pass-pop { from { transform: translateX(-50%) scale(.6); opacity: 0; } to { transform: translateX(-50%) scale(1); opacity: 1; } }

/* ===== 対戦の結果 ===== */
.rank-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rank-row {
  display: grid; grid-template-columns: 2.6em auto 1fr auto; align-items: center; gap: 8px;
  padding: 12px 14px; border-radius: 14px; background: var(--white); box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.rank-row.me { outline: 3px solid var(--blue); }
.rank-no { font-size: 1.3rem; font-weight: bold; color: var(--blue); white-space: nowrap; } /* 「2い」が 2行に おれないように */
.rank-row.finished:first-child .rank-no { color: #e6a700; }
.rank-name { font-size: 1.2rem; font-weight: bold; }
.rank-name small, .rank-time small { display: block; font-size: 0.75rem; font-weight: normal; color: #777; }
.rank-time { text-align: right; font-weight: bold; font-variant-numeric: tabular-nums; }
.rank-row.running .rank-time { color: #777; font-weight: normal; font-size: 0.9rem; }
.rank-row.retired { color: #aaa; }

/* ===== スタンプ ===== */
.stamp-bar { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.stamp {
  padding: 8px 10px; border-radius: 999px; font-size: 0.9rem; font-weight: bold;
  background: var(--white); color: var(--blue-dark); border: 2px solid var(--sky);
}
.stamp-bar.cooling .stamp { opacity: .45; }
.bubble {
  display: inline-block; margin-left: 8px; padding: 2px 10px; border-radius: 999px;
  background: #ff9f43; color: var(--white); font-size: 0.85rem; font-weight: bold;
  animation: pop .25s ease-out;
}
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.rank-name .bubble { font-size: 0.75rem; }
/* 「あと 30ぷん」のような言葉を途中で折り返さない */
.lobby .note { word-break: keep-all; overflow-wrap: anywhere; }
.key-dot { font-size: 2.2rem; line-height: 1; }

/* ===== 分数（分子／横線／分母の縦書き） ===== */
.frac {
  display: inline-flex; flex-direction: column; align-items: center;
  font-size: 0.72em; line-height: 1.05; vertical-align: middle;
}
.frac-num { padding: 0 0.2em 0.08em; border-bottom: 0.09em solid currentColor; min-width: 1.2em; text-align: center; }
.frac-den { padding: 0.08em 0.2em 0; min-width: 1.2em; text-align: center; }
/* 答えの分数の枠：縦に2つ並べる */
.frac-answer { font-size: 0.8em; gap: 0; }
.frac-answer .frac-num { padding-bottom: 0.12em; }
.frac-answer .frac-den { padding-top: 0.12em; }
.frac-answer .slot { height: 1.25em; }
/* 帯分数（4年 G4-11）：問題の「2と1/3」と、答えの「整数・分子・分母」の3つの枠 */
.mixed-num { display: inline-flex; align-items: center; gap: 0.05em; }
.mixed-answer { display: inline-flex; align-items: center; gap: 0.15em; }
.mixed-answer > .slot { height: 1.6em; }

/* ===== はびっつ連携（ログイン） ===== */
.account-bar { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 4px; }
.login-label { display: flex; flex-direction: column; gap: 4px; font-weight: bold; color: var(--blue); }
.login-input {
  font: inherit; font-size: 1.3rem; padding: 10px 12px; border-radius: 12px;
  border: 3px solid #bfd6ea; width: 100%; -webkit-user-select: text; user-select: text;
}
.login-input:focus { outline: none; border-color: var(--blue); }
.family-link { display: block; margin: 4px auto 0; padding: 10px 12px; text-align: center; font-size: .9rem; color: var(--blue-dark); text-decoration: underline; text-underline-offset: 3px; } /* ログイン画面の 下：保護者ページへ */
.login-name { margin: 0; text-align: center; font-size: 1.5rem; font-weight: bold; color: var(--blue); }
.habits-link { text-align: center; color: var(--blue); font-weight: bold; }
.habits-status { margin: 0; text-align: center; font-size: 0.9rem; color: #666; }

/* ===== どうぶつアバター ===== */
.avatar {
  display: inline-block; flex: none;
  width: var(--avatar-size, 40px); height: var(--avatar-size, 40px);
  border-radius: 50%; background: var(--white); box-shadow: 0 1px 3px rgba(0,0,0,.12);
  overflow: hidden;
}
.avatar svg { display: block; width: 100%; height: 100%; }
.avatar-picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.avatar-choice {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 2px; border-radius: 14px; background: var(--blue-light);
  border: 3px solid transparent; font-size: 0.75rem; color: var(--ink);
}
.avatar-choice[aria-pressed="true"] { border-color: var(--blue); background: var(--white); }
.avatar-choice[aria-pressed="true"] .avatar { animation: pop .25s ease-out; }
.avatar-button { position: relative; background: none; padding: 0; border: 0; }
.avatar-edit {
  position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%);
  padding: 0 6px; border-radius: 999px; background: var(--blue); color: var(--white);
  font-size: 0.6rem; line-height: 1.5; white-space: nowrap;
}
.player-name { flex: 1; min-width: 0; }
.picker-box { display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 12px; background: var(--white); border: 2px dashed var(--blue); }
.picker-box .note { margin: 0; }
.name-link { display: inline-flex; align-items: center; gap: 6px; }

/* ===== 表彰台（ひょうしょうだい） ===== */
.podium {
  display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 6px;
  padding: 18px 6px 0; margin-bottom: 4px;
}
.podium-step {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px;
  animation: podium-in .5s ease-out both;
}
.podium-step.place-3 { animation-delay: .1s; }
.podium-step.place-2 { animation-delay: .45s; }
.podium-step.place-1 { animation-delay: .8s; }
.podium-step .avatar { margin-bottom: 2px; }
.podium-step.me .avatar { box-shadow: 0 0 0 3px var(--blue); }
.podium-crown { position: absolute; top: -22px; font-size: 1.4rem; animation: crown 1.6s ease-in-out 1.3s infinite; }
.podium-name { font-weight: bold; font-size: 0.9rem; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.podium-time { font-size: 0.75rem; color: #666; font-variant-numeric: tabular-nums; }
.podium-block {
  width: 100%; margin-top: 4px; border-radius: 10px 10px 0 0;
  display: flex; align-items: flex-start; justify-content: center; padding-top: 6px;
  color: var(--white); font-weight: bold; font-size: 1.6rem;
}
.rank-1 .podium-block { height: 78px; background: var(--blue); font-size: 2rem; }
.rank-2 .podium-block { height: 56px; background: #5aa7ef; }
.rank-3 .podium-block { height: 40px; background: var(--sky); font-size: 1.3rem; }
@keyframes podium-in { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes crown { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-4px) rotate(6deg); } }

/* ===== コンボ（れんぞく正解） ===== */
.combo { position: absolute; top: 4px; left: 0; right: 0; display: flex; justify-content: center; pointer-events: none; }
.combo-badge {
  padding: 3px 14px; border-radius: 999px;
  background: linear-gradient(90deg, #ff9f43, #ff6b6b); color: var(--white);
  font-weight: bold; font-size: 1rem; box-shadow: 0 2px 8px rgba(255, 107, 107, .35);
  animation: pop .3s ease-out;
  transition: opacity .2s;
}
.combo-badge.fade { opacity: 0; } /* 1びょうで 消える（play.js COMBO_SHOW_MS） */
/* ===== 音のスイッチ ===== */
.sound-toggle {
  padding: 6px 14px; border-radius: 999px; background: var(--white); color: var(--ink);
  font-size: 0.9rem; box-shadow: 0 1px 3px rgba(0,0,0,.1);
}
.sound-toggle[aria-pressed="false"] { color: #888; }
/* 設定画面のいちばん下：おと・けいさん メモ を横1行に */
.settings-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; }
.memo-toggle { display: inline-flex; align-items: center; gap: 6px; }
.memo-toggle .ghost-check { width: 1.1em; height: 1.1em; }
.memo-toggle[aria-pressed="true"] .ghost-check { background: var(--blue); border-color: var(--blue); color: var(--white); }

/* ===== タイトルのロゴ ===== */
.title.logo { margin: 8px 0 0; line-height: 0; }
.title.logo img { width: min(300px, 80vw); height: auto; }
/* ロゴの下：ログインしている子の なまえ（setup.js loginChip。おすと じぶんの きろく） */
.login-chip {
  align-self: center; display: inline-flex; align-items: center; gap: 6px;
  max-width: 100%; min-height: 36px; margin-top: -6px; padding: 4px 14px;
  border: 2px solid var(--sky); border-radius: 999px; background: var(--white);
  color: var(--ink); font-size: 0.95rem; white-space: nowrap;
}
.login-chip-icon { display: inline-flex; color: var(--blue); }
.login-chip-icon svg { width: 18px; height: 18px; }
.login-chip-name { font-weight: bold; min-width: 0; overflow: hidden; text-overflow: ellipsis; max-width: 9em; }
.login-chip-arrow { color: var(--blue); font-weight: bold; }
.login-chip-title { color: var(--blue-dark); font-weight: bold; margin-left: -4px; }

/* ===== 画面の下のタブバー（ひとりで／ともだちと／わざ／ログイン） ===== */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: center; gap: 4px;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .96); border-top: 2px solid var(--blue-light);
  box-shadow: 0 -2px 10px rgba(43, 125, 233, .08);
}
.tabbar[hidden] { display: none; }
.tab {
  flex: 1; max-width: 180px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 4px; border-radius: 14px; background: none;
  color: #7f8ea0; font-size: 0.72rem; font-weight: bold;
}
.tab-icon { width: 26px; height: 26px; }
.tab-icon svg { display: block; width: 100%; height: 100%; }
.tab.on { color: var(--blue); background: var(--blue-light); }
.tab:disabled { opacity: .4; }
.tab-label { white-space: pre-line; text-align: center; line-height: 1.2; } /* \n で 2行に分ける */
/* タブバーの下に かくれないように、画面の下を あけておく */
body.has-tabbar #app { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }

/* ===== 設定画面：がくねん（ブルーのカード・まるいボタン）と たんげん（白いカード・帯つきの横長ボタン） ===== */
.step { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.step-no {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 1.6em; height: 1.6em; border-radius: 50%;
  line-height: 1; padding-top: 0.08em; box-sizing: border-box; /* 丸の中の数字を まん中に（ヒラギノ丸ゴは 字が 上に よりやすい） */
  background: var(--blue); color: var(--white); font-size: 0.95rem;
}
.step-no.sky { background: var(--sky); color: var(--blue-dark); }
.grade-card { background: var(--blue); box-shadow: 0 2px 8px rgba(43, 125, 233, .25); }
.grade-card .step { color: var(--white); }
.grade-card .step-no { background: var(--white); color: var(--blue); }
.grade-card { padding: 12px 12px 10px; }
.grade-card .step { margin-bottom: 8px; }
.grade-card .grade-grid { grid-template-columns: repeat(6, 1fr); gap: 6px; }
.grade-ball {
  height: 54px; border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #5aa7ef; color: var(--white); line-height: 1; font-weight: bold;
  transition: transform .12s;
}
.grade-ball:active { transform: scale(.94); }
.grade-num { font-size: 1.5rem; }
.grade-unit { font-size: 0.65rem; margin-top: 2px; }
.grade-ball.on { background: var(--white); color: var(--blue); box-shadow: 0 0 0 3px #ffd84d; }
.grade-ball:disabled { background: rgba(255, 255, 255, .16); color: rgba(255, 255, 255, .5); }
.grade-note { margin: 8px 0 0; text-align: right; font-size: 0.7rem; color: rgba(255, 255, 255, .85); }
/* たんげん：左に帯（えらぶと こいブルー） */
.choice.unit {
  align-items: flex-start; text-align: left;
  padding-left: 12px; border-left: 6px solid var(--sky); border-radius: 4px 12px 12px 4px;
  color: var(--blue-dark);
}
.choice.unit.on { border-left-color: var(--blue-dark); color: var(--white); }

/* ===== ゴースト（ベストの じぶん）と きょうそう ===== */
.race-lane.ghost .runner .avatar { opacity: .45; box-shadow: 0 0 0 2px var(--sky); }
.race-lane.ghost .race-name { color: #7f8ea0; }
.race-lane.ghost.finished .race-tail { color: #7f8ea0; font-size: 0.7rem; }
.race-lane.me.finished .race-tail { color: #e67e00; }
.ghost-toggle {
  align-self: center; display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px; background: var(--white);
  border: 2px solid var(--sky); color: var(--blue-dark); font-size: 0.9rem; font-weight: bold;
}
.ghost-check {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.2em; height: 1.2em; border-radius: 5px; border: 2px solid var(--sky); font-size: 0.8rem;
}
.ghost-toggle[aria-pressed="true"] .ghost-check { background: var(--blue); border-color: var(--blue); color: var(--white); }

/* ===== わざコーナー（screens/waza.js） ===== */
.waza-title { margin: 18px 0 2px; font-size: 1.6rem; color: var(--ink); }
/* わざの 入口の タブ（べんり／中学受験。2026-11-24）。えらんだ ほうを ぬる：べんり＝ブルー、中学受験＝紺（大人っぽく） */
.wz-tabs { display: flex; gap: 6px; margin: 14px 0 0; padding: 4px; border-radius: 16px; background: var(--blue-light); }
.wz-tab {
  flex: 1 1 0; min-width: 0; min-height: 46px; padding: 8px 6px; border: none; border-radius: 12px;
  background: transparent; color: var(--blue-dark); font-size: min(1.1rem, 4.8vw); font-weight: 900; white-space: nowrap;
}
.wz-tab.on { background: var(--blue); color: var(--white); box-shadow: 0 2px 0 #1c5fb8; }
.wz-tab.wz-tab-juken.on { background: var(--ink); box-shadow: 0 2px 0 #0d1520; }
.wz-tab:not(.on):active { background: #d3eafb; }
.wz-tab-note { margin: 0; font-size: 0.85rem; font-weight: bold; color: #5a6b7d; }
/* 中学受験の 題は 長いので 少し 小さく。ふりがな（ruby の rt）は 小さく うすく */
.screen.waza .wz-stage-name { line-height: 1.35; }
.screen.waza ruby rt, .zk ruby rt { font-size: 0.55em; font-weight: normal; color: #5a6b7d; }
/* なかまの 色（waza/menu.js の tone。3つまで）：おひさま・空・夕やけ。
   --wz-band＝おびの 色、--wz-ink＝おびの 字、--wz-num＝段階の 番号の 丸、--wz-right＝右の すすみぐあいの 字 */
.wz-tone-sun  { --wz-band: #fac775; --wz-ink: #633806; --wz-num: #ba7517; --wz-right: #854f0b; --wz-shade: #f0dcb4; }
.wz-tone-sky  { --wz-band: #2b7de9; --wz-ink: #fff;    --wz-num: #2b7de9; --wz-right: var(--blue-dark); --wz-shade: #c9e3f7; }
.wz-tone-dusk { --wz-band: #f5c4b3; --wz-ink: #712b13; --wz-num: #d85a30; --wz-right: #993c1d; --wz-shade: #f1d6cc; }
.wz-group { display: flex; flex-direction: column; gap: 8px; }
.wz-group-name { display: flex; align-items: center; gap: 8px; margin: 6px 0 0; font-size: 1rem; color: var(--ink); }
.wz-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--wz-num); flex-shrink: 0; }
.wz-card { padding: 0; overflow: hidden; border-radius: 20px; box-shadow: 0 3px 0 var(--wz-shade, #c9e3f7); }
.wz-head {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 64px;
  padding: 10px 12px; border-radius: 0; background: var(--wz-band); color: var(--wz-ink); text-align: left;
}
.wz-head:active { filter: brightness(.96); }
.wz-icon-ball {
  flex-shrink: 0; width: 46px; height: 46px; border-radius: 50%; background: var(--white);
  display: flex; align-items: center; justify-content: center;
}
.wz-icon { display: block; width: 36px; height: 22px; }
.wz-icon.spark { width: 30px; height: 30px; }
.wz-icon svg { display: block; width: 100%; height: 100%; }
.wz-head-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.wz-name { font-size: min(1.25rem, 5.4vw); font-weight: 900; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wz-sub { font-size: 0.78rem; font-weight: bold; opacity: .9; }
.wz-chip {
  align-self: flex-start; margin-top: 4px; padding: 2px 10px; border-radius: 999px;
  background: var(--white); color: var(--wz-right); font-size: 0.75rem; font-weight: bold; text-align: center;
}
.wz-caret { flex-shrink: 0; font-size: 1rem; width: 1em; text-align: center; }
.wz-stages { display: flex; flex-direction: column; background: var(--white); }
.wz-stage {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 58px;
  padding: 10px 14px; border-radius: 0; background: var(--white); color: var(--ink); text-align: left;
  border-top: 1px solid #e6edf4;
}
.wz-stage:first-child { border-top: none; }
.wz-stage:not(:disabled):active { background: #f3f8fd; }
.wz-stage.soon { opacity: .5; }
.wz-stage-no {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
  background: var(--wz-num); color: var(--white); display: flex; align-items: center; justify-content: center; font-weight: 900;
}
.wz-stage-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.wz-stage-name { font-size: 1.05rem; font-weight: bold; }
.wz-stage-sub { font-size: 0.75rem; }
.wz-stage-right { flex-shrink: 0; font-size: 0.8rem; font-weight: bold; color: var(--wz-right); text-align: right; }
.wz-stage.soon .wz-stage-right { color: #7f8ea0; }
.wz-soon-card { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; margin-top: 6px; opacity: .55; box-shadow: 0 3px 0 #dde5ec; }
.wz-soon-card .wz-name { font-size: 1.05rem; white-space: normal; }
.wz-soon { flex-shrink: 0; font-size: 0.85rem; font-weight: bold; color: #7f8ea0; }
/* わざモードの設定画面：「◀ わざに もどる」と わざの名前 */
.waza-setup-head { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.waza-setup-head .step { margin: 0; }
.back-link { padding: 4px 0; background: none; color: var(--blue); font-weight: bold; font-size: 0.95rem; }

/* ===== 9の みやぶり「① みる」（waza/nine-see.js） ===== */
/* 位ごとの 色（2026-11-23 試作で 決めた）：百＝夕やけ、十＝おひさま、一＝水色。文字は こい色 */
.nine-see { gap: 12px; padding-top: 8px; }
.nine-card { padding: 14px 14px 16px; border-radius: 20px; }
.nine-top { display: flex; justify-content: flex-end; }
.nine-mode { min-height: 40px; padding: 0 14px; border-radius: 12px; background: var(--blue-light); color: var(--blue-dark); border: 1px solid var(--sky); font-weight: bold; font-size: 0.9rem; }
.nine-num { text-align: center; font-size: 2.8rem; font-weight: 900; line-height: 1.25; font-variant-numeric: tabular-nums; }
.nine-c0 { color: #993c1d; }
.nine-c1 { color: #854f0b; }
.nine-c2 { color: var(--blue-dark); }
.nine-steppers { display: flex; justify-content: center; gap: 12px; margin: 4px 0 14px; }
.nine-place { text-align: center; }
.nine-place-name { font-size: 0.95rem; color: #5a6b7d; font-weight: bold; }
.nine-place-btns { display: flex; gap: 6px; justify-content: center; margin-top: 4px; }
.nine-place-btns button { min-width: 48px; min-height: 48px; border-radius: 12px; background: var(--blue-light); color: var(--blue-dark); border: 1px solid var(--sky); font-size: 1.3rem; font-weight: bold; }
.nine-place-btns button:active { transform: scale(0.96); }
.nine-stage { display: block; width: 100%; height: auto; overflow: visible; font-family: inherit; }
.nine-msg { margin: 0; background: var(--white); border-radius: 18px; padding: 12px 16px; font-size: 1.05rem; font-weight: bold; line-height: 1.8; min-height: 3.6em; word-break: keep-all; overflow-wrap: anywhere; }
.nine-buttons { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 6px; padding-bottom: 12px; }
.nine-buttons .big { margin: 0; width: 100%; font-size: 1.1rem; }
.nine-reset { min-height: 40px; padding: 0 16px; background: none; color: var(--blue); font-weight: bold; font-size: 0.95rem; }

/* ===== くもワープざん「① みる」（waza/warp-see.js） ===== */
.warp-see { gap: 12px; padding-top: 8px; }
.see-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.see-head h1 { margin: 0; font-size: 1.2rem; }
.see-head .back-link { justify-self: start; }
.see-count { justify-self: end; font-weight: bold; font-size: 0.9rem; }
.see-card { padding: 6px; border-radius: 24px; box-shadow: 0 3px 0 #c9e3f7; }
.warp-stage { display: block; width: 100%; height: auto; max-height: 42vh; overflow: visible; }
.warp-stage .wd { text-anchor: middle; font-weight: 900; fill: var(--ink); font-family: inherit; font-variant-numeric: tabular-nums; }
.warp-stage .wd.w-orange { fill: #f08a24; }
.warp-stage .wd.w-blue { fill: var(--blue); }
.warp-stage .wd.w-ghost { fill: #c9d8e6; transition: fill .3s; }
.warp-stage .w-note { text-anchor: middle; font-weight: bold; fill: #1f66c9; font-family: inherit; }
.warp-stage .w-arrow { fill: none; stroke: #1f66c9; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.warp-stage .w-arc { fill: none; stroke: var(--blue); stroke-width: 3; stroke-dasharray: 7 7; }
.warp-stage .w-ring { fill: none; stroke: #f08a24; stroke-width: 3; stroke-dasharray: 6 5; }
.warp-stage .w-box { fill: var(--blue-light); stroke: var(--blue); stroke-width: 3; }
.warp-stage .w-line { stroke: var(--ink); stroke-width: 3; }
.warp-stage .w-cloud-body { fill: var(--white); stroke: var(--sky); stroke-width: 5; }
.warp-stage .hide { opacity: 0; }
.warp-stage g, .warp-stage text, .warp-stage ellipse, .warp-stage path { transition: opacity .35s; }
.warp-stage .pop { transform-box: fill-box; transform-origin: center; animation: warp-pop .45s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes warp-pop { from { transform: scale(.3); } to { transform: scale(1); } }
.see-explain { word-break: keep-all; overflow-wrap: anywhere; margin: 0; background: var(--white); border-radius: 18px; padding: 12px 16px; font-size: 1.02rem; font-weight: bold; line-height: 1.6; }
.see-explain strong { color: #1f66c9; font-size: 1.15rem; }
.see-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.see-step { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px; border-radius: 12px; background: var(--white); font-size: 0.74rem; font-weight: bold; color: var(--ink); white-space: nowrap; }
.see-step-no { font-size: 1rem; line-height: 1.1; }
.see-step.done { background: var(--blue-light); color: #1f66c9; }
.see-step.on { background: var(--blue); color: var(--white); }
.see-formula { margin: 0; text-align: center; font-size: 0.9rem; font-weight: bold; min-height: 1.4em; font-variant-numeric: tabular-nums; }
.see-buttons { margin-top: auto; display: flex; gap: 10px; padding-bottom: 12px; }
.see-buttons .big { margin: 0; }
.see-buttons .big.sub { flex: 1; }
.see-buttons .see-next { flex: 1.4; font-size: 1.15rem; white-space: nowrap; padding-left: 8px; padding-right: 8px; }
@media (prefers-reduced-motion: reduce) {
  .warp-stage .pop { animation: none; }
  .warp-stage g, .warp-stage text, .warp-stage ellipse, .warp-stage path { transition: none; }
}

/* ===== くもワープざん「② ほじょりん」（waza/warp-help.js） ===== */
.warp-help { gap: 10px; padding-top: 8px; }
.help-lead { margin: 0; font-weight: bold; line-height: 1.6; word-break: keep-all; overflow-wrap: anywhere; }
.help-levels { display: flex; flex-direction: column; gap: 10px; }
.help-level {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%;
  padding: 12px 14px; border-radius: 14px; border: 2px solid var(--sky);
  background: var(--white); color: var(--ink); text-align: left;
}
.help-level.on { background: var(--blue); border-color: var(--blue); color: var(--white); }
.help-level:disabled { opacity: .45; border-color: var(--blue-light); }
.help-level-name { font-size: 1.15rem; font-weight: 900; }
.help-level-text { font-size: 0.85rem; font-weight: bold; word-break: keep-all; overflow-wrap: anywhere; }
.help-head-mid { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.help-chip { font-size: 0.72rem; font-weight: bold; background: var(--white); border-radius: 10px; padding: 1px 8px; }
.help-problem { text-align: center; font-size: 2.8rem; font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; }
.help-sheet { display: flex; flex-direction: column; gap: 8px; padding: 10px 6px; border-radius: 22px; box-shadow: 0 3px 0 #c9e3f7; }
.help-row { display: flex; align-items: flex-end; justify-content: center; gap: 4px; }
.help-cell { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.help-kana { font-size: 0.72rem; font-weight: bold; }
.help-op { font-size: 1.4rem; font-weight: bold; padding-bottom: 8px; }
.help-box {
  display: inline-flex; align-items: center; justify-content: center; line-height: 1;
  min-width: 52px; height: 46px; padding: 0 6px;
  border: 2px solid var(--sky); border-radius: 12px; background: var(--white);
  font-size: 1.6rem; font-weight: 900; font-variant-numeric: tabular-nums;
}
.help-box.wide { min-width: 76px; }
.help-box.selected { border: 4px solid var(--blue); background: var(--blue-light); }
.help-box.ok { border-color: var(--green); color: var(--green); }
.help-box.given { border-color: var(--blue-light); color: var(--ink); }
.help-box.given-fixed { border-color: var(--blue-light); background: #f2f9ff; color: #5a6b80; }
.help-hint { margin: 0; text-align: center; font-size: 0.88rem; font-weight: bold; min-height: 1.4em; word-break: keep-all; overflow-wrap: anywhere; }
.help-hint.box-hint { color: #b26b00; }
.warp-help .message { text-align: center; height: 1.4em; font-size: 1.05rem; }
.warp-help .pad { margin-top: auto; padding-bottom: 10px; }
.warp-help .key { height: clamp(50px, 7.5dvh, 72px); }

/* ===== くもワープざん「なぜ できるの？」たねあかし パズル（waza/warp-puzzle.js） ===== */
.warp-puzzle { gap: 10px; padding-top: 8px; padding-bottom: 12px; }
.pz-lead { margin: 0; font-weight: bold; line-height: 1.6; word-break: keep-all; overflow-wrap: anywhere; }
.pz-howto { margin: 0; background: #ffe2c2; border-radius: 14px; padding: 10px 14px; font-weight: bold; font-size: 0.95rem; line-height: 1.5; word-break: keep-all; overflow-wrap: anywhere; }
.pz-card { padding: 8px; border-radius: 24px; box-shadow: 0 3px 0 #c9e3f7; }
.pz-board { display: block; width: 100%; height: auto; max-height: 46vh; touch-action: none; overflow: visible; }
.pz-board text { font-family: inherit; text-anchor: middle; font-weight: 900; fill: var(--ink); }
.pz-board .pz-num { font-size: 15px; }
.pz-board .pz-num-blue { fill: var(--blue); }
.pz-board .pz-num-orange { fill: #d9730d; }
.pz-board .pz-name { font-size: 26px; pointer-events: none; }
.pz-board .pz-gridline { fill: none; stroke: rgba(30, 43, 60, .14); stroke-width: 1; }
.pz-board .pz-grid { pointer-events: none; }
.pz-board .pz-a { fill: var(--white); stroke: var(--ink); stroke-width: 2; }
.pz-board .pz-i { fill: var(--sky); stroke: var(--blue); stroke-width: 2; }
.pz-board .pz-hit { fill: transparent; }
.pz-board .pz-piece { cursor: grab; }
.pz-board .pz-piece.dragging { cursor: grabbing; filter: drop-shadow(0 8px 10px rgba(30, 43, 60, .28)); }
.pz-board .pz-target-box { fill: #f2f9ff; stroke: var(--blue); stroke-width: 3; stroke-dasharray: 8 6; }
.pz-board .pz-target-text { font-size: 13px; fill: #1f66c9; font-weight: bold; }
.pz-board .pz-ghost-box { fill: none; stroke: var(--sky); stroke-width: 2; stroke-dasharray: 6 5; }
.pz-board .hide { display: none; }
.pz-board .pz-u { fill: var(--blue-light); stroke: var(--blue); stroke-width: 2.5; }
.pz-board .pz-cut { stroke: #d9730d; stroke-width: 3; stroke-dasharray: 6 5; stroke-linecap: round; }
.pz-board .pz-fade { transition: opacity .7s; }
.pz-board .pz-pop { transform-box: fill-box; transform-origin: center; animation: warp-pop .45s cubic-bezier(.3, 1.6, .5, 1); }
@media (prefers-reduced-motion: reduce) { .pz-board .pz-pop { animation: none; } .pz-board .pz-fade { transition: none; } }
.pz-board .pz-e { fill: #ffe2c2; stroke: #d9730d; stroke-width: 2.5; }
.pz-auto { align-self: center; padding: 6px 14px; border-radius: 999px; background: var(--white); color: #1f66c9; font-weight: bold; font-size: 0.9rem; border: 2px solid var(--blue-light); }
.pz-auto.hide { display: none; }
.pz-result { display: flex; flex-direction: column; gap: 2px; text-align: center; }
.pz-line { margin: 0; font-weight: 900; font-size: 1.15rem; transition: opacity .3s; }
.pz-line.hide { opacity: 0; }
.pz-blue { color: var(--blue); }
.pz-orange { color: #d9730d; }
.pz-total { font-size: 1.4rem; color: #1f66c9; }
.pz-note { font-size: 0.85rem; font-weight: bold; word-break: keep-all; overflow-wrap: anywhere; }
.pz-next { margin-top: auto; font-size: 1.1rem; }
.pz-next.hide { display: none; }
/* 「① みる」の④から パズルへ */
.see-puzzle { align-self: center; padding: 8px 16px; border-radius: 999px; background: #ffe2c2; color: var(--ink); font-weight: bold; font-size: 0.95rem; }
.see-puzzle[hidden] { display: none; }

/* ===== くもワープざん「④ 81マス あつめ」（waza/warp-81.js） ===== */
.warp-81 { gap: 10px; padding-top: 8px; padding-bottom: 12px; }
.w81-progress { display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.w81-progress.master { background: #fff6e8; box-shadow: 0 0 0 3px #ffd36b inset; }
.w81-count { font-size: 1.9rem; font-weight: 900; white-space: nowrap; font-variant-numeric: tabular-nums; }
.w81-count small { font-size: 1rem; }
.w81-bar-area { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.w81-bar-area p { margin: 0; font-size: 0.75rem; font-weight: bold; }
.w81-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 0.75rem; font-weight: bold; }
.w81-legend span { display: flex; align-items: center; gap: 4px; }
.w81-key { display: inline-block; width: 16px; height: 16px; border-radius: 4px; }
.w81-key.fast, .w81-cell.fast { background: var(--sky); border: 0; }
.w81-key.slow, .w81-cell.slow { background: #f2f9ff; border: 2px dashed var(--sky); }
.w81-key.none, .w81-cell.none { background: var(--white); border: 1px solid #c9e3f7; }
.w81-card { padding: 6px; border-radius: 18px; }
.w81-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 3px; }
.w81-head, .w81-cell {
  height: clamp(28px, 4.2dvh, 40px); border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-variant-numeric: tabular-nums; padding: 0;
}
.w81-head { background: var(--blue-light); font-weight: 900; font-size: 0.8rem; }
.w81-corner { background: var(--white); font-size: 0.95rem; }
.w81-cell { font-size: 0.66rem; font-weight: bold; color: var(--ink); }
.w81-cell:active { transform: scale(.92); }
.w81-note { margin: 0; text-align: center; font-size: 0.82rem; font-weight: bold; word-break: keep-all; overflow-wrap: anywhere; }
.w81-buttons { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.w81-buttons .big { margin: 0; }
.w81-buttons .big.sub { font-size: 1.05rem; }
.warp81-line { margin: 0; text-align: center; font-weight: bold; color: #1f66c9; }
.warp81-line.quiet { color: var(--ink); font-weight: normal; }

/* ===== ピカッと あんざん（waza/flash-play.js） ===== */
/* せってい */
.flash-setup { gap: 12px; padding-top: 8px; }
.flash-kyu {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; color: var(--ink);
  padding: 14px 16px; border-radius: 20px; border: 3px solid transparent; box-shadow: 0 3px 0 #c9e3f7;
}
.flash-kyu.on { border-color: var(--blue); }
.flash-kyu.top { border-color: #ffd84d; }
.flash-badge {
  flex-shrink: 0; width: 70px; height: 70px; border-radius: 50%; background: #ffe2c2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;
}
.flash-badge.top { background: #ffd84d; }
.flash-badge-num { font-size: 1.8rem; font-weight: 900; }
.flash-badge-unit { font-size: 0.75rem; font-weight: bold; }
.flash-badge-word { font-size: 0.95rem; font-weight: 900; }
.flash-kyu-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.flash-kyu-next { font-size: 1rem; font-weight: 900; }
.flash-kyu-cond { font-size: 0.85rem; font-weight: bold; word-break: keep-all; overflow-wrap: anywhere; }
.flash-kyu-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.flash-kyu-chip { font-size: 0.72rem; font-weight: bold; color: #1f66c9; background: var(--blue-light); border-radius: 10px; padding: 2px 8px; }
.flash-kyu.on .flash-kyu-chip { background: var(--blue); color: var(--white); }
.flash-streak { display: inline-flex; gap: 6px; }
.flash-streak-dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--sky); background: var(--white); }
.flash-streak-dot.on { background: var(--blue); border-color: var(--blue); }
.flash-divider { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; font-weight: bold; }
.flash-divider span { flex: 1; height: 2px; background: #c9e3f7; }
.flash-group { display: flex; flex-direction: column; gap: 6px; }
.flash-group-title { display: flex; align-items: center; gap: 6px; font-weight: 900; font-size: 0.95rem; }
.flash-group-title .step-no { width: 24px; height: 24px; font-size: 0.8rem; }
.flash-opts { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 6px; }
.flash-opt {
  min-height: 48px; border: 2px solid #c9e3f7; border-radius: 14px; background: var(--white); color: var(--ink);
  font-size: 1.05rem; font-weight: bold; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.25;
}
.flash-opt.two { min-height: 56px; font-size: 0.9rem; }
.flash-opt small { font-size: 0.85rem; font-weight: bold; }
.flash-opt[aria-pressed="true"] { border: 3px solid var(--blue); background: var(--sky); font-weight: 900; }
.flash-example { margin: 0; background: var(--white); border-radius: 14px; padding: 10px 14px; font-size: 0.9rem; font-weight: bold; font-variant-numeric: tabular-nums; word-break: keep-all; overflow-wrap: anywhere; }
.flash-setup .start-area { margin-top: 4px; }
.flash-setup .big.sub:disabled { opacity: .5; font-size: 1rem; }
.flash-setup .big.sub:disabled small { display: block; margin: 2px 0 0; }

/* かずが でる（画面ぜんたいを ブルーに） */
html.flash-blue, html.flash-blue body { background: var(--blue); }
.flash-play {
  height: 100dvh; padding: 10px 0 20px; gap: 10px;
  align-items: center; color: var(--white);
}
.flash-head { align-self: stretch; display: flex; align-items: center; justify-content: space-between; }
.flash-head .quit { color: var(--ink); }
.flash-head-label { font-size: 0.85rem; font-weight: bold; opacity: .9; }
.flash-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 100%; }
.flash-dots.many { gap: 5px; }
.flash-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--white); }
.flash-dots.many .flash-dot { width: 14px; height: 14px; }
.flash-dot.on { background: var(--white); }
.flash-count { margin: 0; font-size: 1.25rem; font-weight: 900; min-height: 1.5em; }
.flash-stage { flex: 1; position: relative; width: 100%; max-width: 380px; display: flex; align-items: center; justify-content: center; }
.flash-cloud { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); aspect-ratio: 340 / 230; }
.flash-cloud svg { display: block; width: 100%; height: 100%; }
.flash-num {
  position: relative; margin-top: 4%; color: var(--ink); font-weight: 900; line-height: 1;
  font-variant-numeric: tabular-nums; font-size: min(42vw, 170px);
}
.flash-num.keta-2 { font-size: min(36vw, 150px); }
.flash-num.keta-3 { font-size: min(27vw, 112px); }
.flash-num.cue { font-size: min(22vw, 88px); color: var(--blue); text-align: center; white-space: pre-line; line-height: 1.15; }
.flash-num.cue.go { color: #f08a24; font-size: min(23vw, 92px); }       /* 「どん！」は オレンジで 大きく */
.flash-num.cue.wait, .flash-num.cue.soon { font-size: min(11vw, 46px); } /* 「タップで スタート」「まもなく スタート」 */
.flash-num.cue.wait { animation: flash-wait 1.4s ease-in-out infinite; }
@keyframes flash-wait { 50% { transform: scale(1.08); } }
/* 「どん！」で 雲が ピカッと 光る */
.flash-stage.glow .flash-cloud { animation: flash-glow .6s ease-out; }
@keyframes flash-glow {
  0% { filter: drop-shadow(0 0 0 #fff8c4); transform: translateY(-50%) scale(1); }
  30% { filter: drop-shadow(0 0 28px #fff3a0) drop-shadow(0 0 10px #ffffff); transform: translateY(-50%) scale(1.06); }
  100% { filter: drop-shadow(0 0 0 #fff8c4); transform: translateY(-50%) scale(1); }
}
.flash-num.pop { animation: flash-pop .18s ease-out; }
@keyframes flash-pop { from { transform: scale(.7); opacity: .3; } to { transform: scale(1); opacity: 1; } }
.flash-speed { margin: 0; font-size: 1.2rem; font-weight: 900; }
.flash-tip { margin: 0; font-size: 1.2rem; font-weight: bold; text-align: center; line-height: 1.5; white-space: pre-line; }

/* こたえる */
.flash-answer { height: 100dvh; padding: 12px 0 12px; gap: 10px; }
.flash-answer-head { display: flex; align-items: center; justify-content: space-between; font-weight: bold; font-size: 0.9rem; }
.flash-chip { background: var(--white); border-radius: 10px; padding: 3px 10px; }
.flash-cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.flash-card {
  min-width: 52px; height: 52px; padding: 0 6px; border-radius: 14px;
  background: var(--white); border: 2px dashed var(--sky);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 900; color: #1f66c9; font-variant-numeric: tabular-nums;
}
.flash-cards.small { gap: 5px; }
.flash-cards.small .flash-card { min-width: 38px; height: 40px; font-size: 1.15rem; border-radius: 10px; }
.flash-cards.keta-3.small .flash-card { min-width: 0; width: 52px; padding: 0; font-size: 1rem; } /* ひっくりかえしても はばが かわらないように */
.flash-card.open { border-style: solid; border-color: var(--blue); background: var(--blue-light); color: var(--ink); }
.flash-card.flip-out { transform: rotateY(90deg); transition: transform .13s ease-in; }
.flash-card.flip-in { animation: flash-flip-in .15s ease-out; }
@keyframes flash-flip-in { from { transform: rotateY(90deg); } to { transform: rotateY(0); } }
.flash-note { margin: 0; text-align: center; font-size: 0.82rem; }
.flash-ask { margin: 4px 0 0; text-align: center; font-size: 1.8rem; font-weight: 900; }
.flash-verdict { margin: 4px 0 0; text-align: center; font-size: 2rem; font-weight: 900; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.flash-verdict.ok { color: var(--green); }
.flash-verdict.ng { color: var(--red); }
.flash-verdict-sub { font-size: 1.2rem; color: var(--ink); }
.flash-answer-box {
  align-self: center; min-width: max(200px, calc(var(--digits) * 0.75em + 0.8em)); height: 96px;
  border: 4px solid var(--blue); border-radius: 20px; background: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 3.6rem; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1;
}
.flash-answer-box.ok { border-color: var(--green); color: var(--green); }
.flash-answer-box.ng { border-color: var(--red); color: var(--red); }
.flash-caret { display: inline-block; width: 4px; height: 0.9em; background: var(--blue); margin-left: 4px; animation: flash-caret 1s steps(1) infinite; }
@keyframes flash-caret { 50% { opacity: 0; } }
.flash-answer .message { text-align: center; height: 1.4em; font-size: 1.05rem; }
.flash-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.flash-bottom .key { height: clamp(52px, 8dvh, 72px); }
.flash-bottom .buttons { margin-top: 0; }
.flash-result-kyu {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  background: var(--white); border-radius: 16px; padding: 10px 12px; font-weight: bold; font-size: 0.9rem;
}
.flash-result-kyu.new { border: 3px solid #ffd84d; }
.flash-result-big { font-size: 1.35rem; font-weight: 900; color: #d9730d; }
.flash-result-tip { margin: 0; text-align: center; font-size: 0.82rem; font-weight: bold; color: #555; word-break: keep-all; overflow-wrap: anywhere; }
.flash-middle { display: flex; flex-direction: column; gap: 8px; }
.flash-middle:empty { display: none; }
.flash-middle .habits-status { margin: 0; text-align: center; }
/* せの ひくい スマホ（iPhone SE など）でも テンキーまで 1画面に おさめる */
@media (max-height: 700px) {
  .flash-answer { gap: 6px; padding-top: 8px; }
  .flash-ask { font-size: 1.4rem; margin: 0; }
  .flash-verdict { font-size: 1.6rem; margin: 0; }
  .flash-answer-box { height: 72px; font-size: 2.8rem; }
  .flash-note { display: none; }
  .flash-cards.small .flash-card { height: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  .flash-num.pop, .flash-card.flip-in, .flash-caret, .flash-num.cue.wait, .flash-stage.glow .flash-cloud { animation: none; }
  .flash-card.flip-out { transition: none; }
}

/* ===== ピカッと あんざん「みんなで サバイバル」（waza/survival-play.js） ===== */
.flash-setup .big.flash-room { font-size: 1.05rem; }
.flash-room-note { margin: 0; font-size: 0.82rem; font-weight: bold; color: #555; line-height: 1.5; word-break: keep-all; overflow-wrap: anywhere; }
/* こたえる：のこり時間 */
.sv-limit-wrap { display: flex; align-items: center; gap: 8px; }
.sv-limit-track { flex: 1; height: 10px; border-radius: 999px; background: var(--white); overflow: hidden; }
.sv-limit-bar { display: block; height: 100%; width: 100%; background: var(--blue); border-radius: 999px; transition: width .2s linear; }
.sv-limit-bar.hurry { background: #ff9f43; }
.sv-limit { font-size: 0.9rem; font-weight: bold; white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 6.5em; text-align: right; }
/* ラウンドの けっか */
.survival-round { gap: 10px; padding-top: 12px; }
.sv-head { display: flex; align-items: center; justify-content: space-between; }
.sv-head h1 { margin: 0; font-size: 1.15rem; }
.sv-round { font-size: 0.9rem; font-weight: 900; background: var(--white); border-radius: 10px; padding: 4px 12px; }
.sv-answer { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 14px; border-radius: 20px; box-shadow: 0 3px 0 #c9e3f7; }
.sv-formula { margin: 0; font-size: 0.95rem; font-weight: bold; text-align: center; font-variant-numeric: tabular-nums; word-break: keep-all; overflow-wrap: anywhere; line-height: 1.5; }
.sv-sum { margin: 0; font-size: 1.1rem; font-weight: bold; }
.sv-sum strong { font-size: 2.6rem; font-weight: 900; color: #1f66c9; font-variant-numeric: tabular-nums; }
.sv-wait { margin: 0; font-weight: bold; }
.sv-wait-count { margin: 0; font-size: 2rem; font-weight: 900; color: #1f66c9; font-variant-numeric: tabular-nums; }
.sv-answer.waiting .sv-wait-count { animation: sv-blink 1.4s ease-in-out infinite; }
@keyframes sv-blink { 50% { opacity: .45; } }
.sv-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sv-list { gap: 6px; }
.sv-row { display: flex; align-items: center; gap: 10px; padding: 6px 12px; border-radius: 16px; background: var(--white); }
.sv-row.me { outline: 3px solid var(--blue); }
.sv-row.ng .sv-given, .sv-row.late .sv-given { color: #d9650b; }
.sv-row.out { opacity: .6; }
.sv-name { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 1.05rem; font-weight: bold; }
.sv-name small { font-size: 0.75rem; font-weight: bold; color: #5a6b80; }
.sv-name .bubble { align-self: flex-start; margin: 2px 0 0; }
.sv-given { font-size: 1.4rem; font-weight: 900; font-variant-numeric: tabular-nums; min-width: 2.5em; text-align: right; }
.sv-row.hidden .sv-given, .sv-row.wait .sv-given { color: #9db3c9; }
.sv-mark { flex-shrink: 0; width: 30px; height: 30px; }
.sv-mark svg { display: block; width: 100%; height: 100%; }
.sv-banner { display: flex; flex-direction: column; align-items: center; gap: 2px; background: #ffe2c2; border-radius: 18px; padding: 10px 16px; font-weight: bold; font-size: 0.9rem; }
.sv-banner-big { font-size: 1.25rem; font-weight: 900; }
.survival-round .buttons { margin-top: auto; }
@media (prefers-reduced-motion: reduce) {
  .sv-answer.waiting .sv-wait-count { animation: none; }
  .sv-limit-bar { transition: none; }
}
/* ⑥-2：けんがく・のこり・さいごの けっか */
.sv-row.watcher { background: #eaf4fd; }
.sv-row.watcher .sv-name { color: #5a6b80; }
.sv-note { margin: 0; text-align: center; font-size: 0.9rem; font-weight: bold; color: #1f66c9; }
.sv-banner-me { margin-top: 4px; font-size: 0.85rem; color: #b25400; }
.sv-final { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 20px; border: 3px solid #ffd84d; box-shadow: 0 3px 0 #f3d36a; }
.sv-final-head { margin: 0; text-align: center; font-size: 1.35rem; font-weight: 900; color: #d9730d; word-break: keep-all; overflow-wrap: anywhere; }
.sv-final-sub { margin: 0; text-align: center; font-size: 0.85rem; font-weight: bold; }
.sv-final-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.sv-final-list li { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 12px; font-weight: bold; }
.sv-final-list li.champ { background: #fff6d6; }
.sv-final-list li.me { outline: 2px solid var(--blue); }
.sv-final-rank { width: 2.2em; text-align: center; font-size: 1.05rem; font-weight: 900; color: var(--blue); }
.sv-final-name { flex: 1; min-width: 0; }
.sv-final-note { font-size: 0.8rem; color: #5a6b80; white-space: nowrap; }
.sv-banner { text-align: center; word-break: keep-all; overflow-wrap: anywhere; } /* ことばの きれめ（空白）で おりかえす */

/* ===== けいさん メモ（タブレットの手書きメモ。js/memo-pad.js） ===== */
/* メモがあるときは、問題の欄は ちょうどの高さにして、のこりを メモにゆずる */
.play.with-memo .problem-area { flex: none; padding: 4px 0; }
.memo {
  flex: 1; min-height: 160px;
  /* メモだけ 画面の横はば いっぱいに広げる（左右に 16px ずつ すきま）。
     ほかの部品は #app の はば（560px まで）のまま。
     align-self: center で、はみ出した分を 左右に同じだけ のばす */
  width: calc(100vw - 32px - env(safe-area-inset-left) - env(safe-area-inset-right)); align-self: center;
  display: flex; flex-direction: column;
  background: var(--white); border: 2px dashed var(--sky); border-radius: var(--radius);
  overflow: hidden;
}
.memo-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 8px 6px 14px; border-bottom: 1px solid var(--blue-light);
}
.memo-label { font-weight: bold; color: var(--blue); font-size: 0.95rem; }
.memo-tools { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; } /* せまい タブレットでは 2行に おる */
.memo-tool {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px; border-radius: 999px; font-size: 0.85rem; font-weight: bold;
  background: var(--white); border: 2px solid var(--blue-light); color: var(--blue-dark);
}
.memo-tool[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: var(--white); }
.memo-clear { color: #7f8ea0; }
.memo-tool:disabled { opacity: .4; }
/* 「もとの ばしょ」：紙を うごかした ときだけ 出す。目に つくように オレンジの わく */
.memo-tool.memo-home { border-color: #f3b37a; color: #b35500; }
.memo-tool[hidden] { display: none; }
.memo-icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* メモが ある ときの テンキー（2026-11-24、ユーザー：タブレットでは テンキーが 大きく、メモの 場所を とっていた）
   たて向き＝案A：ボタンを ひくく（84px → 60px）して、メモに ゆずる。
   よこ向き：問題と テンキーを 片がわの 列に、もう 片がわを ぜんぶ メモに（下の @media）。
   えらぶ ボタン（偶数・奇数など。1だん だけ）は そのまま。
   .pad:not(.choice-pad) まで 書いて、文と図・ヒントの ときの きまり（.figure-play / .hint-play .key）より つよくする */
.play.with-memo .pad:not(.choice-pad) .key { height: clamp(48px, 5.5dvh, 60px); font-size: 1.6rem; }
.play.with-memo .pad:not(.choice-pad) .key-clear,
.play.with-memo .pad:not(.choice-pad) .key-submit { font-size: 1.15rem; }
.play.with-memo .pad { gap: 8px; }
@media (orientation: landscape) {
  /* grid（グリッド＝格子）で 2列に（2026-11-24、ユーザー：右上が あいて もったいない）：
     片がわの 列（380px）に 上の 帯（やめる・タイム）・すすみぐあい・問題・テンキー、もう 片がわは ぜんぶ メモ。
     メモの がわは ⚙ せってい の「メモの ばしょ」（memo-right＝さいしょ／memo-left）。左ききの 子は ひだりに できる */
  .play.with-memo {
    display: grid;
    width: calc(100vw - 32px - env(safe-area-inset-left) - env(safe-area-inset-right)); align-self: center;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    column-gap: 20px; row-gap: 8px;
  }
  .play.with-memo.memo-right { grid-template-columns: 380px minmax(0, 1fr); grid-template-areas: "head memo" "prog memo" "prob memo" "pad memo"; }
  .play.with-memo.memo-left  { grid-template-columns: minmax(0, 1fr) 380px; grid-template-areas: "memo head" "memo prog" "memo prob" "memo pad"; }
  .play.with-memo > .play-head { grid-area: head; }
  .play.with-memo > .play-head + * { grid-area: prog; } /* すすみぐあい（または ゴーストの コース） */
  .play.with-memo > .problem-area { grid-area: prob; min-height: 0; }
  .play.with-memo > .memo { grid-area: memo; width: auto; align-self: stretch; min-height: 0; }
  .play.with-memo > .pad { grid-area: pad; align-self: end; }
  .play.with-memo > .countdown { grid-area: 1 / 1 / -1 / -1; }
  .play.with-memo .pad:not(.choice-pad) .key { height: clamp(56px, 9dvh, 76px); white-space: nowrap; }
  .play.with-memo .pad.choice-pad .key.choice-key { height: clamp(80px, 14dvh, 120px); }
}
/* 紙：うすい マス目（筆算の くらいを そろえやすく）。マス目は CSS の背景なので、けしゴムでは消えない */
.memo-paper {
  position: relative; flex: 1; min-height: 0;
  background-image:
    linear-gradient(to right, var(--blue-light) 1px, transparent 1px),
    linear-gradient(to bottom, var(--blue-light) 1px, transparent 1px);
  background-size: 36px 36px;
}
.memo-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  touch-action: none;           /* メモの中で指を動かしても、スクロール・拡大しない */
  -webkit-touch-callout: none;  /* 長おしで出る メニューを止める（iPhone・iPad） */
  cursor: crosshair;
}

/* 「ほんとうに でる？」（ホストが たいせんの とちゅうで でるとき） */
.big.sub.confirm { border-color: var(--red); color: var(--red); }

/* ===== ピカッと あんざん「こうさん」（ひとり と みんなで サバイバル。waza/flash-play.js の createGiveUp） ===== */
.flash-head-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.flash-head-right .flash-chip { white-space: nowrap; }
.quit.giveup { color: #b25400; border: 2px solid #ffd2a6; }
/* 「ほんとうに こうさんする？」：画面の 上のほうに出す（テンキー・「こたえる」から はなれた場所） */
.giveup-cover {
  position: fixed; inset: 0; z-index: 50;
  display: flex; justify-content: center; align-items: flex-start;
  padding: calc(64px + env(safe-area-inset-top)) 16px 0;
  background: rgba(30, 43, 60, .35);
}
.giveup-card {
  width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 8px;
  padding: 18px 16px 16px; border-radius: 20px; background: var(--white); box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
.giveup-q { margin: 0; text-align: center; font-size: 1.3rem; font-weight: 900; }
.giveup-note { margin: 0; text-align: center; font-size: 0.88rem; font-weight: bold; color: #5a6b80; word-break: keep-all; overflow-wrap: anywhere; }
.giveup-buttons { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.giveup-buttons .big { margin: 0; font-size: 1.15rem; }
.big.giveup-yes { background: #ff9f43; }
.sv-row.giveup .sv-given { color: #d9650b; }

/* ===== ログインした ひとだけ（12がつ から。js/account/gate.js・gate-ui.js） ===== */
.lock-icon { display: inline-block; width: 1.1em; height: 1.1em; vertical-align: -0.15em; }
.lock-icon svg { display: block; width: 100%; height: 100%; }
.lock-icon.lock-lg { width: 48px; height: 48px; color: var(--blue); }
.lock-icon.lock-lg.white { width: 36px; height: 36px; color: var(--white); flex: none; }
.big.locked-create { border: 2px dashed var(--sky); display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }

/* 「へやを つくるのは ログインした ひとだけ だよ」：画面に かさねる カード */
.gate-cover {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(30, 43, 60, .45);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 16px 12px calc(16px + env(safe-area-inset-bottom));
}
.gate-sheet {
  width: 100%; max-width: 520px;
  background: var(--white); border-radius: 24px; padding: 20px 18px;
  display: flex; flex-direction: column; align-items: stretch; gap: 12px; text-align: center;
}
.gate-sheet .lock-icon { align-self: center; }
.gate-sheet h2 { margin: 0; font-size: 1.3rem; line-height: 1.5; }
.gate-sheet p { margin: 0; line-height: 1.6; }

/* 11がつ中の おしらせ */
.gate-notice { border: 3px solid #f0a14a; display: flex; flex-direction: column; gap: 10px; }
.gate-notice-head { display: flex; align-items: center; gap: 8px; font-weight: bold; font-size: .9rem; }
.gate-notice-tag { background: #f0a14a; color: var(--ink); padding: 2px 10px; border-radius: 10px; font-size: .8rem; }
.gate-notice-main { margin: 0; font-weight: bold; line-height: 1.6; }
.gate-notice-sub { margin: 0; font-size: .85rem; line-height: 1.6; }
.gate-notice-buttons { display: flex; gap: 8px; }
.gate-notice-buttons button { min-height: 46px; border-radius: 14px; font-weight: bold; font-size: 1rem; }
.gate-login { flex: 1; border: none; background: var(--blue); color: var(--white); }
.gate-close { padding: 0 16px; border: 2px solid var(--blue-light); background: var(--white); color: var(--ink); }

/* わざの入口の いちばん上（かぎが かかっているとき） */
.gate-waza { background: var(--blue); color: var(--white); display: flex; flex-direction: column; gap: 10px; }
.gate-waza-head { display: flex; align-items: center; gap: 10px; }
.gate-waza-head p { margin: 0; font-weight: bold; font-size: 1.1rem; line-height: 1.5; }
.gate-waza-sub { margin: 0; font-size: .85rem; }
.big.gate-waza-login { background: var(--white); color: var(--blue-dark); box-shadow: none; }
.screen.waza.locked .wz-stage { opacity: .6; }
.gate-sheet .name-link { align-self: center; }

/* ===== じぶんの きろく（js/screens/records.js） ===== */
.rec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 8px; }
.rec-head h1 { margin: 0; font-size: 1.6rem; }
/* 先生（admin）が ログインしたときだけ 出る「先生の画面」の 入口（teacher/index.html へ） */
.rec-teacher {
  display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 18px;
  background: var(--blue); color: #fff; text-decoration: none; box-shadow: 0 4px 0 #1b5bb3;
}
.rec-teacher-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.rec-teacher-text b { font-size: 1.15rem; }
.rec-teacher-text small { font-size: .82rem; }
.rec-teacher .rec-go { color: #fff; font-size: 1.6rem; }
.rec-name { font-weight: bold; }
.rec-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rec-stat { background: var(--white); border-radius: 16px; padding: 10px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; box-shadow: 0 3px 0 #c9e3f7; }
.rec-stat.main { background: var(--blue); color: var(--white); box-shadow: none; }
.rec-stat-label { font-size: .75rem; font-weight: bold; }
.rec-stat-value { font-size: 1.6rem; font-weight: 900; line-height: 1.1; }
.rec-stat-value small { font-size: .8rem; }
.rec-card { display: flex; flex-direction: column; gap: 2px; box-shadow: 0 3px 0 #c9e3f7; border-radius: 20px; }
.rec-card h2 { margin: 0 0 8px; font-size: 1.2rem; }
.rec-grades { display: flex; gap: 6px; margin-bottom: 6px; }
.rec-grade { flex: 1; min-height: 44px; border-radius: 22px; border: 2px solid var(--blue-light); background: var(--white); color: var(--ink); font-weight: bold; font-size: 1rem; }
.rec-grade.on { background: var(--blue); border-color: var(--blue); color: var(--white); }
.rec-group { margin: 10px 0 2px; font-size: .85rem; color: var(--blue-dark); }
.rec-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--blue-light); }
.rec-row.none { color: #5b6b7d; }
.rec-row.group { border-bottom: none; padding-bottom: 0; }
.rec-row.sub { padding-left: 14px; font-size: .9rem; }
.rec-row-right { display: flex; align-items: center; gap: 6px; }
.rec-row-right small { font-size: .75rem; }
.rec-time { font-weight: 900; white-space: nowrap; }
.rec-row.none .rec-time { font-weight: normal; }
.rec-new, .rec-kyu { font-size: .7rem; font-weight: 900; background: #ffe2c2; color: #8a4a00; padding: 2px 7px; border-radius: 8px; white-space: nowrap; }
.rec-kyu { font-size: .9rem; padding: 3px 10px; }
.rec-bar { height: 10px; border-radius: 5px; background: var(--blue-light); overflow: hidden; margin: 2px 0 6px; }
.rec-bar span { display: block; height: 100%; background: var(--blue); border-radius: 5px; }
.rec-foot { display: flex; flex-direction: column; align-items: center; gap: 12px; padding-bottom: 8px; }
.rec-logout { min-height: 44px; padding: 0 28px; border: 2px solid var(--sky); border-radius: 22px; background: var(--white); color: var(--ink); font-weight: bold; font-size: 1rem; }

/* ===== はじめて ログインした とき：ひきつぎ（js/screens/takeover.js） ===== */
.takeover-hello { background: var(--blue); color: var(--white); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 8px; }
.takeover-hello strong { font-size: 1.6rem; }
.takeover-card { display: flex; flex-direction: column; gap: 12px; }
.takeover-card h1 { margin: 0; font-size: 1.3rem; text-align: center; line-height: 1.5; }
.takeover-card p { margin: 0; line-height: 1.6; }
.takeover-list { background: var(--blue-light); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.takeover-list-head { font-size: .8rem; font-weight: bold; }
.takeover-item { display: flex; justify-content: space-between; gap: 8px; }
.takeover-buttons { flex-direction: column; }

/* ===== くもラボ ランキング（js/screens/ranking.js） ===== */
button.rec-row { width: 100%; background: none; border: none; border-bottom: 1px solid var(--blue-light); font: inherit; color: inherit; text-align: left; cursor: pointer; }
button.rec-row:active { background: var(--blue-light); }
.rec-go { color: var(--blue); font-weight: 900; font-size: 1.2rem; }
.rec-hint { margin: -4px 0 6px; font-size: .8rem; color: var(--blue-dark); }
.rank-title { background: var(--blue); color: var(--white); display: flex; flex-direction: column; gap: 4px; }
.rank-title-head { font-size: .85rem; font-weight: bold; }
.rank-title-main { font-size: 1.3rem; font-weight: 900; }
.rank-title-sub { font-size: .8rem; }
.rank-period { display: flex; background: var(--white); border-radius: 22px; padding: 4px; gap: 4px; }
.rank-period button { flex: 1; min-height: 40px; border: none; border-radius: 18px; background: var(--white); color: var(--ink); font: inherit; font-weight: bold; }
.rank-period button.on { background: var(--sky); font-weight: 900; }
.rank-list { list-style: none; margin: 0; padding: 6px 14px; box-shadow: 0 3px 0 #c9e3f7; border-radius: 20px; }
.rank-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--blue-light); }
.rank-row:last-child { border-bottom: none; }
.rank-row.top3 { font-size: 1.05rem; font-weight: bold; }
.rank-row.me { background: var(--blue-light); border-radius: 10px; margin: 0 -8px; padding: 8px; }
.rank-no { width: 32px; height: 32px; flex: none; display: flex; align-items: center; justify-content: center; font-weight: 900; border-radius: 50%; }
.rank-no.medal { border: 2px solid; }
.rank-no.m1 { background: #ffd36b; border-color: #e8a317; }
.rank-no.m2 { background: #e4e9ef; border-color: #a9b4c0; }
.rank-no.m3 { background: #f3d2b3; border-color: #c98a55; }
.rank-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-time { font-weight: 900; white-space: nowrap; }
.rank-me { border: 3px solid var(--blue); display: flex; flex-direction: column; gap: 6px; }
.rank-me.none { border-style: dashed; text-align: center; }
.rank-me.none p { margin: 0; font-weight: bold; }
.rank-me-row { display: flex; align-items: center; gap: 10px; font-weight: 900; }
.rank-me-no { min-width: 40px; color: var(--blue-dark); font-size: 1.2rem; }
.rank-me-note { margin: 0; font-size: .85rem; }
.rank-chip { font-weight: 900; background: #ffe2c2; color: #8a4a00; padding: 2px 8px; border-radius: 8px; }
.rank-empty { text-align: center; margin: 12px 0; }
/* 結果画面の カード */
.rank-result { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border: none; border-radius: 20px; background: var(--blue); color: var(--white); text-align: left; font: inherit; box-shadow: 0 4px 0 var(--blue-dark); }
.rank-result[hidden] { display: none; }
.rank-result-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.rank-result-head { font-size: .8rem; font-weight: bold; }
.rank-result-main { font-size: 1.35rem; font-weight: 900; }
.rank-result-sub { font-size: .75rem; }
.rank-result-go { font-weight: 900; }

/* 4年 計算のきまり：かっこは 数に くっつける（.problem の gap 0.25em を へらす） */
.token.paren-open { margin-right: -0.2em; font-weight: normal; }
.token.paren-close { margin-left: -0.2em; font-weight: normal; }
/* 4年 がい数：問題の上の ひとこと */
.problem-prompt { margin: 0; font-size: 1.05rem; font-weight: bold; color: var(--blue-dark); text-align: center; }
.problem-prompt[hidden] { display: none; }

/* ===== 6年 文と図の問題（場合の数など。figures.js） ===== */
.choice.unit .trial-badge {
  margin-left: 8px; padding: 1px 7px; border-radius: 8px;
  font-size: 0.7rem; font-weight: bold; vertical-align: 2px;
  background: var(--white); color: var(--blue); border: 1px solid var(--sky);
}
.problem-prompt.hidden, .figure-area.hidden { visibility: hidden; }
.problem-area.with-figure { gap: 8px; justify-content: center; }
.problem-area.with-figure .problem-prompt {
  font-size: clamp(0.98rem, 4.3vw, 1.15rem); line-height: 1.5; padding: 0 4px;
  word-break: keep-all; overflow-wrap: anywhere; /* 空白で おりかえす */
}
.problem-area.with-figure .problem { font-size: clamp(1.8rem, 8vw, 2.5rem); }
.token.unit-word { font-size: 0.62em; }
.figure-area { width: 100%; display: flex; justify-content: center; }
.figure-area[hidden] { display: none; }
.figure {
  width: min(100%, 360px); box-sizing: border-box;
  background: var(--white); border-radius: 18px; padding: 10px 8px;
  box-shadow: 0 2px 0 #d6e8f6;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.fig-svg { display: inline-flex; }
.fig-svg svg { display: block; max-width: 100%; height: auto; }
.fig-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 8px; }
.fig-item { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.fig-animal { width: var(--s); height: var(--s); display: block; }
.fig-animal svg { width: 100%; height: 100%; display: block; }
.fig-name { font-size: 0.75rem; color: #4c5b6e; white-space: nowrap; }
.fig-slots { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; }
.fig-slot {
  min-width: 44px; padding: 4px 6px; border: 2px dashed var(--sky); border-radius: 10px;
  font-size: 0.8rem; color: var(--blue-dark); text-align: center;
}
.fig-slot.round { border-radius: 999px; min-width: 0; padding: 3px 8px; font-size: 0.72rem; }
.fig-card {
  width: 40px; height: 52px; display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--ink); border-radius: 8px; background: var(--white);
  font-size: 1.5rem; font-weight: bold; box-shadow: 0 2px 0 #cfe3f3;
}
.fig-card.empty { border: 2px dashed var(--sky); box-shadow: none; }
.fig-arrow { font-size: 0.8rem; color: var(--blue-dark); margin-right: 2px; }
.fig-pill {
  font-size: 0.78rem; color: var(--blue-dark); background: var(--blue-light);
  border-radius: 999px; padding: 3px 12px;
}
.fig-team {
  width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  color: var(--white); font-weight: bold; font-size: 1.15rem; border: 2px solid var(--ink);
  text-shadow: 0 1px 0 rgba(0, 0, 0, .25);
}
/* まちがえたときの ヒント（じゅけいず・くみの 一覧） */
.hint-card { border: 3px solid #ffb054; padding: 8px 8px 6px; gap: 4px; }
.hint-tag {
  align-self: flex-start; font-size: 0.75rem; font-weight: bold; color: var(--white);
  background: #f08a1c; border-radius: 8px; padding: 2px 8px;
}
.hint-text { margin: 0; font-size: 0.85rem; line-height: 1.55; text-align: center; word-break: keep-all; overflow-wrap: anywhere; }
.hint-rows { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.hint-row { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 4px; font-size: 0.8rem; }
.hint-partners { display: flex; flex-wrap: wrap; gap: 3px; }
.hint-partners .hint-chip { font-size: 0.72rem; padding: 0 5px; }
.hint-row.more { display: block; text-align: center; color: #6b7a8c; line-height: 1; }
.hint-with { color: #6b7a8c; }
.hint-count { font-weight: bold; color: #b26b00; white-space: nowrap; }
.hint-chip {
  display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px;
  border: 1.5px solid var(--sky); border-radius: 999px; background: var(--white); white-space: nowrap;
}
.hint-dot { width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--ink); }
.hint-trios { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 6px; }
.hint-trio { display: inline-flex; gap: 1px; padding: 2px; border-radius: 8px; background: var(--blue-light); font-size: 0.8rem; }
.fig-row.small .fig-team { width: 32px; height: 32px; font-size: 1rem; }
/* 文と図の問題：せの ひくい スマホ（iPhone SE など）でも、図・ヒント・テンキーが 1画面に 入るように
   図の わくは 小さく なれる（flex-shrink）。じゅけいずの 絵は 入る 高さに あわせて ちぢむ */
.play.figure-play { min-height: 0; max-height: 100dvh; } /* flex: 1 の 画面は 中身の高さまで のびるので、画面の高さで とめる（図・ヒントの ほうが ちぢむ） */
.play.figure-play .key { height: clamp(46px, 7.4dvh, 76px); }
.play.figure-play .pad { gap: 7px; }
/* 図の ない 問題で ヒントを 出したとき（5年 偶数・奇数、6年 分数。2026-11-23）：画面の 高さで とめ、ヒントの カードが ちぢむ（入りきらなければ カードの 中で スクロール） */
.play.hint-play { min-height: 0; max-height: 100dvh; }
.play.hint-play .key { height: clamp(46px, 7.4dvh, 76px); }
.play.hint-play .pad { gap: 7px; }
.play.hint-play .problem-area { min-height: 0; }
.play.hint-play .figure-area { flex: 0 1 auto; min-height: 0; }
.play.hint-play .hint-card { max-height: 100%; min-height: 0; overflow-y: auto; }
.problem-area.with-figure .figure-area { flex: 0 1 auto; min-height: 0; }
.problem-area.with-figure .figure { max-height: 100%; min-height: 0; overflow: hidden; }
.problem-area.with-figure .message { height: 1.3em; font-size: 1.05rem; }
.hint-card .fig-svg { flex: 0 1 auto; min-height: 48px; justify-content: center; }
.hint-card .fig-svg svg { height: 100%; width: auto; max-width: 100%; }

/* ===== ⚙ せってい（settings-sheet.js。2026-11-21） ===== */
.screen.setup { position: relative; }
.gear-button {
  position: absolute; top: 14px; right: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 0;
  min-width: 52px; min-height: 52px; padding: 6px 6px 4px; border-radius: 14px;
  background: var(--white); color: var(--blue); box-shadow: 0 1px 3px rgba(0,0,0,.12);
}
.gear-icon { width: 26px; height: 26px; display: block; }
.gear-icon svg { width: 100%; height: 100%; display: block; }
.gear-label { font-size: 0.68rem; font-weight: bold; }
.sheet-cover {
  position: fixed; inset: 0; z-index: 50; background: rgba(30, 43, 60, .35);
  display: flex; align-items: flex-end; justify-content: center;
  animation: sheet-fade .15s ease-out;
}
.sheet {
  width: min(100%, 560px); box-sizing: border-box; max-height: 85dvh; overflow-y: auto;
  background: var(--bg); border-radius: 22px 22px 0 0;
  padding: 14px 16px calc(18px + env(safe-area-inset-bottom));
  animation: sheet-up .2s ease-out;
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sheet-head h2 { margin: 0; font-size: 1.25rem; color: var(--blue-dark); }
.sheet-close { padding: 8px 16px; border-radius: 999px; background: var(--white); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); font-size: 0.95rem; }
.sheet-list { display: flex; flex-direction: column; gap: 10px; }
.sheet-row { background: var(--white); border-radius: 16px; padding: 12px 12px 10px; box-shadow: 0 2px 0 #d6e8f6; }
.sheet-row-head { display: flex; align-items: center; gap: 8px; }
.sheet-icon { font-size: 1.3rem; width: 1.6em; text-align: center; }
.sheet-name { font-weight: bold; font-size: 1.05rem; flex: 1; white-space: nowrap; }
.sheet-choices { display: inline-flex; gap: 6px; }
.sheet-choice {
  min-width: 76px; min-height: 44px; padding: 6px 10px; border-radius: 12px;
  border: 2px solid var(--sky); background: var(--white); color: var(--ink); font-size: 0.95rem;
}
.sheet-choice.on { border-color: var(--blue); background: var(--blue); color: var(--white); font-weight: bold; }
.sheet-note { margin: 6px 0 0; font-size: 0.82rem; color: #4c5b6e; line-height: 1.5; }
@keyframes sheet-up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes sheet-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sheet, .sheet-cover { animation: none; } }
/* プレイ中の タイムを かくす（場所は のこして、ヘッダーの ならびを かえない） */
.play-time.time-hidden { visibility: hidden; }
/* 円の面積（G6-09）の 図と しきの ヒント */
.fig-circle-svg { width: min(220px, 60vw); height: auto; max-height: 26dvh; }
.hint-formula { display: flex; flex-direction: column; gap: 4px; align-items: center; padding: 2px 4px 4px; }
.hint-formula p { margin: 0; font-size: 0.95rem; text-align: center; word-break: keep-all; overflow-wrap: anywhere; }
.hint-formula p.last { font-size: 1.2rem; font-weight: bold; color: var(--blue-dark); }
/* 設定画面では 右上の ⚙ と ロゴが かさならないよう、せまい スマホでは ロゴを 少し 小さく */
.screen.setup .title.logo img { width: min(300px, calc(100vw - 140px)); }

/* 1つだけ えらぶ 条件：つながった 1本の 切りかえスイッチ（setup.js renderOption 'single'。2026-11-21 案A）
   単元の ボタン（横長で ブルーに ぬる）と ちがって、うすい水色の 棒の中で、えらんだ ところだけ 白く うきあがる */
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--blue-light); }
.seg-btn {
  flex: 1 1 0; min-width: 0; min-height: 46px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid transparent; border-radius: 999px; background: transparent;
  color: var(--blue-dark); font-size: clamp(0.82rem, 3.9vw, 1.05rem); font-weight: bold;
  line-height: 1; white-space: nowrap; /* 「ならべる」などを 2行に しない */
}
.seg-btn.on { background: var(--white); color: var(--ink); border-color: var(--blue); box-shadow: 0 2px 0 #cfe3f3; }
/* 「まぜる」は スイッチの 外の 別の ボタン（ほかの しゅるいを 合わせた 出し方なので）。半分ずつ 色の ちがう 丸の しるし */
.seg-row { display: flex; align-items: center; gap: 8px; }
.seg-row .seg { flex: 2 1 0; min-width: 0; }
.seg-btn.seg-mix { flex: 1 1 0; min-height: 54px; gap: 5px; background: var(--blue-light); }
.seg-btn.seg-mix.on { background: var(--white); }
.mix-mark {
  width: 0.85em; height: 0.85em; flex: none; border-radius: 50%;
  background: linear-gradient(90deg, var(--blue) 50%, #ffb054 50%);
}
.fig-solid-svg { width: min(260px, 68vw); height: auto; max-height: 26dvh; }

/* ===== たいせんの かち・まけ（js/screens/battle-record-card.js・records.js・rival.js。仕様書24章） ===== */
.rec-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.rec-stat.battle .rec-stat-wl { display: flex; flex-direction: column; align-items: center; font-weight: 900; line-height: 1.25; font-size: .95rem; white-space: nowrap; }
.rec-stat.battle .rec-stat-wl span + span { font-size: .8rem; }
.rec-battle { font-size: .7rem; font-weight: 900; background: var(--blue-light); color: var(--blue-dark); padding: 2px 7px; border-radius: 8px; white-space: nowrap; }
.bt-card { display: flex; flex-direction: column; gap: 8px; }
.bt-card.guest { border: 2px dashed var(--sky); box-shadow: none; }
.bt-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.bt-head h2 { margin: 0; font-size: 1.05rem; }
.bt-today { font-size: .8rem; color: #4a5868; font-weight: bold; }
.bt-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.bt-row { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px 10px; border-radius: 12px; background: #f6fafe; }
.bt-name { flex: 1; min-width: 0; font-weight: bold; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bt-total { font-size: .78rem; color: #4a5868; white-space: nowrap; }
.bt-chip { flex: none; padding: 3px 12px; border-radius: 999px; font-size: .85rem; font-weight: 900; border: 2px solid transparent; white-space: nowrap; }
.bt-chip.win { background: var(--blue); border-color: var(--blue); color: var(--white); }
.bt-chip.lose { background: var(--white); border-color: #ee6f00; color: #b35500; }
.bt-chip.draw { background: #eef1f4; color: #4a5868; }
.bt-chip.pending { background: var(--white); border-color: #c9d3dd; color: #4a5868; }
.bt-note { margin: 0; font-size: .78rem; color: #4a5868; line-height: 1.5; }
.bt-lead { margin: 0; line-height: 1.6; }
.bt-split { display: flex; gap: 8px; }
.bt-split-item { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; background: #f6fafe; border-radius: 12px; padding: 8px 10px; }
.bt-split-item.card { background: var(--white); padding: 8px 10px; }
.bt-split-item span { font-size: .72rem; color: #4a5868; }
.bt-split-item b { font-size: .9rem; }
.bt-initial { flex: none; width: 30px; height: 30px; border-radius: 50%; background: #ffe7c7; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; font-size: .85rem; }
.bt-initial.big { width: 56px; height: 56px; font-size: 1.5rem; }
.bt-rival { gap: 10px; justify-content: flex-start; }
.bt-rival .rec-row-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bt-more { min-height: 44px; border: none; background: none; color: var(--blue-dark); font: inherit; font-weight: bold; font-size: .9rem; }
.rival-back { align-self: flex-start; min-height: 44px; border: none; background: none; color: var(--blue-dark); font: inherit; font-weight: bold; font-size: 1rem; padding: 0 4px; }
.rival-head { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.rival-head h1 { margin: 0; font-size: 1.35rem; text-align: center; }
.rival-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.rival-tile { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 0; border-radius: 14px; font-weight: bold; }
.rival-tile b { font-size: 2rem; font-weight: 900; line-height: 1.1; }
.rival-tile.win { background: var(--blue); color: var(--white); }
.rival-tile.lose { background: var(--white); border: 2px solid #ee6f00; color: #b35500; }
.rival-tile.draw { background: #eef1f4; color: #4a5868; }
.rival-recent h2 { margin: 0 0 4px; font-size: 1.05rem; }
.rival-recent ul { list-style: none; margin: 0; padding: 0; }
.rival-match { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--blue-light); }
.rival-match:last-child { border-bottom: none; }
.rival-match-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: .88rem; }
.rival-match-text small { font-size: .75rem; color: #4a5868; }
.rival-note { margin: 0; text-align: center; font-size: .8rem; color: #4a5868; }
.rec-row-name.with-tag { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.bt-split-item b { word-break: keep-all; }

/* ===== バッジの たな（screens/badges.js。2026-11-22） ===== */
.screen.badges { gap: 10px; padding-top: 10px; }
.bd-top { display: flex; align-items: center; gap: 8px; }
.bd-back { min-height: 44px; padding: 0 6px; background: none; color: var(--blue-dark); font-weight: bold; font-size: .95rem; }
.bd-count { margin-left: auto; padding: 4px 12px; border-radius: 999px; background: var(--white); font-size: .85rem; font-weight: bold; }
.bd-count b { font-size: 1.05rem; color: var(--blue-dark); }
.bd-title { margin: -4px 0 0; font-size: 1.5rem; text-align: center; }
.bd-card { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 20px; box-shadow: 0 3px 0 #c9e3f7; }
.bd-h2 { margin: 0; font-size: 1.05rem; }
.bd-head { display: flex; align-items: flex-end; gap: 6px; padding-bottom: 2px; }
.bd-head .bd-col { font-size: .66rem; font-weight: bold; color: #4a5868; white-space: nowrap; overflow: visible; }
.bd-col { width: 38px; flex: none; display: flex; justify-content: center; align-items: center; text-align: center; }
.bd-side { width: 96px; flex: none; display: flex; justify-content: flex-end; align-items: center; gap: 2px; }
.bd-row { display: flex; align-items: center; gap: 6px; width: 100%; min-height: 48px; padding: 4px 0; background: none; border-top: 1px solid var(--blue-light); text-align: left; }
.bd-row:active { background: var(--blue-light); }
.bd-row:disabled { opacity: .5; }
.bd-grade { flex: 1; font-size: 1rem; font-weight: 900; }
.bd-go { color: #4a5868; font-size: 1.1rem; font-weight: 900; }
.bd-note { font-size: .74rem; font-weight: bold; color: #4a5868; white-space: nowrap; }
.bd-pill { padding: 2px 8px; border-radius: 999px; background: #fff1e3; color: #9a4700; font-size: .72rem; font-weight: 900; white-space: nowrap; }
.bd-pill.new { padding: 3px 7px; font-size: .62rem; line-height: 1.25; white-space: pre-line; text-align: center; border-radius: 10px; }
.bd-foot { margin: 6px 0 0; font-size: .74rem; color: #4a5868; }
.bd-foot.center { text-align: center; margin: 0; }
.bd-howto { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 20px; }
.bd-howto-art { flex: none; line-height: 0; }
.bd-howto p { margin: 0; font-size: .85rem; line-height: 1.5; word-break: keep-all; overflow-wrap: anywhere; }
.bd-howto small { display: block; margin-top: 2px; font-size: .74rem; color: #4a5868; }

/* 学年ごとの くわしい 画面 */
.bd-three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.bd-kind { background: var(--white); border-radius: 14px; padding: 10px 6px; display: flex; flex-direction: column; align-items: center; gap: 3px; border: 2px solid transparent; }
.bd-kind.kumo { border-color: var(--blue); }
.bd-kind.got { background: var(--blue-light); }
.bd-kind b { font-size: .95rem; }
.bd-kind small { font-size: .66rem; color: #4a5868; text-align: center; line-height: 1.3; word-break: keep-all; }
.bd-kind.wait { background: #f4f5f7; }
.bd-kind.wait b, .bd-kind.wait small { color: #5b6673; }
.bd-bar { width: 100%; height: 6px; border-radius: 999px; background: #e3eef8; overflow: hidden; }
.bd-bar span { display: block; height: 100%; background: var(--blue); border-radius: 999px; }
.bd-kind-num { font-size: .85rem; font-weight: 900; color: var(--blue-dark); }
.bd-wait { margin-top: 4px; padding: 2px 6px; border-radius: 999px; background: var(--white); font-size: .64rem; font-weight: bold; color: #5b6673; white-space: nowrap; }
.bd-got { margin: 0; text-align: center; font-weight: 900; color: var(--blue-dark); }
.bd-got.more { font-size: .85rem; color: #9a4700; }
.bd-units { display: flex; flex-direction: column; padding: 6px 12px 8px; border-radius: 20px; }
.bd-units-head { display: flex; align-items: center; min-height: 30px; font-size: .8rem; font-weight: 900; color: #4a5868; }
.bd-units-head span:first-child { flex: 1; }
.bd-unit { display: flex; align-items: center; gap: 6px; min-height: 46px; padding: 4px 0; border-top: 1px solid var(--blue-light); }
.bd-unit-name { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: .92rem; font-weight: bold; line-height: 1.3; }
.bd-unit-name small { font-size: .68rem; font-weight: bold; color: #4a5868; }
.bd-unit-name small.bd-dans { color: var(--blue-dark); }
.big.bd-practice { font-size: 1.05rem; line-height: 1.35; word-break: keep-all; overflow-wrap: anywhere; }

/* じぶんの きろく の 入口 */
.rec-badges { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px; border-radius: 20px; background: var(--white); box-shadow: 0 3px 0 #c9e3f7; text-align: left; }
.rec-badges:active { background: var(--blue-light); }
.rec-badges-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.rec-badges-text b { font-size: 1.1rem; }
.rec-badges-text small { font-size: .8rem; color: #4a5868; }

/* ログイン画面：ログインしていない子への ひとこと */
.login-badges { word-break: keep-all; overflow-wrap: anywhere; display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; padding: 8px 10px; border-radius: 12px; background: var(--blue-light); font-weight: bold; font-size: .9rem; color: var(--blue-dark); }

/* 結果画面：学年コンプリート「くも」の おいわい */
.kumo-get { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 20px; background: var(--blue); color: var(--white); }
.kumo-get .badge-art { flex: none; background: var(--white); border-radius: 50%; }
.kumo-get-text { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; word-break: keep-all; overflow-wrap: anywhere; }
.kumo-get-text b { font-size: 1.15rem; }
.kumo-get-text small { font-size: .82rem; }
.kumo-get-go { min-height: 40px; padding: 0 14px; border-radius: 20px; background: var(--white); color: var(--blue-dark); font-weight: 900; font-size: .9rem; }

/* バッジの たな：わざ・がんばり・たいせん（②-1。2026-11-22） */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bd-others { gap: 8px; }
.bd-streak { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; padding: 6px 10px; border-radius: 10px; background: var(--blue-light); font-size: .78rem; font-weight: bold; }
.bd-streak b { font-size: 1rem; color: var(--blue-dark); }
.bd-streak-best { color: #4a5868; }
.bd-rest { margin-left: auto; display: flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--white); white-space: nowrap; }
.bd-rest-art { background: none; }
.bd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 8px 2px; }
.bd-badge { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.bd-mark { width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1rem; font-weight: 900; }
.bd-mark.small { font-size: .74rem; }
.bd-mark.locked { width: 39px; height: 39px; background: #f6fafe; border: 1.5px dashed #b9cfe4; color: #a7b8c9; }
.bd-mark.k-waza { background: var(--blue); color: var(--white); }
.bd-mark.k-flash { background: #ffd84d; color: #6b4a00; }
.bd-mark.k-nigate { background: var(--blue-dark); color: var(--white); }
.bd-mark.k-win { background: #b35500; color: var(--white); }
.bd-mark.k-days { background: var(--sky); color: var(--ink); }
.bd-mark.k-streak { background: #1d5fb8; color: var(--white); box-shadow: inset 0 0 0 3px #8fcaf5; }
.bd-mark.k-friends { background: var(--blue-light); color: var(--blue-dark); box-shadow: inset 0 0 0 2px var(--blue); }
.bd-badge-name { font-size: .64rem; font-weight: bold; text-align: center; line-height: 1.25; white-space: pre-line; }
.bd-badge-sub { margin-top: -2px; font-size: .62rem; color: #4a5868; }

/* ===== くもの しょうごう（雲の称号10段。screens/titles.js。本番では まだ 出さない） ===== */
.tt-card {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; text-align: left;
  border: none; border-radius: 18px; background: var(--blue); color: var(--white);
  box-shadow: 0 4px 0 var(--blue-dark); cursor: pointer; font: inherit;
}
.tt-card svg { flex: none; }
.tt-card-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tt-card-text small { font-size: 0.8rem; opacity: 0.95; word-break: keep-all; }
.tt-card-text b { font-size: 1.5rem; letter-spacing: 0.04em; }
.tt-bar { display: block; height: 8px; border-radius: 999px; background: rgba(255,255,255,0.35); overflow: hidden; }
.tt-bar span { display: block; height: 100%; border-radius: 999px; background: var(--white); }
.tt-card-go { font-size: 1.6rem; font-weight: bold; }
.tt-lead { margin: -4px 0 4px; text-align: center; font-size: 0.9rem; word-break: keep-all; }
.tt-list { list-style: none; margin: 0; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.tt-row {
  display: grid; grid-template-columns: 30px 1fr auto; grid-template-rows: auto auto; column-gap: 10px;
  align-items: center; padding: 8px 10px; border-radius: 12px;
}
.tt-dan {
  grid-row: 1 / 3; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--blue-light); color: var(--blue-dark); font-weight: bold; font-size: 0.9rem; line-height: 1;
}
.tt-name { font-weight: bold; font-size: 1.05rem; }
.tt-kanji { grid-column: 2; font-size: 0.75rem; color: #5b6b80; }
.tt-row > :last-child { grid-column: 3; grid-row: 1 / 3; }
.tt-row.locked { opacity: 0.55; }
.tt-row.locked .tt-dan { background: #eef1f5; color: #7a8796; }
.tt-row.now { background: var(--blue); color: var(--white); }
.tt-row.now .tt-dan { background: var(--white); color: var(--blue); }
.tt-row.now .tt-kanji { color: rgba(255,255,255,0.9); }
.tt-now { padding: 2px 10px; border-radius: 999px; background: var(--white); color: var(--blue); font-weight: bold; font-size: 0.85rem; }
.tt-need { font-size: 0.8rem; white-space: nowrap; }
.tt-next { margin: 4px 0; text-align: center; font-weight: bold; color: var(--blue-dark); word-break: keep-all; }
.tt-chip-row { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.tt-chip-label { font-size: 0.75rem; white-space: pre-line; text-align: right; color: #5b6b80; }
.tt-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; border: 2px solid var(--sky);
  border-radius: 999px; background: var(--white); font-size: 0.85rem; white-space: nowrap;
}
.tt-chip b { color: var(--blue-dark); }
.tt-mame { position: relative; margin-top: 10px; padding: 18px 14px 12px; }
.tt-mame p { margin: 0; font-size: 0.9rem; line-height: 1.6; }
.tt-mame-tag {
  position: absolute; top: -10px; left: 12px; padding: 1px 10px; border-radius: 999px;
  background: var(--orange, #ee6f00); color: var(--white); font-size: 0.75rem; font-weight: bold;
}
.login-chip:has(.login-chip-title) .login-chip-name { max-width: 6em; } /* しょうごうが つくときは なまえを みじかめに */
/* にじ（ノーミス。ためし用の URL だけ。screens/badges.js・result.js） */
.bd-kind.niji.got { border-color: #f5b800; }
.bd-got.niji { color: #9a4700; }
.bd-units.two .bd-units-head .bd-col, .bd-units.two .bd-unit .bd-col { width: 44px; }
.bd-pill.quiet { background: #eef1f5; color: #7a8796; }
.niji-get { box-shadow: inset 0 0 0 3px #f5b800; }

/* ===== えらぶ ボタン（5年 G5-01 偶数・奇数。pads/choice.js）===== */
/* おしたら すぐ こたえ。テンキーより 大きく、白地に ブルーの わく。まちがえた ボタンは 点線で うすく（おせない） */
.pad.choice-pad { grid-template-columns: repeat(var(--choices, 2), 1fr); gap: 12px; padding-bottom: 8px; }
.key.choice-key {
  height: clamp(96px, 16dvh, 140px);
  font-size: 2rem; color: var(--blue-dark);
  border: 3px solid var(--blue); box-shadow: 0 4px 0 var(--blue-dark);
}
.key.choice-key.pressed { box-shadow: 0 0 0 var(--blue-dark); }
/* ことばが 長い ボタン（9の みやぶり「わりきれる」「わりきれない」）は 1行に おさめる */
.pad.choice-pad.long-words .key.choice-key { font-size: min(1.6rem, 6.2vw); white-space: nowrap; padding-left: 4px; padding-right: 4px; }
.key.choice-key.wrong, .key.choice-key:disabled {
  color: #8a96a6; background: #eef1f5; border: 3px dashed #b8c2cf; box-shadow: none; transform: none;
}
/* 9の みやぶり（W-03）：まちがえたら 1けたずつ 位の 色に して 下線（.problem.hint-places は play.js が つける）。
   色は ① みる と 同じ：一＝水色の こい色・十＝おひさま・百＝夕やけ。千は 紺（① みる に 千は ないため） */
.place-digits .pd { display: inline-block; }
.problem.hint-places .pd { text-decoration: underline; text-decoration-thickness: 4px; text-underline-offset: 6px; }
.problem.hint-places .pd-0 { color: #1b5bb3; }
.problem.hint-places .pd-1 { color: #854f0b; }
.problem.hint-places .pd-2 { color: #993c1d; }
.problem.hint-places .pd-3 { color: var(--ink); }
/* 一の位：まちがえたら オレンジに して 下線（.problem.hint-ones は play.js が つける） */
.problem.hint-ones .ones { color: #ee6f00; text-decoration: underline; text-decoration-thickness: 4px; text-underline-offset: 6px; }

/* ===== じぶんの きろく の 色わけ（2026-11-23、ユーザーの要望：同じ 色ばかりで、どこが ボタンか わかりにくい） =====
   なかまの 色は わざの 入口（.wz-tone-*）と おなじ 3つ：おひさま（じこベスト）・夕やけ（たいせん）・空（わざ）。
   上の 数字の 色も カードと そろえる。おせる ところは「› の 丸」と 下の 影で ボタンに 見せる。
   --rc-band＝カードの おびの 色、--rc-ink＝おびの 字、--rc-accent＝見出しの 丸・えらんだ 学年・› の 丸、
   --rc-soft＝おした ときの 地・学年ボタンの わく、--rc-shade＝カードの 下の 影 */
.rc-sun  { --rc-band: #fac775; --rc-ink: #633806; --rc-accent: #ba7517; --rc-text: #854f0b; --rc-soft: #fdf0d9; --rc-shade: #f0dcb4; }
.rc-dusk { --rc-band: #f5c4b3; --rc-ink: #712b13; --rc-accent: #d85a30; --rc-text: #993c1d; --rc-soft: #fbe6de; --rc-shade: #f1d6cc; }
.rc-sky  { --rc-band: #2b7de9; --rc-ink: #fff;    --rc-accent: #2b7de9; --rc-text: var(--blue-dark); --rc-soft: var(--blue-light); --rc-shade: #c9e3f7; }

/* カード：上に 色の おび */
.rec-card { padding-top: 0; overflow: hidden; box-shadow: 0 3px 0 var(--rc-shade, #c9e3f7); }
.rec-card h2 { margin: 0 -14px 10px; padding: 10px 16px; background: var(--rc-band, var(--blue-light)); color: var(--rc-ink, var(--ink)); font-size: 1.15rem; }
.rec-card .rec-group { display: flex; align-items: center; gap: 6px; color: var(--rc-text, var(--blue-dark)); }
.rec-card .rec-group::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--rc-accent, var(--blue)); flex-shrink: 0; }
.rec-card .rec-hint { margin: 0 0 8px; color: var(--rc-text, var(--blue-dark)); }

/* 学年の ボタン：カードの 色。6つ ならんでも「1ねん」が 2行に ならないように */
.rec-card .rec-grade { min-width: 0; padding: 0; white-space: nowrap; font-size: min(1rem, 3.8vw); border-color: var(--rc-shade, var(--blue-light)); box-shadow: 0 2px 0 var(--rc-shade, var(--blue-light)); }
.rec-card .rec-grade.on { background: var(--rc-accent, var(--blue)); border-color: var(--rc-accent, var(--blue)); color: var(--white); box-shadow: none; }

/* おせる 行：右の › を 色の 丸に（おせない 行には 丸が ない） */
.rec-card button.rec-row:active { background: var(--rc-soft, var(--blue-light)); }
.rec-card .rec-row.link .rec-go {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--rc-accent, var(--blue)); color: var(--white);
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; line-height: 1; padding-bottom: 2px;
}
.rec-card .rec-row.none { color: #8593a3; }

/* 上の 数字：4つ それぞれの 色 */
.rec-stat { box-shadow: none; }
.rec-stat.t-blue { background: var(--blue); color: var(--white); }
.rec-stat.t-mizu { background: #cfe8fb; color: var(--blue-dark); }
.rec-stat.t-sun  { background: #fde2ad; color: #633806; }
.rec-stat.t-dusk { background: #f9d6c9; color: #712b13; }

/* たいせん：「たいせんで こうしん」も 夕やけ色、もっと みる は ボタンに */
.rec-battle { background: #fbe6de; color: #993c1d; }
.rc-dusk .bt-split-item { background: #fdf3ef; }
.rc-dusk .bt-split-item span { color: #993c1d; }
.rc-dusk .bt-initial { background: #f9d6c9; color: #712b13; }
.rc-dusk .bt-more { align-self: center; margin-top: 10px; min-height: 40px; padding: 0 18px; border: 2px solid var(--rc-band); border-radius: 20px; background: var(--white); color: var(--rc-text); }

/* わざの 81マスの ぼう */
.rc-sky .rec-bar { background: var(--blue-light); }

/* バッジの たな：白地に 水色の わくと 影で ボタンに、› は 青い 丸 */
.rec-badges { border: 2px solid var(--sky); box-shadow: 0 4px 0 var(--sky); }
.rec-badges:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--sky); }
.rec-badges .rec-go, .rec-teacher .rec-go {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.3rem; line-height: 1; padding-bottom: 2px;
}
.rec-badges .rec-go { background: var(--blue); color: var(--white); }
.rec-teacher .rec-go { background: var(--white); color: var(--blue); font-size: 1.3rem; }

/* ログアウト：おせる けど めだたせない（灰色の わく） */
.rec-logout { border-color: #c4ced8; color: #4a5868; }

/* ===== じぶんの きろく の 入口（2026-11-26。できごと ＋ 4つの タイル。js/records-home.js） =====
   1本の 長い たてスクロールを やめて、入口では 少なく・おしたら くわしく。タイルの 色は 中の カードと そろえる
   （がんばり＝ブルー・じこベスト＝おひさま・たいせん＝夕やけ・くもチャレンジ・バッジ＝水色）。オレンジの 札は「あたらしい」だけ */
.rec-back { align-self: flex-start; min-height: 44px; border: none; background: none; color: var(--blue-dark); font: inherit; font-weight: bold; font-size: 1rem; padding: 0 4px; }
.rec-events { display: flex; flex-direction: column; border-radius: 20px; box-shadow: 0 3px 0 #c9e3f7; padding-top: 12px; padding-bottom: 6px; }
.rec-events h2 { margin: 0 0 4px; font-size: 1.1rem; }
.rec-ev { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 48px; padding: 6px 0; border: none; border-top: 1px solid var(--blue-light); background: none; color: var(--ink); font: inherit; text-align: left; }
.rec-ev:first-of-type { border-top: none; }
.rec-ev:active { background: var(--blue-light); }
.rec-ev-text { flex: 1; min-width: 0; font-weight: bold; font-size: .95rem; line-height: 1.35; }
.rec-ev .rec-go, .rec-tile .rec-go { flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; line-height: 1; padding-bottom: 2px; }
.rec-ev .rec-go { background: var(--blue); color: var(--white); }
.rec-ev-none { margin: 6px 0 10px; font-size: .9rem; color: #4a5868; }
.rec-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.rec-tile { display: flex; flex-direction: column; gap: 4px; min-height: 112px; padding: 12px 12px 10px; border: none; border-radius: 20px; font: inherit; text-align: left; }
.rec-tile:active { transform: translateY(2px); }
.rec-tile-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-weight: 900; font-size: 1rem; line-height: 1.2; }
.rec-tile-value { font-size: 2rem; font-weight: 900; line-height: 1.1; white-space: nowrap; }
.rec-tile-value small { font-size: .85rem; }
.rec-tile.wide .rec-tile-value { font-size: min(1.6rem, 7vw); line-height: 1.375; } /* 「18かち 11まけ」は 2つの 数なので すこし 小さく（せまい スマホ・3けたでも 入る） */
.rec-tile-head > span:first-child { white-space: pre-line; }
.rec-tile-sub { font-size: .78rem; font-weight: bold; }
.rec-tile.t-blue { background: var(--blue); color: var(--white); box-shadow: 0 4px 0 #1b5bb3; }
.rec-tile.t-blue .rec-go { background: var(--white); color: var(--blue); }
.rec-tile.t-sun  { background: #fde2ad; color: #633806; box-shadow: 0 4px 0 #f0c878; }
.rec-tile.t-sun .rec-go { background: #ba7517; color: var(--white); }
.rec-tile.t-dusk { background: #f9d6c9; color: #712b13; box-shadow: 0 4px 0 #ecb6a3; }
.rec-tile.t-dusk .rec-go { background: #d85a30; color: var(--white); }
.rec-tile.t-mizu { background: #cfe8fb; color: var(--blue-dark); box-shadow: 0 4px 0 #a9d2f2; }
.rec-tile.t-mizu .rec-go { background: var(--blue); color: var(--white); }
.rec-tile:active { box-shadow: none; }
.rec-stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rec-stats.three .rec-stat-label { text-align: center; line-height: 1.2; }
.rec-card .rec-hint.rec-hint-foot { margin: 10px 0 0; }
.rec-links { display: flex; flex-direction: column; background: var(--white); border-radius: 16px; box-shadow: 0 3px 0 #c9e3f7; padding: 0 16px; }
.rec-link { display: flex; align-items: center; justify-content: space-between; min-height: 48px; border: none; background: none; color: var(--ink); font: inherit; font-weight: bold; font-size: .95rem; text-decoration: none; text-align: left; padding: 0; }
.rec-link + .rec-link { border-top: 1px solid var(--blue-light); }
.rec-link.logout { color: #4a5868; }

/* ===== じぶんの きろく：じこベスト（たたむ・進みぐあい・おとな）と がんばり の カレンダー（2026-11-26） ===== */
.rec-row-name.with-tag { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.rec-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.rec-row-right { flex-shrink: 0; }
.rec-card .rec-grades.wrap { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 10px; }
.rec-progress { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.rec-progress-text { display: flex; justify-content: space-between; align-items: baseline; font-weight: bold; font-size: .95rem; color: var(--rc-text, var(--blue-dark)); }
.rec-progress-text b { font-size: 1.3rem; font-weight: 900; }
.rec-progress-text small { font-size: .8rem; }
.rc-sun .rec-bar { background: var(--rc-soft); height: 12px; border-radius: 6px; margin: 0; }
.rc-sun .rec-bar span { background: var(--rc-accent); border-radius: 6px; }
.rec-rest { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 52px; margin-top: 12px; padding: 0 14px; border: 2px dashed var(--rc-band, var(--sky)); border-radius: 16px; background: var(--rc-soft, var(--blue-light)); color: var(--ink); font: inherit; font-weight: bold; font-size: .95rem; text-align: left; }
.rec-rest b { color: var(--rc-text, var(--blue-dark)); font-size: .85rem; }
.rec-cal { display: flex; flex-direction: column; gap: 8px; border-radius: 20px; box-shadow: 0 3px 0 #c9e3f7; }
.rec-cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rec-cal-head h2 { margin: 0; font-size: 1.15rem; display: flex; align-items: baseline; gap: 8px; }
.rec-cal-head h2 small { font-size: .8rem; color: var(--blue-dark); }
.rec-cal-move { width: 44px; height: 44px; border: 2px solid var(--blue-light); border-radius: 50%; background: var(--white); color: var(--blue-dark); font-size: 1.3rem; font-weight: 900; line-height: 1; padding-bottom: 3px; }
.rec-cal-move:disabled { color: #b8c4d0; border-color: #eef3f8; }
.rec-cal-week, .rec-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; }
.rec-cal-week { font-size: .72rem; font-weight: bold; color: #4a5868; }
.rec-cal-day { justify-self: center; width: min(38px, 100%); aspect-ratio: 1; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: .95rem; color: #4a5868; box-sizing: border-box; }
.rec-cal-day.played { background: var(--blue); color: var(--white); font-weight: 900; }
.rec-cal-day.today { border: 3px solid #ee6f00; }
.rec-cal-day.future { color: #b8c4d0; }
.rec-cal-legend { display: flex; gap: 14px; font-size: .78rem; font-weight: bold; color: #4a5868; }
.rec-cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.rec-cal-legend i { width: 14px; height: 14px; border-radius: 50%; box-sizing: border-box; }
.rec-cal-legend i.played { background: var(--blue); }
.rec-cal-legend i.today { border: 3px solid #ee6f00; }

/* ===== 1年の さくらんぼざん（sakuranbo/。2026-11-23） ===== */
/* 設定画面の カード（G1-03・G1-05 を えらんだ とき）。白地に さくらんぼの 赤を すこしだけ（ふちと 番号の 丸） */
.sk-setup { border: 2px solid #f7c1c1; padding: 12px 14px 6px; }
.sk-setup-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.sk-setup-head p { margin: 0; }
.sk-setup-name { font-size: 1.1rem; font-weight: bold; }
.sk-setup-sub { font-size: 0.85rem; color: #5a6b7d; }
.sk-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 0 4px; background: none; border-top: 1px solid var(--blue-light); color: var(--ink); font-size: 1.05rem; font-weight: bold; text-align: left; }
.sk-row:active { background: #fff5f5; }
.sk-row.soon { opacity: .5; }
.sk-no { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: #e0484f; color: var(--white); font-size: 0.9rem; line-height: 1; }
.sk-row-name { flex: 1; }
.sk-chip { font-size: 0.8rem; padding: 2px 10px; border-radius: 10px; background: #fcebeb; color: #a32d2d; }
.sk-soon { font-size: 0.8rem; color: #7f8ea0; }
.sk-arrow { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--blue-light); color: var(--blue); font-size: 1.2rem; }

/* どうがで みる（設定画面の 入口と、声つき 自動再生の 画面。2026-11-24） */
.sk-video-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 50px; margin: 6px 0 8px; border-radius: 14px; background: #e0484f; color: var(--white); font-size: 1.05rem; font-weight: bold; box-shadow: 0 3px 0 #a32d2d; }
.sk-video-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #a32d2d; }
.sk-video-seen { font-size: 0.8rem; padding: 1px 8px; border-radius: 10px; background: var(--white); color: #a32d2d; }
.sk-see .sk-subtitle { background: var(--ink); color: var(--white); font-size: 1.1rem; line-height: 1.5;
  /* 左よせ・1文ずつ 行を かえる。高さは 2文ぶん（4行）に 固定して、段階が かわっても 下の バーが 動かない（2026-11-24 ユーザー） */
  text-align: left; height: calc(6em + 24px); display: flex; flex-direction: column; justify-content: center; gap: 2px; overflow: hidden; }
.sk-sub-line { display: block; }
.sk-video-area { margin-top: auto; padding-bottom: 12px; }
.sk-vcontrols { display: flex; align-items: center; gap: 12px; }
.sk-vplay { flex-shrink: 0; width: 56px; height: 56px; border-radius: 50%; background: var(--blue); color: var(--white); font-size: 1.3rem; box-shadow: 0 3px 0 var(--blue-dark); }
.sk-vmute { flex-shrink: 0; width: 48px; height: 48px; border-radius: 50%; background: var(--white); font-size: 1.3rem; box-shadow: 0 2px 0 #c9e3f7; }
.sk-vbars { flex: 1; display: flex; gap: 6px; }
.sk-vbar { flex: 1; height: 8px; border-radius: 4px; background: #c9ddf0; transition: background .3s; }
.sk-vbar.on { background: var(--blue); }

/* ① みる（sakuranbo/sakuranbo-see.js） */
.sk-see { gap: 10px; padding-top: 8px; }
.sk-kind { margin: -4px 0 0; text-align: center; font-size: 0.9rem; font-weight: bold; color: #5a6b7d; }
.sk-card { padding: 8px 6px 6px; }
.sk-stage { display: block; width: 100%; height: auto; max-height: 46vh; overflow: visible; font-family: inherit; }
.sk-expr { font-size: 40px; font-weight: 900; fill: var(--ink); font-variant-numeric: tabular-nums; }
.sk-expr.sk-op { fill: #5a6b7d; font-weight: bold; }
.sk-expr.sk-ans.done { fill: var(--blue); }
.sk-cherry { transition: opacity .4s; }
.sk-cherry-stem { fill: none; stroke: #3b6d11; stroke-width: 2.5; stroke-linecap: round; }
.sk-cherry-ball { fill: #e0484f; }
.sk-cherry-num { fill: var(--white); font-weight: 900; }
.sk-frame { fill: var(--white); stroke: #9fc6ea; stroke-width: 1.5; transition: stroke .3s, stroke-width .3s; }
.sk-frame.glow { stroke: var(--blue); stroke-width: 3.5; }
.sk-grid { stroke: #d6e7f6; stroke-width: 1; }
.sk-ten-label { font-size: 15px; font-weight: bold; fill: var(--blue); transition: opacity .3s; }
.sk-stage .hide { opacity: 0; }
.sk-fruit { transition: transform .6s cubic-bezier(.4, 1.3, .5, 1), opacity .5s; }
.sk-fruit.eaten { opacity: .15; }
.sk-ring { fill: none; stroke: var(--blue); stroke-width: 2.5; opacity: 0; transition: opacity .3s; }
.sk-fruit.mark .sk-ring { opacity: 1; }
.sk-stage.sk-instant .sk-fruit, .sk-stage.sk-instant .sk-cherry, .sk-stage.sk-instant .sk-frame, .sk-stage.sk-instant .sk-ten-label { transition: none; }
.sk-msg { min-height: 3.3em; }
.sk-buttons { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 4px; padding-bottom: 12px; }
.sk-buttons .big { margin: 0; width: 100%; font-size: 1.15rem; }
.sk-again { min-height: 40px; padding: 0 16px; background: none; color: var(--blue); font-weight: bold; font-size: 0.95rem; }

/* こたえの 行（sakuranbo/board.js。① みる・② ほじょりん で 同じ。2026-11-23 ユーザーの 声で 下に 1行 つくった） */
.sk-divider { stroke: #c9ddf0; stroke-width: 1.5; stroke-dasharray: 5 5; }
.sk-tile-box { fill: var(--blue); }
.sk-tile-text { font-size: 28px; font-weight: 900; fill: var(--white); font-variant-numeric: tabular-nums; }
.sk-caption { font-size: 13px; font-weight: bold; fill: #5a6b7d; }
.sk-row-num { font-size: 32px; font-weight: 900; fill: var(--ink); font-variant-numeric: tabular-nums; }
.sk-row-op { font-size: 28px; font-weight: bold; fill: #5a6b7d; }
.sk-row-ans.done, .sk-expr.sk-ans.done { fill: var(--blue); }
.sk-slot { fill: none; stroke: #c9ddf0; stroke-width: 2; stroke-dasharray: 4 3; }
.sk-arow, .sk-top, .sk-cherry-help { transition: opacity .35s; }
.sk-arow.hide { opacity: 0; }
.sk-stage .dim { opacity: .3; }

/* ② ほじょりん（sakuranbo/sakuranbo-help.js）。レベルの ボタン・けっかは くもワープざんの ほじょりんと 同じ（.help-*） */
.sk-help { gap: 8px; padding-top: 8px; }
.sk-help .play-head { margin-bottom: 0; }
.sk-help-stage { max-height: 40vh; }
/* とく ときは 画面の 高さで とめて、絵の ほうが ちぢむ（iPhone SE でも テンキーの いちばん下まで 入る） */
.sk-help.playing { min-height: 0; max-height: 100dvh; padding-bottom: 8px; }
/* 絵（SVG）の 高さは board.js の fitStage が はっきり 指定する（iPhone で max-height だけだと 絵が ちぢまず、
   わくの 下の かなが カードの 外に はみ出して といかけに かさなった。2026-11-23）。カードも いっしょに ちぢめる */
.sk-help.playing .sk-card { flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.sk-help.playing .sk-help-stage { flex: 0 1 auto; min-height: 0; max-height: 40vh; }
@media (max-height: 640px) { .sk-help.playing .sk-help-stage { max-height: 36vh; } }
.sk-help.playing .key { height: clamp(46px, 7.4dvh, 72px); }
.sk-help.playing .pad { gap: 7px; }
.sk-box-shape { fill: var(--white); stroke: #9fc6ea; stroke-width: 2; }
.sk-box.ball .sk-box-shape { fill: #fde7e7; stroke: #e0484f; stroke-dasharray: 5 3; }
.sk-box-text { font-size: 24px; font-weight: 900; fill: var(--ink); font-variant-numeric: tabular-nums; }
.sk-box.selected .sk-box-shape { stroke: var(--blue); stroke-width: 4; stroke-dasharray: none; fill: var(--blue-light); }
.sk-box.ok .sk-box-shape { stroke: var(--green); stroke-dasharray: none; fill: #e7f6ee; }
.sk-box.ok .sk-box-text { fill: var(--green); }
.sk-box.ball.given .sk-box-shape, .sk-box.ball.ok .sk-box-shape { fill: #e0484f; stroke: #e0484f; }
.sk-box.ball.given .sk-box-text, .sk-box.ball.ok .sk-box-text { fill: var(--white); }
.sk-box.given .sk-box-shape { stroke-dasharray: none; }
.sk-box.shake { transform-box: fill-box; }
.sk-kana { font-size: 12px; font-weight: bold; fill: #a32d2d; }
/* レベル1：いま 入れる 枠と つながる 10の わく（太線）と、その下の かな */
.sk-frame.focus { stroke: var(--blue); stroke-width: 4; }
.sk-frame-label { font-size: 16px; font-weight: 900; fill: var(--blue); transition: opacity .2s; }
.sk-frame-label.hide { opacity: 0; }
.sk-line { font-size: 22px; font-weight: bold; fill: var(--ink); transition: opacity .3s; }
.sk-line.hide { opacity: 0; }
.sk-prompt { margin: 0; text-align: center; font-weight: bold; word-break: keep-all; overflow-wrap: anywhere;
  /* といかけは 大きく（2026-11-23 ユーザー）。高さは さきに 決めて、ヒント（2行）が 出ても テンキーが ずれない ように */
  height: 2.9rem; display: flex; align-items: center; justify-content: center;
  font-size: clamp(1.35rem, 6.6vw, 1.75rem); line-height: 1.25; }
.sk-prompt.hint { color: #b26b00; font-size: clamp(0.95rem, 4.4vw, 1.1rem); line-height: 1.3; }

@media (prefers-reduced-motion: reduce) {
  .sk-fruit, .sk-cherry, .sk-frame, .sk-ring, .sk-ten-label, .sk-line, .sk-arow, .sk-top, .sk-cherry-help { transition: none; }
}

/* ===== わざ「うごく ずけい」（かいはつちゅう。js/zukei/）=====
   画面の 部品は .zk-○○、図（SVG）の 中は .zk-fig .z-○○（zukei-view.js が「z-」を つける）。
   色は 空と雲 ＋ おひさま（注目する 点と 線）。字は アプリと 同じ */
.zk {
  --zk-ink: #1e2b3c; --zk-ink-soft: #5a6b7d; --zk-blue: #2b7de9; --zk-blue-pale: #e3f3ff;
  --zk-sky-deep: #b9dff6; --zk-sun: #f08a00; --zk-sun-pale: #ffe2a8;
  gap: 12px; padding-top: 12px;
}
.zk-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.zk-head .back-link { justify-self: start; }
.zk-head-mid { font-weight: bold; font-size: 0.95rem; color: var(--zk-blue); }
.zk-count { justify-self: end; font-weight: bold; font-size: 0.9rem; color: var(--zk-ink-soft); font-variant-numeric: tabular-nums; }
.zk-title { margin: 0; font-size: 1.3rem; line-height: 1.4; }
.zk-dev { margin: 0; font-size: 0.8rem; font-weight: bold; color: #854f0b; background: #fdf1d8; border-radius: 10px; padding: 6px 10px; }
.zk-card { background: var(--white); border-radius: 20px; padding: 14px 16px; box-shadow: 0 3px 0 #c9e3f7; }
.zk-card > h2 { margin: 0 0 4px; font-size: 0.95rem; color: var(--zk-blue); }
.zk-problem p { margin: 0; line-height: 1.75; }
.zk-problem ol { margin: 6px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; line-height: 1.75; }
.zk-problem li { padding-left: 2.2em; text-indent: -2.2em; }
.zk-stage { padding: 8px 6px 10px; }
.zk-fig { display: block; width: 100%; height: auto; font-family: inherit; }
.zk-fig.z-solid { touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; }
.zk-slider { display: flex; align-items: center; gap: 10px; padding: 6px 10px 0; min-height: 40px; }
.zk-slider label { font-size: 0.8rem; font-weight: bold; color: var(--zk-ink-soft); white-space: nowrap; }
.zk-slider input { flex: 1; min-width: 0; height: 28px; accent-color: var(--zk-sun); }
.zk-slider.off { visibility: hidden; }
.zk-steps { display: flex; flex-direction: column; gap: 10px; }
.zk-step-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.zk-dots { display: flex; gap: 6px; }
.zk-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--zk-sky-deep); }
.zk-dots i.done { background: var(--zk-blue); }
.zk-dots i.now { background: var(--zk-sun); transform: scale(1.35); }
.zk-steps .zk-step-title { margin: 0; font-size: 1.2rem; line-height: 1.4; color: var(--zk-ink); }
.zk-step-body { margin: 0; min-height: 5.25em; line-height: 1.75; }
.zk-step-body b, .zk-fb b { color: var(--zk-sun); }
.zk-formula { background: var(--zk-blue-pale); border-radius: 14px; padding: 10px 14px; font-weight: bold; font-variant-numeric: tabular-nums; overflow-x: auto; white-space: nowrap; line-height: 1.9; }
.zk-formula[hidden], .zk-nav[hidden], .zk-btn[hidden] { display: none; }
.zk-formula .ans { display: inline-block; margin-top: 2px; padding: 0 10px; border-radius: 10px; background: var(--zk-sun); color: #fff; }
.zk-nav { display: flex; gap: 10px; }
.zk-btn { font: inherit; font-weight: bold; border: 0; border-radius: 999px; padding: 12px 16px; min-height: 48px; cursor: pointer; background: var(--zk-blue-pale); color: var(--zk-blue); }
.zk-btn.main { flex: 1; background: var(--zk-blue); color: #fff; box-shadow: 0 3px 0 var(--blue-dark); }
.zk-btn.main:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--blue-dark); }
.zk-btn:disabled { opacity: .4; cursor: default; }
.zk-note { margin: 0; font-size: 0.8rem; color: var(--zk-ink-soft); text-align: center; }
/* 題材ごとの 一覧 */
.zk-list { display: flex; flex-direction: column; gap: 8px; }
.zk-item { font: inherit; text-align: left; display: flex; align-items: center; gap: 12px; width: 100%; border: 0; border-radius: 16px; padding: 12px 14px; min-height: 60px; background: var(--white); color: var(--zk-ink); box-shadow: 0 3px 0 #c9e3f7; cursor: pointer; }
.zk-item-no { flex: none; width: 34px; height: 34px; border-radius: 50%; background: #ba7517; color: #fff; font-weight: bold; display: flex; align-items: center; justify-content: center; }
.zk-item-text { flex: 1; display: flex; flex-direction: column; }
.zk-item-name { font-weight: bold; line-height: 1.4; }
.zk-item-sub { font-size: 0.8rem; color: var(--zk-ink-soft); }
.zk-item-mark { flex: none; font-size: 0.75rem; font-weight: bold; border-radius: 999px; padding: 2px 10px; color: #854f0b; background: #fdf1d8; }
.zk-item-mark.done { color: #fff; background: var(--zk-sun); }
/* たしかめ問題 */
.zk-answers { display: flex; flex-direction: column; gap: 10px; }
.zk-arow { display: flex; align-items: center; gap: 10px; }
.zk-arow label { font-weight: bold; width: 2.2em; }
.zk-arow input { font: inherit; font-weight: bold; font-size: 1.25rem; width: 8em; max-width: 50%; padding: 8px 12px; border: 2px solid var(--zk-sky-deep); border-radius: 12px; color: var(--zk-ink); background: #fff; font-variant-numeric: tabular-nums; }
.zk-unit { font-weight: bold; }
.zk-judge { font-size: 1.5rem; font-weight: bold; width: 1.2em; text-align: center; }
.zk-judge.ok { color: #d9342b; }
.zk-judge.ng { color: var(--zk-blue); }
.zk-fb { margin: 0; min-height: 1.75em; font-weight: bold; }
.zk-hint { margin: 0; background: var(--zk-blue-pale); border-radius: 14px; padding: 8px 14px; line-height: 1.7; }
.zk-hint b { color: var(--zk-blue); margin-right: 6px; }
.zk-hints { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
/* ---- 図の中：文字 ---- */
.zk-fig text {font-family:inherit; font-weight:900; fill:var(--zk-ink); paint-order:stroke; stroke:#fff; stroke-width:5px; stroke-linejoin:round; text-anchor:middle; dominant-baseline:central}
.zk-fig text.z-v {font-size:23px}                         /* 頂点の名前 */
.zk-fig text.z-va {font-size:25px; fill:var(--zk-sun)}       /* 注目する点の名前 */
.zk-fig text.z-fv {font-size:21px; fill:var(--zk-ink-soft)}  /* うすい名前 */
.zk-fig text.z-len {font-size:20px; fill:var(--zk-sun)}      /* 長さ（注目） */
.zk-fig text.z-lenb {font-size:20px; fill:var(--zk-blue)}    /* 長さ（あたえられた数） */
.zk-fig text.z-small {font-size:21px}
.zk-fig text.z-q {font-size:21px; fill:var(--zk-ink-soft)}
.zk-fig text.z-big {font-size:27px; fill:var(--zk-sun)}
.zk-fig text.z-read {font-size:26px; fill:var(--zk-sun)}
.zk-fig text.z-ell {font-size:24px; font-style:italic; font-weight:700}
.zk-fig text.z-tick {font-size:17px; fill:var(--zk-ink-soft); font-weight:700}
.zk-fig text.z-mk {font-size:17px}
.zk-fig text.z-mk.z-s {font-size:12px; stroke-width:3px}
/* ---- 図の中：線と面 ---- */
.zk-fig .z-ground {stroke:var(--zk-ink); stroke-width:3; stroke-linecap:round}
.zk-fig .z-rect {fill:rgba(43,127,196,.16); stroke:var(--zk-blue); stroke-width:3; stroke-linejoin:round}
.zk-fig .z-sq, .zk-fig .z-trap {fill:rgba(43,127,196,.10); stroke:var(--zk-blue); stroke-width:3; stroke-linejoin:round}
.zk-fig .z-sq.z-fade {opacity:.3}
.zk-fig .z-ghost {fill:none; stroke:var(--zk-blue); stroke-width:1.5; stroke-dasharray:5 5; opacity:.45}
.zk-fig .z-old {fill:none; stroke:var(--zk-blue); stroke-width:2; stroke-dasharray:5 5; opacity:.55}
.zk-fig .z-trail {fill:none; stroke:var(--zk-sun); stroke-width:4.5; stroke-linecap:round; stroke-linejoin:round}
.zk-fig .z-band {fill:none; stroke:var(--zk-sun); opacity:.3}
.zk-fig .z-sweep {fill:var(--zk-sun-pale); opacity:.75}
.zk-fig .z-radius {stroke:var(--zk-sun); stroke-width:3; stroke-linecap:round}
.zk-fig .z-radius.z-dash {stroke-dasharray:6 6; stroke-width:2.5}
.zk-fig .z-diag {stroke:var(--zk-blue); stroke-width:2; stroke-dasharray:5 5}
.zk-fig .z-pivot {fill:#fff; stroke:var(--zk-ink); stroke-width:3}
.zk-fig .z-adot {fill:var(--zk-sun); stroke:#fff; stroke-width:3}
.zk-fig .z-bdot {fill:var(--zk-blue); stroke:#fff; stroke-width:3}
.zk-fig .z-sec1 {fill:#9fd0f2}.zk-fig .z-sec2 {fill:#6fb4e6}.zk-fig .z-sec3 {fill:#c5e3f7}
.zk-fig .z-tri {fill:var(--zk-sun-pale); stroke:var(--zk-sun); stroke-width:2.5; stroke-linejoin:round}
.zk-fig .z-tri2 {fill:none; stroke:var(--zk-sun); stroke-width:3; stroke-linejoin:round}
.zk-fig .z-t1 {fill:var(--zk-sun-pale); stroke:var(--zk-sun); stroke-width:2.5; stroke-linejoin:round}
.zk-fig .z-t2 {fill:#bfe0f6; stroke:var(--zk-blue); stroke-width:2.5; stroke-linejoin:round}
.zk-fig .z-t3 {fill:#7dbbe8; stroke:#1b5e9b; stroke-width:2.5; stroke-linejoin:round}
.zk-fig .z-target {fill:none; stroke:var(--zk-sun); stroke-width:2; stroke-dasharray:6 6}
.zk-fig .z-ghosttri {fill:none; stroke:var(--zk-sun); stroke-width:2.5; stroke-dasharray:5 5; opacity:.8}
.zk-fig .z-dim {opacity:.35}
.zk-fig .z-par {stroke:var(--zk-sun); stroke-width:2.5; stroke-dasharray:7 6}
.zk-fig .z-thin {stroke:var(--zk-ink-soft); stroke-width:2}
.zk-fig .z-base {stroke:var(--zk-blue); stroke-width:6; stroke-linecap:round}
.zk-fig .z-hl {stroke:var(--zk-sun); stroke-width:6; stroke-linecap:round}
.zk-fig .z-hgt {stroke:var(--zk-ink); stroke-width:2.5; stroke-dasharray:4 5}
.zk-fig .z-ang {fill:none; stroke:var(--zk-ink); stroke-width:2.5}
.zk-fig .z-ang.z-sun {stroke:var(--zk-sun); stroke-width:3.5}
.zk-fig .z-grid {stroke:var(--zk-sky-deep); stroke-width:1.5}
.zk-fig .z-axis {stroke:var(--zk-ink); stroke-width:2.5; stroke-linecap:round}
.zk-fig .z-gline {fill:none; stroke:var(--zk-sun); stroke-width:5; stroke-linejoin:round; stroke-linecap:round}
.zk-fig .z-gline.z-blue {stroke:var(--zk-blue)}
.zk-fig .z-gfaint {fill:none; stroke:var(--zk-sun); stroke-width:2.5; opacity:.4; stroke-dasharray:5 5}
.zk-fig .z-level {stroke:var(--zk-blue); stroke-width:3; stroke-dasharray:8 6}
.zk-fig .z-guide {stroke:var(--zk-ink-soft); stroke-width:2; stroke-dasharray:4 5}
.zk-fig .z-mark {fill:none; stroke:var(--zk-ink); stroke-width:2}
.zk-fig .z-paper {fill:#f4faff; stroke:var(--zk-blue); stroke-width:3; stroke-linejoin:round}
.zk-fig .z-flap {fill:#f4faff; stroke:var(--zk-blue); stroke-width:3; stroke-linejoin:round}
.zk-fig .z-flap.z-back {fill:#cfe6f7}
.zk-fig .z-crease {stroke:var(--zk-ink); stroke-width:2.5; stroke-dasharray:10 5 2 5}
.zk-fig .z-same {stroke:var(--zk-sun); stroke-width:6; stroke-linecap:round}
.zk-fig .z-same.z-dash {stroke-dasharray:3 9}
.zk-fig .z-sqmark {fill:none; stroke:var(--zk-ink); stroke-width:2}
.zk-fig .z-land {fill:#cfe9c9; stroke:none}      /* 土地（左） */
.zk-fig .z-land2 {fill:#f4faff; stroke:none}     /* 土地（右） */
.zk-fig .z-frame {fill:none; stroke:var(--zk-blue); stroke-width:3; stroke-linejoin:round}
.zk-fig .z-wheel {fill:rgba(240,138,0,.18); stroke:var(--zk-sun); stroke-width:3}
.zk-fig .z-over {fill:var(--zk-sun); opacity:.55}
/* ---- 立体 ---- */
.zk-fig .z-edge {stroke:var(--zk-blue); stroke-width:3; stroke-linecap:round}
.zk-fig .z-edge.z-hid {stroke-width:2; stroke-dasharray:5 6; opacity:.6}
.zk-fig .z-cut {stroke:var(--zk-sun); stroke-width:4.5; stroke-linecap:round}
.zk-fig .z-ext {stroke:var(--zk-sun); stroke-width:2.5; stroke-dasharray:6 6; stroke-linecap:round}
.zk-fig .z-ext.z-blue {stroke:var(--zk-blue)}
.zk-fig .z-ext.z-faint {opacity:.45}
.zk-fig .z-face {fill:var(--zk-sun); opacity:.38}
.zk-fig .z-face.z-blue {fill:#6fb4e6; opacity:.4}
.zk-fig .z-face.z-small {fill:var(--zk-sun); opacity:.6}
.zk-fig .z-pyr {stroke:#1b5e9b; stroke-width:4.5; stroke-linecap:round}
.zk-fig .z-pdot {fill:var(--zk-sun); stroke:#fff; stroke-width:2.5}

/* ===== しゃしんで もんだいを おくる（screens/request.js。画面の案 https://claude.ai/artifact/EX5ADx6vuqzptdTSsYxrRH） ===== */
.rq { gap: 14px; }
.rq-top { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.rq-back { min-height: 44px; border: none; background: none; color: var(--blue-dark); font: inherit; font-weight: bold; font-size: 1rem; padding: 0 4px; }
.rq-dots { display: flex; gap: 6px; align-items: center; }
.rq-dots span { width: 8px; height: 8px; border-radius: 4px; background: #c9e3f7; }
.rq-dots span.done { background: var(--blue); }
.rq-dots span.on { width: 22px; background: var(--blue); }
.rq-title { margin: 0; font-size: 1.5rem; color: var(--blue); text-align: center; line-height: 1.35; }
.rq-lead { margin: 0; text-align: center; font-size: 1rem; line-height: 1.6; }
.rq-small { margin: 0; text-align: center; font-size: 0.85rem; color: #4a5a6e; line-height: 1.5; }
.rq-info { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--blue-light); color: var(--blue-dark); font-size: 0.85rem; line-height: 1.5; }
.rq-error { margin: 0; padding: 10px 12px; border-radius: 12px; background: #fff4e6; color: #8a4a00; border: 2px solid #e8a317; font-size: 0.95rem; line-height: 1.5; font-weight: bold; }
.rq .buttons { margin-top: auto; }
.big.rq-wait { background: #c9e3f7; color: var(--blue-dark); font-size: 1.05rem; }
.big.rq-wait:disabled { opacity: 1; }

/* ① おくる まえに よんでね */
.rq-notices { display: flex; flex-direction: column; padding: 4px 16px; }
.rq-notice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--blue-light); }
.rq-notice:last-child { border-bottom: none; }
.rq-notice p { margin: 0; font-size: 1.05rem; line-height: 1.6; }
.rq-notice-icon { flex: none; width: 42px; height: 42px; border-radius: 50%; background: var(--blue-light); display: flex; align-items: center; justify-content: center; font-size: 1.3rem; }

/* ② しゃしんを とる */
.rq-file { display: none; }
.rq-examples { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.rq-example { background: var(--white); border-radius: 16px; padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.rq-example.good { border: 3px solid var(--blue); }
.rq-example.bad { border: 2px solid #f1d6cc; }
.rq-example b { font-size: 0.95rem; }
.rq-example.good b { color: var(--blue-dark); }
.rq-example.bad b { color: #993c1d; }
.rq-paper { position: relative; width: 100%; height: 120px; border-radius: 8px; padding: 10px; box-sizing: border-box; display: flex; flex-direction: column; gap: 7px; background: #fbfdff; border: 1px solid #c9e3f7; overflow: hidden; }
.rq-example.bad .rq-paper { background: #f6efe6; border-color: #f1d6cc; }
.rq-line { height: 6px; width: 85%; border-radius: 3px; background: #b9c6d4; }
.rq-line.short { width: 62%; }
.rq-shape { width: 0; height: 0; margin: 6px auto 0; border-left: 34px solid transparent; border-right: 34px solid transparent; border-bottom: 46px solid #8fcaf5; }
.rq-example.bad .rq-shape { border-bottom-color: #c9b8a6; }
.rq-name { align-self: stretch; font-size: 0.65rem; font-weight: bold; color: #712b13; border-bottom: 6px solid #d85a30; line-height: 1.2; }
.rq-face { position: absolute; right: 8px; bottom: 8px; width: 32px; height: 32px; border-radius: 50%; background: #f5c4b3; border: 2px solid #d85a30; }

/* ③ しゃしんを たしかめよう */
.rq-preview { display: block; width: 100%; padding: 8px; border-radius: 16px; background: var(--white); border: 2px solid #c9e3f7; }
.rq-preview img { display: block; width: 100%; max-height: 30vh; object-fit: contain; border-radius: 8px; background: #eef3f8; }
.rq-check-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.rq-check-head span { font-size: 0.85rem; color: #4a5a6e; flex: none; }
.rq-checks { display: flex; flex-direction: column; gap: 6px; }
.rq-check { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 8px 12px; border-radius: 14px; background: var(--white); border: 2px solid #c9e3f7; color: var(--ink); text-align: left; font-size: 1rem; line-height: 1.4; }
.rq-check.on { background: var(--blue-light); border-color: var(--blue); }
.rq-box { flex: none; width: 28px; height: 28px; border-radius: 8px; border: 2px solid #8fa6bd; background: var(--white); color: var(--white); display: flex; align-items: center; justify-content: center; font-weight: bold; }
.rq-check.on .rq-box { background: var(--blue); border-color: var(--blue); }
.rq-zoom { position: fixed; inset: 0; z-index: 50; background: rgba(30, 43, 60, .92); display: flex; flex-direction: column; gap: 12px; padding: calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom)); overflow: auto; }
.rq-zoom img { width: 100%; height: auto; border-radius: 8px; background: var(--white); }
.rq-zoom .big { flex: none; }

/* ④ どこが わからなかった？ */
.rq-reasons { display: flex; flex-direction: column; gap: 6px; }
.rq-reason { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 50px; padding: 6px 12px; border-radius: 14px; background: var(--bg); border: 2px solid #c9e3f7; color: var(--ink); font-size: 1.05rem; font-weight: bold; text-align: left; }
.rq-reason.on { background: var(--blue); border-color: var(--blue); color: var(--white); }
.rq-dot { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 3px solid #8fa6bd; box-sizing: border-box; }
.rq-reason.on .rq-dot { border-color: var(--white); background: var(--white); box-shadow: inset 0 0 0 3px var(--blue); }

/* おくったよ */
.rq-done-art { text-align: center; font-size: 5rem; line-height: 1.1; margin-top: 12px; }
.rq-done-line { margin: 0; padding: 12px 0; font-size: 1.05rem; line-height: 1.6; border-bottom: 1px solid var(--blue-light); }
.rq-done-line:last-child { border-bottom: none; }

/* じぶんの きろく の 入口カード */
.rq-entry { display: flex; flex-direction: column; gap: 12px; padding: 0 0 14px; overflow: hidden; border: 3px solid var(--blue); box-shadow: 0 0 0 4px var(--blue-light); border-radius: 20px; }
.rq-entry > :not(.rq-entry-band) { margin-left: 14px; margin-right: 14px; }
.rq-entry > .big { width: auto; }
.rq-entry-band { display: flex; align-items: center; gap: 10px; background: var(--blue); color: var(--white); padding: 12px 14px; }
.rq-entry-band h2 { margin: 0; font-size: 1.15rem; }
.rq-entry-icon { font-size: 1.4rem; }
.rq-entry-text { margin: 0; font-size: 0.95rem; line-height: 1.6; }
.rq-entry-full { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--blue-light); color: var(--blue-dark); font-weight: bold; font-size: 0.95rem; line-height: 1.5; }
.rq-entry-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.85rem; color: #4a5a6e; }
.rq-entry-link { min-height: 40px; border: none; background: none; padding: 0; color: var(--blue-dark); font: inherit; font-weight: bold; display: inline-flex; align-items: center; gap: 6px; }
.rq-new { background: #ee6f00; color: var(--white); border-radius: 10px; padding: 2px 8px; font-size: 0.75rem; }

/* おくった もんだい */
.rq-item { display: flex; flex-direction: column; gap: 8px; border: 2px solid #c9e3f7; }
.rq-item.t-blue { border: 3px solid var(--blue); }
.rq-item.t-orange { background: #fff4e6; border-color: #e8a317; }
.rq-item-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.rq-item-title { font-size: 0.8rem; color: #4a5a6e; }
.rq-chip { border-radius: 10px; padding: 3px 10px; font-size: 0.85rem; font-weight: bold; background: #eef3f8; color: #4a5a6e; }
.rq-chip.t-blue { background: var(--blue); color: var(--white); }
.rq-chip.t-mizu { background: var(--blue-light); color: var(--blue-dark); }
.rq-chip.t-orange { background: #ffe2c2; color: #8a4a00; }
.rq-item-msg { margin: 0; font-size: 1rem; line-height: 1.5; }
.big.rq-video { text-align: center; text-decoration: none; font-size: 1.1rem; padding: 12px; }

/* ---- 九九 ダッシュ：じかんが かかった 九九（screens/result.js の kukuCard。waza/kuku.js）---- */
.kk-card { background: var(--white); border-radius: var(--radius); padding: 12px 12px 14px; }
.kk-card h2 { font-size: 1rem; margin: 0 0 8px; }
.kk-grid { display: grid; grid-template-columns: 2.2em repeat(8, minmax(0, 1fr)); gap: 3px; font-variant-numeric: tabular-nums; }
.kk-h { font-size: .75rem; color: #4f6b85; display: flex; align-items: center; justify-content: center; min-height: 1.4em; }
.kk-dan { justify-content: flex-start; }
.kk-cell { position: relative; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 6px; font-size: .85rem; font-weight: bold; }
.kk-l0 { background: var(--blue-light); color: #1b4f8f; }
.kk-l1 { background: #fac775; color: #5a3505; }
.kk-l2 { background: #f5c4b3; color: #7a2c12; box-shadow: inset 0 0 0 2px #d85a30; }
.kk-miss::after { content: ""; position: absolute; top: 3px; right: 3px; width: 6px; height: 6px; border-radius: 50%; background: #d85a30; }
.kk-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 10px; font-size: .78rem; color: #4f6b85; }
.kk-legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 4px; }
.kk-legend i.kk-dot { width: 8px; height: 8px; border-radius: 50%; background: #d85a30; vertical-align: 1px; }
.kk-slow-head { margin: 12px 0 4px; font-size: .9rem; font-weight: bold; }
.kk-slow { display: flex; flex-wrap: wrap; gap: 6px; }
.kk-slow span { background: var(--blue-light); border-radius: 999px; padding: 3px 12px; font-size: 1rem; font-weight: bold; white-space: nowrap; }
.kk-slow small { font-weight: normal; margin-left: 6px; font-size: .8rem; color: #4f6b85; }

/* ===== たいかい（2026-11-24。先生が 開く・はしる子 10人まで。sql/014・online/taikai.js） ===== */
/* 部屋を つくる 前の 3つめ（先生だけ） */
.big.role-choice .role-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.role-badge {
  font-size: 0.72rem; font-weight: bold; padding: 2px 8px; border-radius: 999px;
  background: var(--blue-light); color: var(--blue-dark); border: 2px solid var(--sky);
}
/* はしる子の ロビー・けっかの 札 */
.taikai-badge {
  align-self: center; margin: 6px 0 0; padding: 4px 16px; border-radius: 999px;
  background: var(--blue); color: var(--white); font-weight: bold; font-size: 0.95rem;
}

/* はしる子の スマホ：自分の コースの 上に「いま 5い / 10にん」（race-view.js の mode 'me'） */
.race-standing { display: flex; align-items: center; gap: 8px; padding: 0 2px 4px; }
.stand-rank {
  font-weight: bold; color: var(--white); background: var(--blue); border-radius: 999px;
  padding: 2px 12px; font-size: 0.85rem; white-space: nowrap;
}
.stand-rank:empty { display: none; }
.stand-rank b { font-size: 1.15rem; }
.stand-goal { margin-left: auto; font-size: 0.78rem; font-weight: bold; color: var(--blue-dark); white-space: nowrap; }

/* 先生の テレビ（ロビー・みまもり・けっか）：#app の 560px から はみ出して 画面の はば いっぱい。
   字の 大きさは 画面の はばに あわせる（ノートPC でも 大きな テレビでも おなじ 見え方） */
.taikai-tv {
  width: calc(100vw - 32px - env(safe-area-inset-left) - env(safe-area-inset-right));
  max-width: 1600px; align-self: center;
  gap: clamp(10px, 1.5vw, 24px); padding: clamp(8px, 1.4vw, 24px) 0;
  font-size: clamp(16px, 1.35vw, 28px);
}
.taikai-tv .card { padding: clamp(14px, 1.6vw, 30px); }
.tv-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.tv-title { display: flex; flex-direction: column; min-width: 0; }
.tv-title h1 { margin: 0; font-size: 2.1em; line-height: 1.15; }
.tv-brand, .tv-unit { margin: 0; font-weight: bold; color: var(--blue-dark); font-size: 0.85em; }
.tv-unit-pill {
  margin: 0; display: flex; align-items: center; gap: 0.6em; padding: 0.5em 1.2em;
  border-radius: 999px; background: var(--white); border: 3px solid var(--sky); font-weight: bold; font-size: 1.05em;
}
.tv-unit-pill small { color: var(--blue-dark); font-size: 0.75em; }
.tv-note {
  margin: 0; max-width: 26em; padding: 0.5em 1em; border-radius: 14px;
  background: var(--white); color: var(--blue-dark); font-weight: bold; font-size: 0.85em; line-height: 1.5;
}
.tv-body { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: clamp(12px, 1.6vw, 28px); }
@media (max-width: 760px) { .tv-body { grid-template-columns: minmax(0, 1fr); } }
.tv-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px 16px; flex-wrap: wrap; }
.tv-ready { margin: 0; font-weight: bold; color: var(--blue-dark); }
.tv-buttons { display: flex; gap: 12px; flex-wrap: wrap; margin-left: auto; }
.tv-buttons .big { width: auto; padding: 0.6em 1.6em; font-size: 1.1em; }
.tv-cheer { display: flex; align-items: center; gap: 0.6em; flex-wrap: wrap; }
.tv-cheer-label { font-weight: bold; color: var(--blue-dark); }

/* ロビー：大きな あいことば ＋ 5れつの 一覧 */
.tv-code { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 0.6em; }
.tv-code .code-label { margin: 0; font-size: 1.2em; font-weight: bold; color: var(--ink); }
.tv-code-digits { margin: 0; display: flex; gap: 0.25em; }
.tv-code-digits span {
  display: inline-flex; align-items: center; justify-content: center; width: 1.15em; height: 1.5em;
  font-size: 3.4em; font-weight: 900; border-radius: 0.22em; background: var(--blue); color: var(--white);
  font-variant-numeric: tabular-nums;
}
.tv-how { margin: 0; font-weight: bold; }
.tv-code .note { margin: 0; font-size: 0.8em; }
.tv-players { display: flex; flex-direction: column; gap: 0.6em; }
.tv-players .step { font-size: 1.3em; margin: 0; }
.taikai-tv .player-list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.6em; }
.taikai-tv .player-list li {
  flex-direction: column; justify-content: center; gap: 0.25em; padding: 0.5em 0.3em;
  min-height: 5em; font-size: 1em; text-align: center; border: 2px solid var(--sky);
}
.taikai-tv .player-list li small { margin-left: 0; font-size: 0.7em; }
.taikai-tv .player-list li .player-name { overflow-wrap: anywhere; }
.taikai-tv .player-list li.host-role,
.taikai-tv .player-list li.note { grid-column: 1 / -1; flex-direction: row; justify-content: flex-start; min-height: 0; }
.taikai-tv .player-list li.host-role small { margin-left: auto; }
.taikai-tv .player-list li.empty-seat {
  background: transparent; border: 2px dashed #c9dff2; color: #667; font-weight: normal; font-size: 0.85em;
}

/* みまもり：10本の 大きな コース（race-view.js の mode 'tv'） */
.tv-chips { display: flex; gap: 0.6em; flex-wrap: wrap; }
.tv-chip { padding: 0.3em 1em; border-radius: 999px; background: var(--white); border: 3px solid var(--sky); font-weight: bold; }
.tv-chip b { font-size: 1.4em; margin-left: 0.2em; color: var(--blue-dark); }
.tv-chip.finished { background: var(--blue); border-color: var(--blue); color: var(--white); }
.tv-chip.finished b { color: var(--white); }
.tv-chip.retired { border-color: #c3ccd6; color: #4a5a6e; }
.tv-chip.retired b { color: #4a5a6e; }
.race.course.race-tv { padding: 0.5em 1em; gap: 0; }
.race-tv .race-lane {
  height: clamp(38px, 5.4vh, 64px); font-size: 1em; gap: 0.6em;
  grid-template-columns: 6.5em minmax(0, 1fr) 1.6em 9.5em;
}
.race-tv .race-name { font-size: 1.15em; font-weight: bold; color: var(--ink); }
.race-tv .race-lane.me .race-name { color: var(--ink); }
.race-tv .runner { top: 50%; transform: translateY(-50%); left: calc((100% - 1.9em) * var(--p)); }
.race-tv .runner .avatar { zoom: 1.4; } /* テレビでは どうぶつを 大きく（hop の transform と ぶつからない zoom で） */
.taikai-tv .stamp { font-size: 0.75em; }
.race-tv .race-tail,
.race-tv .race-lane.finished .race-tail { font-size: 1.05em; }
.race-tv .race-lane.retired .race-tail { grid-column: auto; font-size: 0.9em; }
.race-tv .race-lane.retired .race-goal { display: block; visibility: hidden; }

/* けっか：表彰台（左）と 一覧（右） */
.tv-podium { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.tv-podium .title { margin: 0 0 0.4em; font-size: 1.4em; }
.tv-podium .podium { width: 100%; zoom: 1.35; } /* テレビでは 表彰台を 大きく */
.tv-ranks .rank-list { gap: 0.4em; }
.tv-ranks .rank-row { padding: 0.35em 0.8em; box-shadow: none; border-bottom: 2px solid var(--blue-light); border-radius: 0; }
.tv-ranks .rank-name { font-size: 1.1em; }
.tv-ranks .rank-time { font-size: 1em; }
.tv-how { word-break: keep-all; overflow-wrap: anywhere; }
/* 高さの ひくい ノートPC（1024×640 など）でも、下の ボタンまで 1画面に おさめる */
@media (max-height: 760px) {
  .taikai-tv { font-size: clamp(14px, 1.15vw, 22px); gap: 8px; padding: 6px 0; }
  .taikai-tv .card { padding: 12px 16px; }
  .tv-title h1 { font-size: 1.8em; }
  .tv-code-digits span { font-size: 2.8em; }
  .taikai-tv .player-list li { min-height: 4.2em; padding: 0.35em 0.3em; }
  .taikai-tv .stamp-bar .stamp { padding-top: 4px; padding-bottom: 4px; }
  .tv-ranks .rank-row { padding: 0.2em 0.8em; }
  .tv-podium .podium { zoom: 1.15; }
  .tv-podium .title { margin-bottom: 0.2em; }
}

/* ===== くもだま そろばん（③ ほじょりん なし。2026-11-25。pads/soroban.js） =====
   たまは オリジナルの 丸い「くもだま」：はりに ついたら ブルー、はなれて いたら 白。
   こうさん で こたえを 見せる ときは ついた たまを オレンジに（.revealed） */
.pad.soroban-pad { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.soroban-pad .sb-svg {
  display: block; width: 100%; height: auto;
  max-height: calc(100dvh - 330px); /* 上の 帯・問題・ボタンの ぶんを のこす（iPhone SE でも 1画面に） */
  min-height: 0;
  touch-action: none;               /* たまを さわっても 画面が スクロール・拡大しない */
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.sb-frame { fill: var(--sb-frame, #f6fbff); stroke: var(--sb-frame-line, var(--blue)); stroke-width: 4; }
.sb-rod { stroke: var(--sb-rod, #b9d3ea); stroke-width: 5; stroke-linecap: round; }
.sb-beam { fill: var(--sb-beam, var(--blue)); }
.sb-mark { fill: var(--sb-mark, #fff); }
.sb-place { font-size: 13px; font-weight: 700; fill: #1e2b3c; }
.sb-bead { cursor: pointer; transition: transform .12s ease-out; }
.sb-hit { fill: transparent; }
.sb-body { fill: var(--sb-off, #fff); stroke: var(--sb-off-line, var(--sky)); stroke-width: 2.5; }
.sb-shine { fill: #fff; opacity: 0; }
.sb-bead.on .sb-body { fill: var(--sb-on, var(--blue)); stroke: var(--sb-on-line, var(--blue-dark)); stroke-width: 2; }
.sb-bead.on .sb-shine { opacity: .45; }
.soroban-pad.revealed .sb-bead.on .sb-body { fill: #ff9f43; stroke: #d9771f; }
.soroban-pad.revealed .sb-bead { cursor: default; }
.sb-buttons { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.sb-buttons .key { height: clamp(52px, 8dvh, 70px); font-size: min(1.15rem, 4.6vw); white-space: nowrap; }
.sb-buttons .sb-clear { color: #1e2b3c; border: 3px solid var(--blue); box-shadow: none; }
/* せの ひくい スマホ（iPhone SE）：問題の まわりの すきまを へらして、そろばんを 大きく（たまを さわりやすく） */
@media (max-height: 640px) { .soroban-pad .sb-svg { max-height: calc(100dvh - 290px); } }
@media (prefers-reduced-motion: reduce) { .sb-bead { transition: none; } }
/* くもだま そろばん × たいせん・ゴースト（2026-11-25）：上に レースの 行（2〜4人）や ゴーストの 2行が あると、
   すすみぐあいの 棒（10px）より 高い ぶん そろばんを ひくく する（--lanes-h は play.js が はかって 入れる）。
   たいせんでは レースの 行を すこし ほそく し、せの ひくい 画面では 問題の 上の「36 を おいて…」を はぶく（式で わかる） */
.play.soroban-play .soroban-pad .sb-svg { max-height: calc(100dvh - 320px - var(--lanes-h, 10px)); }
.play.race-play.soroban-play .race-lane { height: 24px; }
.play.race-play.soroban-play .runner { top: 1px; }
.play.race-play.soroban-play .runner .avatar { --avatar-size: 22px !important; }
@media (max-height: 760px) {
  .play.race-play.soroban-play .problem-prompt { display: none; }
  .play.race-play.soroban-play .problem-area { gap: 6px; }
  .play.race-play.soroban-play .soroban-pad .sb-svg { max-height: calc(100dvh - 236px - var(--lanes-h, 10px)); }
}
@media (max-height: 640px) {
  .play.soroban-play:not(.race-play) .soroban-pad .sb-svg { max-height: calc(100dvh - 280px - var(--lanes-h, 10px)); }
  .play.race-play.soroban-play .soroban-pad .sb-svg { max-height: calc(100dvh - 218px - var(--lanes-h, 10px)); }
}

/* ===== くもだま そろばん「① みる」（waza/soroban-see.js。2026-11-25） =====
   しるし（waza/soroban-board.js）：go＝これから うごく たま（オレンジの わ と 矢印）、
   moved＝いま うごいた たま（オレンジ）、look＝みてほしい たま（水色の わ） */
.sbs-see { gap: 10px; padding-top: 8px; }
.sbs-card { padding: 10px 12px 10px; border-radius: 22px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.sbs-question { font-size: 1.9rem; font-weight: 900; line-height: 1.2; font-variant-numeric: tabular-nums; }
.sbs-question b { color: var(--blue); }
.sbs-card .sb-svg {
  display: block; width: 100%; height: auto;
  max-height: clamp(170px, calc(100dvh - 505px), 360px);
  user-select: none; -webkit-user-select: none;
}
.sbs-readout { font-weight: bold; color: #5a6b7d; font-size: 0.95rem; }
.sbs-readout b { color: var(--ink); font-size: 1.25rem; margin-left: 2px; font-variant-numeric: tabular-nums; }
.sbs-explain { min-height: 4.9em; }
.sbs-formula { font-size: 1.05rem; color: var(--blue-dark); }
.sbs-steps { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.sbs-steps .see-step { font-size: min(0.72rem, 3.2vw); }
.sb-ring { fill: none; stroke: transparent; stroke-width: 3.5; }
.sb-arrow { fill: none; stroke: #ff8a1f; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.sb-bead.still { cursor: default; }
.sb-bead.look .sb-ring { stroke: var(--sky); stroke-dasharray: 5 4; }
.sb-bead.go .sb-ring { stroke: #ff8a1f; }
.sb-bead.go .sb-body { stroke: #ff8a1f; }
.sb-bead.moved .sb-body { fill: #ffb054; stroke: #d9771f; }
.sb-bead.moved:not(.on) .sb-body { fill: #ffe3c4; stroke: #ffb054; }
@media (max-height: 760px) {
  .sbs-question { font-size: 1.5rem; }
  .sbs-explain { min-height: 0; font-size: 0.95rem; padding: 8px 12px; }
  .sbs-see { gap: 7px; }
}
.sbs-see .see-buttons .big { white-space: nowrap; }
@media (max-height: 760px) {
  .sbs-card { padding: 6px 10px; }
  .sbs-card .sb-svg { max-height: max(140px, calc(100dvh - 440px)); }
  .sbs-readout { font-size: 0.85rem; }
  .sbs-readout b { font-size: 1.05rem; }
  .sbs-see .seg-btn { min-height: 38px; }
  .sbs-see .see-step { padding: 3px 1px; }
  .sbs-formula { font-size: 0.95rem; min-height: 0; }
  .sbs-see .see-buttons { padding-bottom: 8px; }
  .sbs-see .see-buttons .big { min-height: 50px; padding-top: 8px; padding-bottom: 8px; font-size: 1rem; }
}

/* ===== くもだま そろばん「② ほじょりん」（waza/soroban-help.js。2026-11-25） =====
   光る たま（.sb-glow の 中の go）は わが ゆっくり ふくらむ。ちがう たまを さわったら ゆれる（.sb-nudge） */
.sbh-help { gap: 10px; padding-top: 8px; }
.sbh-help.playing { max-height: 100dvh; }
.sbh-card { flex: 0 1 auto; }
.sbh-card .sb-svg { max-height: clamp(180px, calc(100dvh - 330px), 420px); touch-action: none; -webkit-touch-callout: none; }
.sbh-card .sbs-question small { font-size: 1.1rem; font-weight: bold; }
.sbh-prompt { margin: 0; text-align: center; font-size: clamp(1.05rem, 4.8vw, 1.3rem); font-weight: 900; line-height: 1.45; min-height: 2.9em; word-break: keep-all; overflow-wrap: anywhere; color: var(--ink); }
.sb-glow .sb-bead.go .sb-ring { animation: sb-pulse 1.1s ease-in-out infinite; }
@keyframes sb-pulse { 0%, 100% { stroke-width: 3.5; } 50% { stroke-width: 7; } }
.sb-nudge .sb-bead.go { animation: sb-shake .35s ease-in-out; }
.sb-nudge .sb-bead.go .sb-ring { stroke: #e8590c; }
@keyframes sb-shake { 0%, 100% { translate: 0 0; } 25% { translate: -6px 0; } 75% { translate: 6px 0; } }
@media (max-height: 640px) {
  .sbh-help { gap: 6px; }
  .sbh-card .sb-svg { max-height: calc(100dvh - 300px); }
  .sbh-prompt { min-height: 2.6em; font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .sb-glow .sb-bead.go .sb-ring, .sb-nudge .sb-bead.go { animation: none; }
}

/* ===== くもだま そろばん「④ きえる そろばん」（waza/soroban-kieru.js。2026-11-25） =====
   うすい（.sb-faint）・みえない（.sb-hidden）でも さわれる ところ（.sb-hit）は のこる。こたえあわせで はっきり */
.sbk-kieru { gap: 8px; padding-top: 8px; }
.sbk-streak { margin: 0; display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: bold; font-size: 0.9rem; color: #5a6b7d; min-height: 1.6em; }
.sbk-dots { display: flex; align-items: center; justify-content: center; gap: 6px; }
.sbk-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--sky); box-sizing: border-box; }
.sbk-dot.on { background: var(--blue); border-color: var(--blue); }
.sbk-count { font-weight: bold; font-size: 0.9rem; margin-left: 4px; }
.sbk-num { min-width: 130px; padding: 2px 18px; border: 4px solid var(--blue); border-radius: 20px; background: var(--white); font-size: clamp(2.4rem, 11vw, 3.2rem); font-weight: 900; line-height: 1.25; text-align: center; font-variant-numeric: tabular-nums; }
.sbk-num.pop { animation: sbk-pop .25s ease-out; }
@keyframes sbk-pop { from { transform: scale(.7); opacity: .3; } to { transform: scale(1); opacity: 1; } }
.sbk-card .sb-svg { max-height: clamp(170px, calc(100dvh - 430px), 380px); touch-action: none; -webkit-touch-callout: none; }
.sb-faint .sb-body, .sb-faint .sb-shine, .sb-faint .sb-deco { opacity: .22; }
.sb-hidden .sb-body, .sb-hidden .sb-shine, .sb-hidden .sb-deco { opacity: 0; }
.sb-svg .sb-body, .sb-svg .sb-deco { transition: opacity .3s; }
.sbk-note { margin: 0; text-align: center; font-weight: bold; font-size: 0.95rem; line-height: 1.5; min-height: 3em; word-break: keep-all; overflow-wrap: anywhere; }
.sbk-buttons { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-bottom: 12px; }
.sbk-buttons .big { margin: 0; white-space: nowrap; font-size: clamp(1rem, 4.6vw, 1.25rem); }
.sbk-result { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; width: 100%; }
.sbk-result p { margin: 0; }
.sbk-expr { font-weight: 900; background: var(--blue-light); border-radius: 12px; padding: 2px 12px; font-variant-numeric: tabular-nums; }
.sbk-verdict { font-size: 1.6rem; font-weight: 900; }
.sbk-verdict.ok { color: #1a8a4a; }
.sbk-verdict.ng { color: #d9480f; }
.sbk-sub { font-weight: bold; font-size: 0.95rem; }
.sbk-get { display: flex; flex-direction: column; gap: 2px; width: 100%; box-sizing: border-box; background: #fff4e8; border: 2px solid #ff9f43; border-radius: 16px; padding: 8px 12px; font-size: 0.85rem; font-weight: bold; }
.sbk-get b { font-size: 1.05rem; }
.sbk-kieru .seg-btn:disabled { opacity: .5; }
@media (max-height: 700px) {
  .sbk-num { font-size: 2.1rem; padding: 0 14px; }
  .sbk-card .sb-svg { max-height: max(140px, calc(100dvh - 400px)); }
  .sbk-note { min-height: 0; font-size: 0.88rem; }
  .sbk-buttons { padding-bottom: 8px; }
  .sbk-buttons .big { padding-top: 12px; padding-bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) { .sbk-num.pop { animation: none; } .sb-svg .sb-body { transition: none; } }
.sbk-dots[hidden], .sbk-num[hidden], .sbk-result[hidden] { display: none; }
/* こたえあわせ では そろばんを すこし 小さく して、けっかと ボタンまで 1画面に */
.sbk-card.checking .sb-svg { max-height: clamp(140px, calc(100dvh - 560px), 300px); }
.sbk-row { display: flex; gap: 8px; }
.sbk-row .big { flex: 1; }
@media (max-height: 700px) {
  .sbk-card.checking .sb-svg { max-height: max(110px, calc(100dvh - 470px)); }
  .sbk-verdict { font-size: 1.3rem; }
  .sbk-get { padding: 5px 10px; }
}

/* ===== くもだま そろばん：たまの きせかえ（2026-11-25。waza/soroban-skins.js・soroban-board.js） =====
   .sb-skin-○○ が 色の 変数を きめる（くもだま は 変数なし＝前の まま）。はりに ついた たま＝こい 色 は どれも 同じ。
   にじだま は いちの くらいから あお・みどり・むらさき・ピンク（うごく たまの しるしの オレンジと まざらない 色）。 */
.sb-skin-niji { --sb-frame: #ffffff; }
.sb-skin-niji .sb-c0 { --sb-on: #2b7de9; --sb-on-line: #1b5bb3; --sb-off-line: #a9cdf6; }
.sb-skin-niji .sb-c1 { --sb-on: #23a56a; --sb-on-line: #187a4e; --sb-off-line: #9fdcbf; }
.sb-skin-niji .sb-c2 { --sb-on: #8a5cd6; --sb-on-line: #6840ad; --sb-off-line: #cdb8f0; }
.sb-skin-niji .sb-c3 { --sb-on: #e0558f; --sb-on-line: #b83a6e; --sb-off-line: #f4b5cf; }
.sb-skin-hoshi {
  --sb-frame: #1e2b3c; --sb-frame-line: #0f1a2a; --sb-rod: #3a4d68; --sb-beam: #ffd24a; --sb-mark: #1e2b3c;
  --sb-on: #ffd24a; --sb-on-line: #d99a00; --sb-off: #2c3e57; --sb-off-line: #5b7aa6;
}
.sb-star { fill: #5b7aa6; }
.sb-bead.on .sb-star { fill: #fff8d6; }
.sb-skin-houseki {
  --sb-frame: #f3f8ff; --sb-frame-line: #1b5bb3; --sb-rod: #c4d8ee; --sb-beam: #1b5bb3;
  --sb-on: #1f6fd6; --sb-on-line: #154f9e; --sb-off: #ffffff; --sb-off-line: #93bbe4;
}
.sb-facet-top { fill: #eef5fd; }
.sb-facet-bottom { fill: #dde9f7; opacity: .7; }
.sb-sparkle { fill: #fff; opacity: 0; }
.sb-bead.on .sb-facet-top { fill: #6fb2f2; }
.sb-bead.on .sb-facet-bottom { fill: #154f9e; opacity: .55; }
.sb-bead.on .sb-sparkle { opacity: 1; }
/* うごいた たま・こうさん の こたえ（オレンジ）の ときは かざりを けす（オレンジが よく 見える ように） */
.sb-bead.moved .sb-deco, .soroban-pad.revealed .sb-bead.on .sb-deco { visibility: hidden; }

/* ===== たまの きせかえ の 画面（waza/soroban-skin.js） ===== */
.sbx-skin { gap: 12px; padding-top: 8px; }
.sbx-preview { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px; }
.sbx-preview .sb-svg { width: 100%; max-width: 230px; max-height: calc(100dvh - 600px); min-height: 150px; touch-action: none; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
.sbx-name { margin: 4px 0 0; font-size: 1.4rem; }
.sbx-note { margin: 0; color: #4a5b70; font-size: 0.95rem; }
.sbx-try { margin: 0; color: #4a5b70; font-size: 0.8rem; }
.sbx-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.sbx-option {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 2px 8px;
  border-radius: 16px; background: var(--white); border: 3px solid var(--white); box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.sbx-option[aria-pressed="true"] { border-color: var(--blue); }
.sbx-option svg { width: 52px; height: 52px; display: block; }
.sbx-option-name { font-size: 0.78rem; font-weight: bold; white-space: nowrap; }
.sbx-option-tag { font-size: 0.68rem; color: var(--blue-dark); min-height: 1.2em; white-space: nowrap; }
@media (max-width: 360px) { .sbx-grid { gap: 5px; } .sbx-option { padding: 8px 0 6px; } .sbx-option svg { width: 44px; height: 44px; } .sbx-option-name { font-size: 0.64rem; } .sbx-option-tag { font-size: 0.58rem; } }

/* くもだま そろばん：ゲームらしい 動き（2026-11-25。waza/soroban-fx.js）
   B はりで ぽよん（.sb-pop-down＝5だま・.sb-pop-up＝1だま。はりに つく がわを 中心に つぶれる）＋ きらっ（.sb-spark）
   D せいかい で ぴょん（.sb-hop／.sb-hop-big）と わくが 光る（.sb-flash／.sb-flash-big）。動かすのは 中の g（.sb-body-g） */
.sb-body-g { transform-box: fill-box; transform-origin: 50% 50%; }
.sb-pop-down .sb-body-g { transform-origin: 50% 100%; animation: sb-pop .16s ease-out .1s; }
.sb-pop-up .sb-body-g { transform-origin: 50% 0%; animation: sb-pop .16s ease-out .1s; }
@keyframes sb-pop { 0% { transform: scale(1, 1); } 40% { transform: scale(1.1, .8); } 75% { transform: scale(.97, 1.05); } 100% { transform: scale(1, 1); } }
.sb-sparks { pointer-events: none; }
.sb-spark { transform-box: fill-box; transform-origin: 50% 50%; opacity: 0; animation: sb-spark .36s ease-out both; }
@keyframes sb-spark { 0% { opacity: 1; transform: translate(0, 0) scale(.5); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.1); } }
.sb-hop .sb-body-g { animation: sb-hop .16s ease-out both; }
.sb-hop-big .sb-body-g { animation: sb-hop-big .18s ease-out both; }
@keyframes sb-hop { 0% { transform: translateY(0); } 45% { transform: translateY(-7px); } 100% { transform: translateY(0); } }
@keyframes sb-hop-big { 0% { transform: translateY(0) scale(1); } 45% { transform: translateY(-12px) scale(1.06); } 100% { transform: translateY(0) scale(1); } }
.sb-flash .sb-frame { animation: sb-frame-flash .25s ease-out; }
.sb-flash-big .sb-frame { animation: sb-frame-flash-big .25s ease-out; }
@keyframes sb-frame-flash { 40% { stroke: #8fcaf5; fill: #e3f3ff; } }
@keyframes sb-frame-flash-big { 40% { stroke: #ff9f43; fill: #fff1df; } }
.sb-skin-hoshi.sb-flash .sb-frame, .sb-skin-hoshi.sb-flash-big .sb-frame { animation-name: sb-frame-flash-night; } /* ほしだま は 夜の わく */
@keyframes sb-frame-flash-night { 40% { stroke: #ffd24a; fill: #36507a; } }
@media (prefers-reduced-motion: reduce) {
  .sb-pop-down .sb-body-g, .sb-pop-up .sb-body-g, .sb-hop .sb-body-g, .sb-hop-big .sb-body-g,
  .sb-flash .sb-frame, .sb-flash-big .sb-frame, .sb-spark { animation: none; }
}

/* くもだま そろばん：ほんばん を いちばん 目立たせる・きえる そろばん の「？？？」・そろばんの せってい（2026-11-25） */
.wz-stage.wz-hero {
  margin: 10px 10px 6px; border: none; border-radius: 16px;
  background: #ee6f00; color: #fff; box-shadow: 0 4px 0 #b35500; padding: 14px 14px;
}
.wz-stage.wz-hero:first-child { border-top: none; }
.wz-stage.wz-hero:not(:disabled):active { background: #d96400; transform: translateY(2px); box-shadow: 0 2px 0 #b35500; }
.wz-stage.wz-hero .wz-stage-no { background: #fff; color: #ee6f00; }
.wz-stage.wz-hero .wz-stage-name { font-size: 1.3rem; }
.wz-stage.wz-hero .wz-stage-sub, .wz-stage.wz-hero .wz-stage-right { color: #fff; }
.wz-stage.wz-teaser { opacity: 1; background: repeating-linear-gradient(135deg, #fafcff 0 8px, #f1f6fc 8px 16px); }
.wz-stage.wz-teaser .wz-stage-no { background: #dfe8f2; color: #7f8ea0; }
.wz-stage.wz-teaser .wz-stage-name, .wz-stage.wz-teaser .wz-stage-sub, .wz-stage.wz-teaser .wz-stage-right { color: #7f8ea0; }
.sbx-section { margin: 4px 2px -4px; font-size: 1rem; color: var(--ink); }
.sbx-menu { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; }
.sbx-menu-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sbx-menu-name { font-weight: bold; white-space: nowrap; }
.sbx-menu .seg { flex: 0 0 auto; }
.sbx-menu .seg-btn { min-height: 40px; padding: 0 14px; }
.sbx-menu-note { margin: 2px 0 0; font-size: 0.78rem; color: #4a5b70; }
.wz-stage.wz-hero { width: calc(100% - 20px); box-sizing: border-box; }
.wz-stage-best { margin-top: 2px; font-size: 0.85rem; font-weight: bold; word-break: keep-all; overflow-wrap: anywhere; }
.wz-stage.wz-hero .wz-stage-best { font-size: 0.95rem; }
/* せってい の 行（そろばんの せってい）：段階と 見分けやすく うすい グレーの 地（2026-11-25、ユーザー） */
.wz-stage.wz-settings { background: #eef1f5; }
.wz-stage.wz-settings:not(:disabled):active { background: #e2e7ee; }
.wz-stage.wz-settings .wz-stage-no { background: #fff; color: #5b6b7d; box-shadow: inset 0 0 0 1.5px #c9d3de; }
.wz-stage.wz-settings .wz-stage-name { color: #3d4b5c; }
.wz-stage.wz-settings .wz-stage-right { color: #5b6b7d; }

/* ===== くもだま そろばん ウォーミングアップ（W-06 かずで・W-07 そろばんで。2026-11-25） =====
   おてほん（waza/soroban-sample.js）：問題の a を 小さな べつの そろばんで（となりの ぼうに おくと「73」に 見えるため）。
   かずで：1〜9 の ボタンだけ（3れつ。あわせて 5 は 1〜4 で 2れつ。そろばんの 絵は 出さない＝2026-11-25 ユーザー）。
   そろばんで：おてほん ＋ じぶんの ぼう 1本（ほんばんと 同じ「ぜんぶ もどす」「こたえる」） */
.sb-sample { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: none; }
.sb-sample[hidden] { display: none; }
.sb-sample .sb-svg {
  display: block; height: 112px; width: auto; pointer-events: none;
  border: 3px solid var(--sb-frame-line, var(--blue)); border-radius: 12px; background: var(--sb-frame, #f6fbff);
}
.sb-sample .sb-frame { stroke: none; }
.sb-sample .sb-place { display: none; }
.sb-sample-label { font-size: .75rem; font-weight: 700; color: #5b6b7d; }
.sb-sample-num { font-size: 1.3rem; font-weight: 900; line-height: 1; }
.pad.choice-pad.warm-keys { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding-bottom: 4px; }
.pad.choice-pad.warm-keys.many { grid-template-columns: repeat(3, 1fr); }
.pad.choice-pad.warm-keys .key.choice-key { height: clamp(60px, 10dvh, 88px); font-size: 2.1rem; }
.pad.choice-pad.warm-keys:not(.many) .key.choice-key { height: clamp(80px, 14dvh, 120px); }
.sb-board-row { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 0; }
.sb-board-row > .sb-svg { flex: 1 1 auto; min-width: 0; }
.sb-sample-plus { font-size: 1.8rem; font-weight: 900; flex: none; }
.sb-sample-plus[hidden] { display: none; }
.soroban-pad.with-sample .sb-board-row > .sb-svg {
  flex: 0 1 auto; width: auto; height: calc(100dvh - 330px); max-height: 440px;
  border: 4px solid var(--sb-frame-line, var(--blue)); border-radius: 20px; background: var(--sb-frame, #f6fbff); box-sizing: border-box;
}
.soroban-pad.with-sample .sb-board-row > .sb-svg .sb-frame { stroke: none; }
@media (max-height: 640px) { .soroban-pad.with-sample .sb-board-row > .sb-svg { height: calc(100dvh - 290px); } }
.soroban-pad.with-sample .sb-sample .sb-svg { width: auto; height: 132px; max-height: none; }
@media (max-height: 640px) {
  .pad.choice-pad.warm-keys .key.choice-key { height: clamp(52px, 9dvh, 70px); font-size: 1.8rem; }
  .sb-sample .sb-svg { height: 84px; }
  .soroban-pad.with-sample .sb-sample .sb-svg { height: 104px; }
}

/* ===== くもだま そろばん ① みる「5と 10」・ゆびづかい（2026-11-25。waza/soroban-see.js・waza/soroban-hand.js） =====
   そろばんの みぎに 手の 絵（オリジナル。ミトンの ような 形。つかう 指を オレンジに）と「おやゆびで いれる ↑」。
   「5と 10」は 下に うごかす じゅんばん（いまの うごきは オレンジの わく、おわった ものは うすく）。
   そろばんの 高さ（--sbs-h）は 画面の 高さから のこりを ひいて きめる（iPhone SE でも 1画面に） */
.sbs-see { --sbs-h: clamp(150px, calc(100dvh - 530px), 330px); }
.sbs-see.mode-both { --sbs-h: clamp(130px, calc(100dvh - 660px), 300px); }
.sbs-board-row { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 0; }
.sbs-board-row .sb-svg { flex: 0 1 auto; width: auto; height: var(--sbs-h); max-height: none; max-width: calc(100% - 104px); }
.sbs-ops[hidden] { display: none; }
.sbs-ops .seg-btn { font-size: min(0.9rem, 3.8vw); }
.sbs-finger { flex: none; width: 98px; display: flex; flex-direction: column; align-items: center; gap: 2px; background: #fff4e8; border: 2px solid #ff8a1f; border-radius: 14px; padding: 6px 4px; text-align: center; }
.sbs-finger[hidden] { display: flex; visibility: hidden; }
.sbs-finger-words { font-weight: 900; color: #9a4700; font-size: 0.85rem; line-height: 1.35; word-break: keep-all; overflow-wrap: anywhere; }
.sb-hand { display: block; flex: none; }
.sb-hand-part, .sb-hand-finger { fill: #ffe2c8; stroke: #c98a5a; stroke-width: 3; }
.sb-hand-finger.on { fill: #ff8a1f; stroke: #c96a10; }
.sbs-moves { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.sbs-moves:empty { display: none; }
.sbs-move { display: flex; align-items: center; gap: 6px; background: var(--white); border: 2px solid transparent; border-radius: 12px; padding: 1px 10px; font-size: 0.85rem; font-weight: bold; }
.sbs-move.on { border-color: #ff8a1f; background: #fff4e8; }
.sbs-move.done { opacity: 0.55; }
.sbs-move-no { width: 1.1em; text-align: center; font-weight: 900; }
.sbs-move-text { overflow-wrap: anywhere; }
@media (max-height: 760px) {
  .sbs-see { --sbs-h: max(120px, calc(100dvh - 430px)); }
  .sbs-see.mode-both { --sbs-h: max(110px, calc(100dvh - 500px)); }
  .sbs-see.mode-both .sbs-formula { display: none; }
  .sbs-finger { width: 84px; padding: 4px 2px; }
  .sbs-finger .sb-hand { width: 38px; height: 42px; }
  .sbs-finger-words { font-size: 0.78rem; }
  .sbs-board-row .sb-svg { max-width: calc(100% - 90px); }
  .sbs-move { font-size: 0.76rem; padding: 0 8px; }
  .sbs-move .sb-hand { width: 14px; height: 15px; }
}
@media (max-height: 700px) {
  /* せの ひくい スマホ（iPhone SE）：じゅんばんの リストは はぶく（指の 絵と ことばで わかる） */
  .sbs-see.mode-both .sbs-moves { display: none; }
  .sbs-see.mode-both { --sbs-h: max(110px, calc(100dvh - 450px)); }
}

/* ===== くもだま そろばん「じゆうに さわる」（フリーモード。2026-11-25。waza/soroban-free.js） =====
   いまの かずを ぼうの 真上に 1けたずつ 大きく（左の 0 は うすく）、下に 数と よみかた。
   ぼうは 1〜5本。おだいは オレンジの 点線の わく（できたら こい オレンジ） */
.sbf-free { --sbf-h: clamp(160px, calc(100dvh - 420px), 440px); gap: 10px; padding-top: 8px; }
.sbf-rods-row { display: flex; align-items: center; gap: 8px; }
.sbf-rods-label { font-weight: bold; font-size: 0.9rem; white-space: nowrap; }
.sbf-rods { flex: 1; }
.sbf-rods .seg-btn { font-size: 1.1rem; font-weight: 900; }
.sbf-card { padding: 8px 10px 10px; border-radius: 22px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.sbf-board { width: min(100%, calc(var(--sbf-h) * 340 / 352)); display: flex; flex-direction: column; }
.sbf-board .sb-svg { display: block; width: 100%; height: auto; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
/* ぼうの 位置（waza/soroban-board.js の rodX：はばの 6/340 を のこして 等分）に そろえる */
.sbf-digits { display: grid; grid-template-columns: repeat(var(--rods, 3), 1fr); padding: 0 1.8%; }
.sbf-digit { text-align: center; font-size: clamp(2rem, 9vw, 3.4rem); font-weight: 900; line-height: 1.1; color: var(--blue-dark); font-variant-numeric: tabular-nums; }
.sbf-digit.lead { color: #c4d6e8; }
.sbf-value { display: flex; align-items: baseline; justify-content: center; gap: 10px; flex-wrap: wrap; font-weight: bold; }
.sbf-number { font-size: 1.3rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.sbf-yomi { font-size: 1rem; color: #5a6b7d; }
.sbf-odai { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #fff4e8; border: 2px dashed #ff8a1f; border-radius: 16px; padding: 8px 14px; font-weight: bold; }
.sbf-odai[hidden] { display: none; }
.sbf-odai b { font-size: 1.5rem; color: #b35900; margin-left: 2px; font-variant-numeric: tabular-nums; }
.sbf-odai.done { background: #ffb054; border-style: solid; }
.sbf-odai.done b { color: #1e2b3c; }
.sbf-odai-count { font-size: 0.85rem; white-space: nowrap; }
.sbf-odai-text { white-space: nowrap; }
.sbf-free .see-buttons .big { white-space: nowrap; }
@media (max-height: 700px) {
  .sbf-free { --sbf-h: max(150px, calc(100dvh - 340px)); gap: 7px; }
  .sbf-digit { font-size: clamp(1.6rem, 8vw, 2.4rem); }
  .sbf-free .see-buttons .big { min-height: 50px; padding-top: 8px; padding-bottom: 8px; font-size: 1rem; }
  .sbf-free .seg-btn { min-height: 38px; }
}

/* ===== くもだま そろばん ほんばん：まちがいの 中身に あわせた ヒント（2026-11-25。waza/soroban.js の sorobanHint） =====
   問題の 上の ことば（「36 を おいて…」）の ところに 水色の わくで 出す。見なおして ほしい ぼうは 水色の 点線（.sb-hl）。
   ヒントが 出て いる あいだは そろばんを すこし ひくく して、ボタンが 画面から はみ出さない ように する */
.problem-prompt.sb-hint {
  display: flex; flex-direction: column; gap: 1px; text-align: left;
  background: #fff; border: 2px solid #4fb3f0; border-radius: 14px; padding: 6px 12px;
  color: #42566b; font-size: 0.85rem; line-height: 1.45; max-width: 100%;
}
.problem-prompt.sb-hint b { color: #1e2b3c; font-size: 1rem; word-break: keep-all; overflow-wrap: anywhere; }
.problem-prompt.sb-hint > span { word-break: keep-all; overflow-wrap: anywhere; }
.sb-hint-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.quit.giveup.play-giveup.in-sb-hint { position: static; flex: none; padding: 3px 12px; font-size: 0.85rem; }
.sb-hl { fill: #4fb3f0; fill-opacity: 0.12; stroke: #4fb3f0; stroke-width: 3; stroke-dasharray: 8 6; pointer-events: none; }
.play.soroban-play.soroban-hinted .soroban-pad .sb-svg { max-height: calc(100dvh - 370px - var(--lanes-h, 10px)); }
@media (max-height: 640px) {
  .play.soroban-play.soroban-hinted:not(.race-play) .soroban-pad .sb-svg { max-height: calc(100dvh - 330px - var(--lanes-h, 10px)); }
  .problem-prompt.sb-hint { font-size: 0.78rem; padding: 4px 10px; }
  .problem-prompt.sb-hint b { font-size: 0.9rem; }
}

/* ===== くもだま そろばん「くりあがり とっくん」（2026-11-26。waza/soroban-toku.js） =====
   マップ：かた A〜H の カード 2れつ（★ は きいろ、G・H は E と F を マスター するまで うすい）。
   ★1 さくせん：そろばんの 下に さくせんの カード（しつもん 1つずつ・えらぶ ボタン・わけ）。
   うごかす あいだは カードを かくして ほじょりん あり と 同じ といかけ */
.tk-toku { gap: 10px; padding-top: 8px; }
.tk-lead { margin: 0; text-align: center; font-size: 0.85rem; font-weight: bold; color: #42566b; word-break: keep-all; overflow-wrap: anywhere; }
.tk-map { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tk-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
  background: var(--white); border: 2px solid transparent; border-radius: 16px; padding: 8px 10px; min-height: 96px;
  box-shadow: 0 3px 0 #c9e3f7; color: var(--ink); cursor: pointer;
}
.tk-card.master { border-color: #f5b800; }
.tk-card.locked { background: #eef1f4; opacity: .6; cursor: default; box-shadow: none; }
.tk-card-top { display: flex; align-items: center; gap: 6px; width: 100%; }
.tk-key { width: 26px; height: 26px; border-radius: 50%; background: var(--blue); color: var(--white); font-weight: 900; display: inline-flex; align-items: center; justify-content: center; }
.tk-card.locked .tk-key { background: #9aa8b6; }
.tk-master { margin-left: auto; background: #fff3c4; color: #8a6400; border-radius: 8px; padding: 0 6px; font-size: 0.7rem; font-weight: 900; }
.tk-name { font-size: 0.92rem; font-weight: 900; line-height: 1.3; word-break: keep-all; overflow-wrap: anywhere; }
.tk-example { font-size: 1.15rem; font-weight: 900; color: #1f66c9; font-variant-numeric: tabular-nums; }
.tk-stars span, .tk-result-stars span { color: #d5dde6; }
.tk-stars span.on, .tk-result-stars span.on { color: #f5b800; }
.tk-stars { font-size: 0.95rem; letter-spacing: 1px; }
.tk-lock { font-size: 0.7rem; font-weight: bold; color: #5a6b7d; }
.tk-note { margin: 0; text-align: center; font-size: 0.8rem; font-weight: bold; color: #5a6b7d; }
.tk-result-stars { margin: 0; text-align: center; font-size: 2.6rem; letter-spacing: 4px; }
.tk-toku .sbh-card .sb-svg { max-height: clamp(130px, calc(100dvh - 520px), 330px); }
.tk-toku.tk-moving .sbh-card .sb-svg { max-height: clamp(180px, calc(100dvh - 330px), 420px); }
.tk-plan { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 18px; }
.tk-plan[hidden], .tk-prompt[hidden], .tk-go[hidden], .tk-ask[hidden], .tk-choices[hidden] { display: none; }
.tk-plan-head { display: flex; align-items: center; justify-content: space-between; font-size: 0.85rem; font-weight: 900; color: #5a6b7d; }
.tk-dots { display: flex; gap: 5px; }
.tk-dots span { width: 11px; height: 11px; border-radius: 50%; background: #d5e9f8; }
.tk-dots span.done { background: #2bb673; }
.tk-dots span.now { background: #ff8a1f; }
.tk-ask { margin: 0; font-size: 1.08rem; font-weight: 900; line-height: 1.45; word-break: keep-all; overflow-wrap: anywhere; }
.tk-choices { display: grid; grid-template-columns: repeat(var(--n, 2), 1fr); gap: 8px; }
.tk-choice {
  min-height: 52px; border: 3px solid var(--blue); border-radius: 14px; background: var(--white); color: var(--blue-dark);
  font-size: 1.2rem; font-weight: 900; box-shadow: 0 3px 0 var(--blue-dark); white-space: nowrap; padding: 0 4px;
}
.tk-choice.right { background: #e7f8ef; border-color: #2bb673; color: #17784a; box-shadow: 0 3px 0 #17784a; }
.tk-choice.wrong, .tk-choice:disabled { color: #8a96a6; background: #eef1f5; border: 3px dashed #b8c2cf; box-shadow: none; }
.tk-why { margin: 0; min-height: 1.5em; font-size: 0.95rem; font-weight: bold; text-align: center; word-break: keep-all; overflow-wrap: anywhere; }
.tk-why.ok { color: #17784a; }
.tk-why.ng { color: #d93b3b; }
.tk-go { margin: 0; }
.tk-prompt.ng { color: #d93b3b; }
@media (max-height: 700px) {
  .tk-toku { gap: 7px; }
  .tk-card { min-height: 0; padding: 5px 8px; }
  .tk-example { font-size: 1rem; }
  .tk-toku .sbh-card .sb-svg { max-height: max(110px, calc(100dvh - 430px)); }
  .tk-choice { min-height: 44px; font-size: 1.05rem; }
  .tk-ask { font-size: 0.98rem; }
}
.tk-toku .see-head h1 { font-size: min(1.2rem, 5vw); white-space: nowrap; }
.tk-toku .see-count { white-space: nowrap; }
.tk-toku .help-chip { font-size: min(0.95rem, 3.9vw); white-space: nowrap; }
.tk-chip-star { font-size: 0.72rem; font-weight: 900; color: #b35900; }
/* かた（★1・★2・★3 を えらぶ）*/
.tk-type-stars span { color: #d5dde6; font-size: 1rem; }
.tk-type-stars span.on { color: #f5b800; }
.tk-type-ex { display: flex; align-items: baseline; justify-content: center; gap: 12px; padding: 14px; border-radius: 20px; }
.tk-type-ex span { font-weight: bold; color: #5a6b7d; }
.tk-type-ex b { font-size: 2.2rem; font-weight: 900; color: #1f66c9; font-variant-numeric: tabular-nums; }
.tk-star-rows { display: flex; flex-direction: column; gap: 10px; }
.tk-star-row {
  display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; border-radius: 18px;
  background: var(--white); border: 3px solid transparent; box-shadow: 0 3px 0 #c9e3f7; color: var(--ink); cursor: pointer;
}
.tk-star-row.next { border-color: #ff8a1f; }
.tk-star-row.done { border-color: #f5b800; }
.tk-star-row:disabled { opacity: .5; box-shadow: none; cursor: default; }
.tk-star-mark { font-size: 2rem; color: #d5dde6; line-height: 1; }
.tk-star-row.done .tk-star-mark { color: #f5b800; }
.tk-star-body { display: flex; flex-direction: column; gap: 2px; font-size: 0.85rem; font-weight: bold; color: #42566b; word-break: keep-all; overflow-wrap: anywhere; }
.tk-star-body b { font-size: 1.1rem; color: var(--ink); }
.tk-star-body small { font-size: 0.8rem; color: #5a6b7d; margin-left: 4px; }
/* ★2 みまもり：うごきの ● と「おっと！」*/
.tk-watch-head { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 0.85rem; font-weight: 900; color: #5a6b7d; }
.tk-warn { display: flex; align-items: center; gap: 10px; background: #fff4e8; border: 2px solid #ff8a1f; border-radius: 16px; padding: 6px 12px; }
.tk-warn[hidden] { display: none; }
.tk-warn-text { display: flex; flex-direction: column; gap: 2px; font-size: 0.9rem; font-weight: bold; color: #6b4a1f; line-height: 1.45; word-break: keep-all; overflow-wrap: anywhere; }
.tk-warn-text b { font-size: 1rem; color: #b35900; }
.tk-toku.tk-watch.tk-moving .sbh-card .sb-svg { max-height: clamp(170px, calc(100dvh - 400px), 400px); }
@media (max-height: 700px) {
  .tk-toku.tk-watch.tk-moving .sbh-card .sb-svg { max-height: max(120px, calc(100dvh - 380px)); }
  .tk-warn { padding: 4px 10px; }
  .tk-warn .sb-hand { width: 30px; height: 33px; }
  .tk-warn-text { font-size: 0.8rem; }
  .tk-star-row { padding: 8px 12px; }
}
/* ★3 スピード（ほんばんと 同じ パッド。ヒントは .sb-hint）*/
.tk-star-extra { font-size: 0.78rem; color: #b35900; }
.tk-speed-right { display: flex; flex-direction: column; align-items: flex-end; font-weight: bold; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.tk-speed-q { text-align: center; font-size: 2.2rem; }
.tk-speed-hint[hidden] { display: none; }
.tk-result-sub { margin: 0; text-align: center; font-weight: bold; color: #5a6b7d; }
.tk-toku .soroban-pad .sb-svg { max-height: calc(100dvh - 300px); }
.tk-toku.soroban-hinted .soroban-pad .sb-svg { max-height: calc(100dvh - 380px); }
@media (max-height: 640px) {
  .tk-toku .soroban-pad .sb-svg { max-height: calc(100dvh - 270px); }
  .tk-toku.soroban-hinted .soroban-pad .sb-svg { max-height: calc(100dvh - 340px); }
  .tk-speed-q { font-size: 1.7rem; }
}

/* ===== えいごで けいさん（W-08。くもチャレンジ「大人」タブ。2026-11-26）=====
   プレイ画面の 大きな スピーカー（screens/play.js の unit.listen）。おすと もう一度 読み上げる。読んでいる 間は ゆれる */
.listen-area { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; }
.listen-area.hidden { visibility: hidden; }
.listen-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  width: clamp(104px, 30vw, 132px); height: clamp(104px, 30vw, 132px); border-radius: 50%;
  background: var(--blue); color: var(--white); border: none; box-shadow: 0 6px 0 var(--blue-dark);
  cursor: pointer; touch-action: manipulation;
}
.listen-btn:active { transform: translateY(3px); box-shadow: 0 3px 0 var(--blue-dark); }
.listen-btn:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }
.listen-icon { font-size: clamp(2.2rem, 10vw, 2.8rem); line-height: 1; }
.listen-label { font-size: 0.78rem; font-weight: bold; white-space: nowrap; }
.listen-btn.talk { animation: listen-pulse 0.9s ease-in-out infinite; }
@keyframes listen-pulse { 50% { box-shadow: 0 6px 0 var(--blue-dark), 0 0 0 12px rgba(43, 125, 233, 0.22); } }
.listen-sub {
  margin: 0; max-width: 100%; padding: 6px 12px; border-radius: 10px; background: var(--blue-light);
  color: var(--blue-dark); font-weight: bold; font-size: clamp(1rem, 4.4vw, 1.15rem); text-align: center; overflow-wrap: anywhere;
}
.listen-sub[hidden] { display: none; }
.hint-text p { overflow-wrap: anywhere; } /* 英語の 長い 文（ねだん・わりあい）が はみ出さない ように */
@media (max-height: 640px) {
  .listen-btn { width: 88px; height: 88px; }
  .listen-icon { font-size: 2rem; }
}
/* まちがえて ヒントが 出たら スピーカーを 小さく（ヒントと テンキーの 場所を あける） */
.play.hint-play .listen-btn { width: 64px; height: 64px; box-shadow: 0 4px 0 var(--blue-dark); }
.play.hint-play .listen-icon { font-size: 1.6rem; }
.play.hint-play .listen-label { display: none; }
@media (prefers-reduced-motion: reduce) { .listen-btn.talk { animation: none; } }
/* せの ひくい スマホ（iPhone SE）：ヒントの 間は「こたえは？」を はぶき、スピーカーは もっと 小さく（ヒントの 英語を 読める ように） */
.play.hint-play .listen-area ~ .problem-prompt { display: none; }
@media (max-height: 640px) {
  .play.hint-play .listen-btn { width: 48px; height: 48px; box-shadow: 0 3px 0 var(--blue-dark); }
  .play.hint-play .listen-icon { font-size: 1.25rem; }
}
/* 英語の ヒントは 文が 長い（ねだん・わりあい）ので、字を すこし 小さく */
.listen-play .hint-text p { font-size: clamp(0.85rem, 3.9vw, 1.02rem); line-height: 1.38; }

/* ===== しごとの けいさん（W-09。くもチャレンジ「大人」タブ。2026-11-26）=====
   問題の 文（q.story）を 大きな 字で、その 下に 問うこと（.problem-prompt）、答えの 行（「□ 円」）。screens/play.js */
.story-area { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%; padding: 0 4px; }
.story-area[hidden] { display: none; }
.story-line {
  margin: 0; text-align: center; font-weight: bold; line-height: 1.3; color: var(--ink);
  font-size: clamp(1.35rem, 6.2vw, 1.8rem); font-variant-numeric: tabular-nums;
  word-break: keep-all; overflow-wrap: anywhere; /* 空白で おりかえす */
}
.problem-area.with-story { gap: 8px; }
.problem-area.with-story .problem-prompt { font-size: clamp(1rem, 4.6vw, 1.2rem); }
.problem-area.with-story .problem { font-size: clamp(2rem, 9vw, 2.8rem); }
/* まちがえて ヒントが 出たら、問題の 文を すこし 小さく（せの ひくい スマホで ヒントと テンキーが はいる ように） */
.play.hint-play .story-line { font-size: clamp(1.1rem, 5vw, 1.4rem); }
.play.hint-play .problem-area.with-story .problem { font-size: clamp(1.7rem, 7.5vw, 2.3rem); }
@media (max-height: 640px) {
  .story-line { font-size: clamp(1.2rem, 5.6vw, 1.5rem); }
  .play.hint-play .story-line { font-size: 1.05rem; }
  .play.hint-play .problem-area.with-story .problem-prompt { font-size: 0.95rem; }
}
/* せの ひくい スマホ（iPhone SE など）：ヒントの 3行が カードに おさまる ように 字と すきまを 小さく */
@media (max-height: 640px) {
  .problem-area.with-story { gap: 4px; }
  .problem-area.with-story .hint-formula { gap: 2px; }
  .problem-area.with-story .hint-formula p { font-size: 0.82rem; line-height: 1.35; }
  .problem-area.with-story .hint-formula p.last { font-size: 1rem; }
}
/* 「．」を おせない 問題（しごとの けいさん で 整数の 答えの 問題。pads/tenkey.js の setDot）：段は のこして 見えなく する */
.key.key-off { visibility: hidden; }
/* せの とても ひくい スマホ（320×568 など）：ヒントの 間は 問題の 文・問うこと・ヒントを もう すこし 小さく（文が 2行に なっても ヒントが 読める ように） */
@media (max-height: 600px) {
  .play.hint-play .story-line { font-size: 0.95rem; line-height: 1.25; }
  .play.hint-play .problem-area.with-story .problem-prompt { font-size: 0.88rem; }
  .play.hint-play .problem-area.with-story .problem { font-size: 1.6rem; }
  .problem-area.with-story .hint-formula p { font-size: 0.78rem; line-height: 1.3; }
  .problem-area.with-story .hint-formula p.last { font-size: 0.92rem; }
  .problem-area.with-story .hint-card { padding: 4px 6px; }
}
/* しごとの けいさん：テンキーと 入れかわる「A／B／同じ」の ボタン（pads/mixed.js）。
   ヒントの 間も ボタンを ひくく しすぎない（.play.hint-play .key の きまりより つよく。「同じ」が きれない ように） */
.pad.mixed-choice .key.choice-key { font-size: clamp(1.6rem, 7vw, 2rem); }
.play.hint-play .pad.mixed-choice .key.choice-key { height: clamp(64px, 11dvh, 100px); font-size: clamp(1.4rem, 6vw, 1.8rem); }
/* えらびかたの 名前が 長い ときの 2れつ（しごとの けいさん の テーマ。setup.js の o.grid）。「まぜる（ミックス）」は その 下に 1本 */
.seg.seg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-radius: 18px; }
.seg.seg-grid .seg-btn { border-radius: 14px; min-height: 48px; white-space: normal; line-height: 1.25; padding: 4px 6px; text-align: center; word-break: keep-all; overflow-wrap: anywhere; }
.seg-row.seg-row-grid { flex-direction: column; align-items: stretch; }
.seg-row.seg-row-grid .seg-btn.seg-mix { min-height: 48px; border-radius: 14px; }
