/* SMC の授業の画面 (10-18・lesson_ui.js)。教室を前から見る全画面。座標は教室の絵 (1376 × 768) の点を --u 倍して置く */
.lsRoot { position: fixed; inset: 0; z-index: 9000; background: #10161f; color: #2b2116; display: flex; flex-direction: column;
  font-family: "Yu Gothic UI", "Hiragino Sans", "Meiryo", sans-serif; overscroll-behavior: contain; touch-action: manipulation; }
.lsRoot.hidden { display: none; }
.lsTop { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 6px 12px; min-height: 46px; background: #1f2f4f; color: #fff3dc; }
.lsTitle { min-width: 0; flex: 1 1 auto; line-height: 1.25; }
.lsTitle b { font-size: 16px; }
.lsTitle small { display: block; font-size: 13px; color: #d6c7a4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lsDots { display: flex; gap: 4px; flex: 0 0 auto; }
.lsDots i { width: 18px; height: 6px; border-radius: 3px; background: #ffffff40; display: block; }
.lsDots i.done { background: #c9a14a; }
.lsDots i.on { background: #ffd166; }
.lsTop button { flex: 0 0 auto; min-height: 36px; border: 2px solid #fff3dc88; background: transparent; color: #fff3dc; border-radius: 8px; font: bold 14px/1 inherit; padding: 0 12px; cursor: pointer; white-space: nowrap; }
.lsMain { position: relative; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }

/* 教室 */
.lsStage { position: relative; overflow: hidden; flex: 0 0 auto; background: #e9dcc4; --u: 1px; user-select: none; -webkit-user-select: none; }
.lsBg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.lsWho { position: absolute; pointer-events: none; }
.lsWho img { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; display: block; }
.lsWho img.on { opacity: 1; }
.lsMi { left: calc(var(--u) * 4); top: calc(var(--u) * 260); width: calc(var(--u) * 354); height: calc(var(--u) * 502); z-index: 4; }
.lsHa { left: calc(var(--u) * 1015); top: calc(var(--u) * 300); width: calc(var(--u) * 356); height: calc(var(--u) * 462); z-index: 4; }
/* 立っている先生は黒板の右の端の前 (11-24 夜 881 → 931 = ハルの机の横へ 50 ずらした・体で板書の右の端を隠さない。黒板の字の右の余白 .lsLines と組) */
.lsNaoStand { left: calc(var(--u) * 931); top: calc(var(--u) * 168); width: calc(var(--u) * 218); height: calc(var(--u) * 538); z-index: 3; }
.lsNaoWrite { width: calc(var(--u) * 239); height: calc(var(--u) * 535); z-index: 3; transition: left .2s linear, top .2s linear; }
.lsNaoLow { width: calc(var(--u) * 256); height: calc(var(--u) * 531); }
.lsWho.off { display: none; }
/* 手前の自分の机 (教室の絵の (410,656)〜(973,656) の天板と 310〜1080 の下の辺の台形・角は少し丸い) */
.lsDesk { position: absolute; inset: 0; z-index: 5; pointer-events: none; background-size: 100% 100%; background-repeat: no-repeat;
  clip-path: polygon(29.29% 86.2%, 29.94% 85.42%, 70.49% 85.42%, 71.22% 86.2%, 78.49% 100%, 22.53% 100%); }

/* 黒板 (広い画面 = 教室の黒板の上・縦の画面 = 教室の下の帯) */
.lsBoard { position: absolute; left: calc(var(--u) * 400); top: calc(var(--u) * 170); width: calc(var(--u) * 604); height: calc(var(--u) * 268);
  z-index: 2; color: #f4f7f0; font-family: "UD デジタル 教科書体 N", "UD Digi Kyokasho N-R", "Yu Gothic UI", "Hiragino Sans", sans-serif; overflow: hidden; }
.lsTag { display: inline-block; margin: calc(var(--u) * 6) 0 0 calc(var(--u) * 8); font-size: calc(var(--u) * 15); color: #d6e2ce; text-decoration: none;
  border-bottom: 1px dashed #d6e2ce88; max-width: calc(100% - var(--u) * 20); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lsTag:hover { color: #fff; }
/* 右の余白 76 = 立っている先生の体 (左の端 = 教室の絵の点 936) の分 (11-24 夜 まとめ役⑦「板書の右の端が先生の体で隠れる」・前は 14)。1 行は約 22 字 */
.lsLines { position: absolute; left: calc(var(--u) * 14); right: calc(var(--u) * 76); top: calc(var(--u) * 34); bottom: calc(var(--u) * 6); overflow: hidden; }
/* 折り返しは言葉の切れ目で (11-24 夜 ⑦「前日の高 / 値・安値」と途中で切れた): auto-phrase = 日本語の文節 (Chrome・Edge・lang=ja が要る)・
   使えない所 (Safari など) は keep-all = スペースと句読点の所。どちらでも 1 つの言葉が 1 行に収まらない時だけ途中で切る (overflow-wrap) */
.lsLn { font-size: calc(var(--u) * 23); line-height: 1.45; margin: 0 0 calc(var(--u) * 4); text-shadow: 0 0 1px #fff8; word-break: keep-all; word-break: auto-phrase; overflow-wrap: anywhere; transition: opacity .35s; }
.lsLn.gone { opacity: 0; }
.lsLn.cr { color: #ffd98a; }
.lsLn.sk { font-style: italic; }
.lsLn .ring { display: inline-block; padding: 0 .2em; border: calc(var(--u) * 3) solid transparent; border-radius: 50%; }
.lsLn.done .ring { border-color: #ffd166; transform: rotate(-3deg); }
.lsLn.ul.done { text-decoration: underline double #ffd166; text-underline-offset: .2em; }
.lsLn .fig { display: inline-block; margin-right: .4em; padding: 0 .35em; font-size: .72em; background: #f3ead6; color: #4a3a1e; border-radius: 3px; transform: rotate(-2deg); text-shadow: none; vertical-align: .1em; }
/* 黒板に貼る note の図 (11-24 モニターのひなさん「実際の図を貼り付けた方が分かりやすい」): 白い紙の図を左に貼る・字は右から下へ回る。
   高さ = --figH (lesson_ui.js の fitFigH が黒板の字の所の高さから決める)・押すと大きく開く (.lsFigBig) */
.lsLn.hasFig { display: flow-root; }
.lsLn .lsFig { float: left; position: relative; box-sizing: border-box; height: var(--figH, calc(var(--u) * 180)); max-width: 64%; margin: 2px .5em 4px 0; padding: 3px;
  background: #fbf8f0; border: 0; border-radius: 2px; box-shadow: 0 2px 6px #0008; transform: rotate(-.8deg); cursor: zoom-in; font: inherit; line-height: 0; }
.lsLn .lsFig img { display: block; height: 100%; width: auto; max-width: 100%; object-fit: contain; }
.lsLn .lsFig:focus-visible { outline: 3px solid #ffd166; outline-offset: 2px; }
.lsLn .lsFigHint { position: absolute; right: 4px; bottom: 4px; padding: 2px 6px; border-radius: 9px; background: #1f2f4fd9; color: #fff3dc; font-size: 11px; line-height: 1.3; white-space: nowrap; text-shadow: none; }
.lsLn .lsFigHintT { margin-left: 2px; }
.lsRoot.tall .lsLn .lsFigHint, .lsRoot.side .lsLn .lsFigHint { right: 2px; bottom: 2px; padding: 1px 5px; font-size: 13px; }
.lsRoot.tall .lsLn .lsFigHintT, .lsRoot.side .lsLn .lsFigHintT { display: none; }
.lsFigBig { position: absolute; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 52px 10px 12px; background: #0b1018eb; cursor: zoom-out; }
.lsFigBig.hidden { display: none; }
.lsFigBig .lsFigImg { display: block; max-width: 100%; max-height: calc(100% - 52px); min-height: 0; object-fit: contain; background: #fff; border-radius: 4px; box-shadow: 0 4px 18px #000a; }
.lsFigBig .lsFigCap { color: #fff3dc; font-size: 15px; line-height: 1.5; text-align: center; max-width: 900px; }
.lsFigBig .lsFigTip { display: none; color: #d6e2ce; font-size: 13px; }
@media (orientation: portrait) and (max-width: 700px) { .lsFigBig .lsFigTip { display: block; } }
.lsFigBig .lsFigX { position: absolute; top: 8px; right: 10px; min-height: 40px; padding: 0 16px; border: 2px solid #fff3dc; border-radius: 10px; background: #1f2f4f; color: #fff3dc; font: bold 15px/1 inherit; cursor: pointer; }
.lsLn .end { display: inline-block; width: 0; height: 1em; vertical-align: -.1em; }
.lsEraser { position: absolute; z-index: 3; width: calc(var(--u) * 70); height: calc(var(--u) * 26); border-radius: 4px;
  background: linear-gradient(#8a6a44 0 45%, #d8d2c4 45%); box-shadow: 0 2px 3px #0005; left: -999px; top: 0; opacity: 0; pointer-events: none; }
.lsEraser.go { opacity: 1; transition: left .7s ease-in-out, top .7s ease-in-out; }

/* 吹き出し (広い画面 = 教室の下の真ん中に重ねる) */
.lsTalk { position: absolute; z-index: 6; left: calc(var(--u) * 296); width: calc(var(--u) * 784); bottom: calc(var(--u) * 10); min-height: calc(var(--u) * 132);
  background: #fffaf0f2; border: 3px solid #1f2f4f; border-radius: 14px; box-shadow: 0 6px 16px #0005; padding: calc(var(--u) * 22) calc(var(--u) * 20) calc(var(--u) * 10); display: flex; flex-direction: column; gap: 6px; }
.lsName { position: absolute; top: -16px; left: 18px; background: #1f2f4f; color: #ffd166; font-weight: bold; font-size: 15px; padding: 3px 14px; border-radius: 9px; }
.lsName.mi { background: #8a5a12; color: #fff3dc; }
.lsName.ha { background: #1f5f5a; color: #fff3dc; }
.lsText { font-weight: bold; font-size: max(16px, calc(var(--u) * 22)); line-height: 1.6; min-height: 3.2em; overflow-wrap: anywhere; color: #2b2116; }
.lsCtrl { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.lsCtrl button { min-height: 38px; border: 2px solid #1f2f4f; background: #fff; color: #1f2f4f; border-radius: 9px; font: bold 14px/1 inherit; padding: 0 12px; cursor: pointer; white-space: nowrap; }
.lsCtrl button.main { background: #1f2f4f; color: #fff; }
.lsCtrl button[aria-pressed="false"] { opacity: .65; }
.lsCtrl button.lsSpeed.on { background: #fff3c8; }   /* 速さ 1.2× / 1.5× の時 (10-19) */
.lsCtrl button.lsPause.on { background: #fff3c8; }   /* 一時停止の間 = 「▶ 再開」(10-19) */
.lsCtrl .lsMsg { margin-right: auto; font-size: 13px; color: #6a5a40; }

/* 始まりと終わりの札 */
/* 広い画面 = 教室の上・スマホの縦と横 = 教室の外の全体 (.lsMain) の上 (11-24 夜 ⑦「スマホの縦で札の題が上の帯に隠れる」= 低い教室の枠の中では札がはみ出していた・lesson_ui.js の layout) */
.lsCover { position: absolute; inset: 0; z-index: 8; display: flex; align-items: flex-start; justify-content: flex-start; background: #10161fb0; overflow-y: auto; }
.lsCover > .lsCard { margin: auto; }   /* (真ん中に置く・入り切らない時は上の端から見せて下へ送れる = align-items: center だと上がはみ出して見えない) */
.lsCover.hidden { display: none; }
.lsCard { background: #fffaf0; border: 3px solid #1f2f4f; border-radius: 16px; padding: 22px 26px; max-width: min(560px, 92%); text-align: center; box-shadow: 0 10px 30px #0008; }
.lsCard h2 { margin: 0 0 6px; font-size: 22px; color: #1f2f4f; }
.lsCard p { margin: 6px 0; font-size: 15px; line-height: 1.6; color: #4a3a1e; }
.lsCard .row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.lsCard button, .lsCard a.btn { min-height: 44px; border: 2px solid #1f2f4f; background: #fff; color: #1f2f4f; border-radius: 10px; font: bold 16px/1 inherit; padding: 0 18px; cursor: pointer; display: inline-flex; align-items: center; text-decoration: none; }
.lsCard button.main { background: #1f2f4f; color: #fff; }
.lsCard small { display: block; margin-top: 10px; font-size: 13px; color: #7a6a4a; }

/* 縦の画面 (スマホなど): 教室 → 黒板の帯 → 吹き出しの順に縦に並べる */
.lsRoot.tall .lsMain { justify-content: flex-start; }
.lsStrip { display: none; }
.lsRoot.tall .lsStrip { display: block; position: relative; width: 100%; flex: 1 1 auto; min-height: 170px; background: radial-gradient(ellipse at 30% 30%, #3b5a47, #2b4536 70%); border-top: 6px solid #7a5530; border-bottom: 6px solid #7a5530; }
.lsRoot.tall .lsStrip .lsBoard { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.lsRoot.tall .lsStrip .lsTag { font-size: 12px; margin: 6px 0 0 10px; }
.lsRoot.tall .lsStrip .lsLines { left: 12px; right: 12px; top: 28px; bottom: 6px; }
.lsRoot.tall .lsStrip .lsLn { font-size: 17px; margin-bottom: 4px; }
.lsRoot.tall .lsStrip .lsLn .ring { border: 2px solid transparent; }
.lsRoot.tall .lsStrip .lsLn.done .ring { border-color: #ffd166; }
.lsRoot.tall .lsTalk { position: relative; left: auto; bottom: auto; width: auto; align-self: stretch; margin: 18px 8px 8px; min-height: 0; flex: 0 0 auto; padding: 18px 12px 8px; }
.lsRoot.tall .lsText { font-size: 17px; }
.lsRoot.tall .lsCtrl button { flex: 1 1 0; padding: 0 4px; min-height: 42px; }
.lsRoot.tall .lsCtrl .lsMsg { flex-basis: 100%; }
.lsRoot.tall .lsTitle b { font-size: 14px; }
.lsRoot.tall .lsDots i { width: 9px; }
/* スマホの横画面: 左に教室 (高さいっぱい)・右の列に黒板の帯と吹き出し */
.lsCol { display: none; }
.lsRoot.side .lsTop { min-height: 34px; padding: 2px 8px; }
.lsRoot.side .lsTitle b { font-size: 13px; }
.lsRoot.side .lsTitle small { font-size: 11px; }
.lsRoot.side .lsTop button { min-height: 28px; font-size: 12px; }
.lsRoot.side .lsDots i { width: 8px; }
.lsRoot.side .lsMain { flex-direction: row; align-items: stretch; justify-content: flex-start; }
.lsRoot.side .lsStage { align-self: center; }
.lsRoot.side .lsCol { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.lsRoot.side .lsStrip { display: block; position: relative; flex: 1 1 auto; min-height: 80px; background: radial-gradient(ellipse at 30% 30%, #3b5a47, #2b4536 70%); border-left: 5px solid #7a5530; border-bottom: 5px solid #7a5530; }
.lsRoot.side .lsStrip .lsBoard { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.lsRoot.side .lsStrip .lsTag { font-size: 11px; margin: 4px 0 0 8px; }
.lsRoot.side .lsStrip .lsLines { left: 8px; right: 8px; top: 22px; bottom: 4px; }
.lsRoot.side .lsStrip .lsLn { font-size: 13px; margin-bottom: 2px; }
.lsRoot.side .lsStrip .lsLn .ring { border: 2px solid transparent; }
.lsRoot.side .lsStrip .lsLn.done .ring { border-color: #ffd166; }
.lsRoot.side .lsTalk { position: relative; left: auto; bottom: auto; width: auto; margin: 14px 4px 4px; min-height: 0; flex: 0 0 auto; padding: 14px 8px 6px; gap: 4px; border-width: 2px; }
.lsRoot.side .lsName { font-size: 12px; top: -12px; padding: 2px 10px; }
.lsRoot.side .lsText { font-size: 13px; line-height: 1.5; min-height: 3em; }
.lsRoot.side .lsCtrl { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.lsRoot.side .lsCtrl button { min-height: 32px; font-size: 12px; padding: 0 4px; }
.lsRoot.side .lsCtrl .lsMsg { grid-column: 1 / -1; font-size: 11px; }
.lsRoot.side .lsCard { padding: 12px 16px; }
.lsRoot.side .lsCard h2 { font-size: 17px; }
.lsRoot.side .lsCard p { font-size: 13px; margin: 3px 0; }
.lsRoot.side .lsCard button, .lsRoot.side .lsCard a.btn { min-height: 36px; font-size: 14px; }
/* まとめの問題 (10-19・lesson_ui.js の startQuiz)。教室・黒板の帯・吹き出しの全部の上に重ねる。字は大きめ */
.lsQuiz { position: absolute; inset: 0; z-index: 12; display: flex; align-items: center; justify-content: center; padding: 14px; background: #10161fcc; overflow: auto; }
.lsQuiz.hidden { display: none; }
.lsQzCard { display: grid; gap: 14px; width: min(780px, 100%); max-height: 100%; overflow: auto; background: #fffaf0; border: 3px solid #1f2f4f; border-radius: 16px; padding: 18px 22px; box-shadow: 0 10px 30px #0008; outline: none; }
.lsQzAsk, .lsQzFb { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.lsQzFb:empty { display: none; }
.lsQzHead { font-weight: bold; font-size: 15px; color: #8a5a12; letter-spacing: .05em; }
.lsQzQ { margin: 0; font-weight: bold; font-size: 23px; line-height: 1.5; color: #1f2f4f; overflow-wrap: anywhere; }
.lsQzChoices { display: flex; flex-direction: column; gap: 9px; }
.lsQzCh { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 8px 14px; text-align: left; border: 2px solid #1f2f4f; border-radius: 12px; background: #fff; color: #2b2116;
  font-family: inherit; font-weight: bold; font-size: 19px; line-height: 1.45; cursor: pointer; }
.lsQzCh .no { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; background: #1f2f4f; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; }
.lsQzCh .t { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.lsQzCh:hover:not(:disabled), .lsQzCh:focus-visible { background: #fff3c8; }
.lsQzCh:disabled { cursor: default; opacity: .6; }
.lsQzCh.ok, .lsQzCh.ng { opacity: 1; }
.lsQzCh.ok { background: #e3f3df; border-color: #2e7d32; }
.lsQzCh.ok .no { background: #2e7d32; }
.lsQzCh.ng { background: #fbe3df; border-color: #b23a2b; }
.lsQzCh.ng .no { background: #b23a2b; }
.lsQzCh.ok::after, .lsQzCh.ng::after { flex: 0 0 auto; font-size: 26px; line-height: 1; }
.lsQzCh.ok::after { content: "○"; color: #2e7d32; }
.lsQzCh.ng::after { content: "×"; color: #b23a2b; }
.lsQzHint { font-size: 13px; color: #7a6a4a; }
.lsQzMark { font-weight: bold; font-size: 26px; }
.lsQzMark.ok { color: #2e7d32; }
.lsQzMark.ng { color: #b23a2b; }
.lsQzRight { margin: 0; font-weight: bold; font-size: 17px; color: #2e7d32; }
.lsQzWhy { position: relative; margin-top: 10px; background: #fff; border: 2px solid #1f2f4f; border-radius: 12px; padding: 18px 14px 10px; }
.lsQzWhy .lsName { top: -14px; left: 14px; font-size: 14px; }
.lsQzWhy p { margin: 0; font-size: 18px; line-height: 1.65; color: #2b2116; overflow-wrap: anywhere; }
.lsQzRow { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.lsQzRow button { min-height: 46px; border: 2px solid #1f2f4f; background: #fff; color: #1f2f4f; border-radius: 10px; font-family: inherit; font-weight: bold; font-size: 17px; padding: 0 18px; cursor: pointer; }
.lsQzRow button.main { background: #1f2f4f; color: #fff; }
.lsQzCard.end { text-align: center; }
.lsQzCard.end .lsQzRow { justify-content: center; }
.lsQzScore { font-weight: bold; font-size: 34px; color: #1f2f4f; }
.lsQzMsg { margin: 0; font-size: 17px; line-height: 1.6; color: #4a3a1e; }
.lsQzBest { font-size: 14px; color: #7a6a4a; }
/* 縦の画面 */
.lsRoot.tall .lsQuiz { align-items: flex-start; padding: 8px; }
.lsRoot.tall .lsQzQ { font-size: 19px; }
.lsRoot.tall .lsQzCh { font-size: 17px; min-height: 50px; }
.lsRoot.tall .lsQzWhy p { font-size: 16px; }
/* スマホの横画面: 答えた後は 左 = 問題と答え・右 = ○ / × と解説 (高さに収める) */
.lsRoot.side .lsQuiz { padding: 6px; }
.lsRoot.side .lsQzCard { width: 100%; padding: 10px 14px; gap: 6px 16px; border-width: 2px; }
.lsRoot.side .lsQzCard.answered { grid-template-columns: 1.15fr 1fr; align-items: start; }
.lsRoot.side .lsQzAsk, .lsRoot.side .lsQzFb { gap: 6px; }
.lsRoot.side .lsQzHead { font-size: 13px; }
.lsRoot.side .lsQzQ { font-size: 17px; line-height: 1.4; }
.lsRoot.side .lsQzChoices { gap: 6px; }
.lsRoot.side .lsQzCh { min-height: 44px; font-size: 16px; line-height: 1.35; padding: 5px 10px; gap: 8px; }
.lsRoot.side .lsQzCh .no { width: 26px; height: 26px; font-size: 14px; }
.lsRoot.side .lsQzCh.ok::after, .lsRoot.side .lsQzCh.ng::after { font-size: 20px; }
.lsRoot.side .lsQzHint { display: none; }
.lsRoot.side .lsQzMark { font-size: 20px; }
.lsRoot.side .lsQzRight { font-size: 14px; }
.lsRoot.side .lsQzWhy { margin-top: 8px; padding: 14px 10px 8px; }
.lsRoot.side .lsQzWhy p { font-size: 15px; line-height: 1.55; }
.lsRoot.side .lsQzRow button { min-height: 40px; font-size: 15px; }
.lsRoot.side .lsQzScore { font-size: 26px; }
.lsRoot.side .lsQzMsg { font-size: 15px; }
@media (prefers-reduced-motion: reduce) { .lsNaoWrite { transition: none; } .lsEraser.go { transition: none; } .lsLn { transition: none; } }
/* 先生の窓の「授業を見る」(town.js の lessonSec) */
#npcDlg .lessonBtn { display: block; width: 100%; margin: 6px 0 2px; min-height: 48px; text-align: left; padding: 8px 12px; font-size: 16px; line-height: 1.4; white-space: normal; }
