/*
 * ===== スクラッチティーチャー（/teacher/）— 自由につくる =====
 *
 * 設計: docs/TEACHER-S3-PARENT.md §7（方向 A「青い板と銀縁」。S2 のエディタ free.css・style.css の .bar--embedded と同じ値）。
 * 画面は 3 つ: ④入口 #tfLanding ／③ホーム #tfHome ／①エディタ #tfEditor（＋ SO君パネル aside#soPanel）。
 * どれを出すかは :root[data-screen] と各画面の hidden 属性（page.js が切り替える）。
 *
 * 読み込み順: この teacher-free.css → _chat-internals.css（チャットの中身。C 担当）→ login.css。
 * ⚠️ パネルの骨組み（.chat-area・#quickPromptChips・#inputArea の置き場所と大きさ）は #soPanel 付きのセレクタで書く。
 *    後から読む _chat-internals.css の .chat-area などに位置指定があっても、こちら（id を含む）が勝つ。
 * ⚠️ ルビを flex／grid の直下に置かない（<ruby> と文字が別々のアイテムになり、gap ぶん字間が空く）。文言は span で包んである。
 * ⚠️ [hidden] は display を指定した要素でも必ず消す（dev ハーネスで透けた罠）。
 * ⚠️ 明るい世界観（暗いクール系にしない）。色は下の --tf-* だけ。
 */

:root {
  --tf-blue: #2f86ea;
  --tf-blue-d: #1a63c8;
  --tf-blue-l: #5db2ff;
  --tf-navy: #123a7a;
  --tf-yellow: #ffcf1f;
  --tf-silver: #c9d3df;
  --tf-silver-d: #8f9cad;
  --tf-ok: #3cc35a;
  --tf-warn: #ff8a2b;
  --tf-ink: #22303f;
  --tf-line: #dde5ee;

  /* 以下は上の色から作った語彙（新しい色は足していない） */
  --tf-bar-grad: linear-gradient(180deg, var(--tf-blue-l) 0%, var(--tf-blue) 50%, #1e63c6 100%);
  --tf-yellow-grad: linear-gradient(180deg, #fff08a, var(--tf-yellow) 60%, #f5b800);
  --tf-silver-ring: 0 0 0 4px var(--tf-silver), 0 0 0 5px var(--tf-silver-d);
  /* 銀の縁に打つリベット（1 つぶん。background の繰り返しで並べる。作品の板・入口の下の段） */
  --tf-rivet: radial-gradient(circle at 50% 50%, #fff 0 1.2px, #eef2f7 1.6px 2.4px, var(--tf-silver-d) 2.8px 3.4px, transparent 3.8px);
  --tf-font: 'M PLUS Rounded 1c', 'Hiragino Maru Gothic ProN', 'Yu Gothic', system-ui, sans-serif;
  --tf-panel-w: 360px;
  --tf-bar-h: 56px;
}

/* ---------- 土台 ---------- */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body.tf {
  min-height: 100vh;
  font-family: var(--tf-font);
  color: var(--tf-ink);
  background: #eef3f8;
  overflow-x: hidden;
}
/* 土台の既定は :where で詳細度 0 にする（.tf-cta などのクラス指定が必ず勝つように） */
:where(body.tf) :where(h1, h2, h3, p, ul, ol) { margin: 0; }
:where(body.tf) :where(button) { font: inherit; color: inherit; }
:where(body.tf) :where(img) { max-width: 100%; }
rt { font-size: .5em; font-weight: 700; }
/* ルビが漢字より長いとき（修行＝しゅぎょう）に漢字の間を空けない（はみ出したルビは両隣にかぶせる） */
ruby { ruby-align: center; }

/* Safari(WebKit)のルビ描画差の補正（旧 fullscreen-ui.css・本体 style.css と同じ対策） */
@supports (background: -webkit-named-image(i)) {
  rt { margin-bottom: -0.5em; }
}

/* ふりがな OFF（メニューの「表示：ふりがな」。旧 scroll-manager.js と同じ body クラス） */
.hide-furigana ruby rt { display: none !important; }
.hide-furigana ruby { display: inline; }

/* 数と単位（497点）を行で分けない */
.tf-nowrap { white-space: nowrap; }

/* 読み上げだけの文字 */
.tf-sr {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

:focus-visible { outline: 3px solid var(--tf-yellow); outline-offset: 2px; }

/* ---------- 画面の切り替え ---------- */

/* エディタの間はページを動かさない（Scratch が画面いっぱい。縦 768px で右下のスプライト情報まで見せる） */
:root[data-screen="editor"],
:root[data-screen="editor"] body.tf { overflow: hidden; height: 100%; }
:root[data-screen="editor"] .teacher-footer,
:root[data-screen="editor"] .tf-world { display: none; }
/* ホームは下に説明文を持たない（入口だけ）。フッターは入口とホームの両方 */

/* ---------- 白抜き太字（紺の縁取り） ---------- */

.tf-outline {
  color: #fff;
  font-weight: 900;
  paint-order: stroke fill;
  -webkit-text-stroke: 3px var(--tf-navy);
  text-shadow: 0 2px 0 var(--tf-navy);
}
.tf-outline rt { -webkit-text-stroke: 1.5px var(--tf-navy); }
.tf-outline--thin { -webkit-text-stroke-width: 2px; text-shadow: 0 1px 0 var(--tf-navy); }
.tf-outline--thin rt { -webkit-text-stroke-width: 1px; }

/* ---------- 黄色い札（右端を斜めに切る） ---------- */

.tf-tag {
  display: inline-block;
  padding: 3px 16px 3px 10px;
  background: var(--tf-yellow-grad);
  color: var(--tf-navy);
  clip-path: polygon(0 0, 100% 0, calc(100% - 9px) 100%, 0 100%);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.4;
  white-space: nowrap;
}

/* ---------- 青い帯（入口・ホームのヘッダー。.bar--embedded と同じ語彙。親ページなので 56px） ---------- */

.tf-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--tf-bar-h);
  /* 下端 5px は銀の縁。青い面の中で中身を真ん中にする（.bar--embedded と同じ手当て） */
  padding: 0 14px 5px;
  background: var(--tf-bar-grad);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .45),
    inset 0 -4px 0 var(--tf-silver),
    inset 0 -5px 0 var(--tf-silver-d),
    0 3px 8px rgba(0, 30, 80, .25);
  color: #fff;
}
/* 左のティーチャーのロゴ（1693×579 の横長。帯の青い面 51px に収める） */
.tf-bar__brand { flex: 0 0 auto; display: block; line-height: 0; }
.tf-bar__brand img { height: 46px; width: auto; display: block; filter: drop-shadow(0 2px 2px rgba(0, 30, 80, .45)); }
/*
 * 入口の帯は最初は色なし（背景の絵を見せる。下の場面の窓の青い帯と同じ帯を上下に並べない。2026-09-26 ユーザー指摘）。
 * ロゴとボタンだけが浮かぶ（読みやすさはボタンの白い縁と影で持つ）。
 * スクロールしたら landing.js が data-solid を付けて青い帯に戻す（下の説明欄や場面の上に重なって読めなくならないように）。
 * JS が動かないときは色なしのまま（ボタンは縁と影で読める）。
 */
.tf-bar--landing { transition: background-color .25s, box-shadow .25s; }
.tf-bar--landing:not([data-solid]) { background: transparent; box-shadow: none; }
.tf-bar--landing .tf-bar__brand img { height: 50px; }
.tf-bar--landing:not([data-solid]) .tf-bar__brand img { filter: drop-shadow(0 2px 3px rgba(0, 30, 80, .55)) drop-shadow(0 0 1px rgba(255, 255, 255, .8)); }
.tf-bar--landing:not([data-solid]) .tf-pill--navy { border: 2px solid #fff; box-shadow: 0 2px 0 var(--tf-silver-d), 0 4px 10px rgba(0, 30, 80, .35); }
.tf-bar--landing:not([data-solid]) .tf-pill--white,
.tf-bar--landing:not([data-solid]) .tf-notice-slot .notice-bell { box-shadow: inset 0 0 0 2px var(--tf-silver), 0 2px 0 var(--tf-silver-d), 0 4px 10px rgba(0, 30, 80, .3); }
.tf-bar--landing[data-solid] { background: var(--tf-bar-grad); }
.tf-bar__spacer { flex: 1 1 auto; min-width: 0; }

/* 帯の丸いボタン（押せる面 44px） */
.tf-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: 22px;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.tf-pill--navy { background: #1958a5; color: #fff; }
.tf-pill--navy:hover { background: #134b8f; }
.tf-pill--white { background: #fff; color: var(--tf-navy); border-color: var(--tf-silver); box-shadow: 0 2px 0 var(--tf-silver-d); }
.tf-pill--white:hover { background: #f3f8ff; }
.tf-pill__icon { width: 24px; height: 24px; display: block; }

/* ⋯ の丸いボタン（白地） */
.tf-round {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--tf-yellow-grad);
  color: var(--tf-navy);
  box-shadow: 0 2px 0 var(--tf-silver-d);
  cursor: pointer;
}
.tf-round svg { width: 20px; height: 20px; fill: currentColor; }

/* コインの残り（帯の中。エディタの .free-bar__coin と同じ形） */
.tf-coin {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 34px;
  padding: 0 12px 0 4px;
  border: 1px solid rgba(255, 255, 255, .4);
  border-radius: 17px;
  background: #1958a5;
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  white-space: nowrap;
}
.tf-coin__icon { width: 26px; height: 26px; display: block; }

/*
 * お知らせのベル（notices.js が #tfNoticeSlot の中に .notice-icon-wrapper を入れる）。
 * 旧 UI の見た目（fullscreen-ui.css の fixed 配置・黄色のベル）はもう読まないので、帯の上で読める最小限をここで持つ:
 * 白い丸（44px）に紺のベル、未読は黄色い丸に紺の数字。一覧は帯の右端に合わせて下へ開く。
 * お知らせの本文・緊急のモーダル（.notice-modal-*・.urgent-modal-*）は _chat-internals.css。
 */
.tf-notice-slot { flex: 0 0 auto; display: block; }
.tf-notice-slot:empty { display: none; }
.tf-notice-slot .notice-icon-wrapper { position: relative; }
.tf-notice-slot .notice-bell {
  position: relative;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 2px var(--tf-silver), 0 2px 0 var(--tf-silver-d);
  cursor: pointer;
}
.tf-notice-slot .notice-bell:hover { background: #f3f8ff; }
.tf-notice-slot .notice-bell svg { width: 22px; height: 22px; fill: var(--tf-navy); }
.tf-notice-slot .notice-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  border-radius: 11px;
  background: var(--tf-yellow-grad);
  color: var(--tf-navy);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 1px 0 var(--tf-silver-d);
}
.tf-notice-slot .notice-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 60;
  width: min(320px, calc(100vw - 24px));
  overflow: hidden;
  border-radius: 14px;
  background: #fff;
  color: var(--tf-ink);
  box-shadow: 0 10px 24px rgba(10, 40, 90, .25), var(--tf-silver-ring);
}
.tf-notice-slot .dropdown-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: linear-gradient(180deg, var(--tf-blue-l), var(--tf-blue) 45%, var(--tf-blue-d));
  color: #fff;
  font-size: 15px;
  font-weight: 900;
}
.tf-notice-slot .notice-list { max-height: 300px; overflow-y: auto; }
.tf-notice-slot .notice-item { padding: 12px 16px; border-bottom: 1px solid var(--tf-line); cursor: pointer; }
.tf-notice-slot .notice-item:hover { background: #f3f8ff; }
.tf-notice-slot .notice-item.unread { background: #fffbe0; }
.tf-notice-slot .notice-item.important { border-left: 3px solid var(--tf-warn); }
.tf-notice-slot .notice-item-header { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.tf-notice-slot .unread-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--tf-blue); }
.tf-notice-slot .priority-icon { flex: 0 0 auto; font-size: 14px; }
.tf-notice-slot .notice-title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--tf-navy);
  font-size: 14px;
  font-weight: 800;
}
.tf-notice-slot .notice-date { font-size: 12px; color: #5d6f80; }
.tf-notice-slot .no-notices { padding: 24px; text-align: center; color: #5d6f80; font-size: 14px; }
.tf-notice-slot .dropdown-footer { padding: 4px 16px; background: #f5f8fd; text-align: center; }
.tf-notice-slot .view-all-link { display: inline-block; padding: 10px 8px; color: var(--tf-blue-d); font-size: 14px; font-weight: 800; text-decoration: none; }
.tf-notice-slot .view-all-link:hover { text-decoration: underline; }

/* 帯の下の login.js のログイン後表示（#userInfoArea は login.js が inline style で作る）を帯の高さに収める */
.tf-bar #userInfoArea { flex: 0 0 auto; max-width: 260px; }

/* ---------- ボタン（丸い。青＝進む／黄＝主要／白＝戻る／橙＝消す。free.css の .free-dialog__button と同じ） ---------- */

.tf-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 22px;
  background: linear-gradient(180deg, var(--tf-blue-l), var(--tf-blue) 55%, var(--tf-blue-d));
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), inset 0 -3px 0 rgba(0, 30, 80, .35), 0 2px 0 var(--tf-silver-d);
  cursor: pointer;
}
.tf-button:active { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 0 0 var(--tf-silver-d); }
.tf-button:disabled { opacity: .55; cursor: default; transform: none; }
.tf-button--yes {
  background: var(--tf-yellow-grad);
  color: var(--tf-navy);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), inset 0 -3px 0 rgba(120, 80, 0, .25), 0 2px 0 var(--tf-silver-d);
}
.tf-button--back {
  background: #fff;
  color: var(--tf-navy);
  box-shadow: inset 0 0 0 2px var(--tf-silver), 0 2px 0 var(--tf-silver-d);
}
.tf-button--danger {
  background: linear-gradient(180deg, #ffab66, var(--tf-warn) 55%, #e8700f);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), inset 0 -3px 0 rgba(120, 50, 0, .3), 0 2px 0 var(--tf-silver-d);
}
.tf-button__icon { width: 26px; height: 26px; display: block; }

/* ---------- 世界（背景・飛ぶ鳥小屋と創くん。入口とホームだけ） ---------- */

/*
 * 背景はヒロの工場の絵（1500×933。男の子とロボットが真ん中。2026-10-28 に森の絵 so_background.jpg から差し替え）。
 * 画面に固定。入口は最初の 1 画面でこの絵を全部見せ、下の段（基地の板）が上がってきて覆う。ホームは作品の板の後ろ。
 */
.tf-world { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.tf-world__bg {
  position: absolute;
  inset: 0;
  background: #1a2230 url("../../images/bg_factory.jpg") center 40% / cover no-repeat;
  /* GPU コンポジターのバグ回避（旧 .background-layer と同じ） */
  transform: translateZ(0);
}

/*
 * 飛ぶ鳥小屋（flying_birdhouse.png 1000×1000・透過）と、その上に乗る創くん。幅だけ決めれば比率で並ぶ（箱は正方形）。
 * 創くんの足は鳥小屋の絵の (45.4%, 5%)、創くんの絵の幅は鳥小屋の 59.5%（ヒロの見本の画像に合わせて測った値）。
 * 創くんの絵 so.png（500×500）の足は (50%, 87.6%) なので、左 = 45.4 − 59.5×0.5、上 = 5 − 59.5×0.876（箱が正方形なので % は幅の割合）。
 */
.tf-pod {
  position: relative;
  width: var(--tf-pod-w, 300px);
  aspect-ratio: 1;
  pointer-events: none;
}
.tf-pod__house { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.tf-pod__so {
  position: absolute;
  left: 15.65%;
  top: -47.12%;
  width: 59.5%;
  /* 呼吸（scaleY）は足元から */
  transform-origin: 50% 87.6%;
}
/* 元の絵は左向き。鳥小屋は左にいて右（作品の板・場面）を向く（旧 .character-so と同じ反転） */
.tf-pod__img { width: 100%; height: auto; display: block; transform: scaleX(-1); }

/*
 * 世界の鳥小屋（入口・ホーム共通の 1 つ）。幅 1024px 以上は worldPod.js が背景の絵の座標から位置と幅を出して
 * --pod-x／--pod-y／--pod-w に入れ、置いたら data-placed を付ける（置くまでは隠す）。狭い画面は下の幅の節で左下に置く
 */
.tf-world__pod { position: absolute; left: var(--pod-x, 0); top: var(--pod-y, 0); width: var(--pod-w, 300px); }
@media (min-width: 1024px) {
  .tf-world__pod:not([data-placed]) { visibility: hidden; }
}

/* Z マーク（寝ているときだけ。旧 zmove）。創くんは右向きなので頭の左上に出す */
.tf-zmark { position: absolute; height: auto; opacity: 0; pointer-events: none; }
.tf-pod__so .tf-zmark--1 { top: 40%; left: 16%; width: 13%; }
.tf-pod__so .tf-zmark--2 { top: 18%; left: 11%; width: 18%; }
.tf-pod__so .tf-zmark--3 { top: 10%; left: 20%; width: 23%; }
[data-so-host][data-so-state="sleep"] .tf-pod__so .tf-zmark { animation: tf-zmove 2s ease-in-out infinite backwards; }
[data-so-host][data-so-state="sleep"] .tf-pod__so .tf-zmark--2 { animation-delay: .7s; }
[data-so-host][data-so-state="sleep"] .tf-pod__so .tf-zmark--3 { animation-delay: 1.4s; }
@keyframes tf-zmove {
  0% { opacity: 0; transform: translate(0, 0) scale(.5); }
  20%, 80% { opacity: 1; }
  100% { opacity: 0; transform: translate(20px, -40px) scale(1.2); }
}

/* ---------- SO君の姿（soCharacter.js が data-so-state を付ける。§4.3） ---------- */

@keyframes tf-breathe { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.03); } }
@keyframes tf-bob { from { transform: translateY(0); } to { transform: translateY(-8%); } }
@keyframes tf-jump { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-22%); } 70% { transform: translateY(0); } 85% { transform: translateY(-6%); } }
@keyframes tf-wake { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-6deg); } 65% { transform: rotate(5deg); } }

/* 呼吸は旧 breathe と同じ幅（3%）で 4 秒周期（§4.3） */
[data-so-host][data-so-state="idle"] .tf-pod__so,
.tf-so__avatar-wrap[data-so-state="idle"] { animation: tf-breathe 4s ease-in-out infinite; }
[data-so-host][data-so-state="sleep"] .tf-pod__so,
.tf-so__avatar-wrap[data-so-state="sleep"] { animation: tf-breathe 5s ease-in-out infinite; }
.tf-so__avatar-wrap[data-so-state="thinking"] { animation: tf-bob .3s ease-in-out infinite alternate; }
.tf-so__avatar-wrap[data-so-state="happy"] { animation: tf-jump .8s ease-out 1; }
[data-so-host][data-so-state="waking"] .tf-pod__so,
.tf-so__avatar-wrap[data-so-state="waking"] { animation: tf-wake .45s ease-in-out 1; }

/* ---------- ④ 入口 ---------- */

/*
 * 最初の 1 画面（.tf-hero）は工場の絵（.tf-world。画面に固定）をそのまま見せる: 左上にキャッチと「つくりはじめる」、
 * 左下に飛ぶ鳥小屋と創くん（.tf-world__pod）、右下に下の段へ誘う札。真ん中（男の子とロボット）には何も置かない。
 * スクロールすると下の段（.tf-showcase＝基地の板）がシャッターのように上がってきて絵を覆い、「動くエディタの場面」
 * （figure#tfLandingScene。§13 の L2a′）が出る。背景を別の絵に切り替えない（2026-10-28。prototypes/teacher-codecraft-ab の A-1）。
 * ロゴは帯に（大きいロゴと注意書きは 2026-09-26 の指摘で廃止）。
 */
.tf-landing { position: relative; }
/* 帯（色なし）の下にもぐらせて、画面の上はしから絵を見せる */
.tf-hero {
  position: relative;
  height: 100vh;
  height: 100dvh;
  min-height: 560px;
  margin-top: calc(-1 * var(--tf-bar-h));
}
.tf-hero__copy {
  position: absolute;
  z-index: 1;
  left: clamp(20px, 3vw, 48px);
  top: calc(var(--tf-bar-h) + clamp(16px, 5vh, 56px));
  width: min(30vw, 440px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}
.tf-hero__catch { font-size: clamp(26px, 2.3vw, 34px); line-height: 1.6; word-break: auto-phrase; }
.tf-hero .tf-cta { min-width: 0; width: 100%; }

/* 下の段へ誘う札（右下。押すと landing.js がなめらかに下の段へ） */
.tf-hero__down {
  position: absolute;
  z-index: 1;
  right: clamp(20px, 3vw, 48px);
  bottom: clamp(16px, 4vh, 36px);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 20px;
  border: 3px solid #fff;
  border-radius: 999px;
  background: var(--tf-bar-grad);
  color: #fff;
  font-size: 17px;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 3px 0 var(--tf-silver-d), 0 8px 18px rgba(0, 30, 80, .35);
}
.tf-hero__down:hover { filter: brightness(1.06); }
.tf-hero__down svg { width: 20px; height: 20px; flex: 0 0 auto; animation: tf-down-bob 1.5s ease-in-out infinite; }
@keyframes tf-down-bob { 50% { transform: translateY(4px); } }

/*
 * 下の段（基地の板）。上のふちは銀の金属のふち＋リベット＋黄色と紺のしま（ホームの作品の板と同じ語彙）。
 * 透けない（後ろの絵は見せない）。z-index は世界（-1）より上・帯（50）より下
 */
.tf-showcase {
  position: relative;
  z-index: 1;
  scroll-margin-top: var(--tf-bar-h);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: calc(clamp(24px, 5vh, 48px) + 14px) clamp(20px, 3vw, 48px) clamp(28px, 5vh, 56px);
  border-top: 8px solid #dfe6f2;
  background: linear-gradient(180deg, var(--tf-blue) 0%, #1f63c6 100%);
  box-shadow: 0 -3px 0 var(--tf-silver-d), 0 -14px 30px rgba(0, 0, 0, .35);
}
.tf-showcase::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 14px;
  background: repeating-linear-gradient(-45deg, var(--tf-yellow) 0 14px, var(--tf-navy) 14px 28px);
  box-shadow: 0 2px 0 rgba(0, 20, 60, .3);
}
.tf-showcase::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -8px;
  height: 8px;
  background: var(--tf-rivet) 0 0 / 64px 8px space no-repeat;
}
.tf-showcase__title { font-size: clamp(24px, 2.4vw, 32px); line-height: 1.5; text-align: center; }

/* 大きな「つくりはじめる」（黄＝主要） */
.tf-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: min(360px, 100%);
  min-height: 82px;
  margin-top: 4px;
  padding: 0 32px;
  border: 4px solid #fff;
  border-radius: 42px;
  background: var(--tf-yellow-grad);
  color: var(--tf-navy);
  font-size: 29px;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .7), inset 0 -5px 0 rgba(120, 80, 0, .25), 0 6px 0 var(--tf-silver-d), 0 10px 24px rgba(0, 30, 80, .3);
  cursor: pointer;
}
.tf-cta:hover { filter: brightness(1.04); }
.tf-cta:active { transform: translateY(3px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .7), 0 3px 0 var(--tf-silver-d); }
.tf-cta__icon { width: 30px; height: 30px; flex: 0 0 auto; }
.tf-cta__label rt { font-size: .45em; }

/*
 * ===== 場面（figure#tfLandingScene。§13 の L2a′。マークアップは index.php、位置合わせ・ブロックの絵は views/landingScene.js） =====
 *
 * エディタの枠（帯・ステージ・素材の棚・SO君パネル）を HTML で組み、その中でゲームが動く。12 秒で 1 つの話:
 *   0.1〜6.35 秒 場面の窓の右上に、窓からはみ出してスクラッチモンスターの課題エディタ（小さな別窓 .tf-mini）が開く:
 *                ミッションの帯「ゴールまで進もう」→ 手がブロックを 2 つ運んではめる → 緑の旗を押す → キュンがゴールまで歩く
 *                → ミッション クリア！＋100 → コイン 3 枚がその別窓から場面の帯のコインへ飛んで 1,225 → 1,325 → 別窓は閉じる
 *                （別窓＝修行でもらう、ティーチャーの画面＝ここで素材に変える。§15.1 #6。2026-09-26 に「何か分からない」で作り直し）
 *   6.2〜7.8 秒  手がティラノサウルスの 🔒100 を押す → コインが 1 枚タイルへ飛ぶ → 1,225 に → 🔒 が ✓ に
 *   7.9〜8.55 秒 ティラノがタイルから場面へ飛び出す → 着地して歩き出す（11.4 秒まで）
 *   0.3〜6.0 秒  リオンが右へ歩いて画面の外に出てしまう
 *   6.6〜8.3 秒  入力欄に「リオンが画面の外に行っちゃう！」が 1 文字ずつ → 送る → 吹き出しになる（会話はコインの後）
 *   8.35〜10.2 秒 創くんが考える（飛ぶ・…）→ 答えの吹き出し → 文 → 9.8 秒 ブロックがぽんと出る → 10.2 秒 創くんが喜ぶ
 *   10.0〜11.6 秒 リオンが戻ってきて、右の端で跳ね返る
 *   11.4〜12 秒  会話・ティラノ・✓ がすっと消えて、最初に戻る
 * ずっと動いているもの: 勇者の攻撃（エネルギー波 → スライム → 爆発。4 秒で 1 回）・宝箱とコイン・プテラノドン・背景のゆれ。
 * ⚠️ 動かすのは transform と opacity だけ（コマ送りは steps() と opacity の step-end）。JS はフレームを更新しない。
 * ⚠️ どの動きも 12 秒で割り切れる長さ（12・4・2・1.5・0.8・0.75・0.6・0.5・0.4・0.3 秒）。一周してもずれない。
 * ⚠️ 手前（キャラの足元）には何も重ねない（2026-09-26 ユーザー指摘で草花の層を外した）。
 * ⚠️ 文字の説明の札は置かない。「買う」「ショップ」「¥」も出さない。コインの札は 🔒・コインの絵・数字だけ。
 * ⚠️ 動きを減らす設定では全部止まる。止まった形（各要素の素の値）も 1 枚の絵になっている: 会話と答えは出ている、
 *    課題の別窓は右下に「ブロックが組まれて、キュンがゴールにいて、ミッション クリア！＋100」の形で出ている（会話にかぶらない位置）、
 *    波・爆発・手・飛ぶコイン・ティラノは無い。
 * ⚠️ 飛ぶもの（.tf-scene__fx）の出発点・行き先は landingScene.js が寸法を測って CSS 変数に入れる（--earn-x など）。
 * ⚠️ 画面の外（スクロール・別の画面）では landingScene.js が data-paused を付けて全部いっしょに止める。
 * keyframes は tf-sc- で始める（ほかの節の tf-bob などと名前がぶつからないように）。
 */

.tf-scene {
  position: relative;
  /* 下の段の見出しと場面が 1 画面に収まる幅（見出しのぶん 390px を引く）。広い画面でも 1180px まで */
  width: min(100%, 1180px, calc((100vh - var(--tf-bar-h) - 390px) * 1.33 + 310px));
  width: min(100%, 1180px, calc((100dvh - var(--tf-bar-h) - 390px) * 1.33 + 310px));
  margin: 0 auto;
  padding: 8px 0 10px;
  color: var(--tf-ink);
}
.tf-scene[data-paused], .tf-scene[data-paused] * { animation-play-state: paused !important; }
.tf-scene img { display: block; }
.tf-scene__win {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 6px solid #dfe6f2;
  border-radius: 20px;
  background: #eef3f8;
  box-shadow: 0 0 0 3px var(--tf-silver-d), 0 18px 40px rgba(0, 30, 80, .35);
}

/* 帯（エディタの .bar--embedded と同じ語彙を小さく） */
.tf-scene__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 12px 4px;
  background: var(--tf-bar-grad);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -3px 0 var(--tf-silver), inset 0 -4px 0 var(--tf-silver-d);
  color: #fff;
}
.tf-scene__tag {
  padding: 2px 14px 2px 9px;
  background: var(--tf-yellow-grad);
  color: var(--tf-navy);
  clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.4;
  white-space: nowrap;
}
.tf-scene__title {
  min-width: 0;
  overflow: hidden;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.25;
  white-space: nowrap;
  paint-order: stroke fill;
  -webkit-text-stroke: 3px var(--tf-navy);
  text-shadow: 0 2px 0 var(--tf-navy);
}
.tf-scene__title rt { -webkit-text-stroke: 1.5px var(--tf-navy); }
.tf-scene__coin {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 10px 0 3px;
  border: 1px solid rgba(255, 255, 255, .4);
  border-radius: 13px;
  background: #1958a5;
  font-size: 13px;
  font-weight: 900;
  animation: tf-sc-coin-bump 12s ease-out infinite;
}
.tf-scene__coin img { width: 20px; height: 20px; }
/* 帯のコインの数: 1,225 → （もらう）1,325 → （交換）1,225 */
.tf-scene__num { display: inline-grid; }
.tf-scene__num > span { grid-area: 1 / 1; text-align: right; }
.tf-scene__num-a { animation: tf-sc-num-a 12s step-end infinite; }
.tf-scene__num-b { opacity: 0; animation: tf-sc-num-b 12s step-end infinite; }
@keyframes tf-sc-num-a { 0% { opacity: 1; } 49.6% { opacity: 0; } 59.2% { opacity: 1; } }
@keyframes tf-sc-num-b { 0% { opacity: 0; } 49.6% { opacity: 1; } 59.2% { opacity: 0; } }
@keyframes tf-sc-coin-bump {
  0%, 49.5% { transform: scale(1); }
  50.5% { transform: scale(1.2); }
  52.2% { transform: scale(1); }
  59.1% { transform: scale(1); }
  60.1% { transform: scale(.9); }
  61.7%, 100% { transform: scale(1); }
}

.tf-scene__body { display: grid; grid-template-columns: minmax(0, 1fr) clamp(210px, 31%, 270px); min-height: 0; }
.tf-scene__main { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 10px; }

/* ---------- ステージ（ゲームの場面。奥から: 背景 → プテラノドン → 宝箱 → ティラノ → リオン → 勇者・波・スライム・爆発） ---------- */

.tf-game {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  isolation: isolate;
  border-radius: 10px;
  background: #bfe3ff;
  box-shadow: 0 0 0 1px var(--tf-silver);
}
/* 背景（古代遺跡。本家 Scratch に無い場所）: 少し大きく置いて左右にゆっくり。奥行きはこれだけで出す */
.tf-game__bg { position: absolute; inset: -3% -4%; z-index: 0; animation: tf-sc-pan 12s ease-in-out infinite; }
.tf-game__bg img { width: 100%; height: 100%; object-fit: cover; }
@keyframes tf-sc-pan { 0%, 100% { transform: translateX(-1.5%); } 50% { transform: translateX(1.5%); } }

/* ステージの幅いっぱいの「軌道」。translateX の % がステージの幅になる（left を動かさずに済む） */
.tf-game__track { position: absolute; inset: 0; pointer-events: none; }

/* コマを重ねて opacity で切り替える（1 コマ目が箱の大きさを決める） */
.tf-f { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
@keyframes tf-sc-f2a { 0% { opacity: 1; } 50% { opacity: 0; } }
@keyframes tf-sc-f2b { 0% { opacity: 0; } 50% { opacity: 1; } }
@keyframes tf-sc-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14%); } }
/* コマを横に並べた帯を steps() でずらす（歩き。--frames＝コマ数、--dur＝1 巡の長さ。12 秒で割り切れる値にする） */
.tf-strip {
  position: absolute;
  top: 0;
  left: 0;
  width: calc(var(--frames) * 100%);
  height: 100%;
  display: flex;
  animation: tf-sc-frames var(--dur) steps(var(--frames), jump-none) infinite;
}
.tf-strip img { flex: 1 1 0; min-width: 0; height: 100%; object-fit: contain; object-position: 50% 100%; }
@keyframes tf-sc-frames { from { transform: translateX(0); } to { transform: translateX(calc((1 / var(--frames) - 1) * 100%)); } }

/* 空: プテラノドン（羽ばたき 2 コマ＋上下のゆれ） */
.tf-game__track--ptera { z-index: 1; animation: tf-sc-fly 12s linear -7s infinite; }
@keyframes tf-sc-fly { from { transform: translateX(-88%); } to { transform: translateX(46%); } }
.tf-game__ptera { position: absolute; left: 58%; top: 2%; width: 19%; aspect-ratio: 547 / 360; animation: tf-sc-bob 2s ease-in-out infinite; }
.tf-game__ptera .tf-f0 { animation: tf-sc-f2a .5s step-end infinite; }
.tf-game__ptera .tf-f1 { opacity: 0; animation: tf-sc-f2b .5s step-end infinite; }

/* 階段の上: 開いた宝箱と、まわりで回るコイン・キラキラ・光 */
.tf-game__chest { position: absolute; left: 74%; bottom: 46%; z-index: 2; width: 17%; aspect-ratio: 1; }
.tf-game__box { position: relative; width: 100%; height: 100%; object-fit: contain; }
.tf-game__glow {
  position: absolute;
  inset: -45%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 240, 150, .95), rgba(255, 207, 31, .45) 45%, transparent 72%);
  animation: tf-sc-glow 1.5s ease-in-out infinite;
}
@keyframes tf-sc-glow { 0%, 100% { opacity: .55; transform: scale(.9); } 50% { opacity: 1; transform: scale(1.05); } }
.tf-game__gold { position: absolute; width: 40%; aspect-ratio: 1; animation: tf-sc-float 2s ease-in-out infinite; }
.tf-game__gold img { width: 100%; height: 100%; object-fit: contain; animation: tf-sc-spin 1.5s linear infinite; }
.tf-game__gold--1 { left: -22%; top: -38%; animation-delay: -.5s; }
.tf-game__gold--1 img { animation-delay: -.3s; }
.tf-game__gold--2 { left: 30%; top: -72%; }
.tf-game__gold--2 img { animation-delay: -.8s; }
.tf-game__gold--3 { left: 82%; top: -38%; animation-delay: -1s; }
.tf-game__gold--3 img { animation-delay: -1.2s; }
@keyframes tf-sc-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-22%); } }
@keyframes tf-sc-spin { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(.14); } }
.tf-game__sparkle { position: absolute; left: -10%; top: -55%; width: 120%; aspect-ratio: 1; }
.tf-game__sparkle .tf-f0 { animation: tf-sc-f2a .8s step-end infinite; }
.tf-game__sparkle .tf-f1 { opacity: 0; animation: tf-sc-f2b .8s step-end infinite; }

/* 交換して足したティラノサウルス: 8.55 秒に着地して、右へ歩く（歩き 5 コマ・0.6 秒） */
.tf-game__track--trex { z-index: 3; opacity: 0; animation: tf-sc-trex-go 12s linear infinite; }
@keyframes tf-sc-trex-go {
  0%, 71.2% { opacity: 0; transform: translateX(0); }
  71.25% { opacity: 1; transform: translateX(0); }
  95% { opacity: 1; transform: translateX(28%); }
  97.5%, 100% { opacity: 0; transform: translateX(29%); }
}
.tf-game__trex { position: absolute; left: 3%; bottom: 36%; height: 21%; aspect-ratio: 786 / 360; }
.tf-game__trex-body { position: absolute; inset: 0; overflow: hidden; transform-origin: 50% 100%; animation: tf-sc-land 12s ease-out infinite; }
.tf-game__trex .tf-strip { --frames: 5; --dur: .6s; }
@keyframes tf-sc-land {
  0%, 71.2% { transform: scale(1, 1); }
  72.1% { transform: scale(1.12, .82); }
  74% { transform: scale(.96, 1.05); }
  75.5%, 100% { transform: scale(1, 1); }
}

/* 広場: リオン（うちのモンスターの歩行シート）。右へ歩いて画面の外に出てしまい、SO君の答えのあと戻って右の端で跳ね返る */
.tf-game__track--lion { z-index: 4; animation: tf-sc-lion-go 12s linear infinite; }
@keyframes tf-sc-lion-go {
  0% { opacity: 0; transform: translateX(0); }
  2.5% { opacity: 1; transform: translateX(2.6%); }
  50% { opacity: 1; transform: translateX(62%); }
  50.1%, 82.9% { opacity: 0; transform: translateX(28%); }
  84.2% { opacity: 1; transform: translateX(30.5%); }
  91% { opacity: 1; transform: translateX(48%); }
  95% { opacity: 1; transform: translateX(40%); }
  97.5% { opacity: 0; transform: translateX(37%); }
  100% { opacity: 0; transform: translateX(0); }
}
/* 歩行シート（my-vue-app/src/data/monsterWalkMeta.js の 21: 4 コマ・300×280・右向き・5fps） */
.tf-game__lion { position: absolute; left: 40%; bottom: 24%; height: 15%; aspect-ratio: 300 / 280; }
.tf-game__lion-turn { position: absolute; inset: 0; overflow: hidden; animation: tf-sc-lion-turn 12s step-end infinite; }
.tf-game__lion .tf-strip {
  --frames: 4;
  --dur: .8s;
  background: url("../../../wp-content/themes/cocoon-child-master/dist/images/monster-field/21.png") 0 0 / 100% 100% no-repeat;
}
@keyframes tf-sc-lion-turn { 0% { transform: scaleX(1); } 91% { transform: scaleX(-1); } }

/* 手前: 勇者が剣をふる → エネルギー波 → スライムに当たって爆発、スライムは跳ね飛ぶ（4 秒で 1 回） */
.tf-game__hero { position: absolute; left: 2%; bottom: 2%; z-index: 5; height: 38%; aspect-ratio: 1; transform-origin: 50% 100%; animation: tf-sc-lunge 4s ease-out infinite; }
.tf-game__hero .tf-f0 { animation: tf-sc-hero0 4s step-end infinite; }
.tf-game__hero .tf-f1 { opacity: 0; animation: tf-sc-hero1 4s step-end infinite; }
.tf-game__hero .tf-f2 { opacity: 0; animation: tf-sc-hero2 4s step-end infinite; }
@keyframes tf-sc-hero0 { 0% { opacity: 1; } 25% { opacity: 0; } 55% { opacity: 1; } }
@keyframes tf-sc-hero1 { 0% { opacity: 0; } 25% { opacity: 1; } 35% { opacity: 0; } }
@keyframes tf-sc-hero2 { 0% { opacity: 0; } 35% { opacity: 1; } 55% { opacity: 0; } }
@keyframes tf-sc-lunge { 0%, 33% { transform: translateX(0); } 38%, 55% { transform: translateX(14%); } 66%, 100% { transform: translateX(0); } }
.tf-game__track--wave { z-index: 6; opacity: 0; animation: tf-sc-shot 4s linear infinite; }
@keyframes tf-sc-shot {
  0%, 36% { opacity: 0; transform: translateX(0); }
  36.1% { opacity: 1; transform: translateX(0); }
  52% { opacity: 1; transform: translateX(33%); }
  53%, 100% { opacity: 0; transform: translateX(33%); }
}
.tf-game__wave { position: absolute; left: 22%; bottom: 12%; width: 17%; height: auto; }
.tf-game__slime { position: absolute; left: 60%; bottom: 4%; z-index: 5; width: 12%; aspect-ratio: 301 / 360; transform-origin: 50% 100%; animation: tf-sc-slime 4s ease-in-out infinite; }
.tf-game__slime img { width: 100%; height: 100%; object-fit: contain; }
@keyframes tf-sc-slime {
  0% { transform: translate(0, 0) scale(1, 1); }
  6% { transform: translate(0, -24%) scale(.94, 1.06); }
  12% { transform: translate(0, 0) scale(1.12, .88); }
  18% { transform: translate(0, 0) scale(1, 1); }
  24% { transform: translate(0, -24%) scale(.94, 1.06); }
  30% { transform: translate(0, 0) scale(1.12, .88); }
  36%, 52% { transform: translate(0, 0) scale(1, 1); }
  58% { transform: translate(40%, -70%) rotate(20deg) scale(1, 1); }
  66% { transform: translate(60%, 0) rotate(0) scale(1.18, .82); }
  74% { transform: translate(60%, 0) scale(1, 1); }
  86% { transform: translate(20%, -18%) scale(.96, 1.04); }
  94%, 100% { transform: translate(0, 0) scale(1, 1); }
}
.tf-game__boom { position: absolute; left: 56%; bottom: 4%; z-index: 6; width: 21%; height: auto; opacity: 0; animation: tf-sc-boom 4s ease-out infinite; }
@keyframes tf-sc-boom {
  0%, 51.9% { opacity: 0; transform: scale(.3); }
  52% { opacity: 1; transform: scale(.55); }
  60% { opacity: 1; transform: scale(1.15); }
  67%, 100% { opacity: 0; transform: scale(1.3); }
}

/* ---------- 素材の棚（課題エディタのピッカーと同じ見え方。🔒＝コインで交換できる素材） ---------- */

.tf-scene__picker { display: block; padding: 7px 8px 14px; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px var(--tf-line); }
.tf-scene__tabs { display: flex; gap: 4px; }
.tf-scene__tabs > span {
  padding: 1px 10px;
  border-radius: 999px;
  background: #eef3f8;
  color: #5d6f80;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.8;
  white-space: nowrap;
}
.tf-scene__tabs > .is-on { background: var(--tf-blue); color: #fff; }
.tf-scene__tiles { list-style: none; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 7px; margin: 8px 0 0; padding: 0; }
.tf-scene__tile {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  /* 縦長の絵（魔法使いなど）でタイルが伸びない（aspect-ratio の箱の最小の高さは中身で決まるため） */
  min-height: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #f7fbff, #e3edf8);
  box-shadow: inset 0 0 0 2px #dfe6f2, 0 2px 0 var(--tf-silver-d);
}
.tf-scene__tile > img { width: 84%; height: 84%; min-height: 0; object-fit: contain; }
.tf-scene__lock {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -7px;
  width: max-content;
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 1px 6px 1px 5px;
  border-radius: 999px;
  background: var(--tf-navy);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.5;
  white-space: nowrap;
  box-shadow: 0 0 0 2px #fff;
}
.tf-scene__lock img { width: 14px; height: 14px; }

/* 交換するタイル: 手に押されて黄色く光る → 🔒 が外れて ✓（緑） */
.tf-scene__tile.is-target { animation: tf-sc-tile-press 12s ease-out infinite; }
@keyframes tf-sc-tile-press {
  0%, 57.5% { transform: scale(1); }
  58.3% { transform: scale(.9); }
  59.2% { transform: scale(1); }
  63% { transform: scale(1); }
  64% { transform: scale(1.1); }
  65.2%, 100% { transform: scale(1); }
}
.tf-scene__tile.is-target .tf-scene__lock { animation: tf-sc-unlock 12s ease-out infinite; }
@keyframes tf-sc-unlock {
  0%, 62.9% { opacity: 1; transform: scale(1); }
  64.8% { opacity: 0; transform: scale(1.7) translateY(-30%); }
  96.6% { opacity: 0; transform: scale(.6); }
  98.5%, 100% { opacity: 1; transform: scale(1); }
}
.tf-scene__ring { position: absolute; inset: -3px; border-radius: 14px; opacity: 0; }
.tf-scene__ring--hover { box-shadow: inset 0 0 0 4px var(--tf-yellow), 0 0 0 3px #f5b800, 0 0 18px 6px rgba(255, 207, 31, .75); animation: tf-sc-ring-hover 12s step-end infinite; }
.tf-scene__ring--ok { box-shadow: inset 0 0 0 4px var(--tf-ok), 0 0 16px 5px rgba(60, 195, 90, .55); animation: tf-sc-ring-ok 12s step-end infinite; }
@keyframes tf-sc-ring-hover { 0% { opacity: 0; } 56.7% { opacity: 1; } 63% { opacity: 0; } }
@keyframes tf-sc-ring-ok { 0% { opacity: 0; } 63% { opacity: 1; } 96.7% { opacity: 0; } }
.tf-scene__ok {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  z-index: 1;
  width: 22px;
  height: 22px;
  margin-inline: auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--tf-ok);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 0 0 2px #fff;
  opacity: 0;
  animation: tf-sc-ok 12s ease-out infinite;
}
@keyframes tf-sc-ok {
  0%, 63.2% { opacity: 0; transform: scale(.3); }
  64.8% { opacity: 1; transform: scale(1.3); }
  66% { opacity: 1; transform: scale(1); }
  95.8% { opacity: 1; transform: scale(1); }
  97.5%, 100% { opacity: 0; transform: scale(1); }
}

/* ---------- SO君のパネル（パネル P1 の語彙を小さく）: 入力 → 送る → 考える → 答える ---------- */

.tf-scene__so { display: flex; flex-direction: column; min-width: 0; background: #f5f8fd; box-shadow: inset 3px 0 0 var(--tf-silver); }
.tf-scene__so-head {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 74px;
  padding: 8px 8px 11px 74px;
  background: var(--tf-bar-grad);
  box-shadow: inset 0 -3px 0 var(--tf-silver), inset 0 -4px 0 var(--tf-silver-d);
}
/* SO君: ふだん → 飛ぶ（考え中）→ 口パク（答える）→ 笑顔でジャンプ */
.tf-scene__so-av { position: absolute; left: 0; bottom: 3px; width: 76px; height: 76px; }
.tf-scene__so-a { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.tf-scene__so-a img, img.tf-scene__so-a { transform: scale(1.15); transform-origin: 50% 80%; }
.tf-scene__so-a--idle { animation: tf-sc-so-idle 12s step-end infinite; }
.tf-scene__so-a--fly { opacity: 0; animation: tf-sc-so-fly 12s step-end infinite, tf-sc-bob .6s ease-in-out infinite; }
.tf-scene__so-a--fly .tf-f0 { animation: tf-sc-f2a .6s step-end infinite; }
.tf-scene__so-a--fly .tf-f1 { opacity: 0; animation: tf-sc-f2b .6s step-end infinite; }
.tf-scene__so-a--speak { opacity: 0; animation: tf-sc-so-speak 12s step-end infinite; }
.tf-scene__so-a--speak .tf-f0 { animation: tf-sc-f2a .3s step-end infinite; }
.tf-scene__so-a--speak .tf-f1 { opacity: 0; animation: tf-sc-f2b .3s step-end infinite; }
.tf-scene__so-a--smile { opacity: 0; animation: tf-sc-so-smile 12s ease-out infinite; }
@keyframes tf-sc-so-idle { 0% { opacity: 1; } 69.6% { opacity: 0; } 91.7% { opacity: 1; } }
@keyframes tf-sc-so-fly { 0% { opacity: 0; } 69.6% { opacity: 1; } 76.7% { opacity: 0; } }
@keyframes tf-sc-so-speak { 0% { opacity: 0; } 76.7% { opacity: 1; } 85% { opacity: 0; } }
@keyframes tf-sc-so-smile {
  0%, 84.9% { opacity: 0; transform: translateY(0) scale(1.15); }
  85% { opacity: 1; transform: translateY(0) scale(1.15); }
  86.6% { opacity: 1; transform: translateY(-16%) scale(1.15); }
  88.2% { opacity: 1; transform: translateY(0) scale(1.15); }
  89.4% { opacity: 1; transform: translateY(-5%) scale(1.15); }
  90.6% { opacity: 1; transform: translateY(0) scale(1.15); }
  91.6% { opacity: 1; }
  91.7%, 100% { opacity: 0; }
}
.tf-scene__so-name { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.tf-scene__so-title {
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.5;
  paint-order: stroke fill;
  -webkit-text-stroke: 3px var(--tf-navy);
  text-shadow: 0 2px 0 var(--tf-navy);
}
.tf-scene__so-title rt { -webkit-text-stroke: 1.5px var(--tf-navy); }
/* 状態の札: ふだん → 考え中… → 答えているよ */
.tf-scene__so-status {
  display: inline-grid;
  padding: 0 9px;
  border-radius: 999px;
  background: #fff;
  color: #2c6b2e;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.9;
  white-space: nowrap;
  box-shadow: 0 2px 0 var(--tf-silver-d);
}
.tf-scene__st { grid-area: 1 / 1; }
.tf-scene__st--idle { animation: tf-sc-st-idle 12s step-end infinite; }
.tf-scene__st--think { opacity: 0; color: #7a5600; animation: tf-sc-st-think 12s step-end infinite; }
.tf-scene__st--speak { opacity: 0; animation: tf-sc-st-speak 12s step-end infinite; }
@keyframes tf-sc-st-idle { 0% { opacity: 1; } 69.6% { opacity: 0; } 85% { opacity: 1; } }
@keyframes tf-sc-st-think { 0% { opacity: 0; } 69.6% { opacity: 1; } 76.7% { opacity: 0; } }
@keyframes tf-sc-st-speak { 0% { opacity: 0; } 76.7% { opacity: 1; } 85% { opacity: 0; } }

/* 会話: 子どもの質問（📎 作品つき）→ 考え中の … → 答えの吹き出し（文 → ブロック） */
.tf-scene__chat {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 8px;
  min-height: 0;
  padding: 10px 9px;
  overflow: hidden;
  background: linear-gradient(180deg, #dcefff 0, #eef6ff 120px, #f5f8fd 100%);
  font-size: 12px;
}
.tf-scene__say { display: block; font-weight: 700; line-height: 1.75; word-break: auto-phrase; }
.tf-scene__say--kid {
  max-width: 92%;
  padding: 6px 12px 7px;
  border-radius: 14px 4px 14px 14px;
  background: linear-gradient(180deg, var(--tf-blue-l), var(--tf-blue));
  color: #fff;
  box-shadow: 0 2px 0 var(--tf-navy);
}
.tf-scene__clip {
  display: table;
  margin-bottom: 3px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--tf-yellow-grad);
  color: var(--tf-navy);
  font-size: .82em;
  font-weight: 900;
}
.tf-scene__say--so {
  position: relative;
  margin-top: 12px;
  padding: 12px 10px 8px;
  border: 3px solid var(--tf-silver);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 0 var(--tf-silver-d);
}
.tf-scene__name {
  position: absolute;
  left: 8px;
  top: -12px;
  padding: 0 13px 0 8px;
  background: var(--tf-yellow-grad);
  color: var(--tf-navy);
  clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
  font-size: .82em;
  font-weight: 900;
  line-height: 1.6;
}
.tf-scene__text { display: block; }
.tf-scene__q { display: flex; flex-direction: column; align-items: flex-end; transform-origin: 100% 100%; animation: tf-sc-q 12s ease-out infinite; }
@keyframes tf-sc-q {
  0%, 68.3% { opacity: 0; transform: translateY(14px) scale(.94); }
  69.2% { opacity: 1; transform: translateY(0) scale(1); }
  95.8% { opacity: 1; transform: none; }
  98.3%, 100% { opacity: 0; transform: none; }
}
.tf-scene__a { position: relative; display: block; }
.tf-scene__dots {
  position: absolute;
  left: 0;
  top: 12px;
  display: inline-flex;
  gap: 5px;
  padding: 10px 14px;
  border: 3px solid var(--tf-silver);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 0 var(--tf-silver-d);
  opacity: 0;
  animation: tf-sc-dots 12s step-end infinite;
}
@keyframes tf-sc-dots { 0% { opacity: 0; } 69.6% { opacity: 1; } 76.7% { opacity: 0; } }
.tf-scene__dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--tf-blue); animation: tf-sc-dot .75s ease-in-out infinite; }
.tf-scene__dots i:nth-child(2) { animation-delay: .125s; }
.tf-scene__dots i:nth-child(3) { animation-delay: .25s; }
@keyframes tf-sc-dot { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-5px); } }
.tf-scene__a .tf-scene__say--so { transform-origin: 0 0; animation: tf-sc-a 12s ease-out infinite; }
@keyframes tf-sc-a {
  0%, 76.6% { opacity: 0; transform: scale(.9); }
  77.5% { opacity: 1; transform: scale(1.02); }
  78.3% { opacity: 1; transform: scale(1); }
  95.8% { opacity: 1; transform: scale(1); }
  98.3%, 100% { opacity: 0; transform: scale(1); }
}
.tf-scene__line--1 { animation: tf-sc-line1 12s step-end infinite; }
.tf-scene__line--2 { animation: tf-sc-line2 12s step-end infinite; }
@keyframes tf-sc-line1 { 0% { opacity: 0; } 77.1% { opacity: 1; } }
@keyframes tf-sc-line2 { 0% { opacity: 0; } 79.2% { opacity: 1; } }
.tf-scene__blocks { display: block; margin-top: 6px; transform-origin: 0 0; animation: tf-sc-blocks 12s ease-out infinite; }
.tf-scene__blocks:empty { display: none; }
.tf-scene__blocks svg { display: block; max-width: 100%; height: auto; }
@keyframes tf-sc-blocks {
  0%, 81.2% { opacity: 0; transform: scale(.55); }
  82.3% { opacity: 1; transform: scale(1.08); }
  83.3%, 100% { opacity: 1; transform: scale(1); }
}

/* 入力欄: 1 文字ずつ打つ（白い覆いを steps で右へずらす。文字は全角 15 字）→ 送る */
.tf-scene__input { display: flex; flex-direction: column; gap: 6px; padding: 8px; background: #fff; box-shadow: inset 0 1px 0 var(--tf-line); }
.tf-scene__share {
  align-self: flex-start;
  padding: 1px 10px;
  border-radius: 999px;
  background: var(--tf-yellow-grad);
  color: var(--tf-navy);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.9;
  box-shadow: 0 2px 0 #b98a00;
}
.tf-scene__row { display: flex; align-items: center; gap: 6px; }
.tf-scene__field {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  display: grid;
  align-items: center;
  padding: 5px 10px;
  border-radius: 10px;
  box-shadow: inset 0 0 0 2px var(--tf-silver);
  color: var(--tf-ink);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.9;
}
.tf-scene__ph, .tf-scene__type { grid-area: 1 / 1; }
.tf-scene__ph { color: #8a97a6; animation: tf-sc-ph 12s step-end infinite; }
@keyframes tf-sc-ph { 0% { opacity: 1; } 55% { opacity: 0; } 69.2% { opacity: 1; } }
.tf-scene__type { position: relative; justify-self: start; opacity: 0; font-weight: 800; white-space: nowrap; animation: tf-sc-type 12s step-end infinite; }
@keyframes tf-sc-type { 0% { opacity: 0; } 55% { opacity: 1; } 68.3% { opacity: 0; } }
.tf-scene__cover { position: absolute; top: 0; bottom: 0; left: 0; width: 100%; background: #fff; animation: tf-sc-typing 12s infinite; }
@keyframes tf-sc-typing {
  0%, 55.5% { transform: translateX(0); animation-timing-function: steps(15, end); }
  66.7% { transform: translateX(100%); animation-timing-function: step-end; }
  68.3% { transform: translateX(100%); }
}
.tf-scene__caret { position: absolute; left: 0; top: 12%; bottom: 12%; width: 2px; background: var(--tf-blue-d); animation: tf-sc-f2a .5s step-end infinite; }
.tf-scene__send { flex: 0 0 auto; width: 52px; height: auto; animation: tf-sc-send 12s ease-out infinite; }
@keyframes tf-sc-send { 0%, 67.5% { transform: scale(1); } 68% { transform: scale(.8); } 69.5%, 100% { transform: scale(1); } }

/* ---------- 飛ぶもの（枠の上に重ねた層）: コイン・手・飛び出すティラノ ---------- */

/* 横だけ切る（手・ティラノの出発点が狭い画面で右にはみ出して横スクロールが出ないように。上へ弧を描くコインは切らない）。
   課題の別窓（.tf-mini）より手前（別窓から飛び出すコインが別窓に隠れないように） */
.tf-scene__fx { position: absolute; inset: 0; z-index: 10; overflow-x: clip; pointer-events: none; }

/*
 * ===== スクラッチモンスターの課題エディタ（小さな別窓 .tf-mini。§15.1 #6 → 2026-09-26 の追加指摘で作り直し） =====
 *
 * 前の版は「スクラッチの画面に CLEAR! がでかでかと出るだけで何か分からない」→「ミッション＝スクラッチの学習」を順に見せる:
 *   0.1〜0.45 秒  場面の窓の右上に、窓からはみ出して少し傾いて開く（影を強く＝前面の別窓）
 *   0.45〜1.5 秒  ミッションの帯「ゴールまで進もう」（課題エディタのブリーフィングの斜めの帯を小さく）
 *   1.45〜3.3 秒  手がブロックの一覧から「緑の旗が押されたとき」→「10 回繰り返す／20 歩動かす」を運んではめる
 *   3.3〜3.8 秒   手が緑の旗を押す → 3.8〜4.75 秒 キュン（草原の歩行シート）がゴールまで歩く
 *   4.8〜5.2 秒   ミッション クリア！（クリア演出の帯を小さく。ステージとブロックは透けて見える）→ ＋100
 *   5.35〜6.2 秒  コイン 3 枚がこの別窓から場面の帯のコインへ飛ぶ（.tf-scene__earn）→ 6.0〜6.35 秒 閉じる
 * 中の配置は px の固定寸法（幅 400px。手の通り道とブロックの動きを合わせるため）。大きさは --tf-mini-s（広い画面は 1.14 倍、狭い画面は縮める）。
 *   座標（枠の内側。左上が 0,0）: 帯 0〜30 ／ ブロックの一覧 x 8〜92 ／ コード x 100〜232 ／ ステージ x 240〜392・y 38〜152
 *   一覧のつまむ所: 旗のブロック (38,51)・繰り返し (38,70) → はめる所: (120,51)・(120,82)。緑の旗 (345,15)
 * ⚠️ 傾き（rotate）と縮小（scale）は個別プロパティで持ち、動き（transform）と重ねる。landingScene.js が両方を読んで
 *    もらうコインの出発点（.tf-mini__coin）を計算する（offset で測るので transform の途中の値に左右されない）。
 * ⚠️ 素の値（動きを減らす設定で見える形）は「ブロックが組まれて、キュンがゴールにいて、ミッション クリア！＋100」。
 *    帯・手は素の値で隠す。置き場所は下の prefers-reduced-motion で会話にかぶらない右下へ。
 */
.tf-mini {
  position: absolute;
  top: 12%;
  right: -26px;
  z-index: 9;
  width: 400px;
  overflow: hidden;
  border: 4px solid #fff;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 0 0 2px var(--tf-silver-d), 0 20px 38px rgba(0, 30, 80, .5), 0 5px 12px rgba(0, 30, 80, .3);
  rotate: 2deg;
  --tf-mini-s: 1.14;
  scale: var(--tf-mini-s, 1);
  transform-origin: 90% 10%;
  animation: tf-sc-mini 12s ease-out infinite;
}
@keyframes tf-sc-mini {
  0%, .8% { opacity: 0; transform: translateY(18px) scale(.6); }
  .85% { opacity: 1; transform: translateY(18px) scale(.6); }
  2.9% { opacity: 1; transform: translateY(0) scale(1.04); }
  3.75% { opacity: 1; transform: translateY(0) scale(1); }
  50% { opacity: 1; transform: translateY(0) scale(1); }
  52.9%, 100% { opacity: 0; transform: translateY(12px) scale(.8); }
}
.tf-mini__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 8px 3px;
  background: var(--tf-bar-grad);
  box-shadow: inset 0 -2px 0 var(--tf-silver), inset 0 -3px 0 var(--tf-silver-d);
  color: #fff;
}
.tf-mini__logo { flex: 0 0 auto; width: auto; height: 20px; filter: drop-shadow(0 1px 1px rgba(0, 30, 80, .4)); }
.tf-mini__tag {
  flex: 0 0 auto;
  padding: 0 11px 0 7px;
  background: var(--tf-yellow-grad);
  color: var(--tf-navy);
  clip-path: polygon(0 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.6;
}
.tf-mini__spacer { flex: 1 1 auto; }
/* 緑の旗（手に押される → 動いている間は黄色く光る）と止める */
.tf-mini__flag, .tf-mini__stop {
  position: relative;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  box-shadow: 0 1px 0 var(--tf-silver-d);
}
.tf-mini__flag {
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 3v18' stroke='%23455a64' stroke-width='2.4' stroke-linecap='round'/%3E%3Cpath d='M6 4h12l-3 4 3 4H6z' fill='%233cc35a'/%3E%3C/svg%3E") center / 15px no-repeat;
  animation: tf-sc-mini-flag 12s ease-out infinite;
}
.tf-mini__stop { background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 3h8l5 5v8l-5 5H8l-5-5V8z' fill='%23ec5959'/%3E%3C/svg%3E") center / 13px no-repeat; }
.tf-mini__flagon {
  position: absolute;
  display: block;
  inset: -3px;
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--tf-yellow), 0 0 10px 3px rgba(255, 207, 31, .85);
  opacity: 0;
  animation: tf-sc-mini-flagon 12s step-end infinite;
}
@keyframes tf-sc-mini-flag { 0%, 30.4% { transform: scale(1); } 30.8% { transform: scale(.72); } 31.7%, 100% { transform: scale(1); } }
@keyframes tf-sc-mini-flagon { 0% { opacity: 0; } 30.8% { opacity: 1; } 40% { opacity: 0; } }

.tf-mini__body { display: grid; grid-template-columns: 84px 132px 152px; gap: 8px; padding: 8px; background: #eef3f8; }
/* ブロックの一覧: 色の丸（カテゴリ）＋形だけのブロック（旗・繰り返し・動かす） */
.tf-mini__palette { display: flex; gap: 4px; padding: 4px; border-radius: 6px; background: #fff; box-shadow: inset 0 0 0 1px var(--tf-line); }
.tf-mini__cats { flex: 0 0 9px; display: flex; flex-direction: column; gap: 5px; padding-top: 2px; }
.tf-mini__cats i { display: block; width: 9px; height: 9px; border-radius: 50%; }
.tf-mini__cats i:nth-child(1) { background: #4c97ff; }
.tf-mini__cats i:nth-child(2) { background: #9966ff; }
.tf-mini__cats i:nth-child(3) { background: #cf63cf; }
.tf-mini__cats i:nth-child(4) { background: #ffbf00; }
.tf-mini__cats i:nth-child(5) { background: #ffab19; }
.tf-mini__chips { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; padding-top: 2px; }
.tf-mini__chip { position: relative; display: block; width: 92%; }
.tf-mini__chip--hat { height: 14px; border-radius: 8px 8px 3px 3px; background: #ffbf00; box-shadow: inset 0 -1px 0 #cc9900; }
.tf-mini__chip--loop { height: 22px; border-radius: 3px; background: #ffab19; box-shadow: inset 0 -1px 0 #cf8b17; }
/* C の形（内側を白く抜く） */
.tf-mini__chip--loop::after { content: ""; position: absolute; left: 8px; right: 0; top: 7px; height: 8px; border-radius: 2px 0 0 2px; background: #fff; }
.tf-mini__chip--move { width: 80%; height: 12px; border-radius: 3px; background: #4c97ff; box-shadow: inset 0 -1px 0 #3373cc; }
/* コードの場所（ブロックは下の .tf-mini__piece が上に載る） */
.tf-mini__code { display: block; min-width: 0; border-radius: 6px; background: #fff; box-shadow: inset 0 0 0 1px var(--tf-line); }

/* 運ばれてはまるブロック（landingScene.js が scratchblocks の絵を入れる。来なければ色の帯）。つまむ所（14,7）を中心に持ち上がる */
.tf-mini__piece {
  position: absolute;
  left: 106px;
  top: 44px;
  z-index: 2;
  display: block;
  transform-origin: 14px 7px;
  filter: drop-shadow(0 2px 2px rgba(0, 30, 80, .25));
}
.tf-mini__piece svg { display: block; width: auto; max-width: none; }
.tf-mini__piece--hat { animation: tf-sc-mini-hat 12s ease-in-out infinite; }
.tf-mini__piece--loop { top: var(--tf-mini-loop-top, 74px); animation: tf-sc-mini-loop 12s ease-in-out infinite; }
@keyframes tf-sc-mini-hat {
  0%, 12.8% { opacity: 0; transform: translate(-82px, 0) scale(1); }
  12.9%, 13.3% { opacity: 1; transform: translate(-82px, 0) scale(1.08); }
  18.3% { opacity: 1; transform: translate(0, 0) scale(1.08); }
  18.75%, 100% { opacity: 1; transform: translate(0, 0) scale(1); }
}
@keyframes tf-sc-mini-loop {
  0%, 21.7% { opacity: 0; transform: translate(-82px, calc(62px - var(--tf-mini-loop-top, 74px))) scale(1); }
  21.8%, 22.2% { opacity: 1; transform: translate(-82px, calc(62px - var(--tf-mini-loop-top, 74px))) scale(1.08); }
  27.1% { opacity: 1; transform: translate(0, 0) scale(1.08); }
  27.5%, 100% { opacity: 1; transform: translate(0, 0) scale(1); }
}
/* scratchblocks が来ないときの代わり（色の帯） */
.tf-mini__blk { display: block; border-radius: 3px; }
.tf-mini__blk--hat { width: 86px; height: 30px; border-radius: 10px 10px 3px 3px; background: #ffbf00; }
.tf-mini__blk--loop { width: 92px; height: 38px; background: linear-gradient(#ffab19 0 12px, transparent 12px 28px, #ffab19 28px) 0 0 / 100% 100% no-repeat, linear-gradient(90deg, #ffab19 0 10px, #4c97ff 10px 70%, transparent 70%) 0 12px / 100% 16px no-repeat; }

/* ステージ: 空と草。キュンが左から右のゴールまで歩く */
.tf-mini__stage {
  position: relative;
  height: 114px;
  overflow: hidden;
  border-radius: 6px;
  background: linear-gradient(180deg, #bfe3ff 0 58%, #8fd07a 58% 100%);
  box-shadow: inset 0 0 0 1px var(--tf-silver);
}
/* ゴールの旗（棒＋市松の旗） */
.tf-mini__goal { position: absolute; right: 9%; bottom: 20%; width: 3px; height: 46%; border-radius: 2px; background: #455a64; }
.tf-mini__goal::after {
  content: "";
  position: absolute;
  left: 100%;
  top: 0;
  width: 18px;
  height: 13px;
  background: repeating-conic-gradient(#22303f 0 25%, #fff 0 50%) 0 0 / 50% 50%;
  box-shadow: 0 0 0 1px #22303f;
}
.tf-mini__run { position: absolute; inset: 0; transform: translateX(54%); animation: tf-sc-mini-run 12s linear infinite; }
/* 草原の歩行シート（monsterWalkMeta の 1: 2 コマ・280×280・左向き）。右へ歩くので反転 */
.tf-mini__kyun { position: absolute; left: 3%; bottom: 10%; height: 44%; aspect-ratio: 1; overflow: hidden; transform: scaleX(-1); }
.tf-mini__kyun .tf-strip {
  --frames: 2;
  --dur: .4s;
  background: url("../../../wp-content/themes/cocoon-child-master/dist/images/monster-field/1.png") 0 0 / 100% 100% no-repeat;
}
@keyframes tf-sc-mini-run {
  0%, 31.7% { transform: translateX(0); }
  39.6%, 100% { transform: translateX(54%); }
}

/* ミッションの帯（課題エディタのブリーフィング: 青い板に銀の縁、後ろに黄色い帯、MISSION の札）。素の値は隠す */
.tf-mini__brief {
  position: absolute;
  inset: 30px 0 0;
  z-index: 3;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: rgba(37, 105, 194, .5);
  opacity: 0;
  animation: tf-sc-mini-brief 12s ease-out infinite;
}
@keyframes tf-sc-mini-brief {
  0%, 3.6% { opacity: 0; }
  4.2% { opacity: 1; }
  11.2% { opacity: 1; }
  12.5%, 100% { opacity: 0; }
}
.tf-mini__band, .tf-mini__clearband {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 120%;
  margin-left: -10%;
  padding: 13px 0 9px;
  background: linear-gradient(180deg, var(--tf-blue-l), var(--tf-blue) 55%, var(--tf-blue-d));
  /* 銀の縁 → 後ろにずらした黄色い帯 → 影 */
  box-shadow: 0 0 0 3px #eef2f7, 0 0 0 4px var(--tf-silver-d), 8px 8px 0 4px var(--tf-yellow), 0 12px 14px rgba(0, 30, 80, .35);
  text-align: center;
}
.tf-mini__band { transform: rotate(-4deg); animation: tf-sc-mini-band 12s cubic-bezier(.2, .9, .3, 1) infinite; }
@keyframes tf-sc-mini-band {
  0%, 3.75% { transform: rotate(-4deg) translateX(-110%); }
  5.4% { transform: rotate(-4deg) translateX(0); }
  11% { transform: rotate(-4deg) translateX(0); }
  12.5%, 100% { transform: rotate(-4deg) translateX(110%); }
}
/* MISSION の札（帯の上のふちに食い込ませる） */
.tf-mini__ribbon {
  position: absolute;
  left: 22%;
  top: -10px;
  padding: 0 14px;
  background: var(--tf-yellow-grad);
  color: var(--tf-navy);
  clip-path: polygon(6% 0, 100% 0, 94% 100%, 0 100%);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
  line-height: 1.8;
}
.tf-mini__goaltext {
  display: block;
  color: #fff;
  font-size: 21px;
  font-weight: 900;
  line-height: 1.5;
  white-space: nowrap;
  paint-order: stroke fill;
  -webkit-text-stroke: 4px var(--tf-navy);
  text-shadow: 0 2px 0 var(--tf-navy);
}
.tf-mini__goaltext rt { -webkit-text-stroke: 2px var(--tf-navy); }

/* クリア（課題エディタのクリア演出を小さく）。後ろ（組んだブロック・ゴールのキュン）は透けて見える */
.tf-mini__clear {
  position: absolute;
  inset: 30px 0 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 45%, rgba(22, 156, 203, .45), rgba(10, 49, 91, .55) 85%);
  animation: tf-sc-mini-clear 12s step-end infinite;
}
@keyframes tf-sc-mini-clear { 0% { opacity: 0; } 40% { opacity: 1; } }
.tf-mini__clearband { padding: 11px 0 5px; transform: rotate(-5deg); animation: tf-sc-mini-clearband 12s cubic-bezier(.2, .9, .3, 1) infinite; }
@keyframes tf-sc-mini-clearband {
  0%, 40% { transform: rotate(-5deg) translateX(-110%); }
  41.2%, 100% { transform: rotate(-5deg) translateX(0); }
}
.tf-mini__word {
  display: inline-block;
  color: #fff;
  font-family: 'Dela Gothic One', var(--tf-font);
  font-size: 34px;
  line-height: 1.15;
  paint-order: stroke fill;
  -webkit-text-stroke: 6px #163b60;
  text-shadow: 1px 4px 0 #163b60;
  transform: skewX(-8deg);
  animation: tf-sc-mini-word 12s ease-out infinite;
}
@keyframes tf-sc-mini-word {
  0%, 40.4% { opacity: 0; transform: skewX(-8deg) scale(2); }
  41.4% { opacity: 1; transform: skewX(-8deg) scale(.92); }
  42%, 100% { opacity: 1; transform: skewX(-8deg) scale(1); }
}
.tf-mini__prize { display: flex; align-items: center; gap: 4px; animation: tf-sc-mini-prize 12s ease-out infinite; }
.tf-mini__prize b {
  color: #ffe253;
  font-family: "Arial Black", "Arial", sans-serif;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.1;
  paint-order: stroke fill;
  -webkit-text-stroke: 4px #704622;
  text-shadow: 0 2px 0 #704622;
}
.tf-mini__coin { width: 30px; height: 30px; }
@keyframes tf-sc-mini-prize {
  0%, 42.4% { opacity: 0; transform: translateY(10px) scale(.8); }
  43.4% { opacity: 1; transform: translateY(0) scale(1.1); }
  44%, 100% { opacity: 1; transform: none; }
}

/* 手（指先が 0,0 に来るように寄せる）: 旗のブロックを運ぶ → 繰り返しを運ぶ → 緑の旗を押す。素の値は隠す */
.tf-mini__hand {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 4;
  width: 30px;
  margin: -8px 0 0 -10px;
  transform-origin: 10px 8px;
  opacity: 0;
  animation: tf-sc-mini-hand 12s ease-in-out infinite;
}
.tf-mini__hand img { width: 100%; height: auto; filter: drop-shadow(0 3px 3px rgba(0, 30, 80, .35)); }
@keyframes tf-sc-mini-hand {
  0%, 11.6% { opacity: 0; transform: translate(70px, 130px) scale(1); }
  12.5% { opacity: 1; transform: translate(38px, 51px) scale(1); }
  12.9%, 13.3% { opacity: 1; transform: translate(38px, 51px) scale(.85); }
  18.3% { opacity: 1; transform: translate(120px, 51px) scale(.85); }
  18.75%, 19.2% { opacity: 1; transform: translate(120px, 51px) scale(1); }
  21.4% { opacity: 1; transform: translate(38px, 70px) scale(1); }
  21.8%, 22.2% { opacity: 1; transform: translate(38px, 70px) scale(.85); }
  27.1% { opacity: 1; transform: translate(120px, calc(var(--tf-mini-loop-top, 74px) + 8px)) scale(.85); }
  27.5% { opacity: 1; transform: translate(120px, calc(var(--tf-mini-loop-top, 74px) + 8px)) scale(1); }
  30.4% { opacity: 1; transform: translate(345px, 15px) scale(1); }
  30.8% { opacity: 1; transform: translate(345px, 15px) scale(.8); }
  31.7%, 33.3% { opacity: 1; transform: translate(345px, 15px) scale(1); }
  35%, 100% { opacity: 0; transform: translate(360px, 70px) scale(1); }
}

/* もらったコイン 3 枚が場面の帯のコインへ飛ぶ（少しずつずらす）／交換で 1 枚がタイルへ飛ぶ */
.tf-scene__earn, .tf-scene__pay { position: absolute; width: 24px; height: 24px; margin: -12px 0 0 -12px; opacity: 0; }
.tf-scene__earn img, .tf-scene__pay img { width: 100%; height: 100%; filter: drop-shadow(0 2px 2px rgba(120, 80, 0, .45)); }
.tf-scene__earn { left: var(--earn-from-x, 0px); top: var(--earn-from-y, 0px); animation: tf-sc-earn 12s ease-in-out infinite; }
.tf-scene__earn--2 { animation-delay: .12s; }
.tf-scene__earn--3 { animation-delay: .24s; }
@keyframes tf-sc-earn {
  0%, 44.5% { opacity: 0; transform: translate(0, 0) scale(.8); }
  44.6% { opacity: 1; transform: translate(0, 0) scale(1); }
  47.1% { opacity: 1; transform: translate(calc(var(--earn-x, 0px) * .5), calc(var(--earn-y, 0px) * .5 - 70px)) scale(1.35); }
  49.6% { opacity: 1; transform: translate(var(--earn-x, 0px), var(--earn-y, 0px)) scale(1); }
  50.2%, 100% { opacity: 0; transform: translate(var(--earn-x, 0px), var(--earn-y, 0px)) scale(.6); }
}
.tf-scene__pay { left: var(--coin-x, 0px); top: var(--coin-y, 0px); animation: tf-sc-pay 12s ease-in-out infinite; }
@keyframes tf-sc-pay {
  0%, 59.1% { opacity: 0; transform: translate(0, 0) scale(1); }
  59.2% { opacity: 1; transform: translate(0, 0) scale(1); }
  61% { opacity: 1; transform: translate(calc(var(--pay-x, 0px) * .5), calc(var(--pay-y, 0px) * .5 - 50px)) scale(1.3); }
  62.9% { opacity: 1; transform: translate(var(--pay-x, 0px), var(--pay-y, 0px)) scale(.8); }
  63.8%, 100% { opacity: 0; transform: translate(var(--pay-x, 0px), var(--pay-y, 0px)) scale(.4); }
}

/* 手がティラノの 🔒100 を押す（指先がタイルの上寄せに来る＝🔒 の札は隠さない） */
.tf-scene__hand {
  position: absolute;
  left: var(--tile-x, 0px);
  top: var(--tile-y, 0px);
  width: 40px;
  margin: -22px 0 0 -13px;
  transform-origin: 32% 20%;
  opacity: 0;
  animation: tf-sc-hand 12s ease-in-out infinite;
}
.tf-scene__hand img { width: 100%; height: auto; filter: drop-shadow(0 3px 3px rgba(0, 30, 80, .35)); }
@keyframes tf-sc-hand {
  0%, 51.6% { opacity: 0; transform: translate(150px, 120px); }
  52.5% { opacity: 1; transform: translate(130px, 104px); }
  57.5% { opacity: 1; transform: translate(0, 0) scale(1); }
  58.3% { opacity: 1; transform: translate(0, 0) scale(.84); }
  59.2% { opacity: 1; transform: translate(0, 0) scale(1); }
  62.5% { opacity: 1; transform: translate(0, 0); }
  67%, 100% { opacity: 0; transform: translate(140px, 110px); }
}

/* 交換したティラノがタイルから場面へ飛び出す（着地したら場面の中のティラノに入れ替わる。786×360 の絵） */
.tf-scene__drop {
  position: absolute;
  left: var(--tile-x, 0px);
  top: var(--tile-y, 0px);
  width: var(--tile-w, 40px);
  margin-left: calc(var(--tile-w, 40px) / -2);
  margin-top: calc(var(--tile-w, 40px) * -.229);
  opacity: 0;
  animation: tf-sc-drop 12s ease-in-out infinite;
}
.tf-scene__drop img { width: 100%; height: auto; }
@keyframes tf-sc-drop {
  0%, 65.4% { opacity: 0; transform: translate(0, 0) scale(1); }
  65.5% { opacity: 1; transform: translate(0, 0) scale(1.15); }
  68.3% { opacity: 1; transform: translate(calc(var(--drop-x, 0px) * .5), calc(var(--drop-y, 0px) * .5 - 110px)) scale(calc(1 + (var(--drop-s, 1) - 1) * .6)); }
  71.2% { opacity: 1; transform: translate(var(--drop-x, 0px), var(--drop-y, 0px)) scale(var(--drop-s, 1)); }
  71.25%, 100% { opacity: 0; transform: translate(var(--drop-x, 0px), var(--drop-y, 0px)) scale(var(--drop-s, 1)); }
}

/* ---------- 入口の幅（§7.2） ---------- */

/* 1024〜1279px: 左の列が狭いので CTA とキャッチを小さく、素材は 6 つに（交換する 5 つ目は残る） */
@media (max-width: 1279px) {
  .tf-hero__catch { font-size: 22px; }
  .tf-cta { min-width: 0; width: 100%; padding: 0 18px; font-size: 23px; }
  .tf-scene__tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .tf-scene__tiles > :nth-child(n + 7) { display: none; }
  .tf-mini { right: -22px; --tf-mini-s: .86; }
}

/* 1023px 以下: 最初の 1 画面は工場の絵のまま（2026-10-28 ユーザー決定）。文字と CTA は上に横いっぱい、鳥小屋と創くんは左下に小さく
   （背景の絵の座標では画面の外に出るので、画面の左下に置く）。場面の幅は 720px まで */
@media (max-width: 1023px) {
  .tf-hero__copy { right: 24px; width: auto; max-width: 560px; top: calc(var(--tf-bar-h) + 20px); }
  .tf-hero__catch { font-size: 26px; }
  .tf-hero .tf-cta { width: auto; min-width: min(360px, 100%); padding: 0 32px; font-size: 26px; }
  .tf-world__pod { left: -2%; top: auto; bottom: 14%; width: min(40vw, 320px); }
  .tf-scene { width: min(100%, 720px); }
  .tf-scene__tiles { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .tf-scene__tiles > :nth-child(n + 7) { display: grid; }
  .tf-mini { right: -14px; top: 14%; --tf-mini-s: .9; }
}

/* 767px 以下: SO君のパネルはステージの下に。素材は 6 つに */
@media (max-width: 767px) {
  .tf-hero__copy { left: 16px; right: 16px; }
  .tf-hero__catch { font-size: 24px; }
  .tf-cta { font-size: 22px; min-height: 64px; }
  /* 札と鳥小屋を左右に並べると幅 375px で重なるので、鳥小屋は札の段より上に */
  .tf-hero__down { right: 16px; bottom: 16px; padding: 6px 16px; font-size: 15px; }
  .tf-world__pod { width: min(42vw, 240px); bottom: calc(76px + 4%); }
  .tf-showcase { padding-left: 16px; padding-right: 16px; }
  .tf-scene__body { grid-template-columns: minmax(0, 1fr); }
  .tf-scene__so { box-shadow: inset 0 3px 0 var(--tf-silver); }
  .tf-scene__chat { min-height: 250px; }
  .tf-scene__tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .tf-scene__tiles > :nth-child(n + 7) { display: none; }
  /* 別窓は窓の中に収める（画面の外へはみ出すと横スクロールになる） */
  .tf-mini { right: 3%; top: 9%; --tf-mini-s: .72; }
}

/* 動きを減らす設定: 場面と創くんたちは全部止める（止まった形も 1 枚の絵になっている）。
   課題の別窓は「クリアした形」で右下に置く（会話と答えにかぶらないように） */
@media (prefers-reduced-motion: reduce) {
  .tf-scene, .tf-scene *, .tf-hero__down svg { animation: none !important; }
  .tf-mini { top: auto; bottom: 3%; }
}
@media (prefers-reduced-motion: reduce) and (min-width: 768px) {
  .tf-mini { --tf-mini-s: .78; }
}

/* ---------- ③ ホーム ---------- */

.tf-home { position: relative; min-height: 100vh; min-height: 100dvh; }
.tf-home__body {
  display: grid;
  grid-template-columns: clamp(270px, 26vw, 400px) minmax(0, 1fr);
  gap: 16px;
  padding: 20px 24px 28px 0;
  align-items: start;
}
.tf-home__side {
  position: sticky;
  top: calc(var(--tf-bar-h) + 16px);
  height: calc(100vh - var(--tf-bar-h) - 44px);
  height: calc(100dvh - var(--tf-bar-h) - 44px);
  min-height: 420px;
  display: flex;
  flex-direction: column;
  /* 吹き出しは SO君の頭の上（空いた空は上に残す） */
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding-left: 16px;
}
/* 狭い画面（1023px 以下）だけの小さい鳥小屋と創くん。広い画面は世界の鳥小屋（.tf-world__pod）を使う */
.tf-home__world { display: none; pointer-events: none; }

/* SO君の吹き出し（静的。押すと直近の作品を開く／新しく作る） */
.tf-bubble {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  max-width: 330px;
  padding: 14px 18px;
  border: 4px solid #dfe6f2;
  border-radius: 20px;
  background: #fff;
  color: var(--tf-ink);
  text-align: left;
  font-weight: 900;
  box-shadow: 0 0 0 2px var(--tf-silver-d), 0 6px 0 var(--tf-silver-d), 0 10px 20px rgba(0, 30, 80, .18);
  cursor: pointer;
}
.tf-bubble::after {
  content: "";
  position: absolute;
  left: 34%;
  bottom: -20px;
  width: 26px;
  height: 22px;
  background: #fff;
  clip-path: polygon(0 0, 100% 0, 18% 100%);
  filter: drop-shadow(0 2px 0 var(--tf-silver-d));
}
.tf-bubble:hover { background: #f8fbff; }
.tf-bubble__hello { display: block; font-size: 18px; line-height: 1.6; color: var(--tf-navy); }
.tf-bubble__next { display: block; margin-top: 2px; font-size: 15px; line-height: 1.9; word-break: auto-phrase; }
.tf-bubble__next b { color: var(--tf-blue-d); }
/*
 * 幅 1024px 以上: 吹き出しは世界の創くん（鳥小屋の上）の頭の上に浮かべ、右はしは作品の板の手前まで（ヒロのモック）。
 * 位置と幅は worldPod.js が --bb-x／--bb-y／--bb-w に入れて data-float を付ける。しっぽは ::after の代わりに
 * svg（.tf-bubble__tail。創くんの口へ向けて worldPod.js が描く）。吹き出しのふちの上に重ねてつなぎ目を消す
 */
.tf-bubble__tail { position: fixed; z-index: 3; pointer-events: none; overflow: visible; filter: drop-shadow(0 2px 0 var(--tf-silver)); }
.tf-bubble__tail polygon { fill: #fff; }
@media (min-width: 1024px) {
  .tf-bubble[data-float] { position: fixed; left: var(--bb-x, 0); top: var(--bb-y, 0); width: var(--bb-w, 300px); max-width: none; }
  .tf-bubble[data-float]::after { display: none; }
}
@media (max-width: 1023px) {
  .tf-bubble__tail { display: none; }
}

/*
 * 作品の板＝秘密基地の装置（2026-10-28。prototypes/teacher-codecraft-ab の base-board.css。ヒロの狙い「秘密基地・秘密のメカ工房」）。
 * 語彙は今のまま（青い板・銀の縁・黄色の札）で新しい色は足さない: 透けない青・銀の金属枠とリベット・上のはしに黄色と紺のしま。
 * カードの置き場は格納庫のベイ、「新しく作る」は白紙の設計図、「3 / 30」の横に空きのメーター、板の下の空きは空いている格納庫
 */
.tf-board {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: calc(100vh - var(--tf-bar-h) - 48px);
  min-height: calc(100dvh - var(--tf-bar-h) - 48px);
  padding: 30px 24px 22px;
  border: 8px solid #dfe6f2;
  border-radius: 18px;
  background: linear-gradient(180deg, var(--tf-blue) 0%, #1f63c6 100%);
  box-shadow:
    inset 0 0 0 2px var(--tf-silver-d),
    inset 0 3px 10px rgba(0, 20, 60, .35),
    0 0 0 3px var(--tf-silver-d),
    0 14px 30px rgba(0, 0, 0, .35);
}
/* 上のはしのしま（危険マークのテープ） */
.tf-board::before {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  top: 2px;
  height: 12px;
  border-radius: 9px 9px 0 0;
  background: repeating-linear-gradient(-45deg, var(--tf-yellow) 0 12px, var(--tf-navy) 12px 24px);
  box-shadow: 0 2px 0 rgba(0, 20, 60, .3);
  pointer-events: none;
}
/* 枠のリベット（銀の縁の上に等間隔。縁の太さ 8px の帯に並べる） */
.tf-board::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 18px;
  background:
    var(--tf-rivet) top / 64px 8px space no-repeat,
    var(--tf-rivet) bottom / 64px 8px space no-repeat,
    var(--tf-rivet) left / 8px 64px no-repeat space,
    var(--tf-rivet) right / 8px 64px no-repeat space;
  pointer-events: none;
}
/*
 * 作品が 0 件のとき（home.js が .tf-home に data-empty）。幅 1024px 以上は板を右の小さな板（300〜360px）にして、
 * 真ん中（工場の絵の男の子とロボット）を見せる（prototypes/teacher-codecraft-ab の A-2）。
 * 棚にアレンジが並んでいるとき（views/shelf.js が data-shelf-items）は板を広いままにする（細い板だと棚が 1 枚ずつしか見えない）
 */
@media (min-width: 1024px) {
  .tf-home[data-empty]:not([data-shelf-items]) .tf-home__body { grid-template-columns: clamp(270px, 26vw, 400px) minmax(0, 1fr) clamp(300px, 24vw, 360px); }
  .tf-home[data-empty]:not([data-shelf-items]) .tf-board { grid-column: 3; min-height: 0; }
  .tf-home[data-empty]:not([data-shelf-items]) .tf-grid { grid-template-columns: minmax(0, 1fr); }
  .tf-home[data-empty]:not([data-shelf-items]) .tf-newcard { min-height: 200px; }
  .tf-home[data-empty]:not([data-shelf-items]) .tf-board__foot { margin-top: 0; }
  .tf-home[data-empty]:not([data-shelf-items]) .tf-board__note { flex-basis: 100%; word-break: auto-phrase; }
  .tf-home[data-empty]:not([data-shelf-items]) .tf-board__shop { width: 100%; justify-content: center; }
  /* 細い板の中の棚: 送りボタンの余白を詰める */
  .tf-home[data-empty]:not([data-shelf-items]) .tf-shelf__row { padding-left: 16px; padding-right: 16px; }
}
.tf-board__head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.tf-board__title { font-size: 28px; line-height: 1.5; }
.tf-board__count { font-size: 15px; padding-top: 4px; padding-bottom: 4px; }
/* 格納庫の空きのメーター（上限の数だけ区切り、作品の数だけ黄色く光る。区切りは home.js が上限の数だけ入れる。上限 30 で 186px） */
.tf-gauge {
  display: inline-grid;
  grid-template-columns: repeat(var(--max, 30), minmax(0, 1fr));
  gap: 2px;
  width: clamp(64px, calc(var(--max, 30) * 6px + 6px), 186px);
  height: 18px;
  padding: 4px;
  border-radius: 5px;
  background: rgba(18, 58, 122, .55);
  box-shadow: inset 0 0 0 2px var(--tf-silver-d), 0 1px 0 rgba(255, 255, 255, .35);
}
.tf-gauge i { border-radius: 1px; background: rgba(255, 255, 255, .22); }
.tf-gauge i.is-on { background: var(--tf-yellow); box-shadow: 0 0 3px rgba(255, 207, 31, .7); }
.tf-board__status {
  padding: 12px 16px;
  border-radius: 14px;
  background: #fff;
  color: var(--tf-navy);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.9;
  box-shadow: var(--tf-silver-ring);
}
.tf-board__status .tf-button { margin-left: 10px; min-height: 40px; }
.tf-board__foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
}
.tf-board__note { flex: 1 1 280px; font-size: 14px; line-height: 1.9; }
.tf-board__more {
  color: #fff;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
  -webkit-text-stroke: 0;
  text-shadow: 0 1px 0 var(--tf-navy);
  /* 押せる面を広げる */
  display: inline-block;
  padding: 10px 4px;
}
.tf-board__shop { flex: 0 0 auto; }
.tf-board__transfer { flex: 0 0 auto; }

/* 作品のグリッド（先頭は「新しく作る」） */
.tf-grid {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
}
.tf-grid[aria-busy="true"] .tf-grid__item:not(:first-child) { opacity: .6; }
/* 置き場＝格納庫のベイ（上に作業灯・左上に番号のプレート・床にしま）。行の高さはそろえる */
.tf-grid { grid-auto-rows: 1fr; counter-reset: tf-bay; }
.tf-grid__item {
  position: relative;
  min-width: 0;
  padding: 20px 10px 18px;
  border-radius: 12px;
  background:
    repeating-linear-gradient(-45deg, var(--tf-yellow) 0 8px, var(--tf-navy) 8px 16px) bottom / 100% 8px no-repeat,
    radial-gradient(ellipse 60% 70% at 50% 0, rgba(255, 244, 191, .45), transparent 70%) top / 100% 70% no-repeat,
    rgba(10, 50, 120, .3);
  box-shadow: inset 0 3px 8px rgba(0, 20, 60, .35), inset 0 0 0 2px rgba(255, 255, 255, .18);
}
/* 作業灯 */
.tf-grid__item::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 4px;
  width: 52px;
  height: 9px;
  transform: translateX(-50%);
  border-radius: 2px 2px 9px 9px;
  background: var(--tf-yellow-grad);
  box-shadow: 0 0 0 2px var(--tf-silver-d), 0 4px 14px 4px rgba(255, 230, 120, .55);
}
/* 番号のプレート（作品のベイと空いている格納庫。01・02…。「新しく作る」には付けない） */
.tf-grid__item--work,
.tf-grid__item--empty { counter-increment: tf-bay; }
.tf-grid__item--work::after,
.tf-grid__item--empty::after {
  content: counter(tf-bay, decimal-leading-zero);
  position: absolute;
  left: 10px;
  top: 3px;
  padding: 0 6px;
  border-radius: 3px;
  background: #eef2f7;
  color: var(--tf-navy);
  box-shadow: 0 0 0 1px var(--tf-silver-d);
  font: 900 11px/14px var(--tf-font);
  letter-spacing: .08em;
}
/* 空いている格納庫（作品がまだ入っていないベイ。灯りは消えている。home.js が「今の段の残り＋もう 1 段」を上限まで足す） */
.tf-grid__item--empty {
  background:
    repeating-linear-gradient(-45deg, rgba(255, 207, 31, .45) 0 8px, rgba(18, 58, 122, .45) 8px 16px) bottom / 100% 8px no-repeat,
    rgba(10, 50, 120, .22);
  box-shadow: inset 0 3px 8px rgba(0, 20, 60, .25), inset 0 0 0 2px rgba(255, 255, 255, .12);
}
.tf-grid__item--empty::before { background: var(--tf-silver); box-shadow: 0 0 0 2px var(--tf-silver-d); }
.tf-grid__item--empty::after { background: rgba(238, 242, 247, .5); box-shadow: none; }

.tf-newcard {
  width: 100%;
  height: 100%;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  border: 4px dashed #fff;
  border-radius: 18px;
  /* 白紙の設計図（方眼） */
  background:
    linear-gradient(rgba(255, 255, 255, .16) 1px, transparent 1px) 0 0 / 18px 18px,
    linear-gradient(90deg, rgba(255, 255, 255, .16) 1px, transparent 1px) 0 0 / 18px 18px,
    #2a78dc;
  color: #fff;
  cursor: pointer;
}
.tf-newcard:hover {
  background:
    linear-gradient(rgba(255, 255, 255, .22) 1px, transparent 1px) 0 0 / 18px 18px,
    linear-gradient(90deg, rgba(255, 255, 255, .22) 1px, transparent 1px) 0 0 / 18px 18px,
    #3484e6;
}
.tf-newcard__plus {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--tf-yellow-grad);
  color: var(--tf-navy);
  font-size: 38px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 3px 0 var(--tf-silver-d);
}
.tf-newcard__label, .tf-newcard__sub {
  paint-order: stroke fill;
  -webkit-text-stroke: 3px var(--tf-navy);
  text-shadow: 0 2px 0 var(--tf-navy);
  font-weight: 900;
}
.tf-newcard__label { font-size: 19px; line-height: 1.7; }
.tf-newcard__label rt, .tf-newcard__sub rt { -webkit-text-stroke-width: 1.5px; }
.tf-newcard__sub { font-size: 13px; line-height: 1.8; -webkit-text-stroke-width: 2px; }
.tf-newcard--full .tf-newcard__plus { background: #fff; color: var(--tf-silver-d); }

/* 作品カード（白＋銀縁） */
.tf-card {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  border: 4px solid #dfe6f2;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 5px 0 var(--tf-silver-d), 0 8px 14px rgba(0, 20, 60, .35);
  overflow: hidden;
}
.tf-card:hover { border-color: #fff4bf; }
.tf-card__open {
  display: flex;
  flex-direction: column;
  width: 100%;
  flex: 1 1 auto;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
/* サムネ（ステージは 4:3）。無ければ薄い空色の地に SO君の顔 */
.tf-card__thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: linear-gradient(180deg, #eaf4ff, #d8e8fb);
  border-bottom: 3px solid #dfe6f2;
}
.tf-card__thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.tf-card__thumb--empty img { inset: 22% 32%; width: 36%; height: 56%; object-fit: contain; opacity: .45; }
.tf-card__latest { position: absolute; left: 0; top: 10px; font-size: 12px; padding: 2px 14px 2px 10px; }
.tf-card__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 56px 12px 14px;
  min-width: 0;
}
.tf-card__title {
  display: block;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.6;
  color: var(--tf-navy);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tf-card__time { display: block; font-size: 13px; font-weight: 700; line-height: 1.9; color: #5d6f80; }
/* ⋯（名前を変える／消す）。カードの右下。押せる面 44px */
.tf-card__more {
  position: absolute;
  right: 6px;
  bottom: 8px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--tf-navy);
  cursor: pointer;
}
.tf-card__more:hover, .tf-card__more[aria-expanded="true"] { background: #eaf2fc; }
.tf-card__more svg { width: 20px; height: 20px; fill: currentColor; }

/* ---------- ゲストの基地（2026-10-30。docs/CRAFT-ARRANGE-SHELF.md 決定 2）: 鍵のかかった格納庫・エース会員の案内 ---------- */

/* 鍵のかかった格納庫（エース会員で開く。home.js の renderGuest が使える 1 つの後ろに 4 つ置く） */
.tf-lockbay { display: grid; place-items: center; min-height: 220px; }
.tf-lockbay__in { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.tf-lock {
  position: relative;
  width: 44px;
  height: 36px;
  margin-top: 14px;
  border-radius: 7px;
  background: linear-gradient(180deg, #eef2f7, var(--tf-silver) 60%, var(--tf-silver-d));
  box-shadow: 0 3px 0 rgba(0, 20, 60, .35);
}
/* つる */
.tf-lock::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 100%;
  width: 26px;
  height: 22px;
  transform: translateX(-50%);
  border: 6px solid var(--tf-silver);
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
}
/* かぎ穴 */
.tf-lock::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 11px;
  width: 8px;
  height: 13px;
  transform: translateX(-50%);
  border-radius: 4px;
  background: var(--tf-navy);
}
.tf-lockbay__text {
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.8;
  text-align: center;
  paint-order: stroke fill;
  -webkit-text-stroke: 3px var(--tf-navy);
  text-shadow: 0 2px 0 var(--tf-navy);
}
.tf-lockbay__text rt { -webkit-text-stroke-width: 1.5px; }

/* エース会員（無料）の案内（黄色い札。板の中、格納庫と棚の間） */
.tf-join {
  display: flex;
  align-items: center;
  gap: 12px 16px;
  flex-wrap: wrap;
  padding: 12px 18px;
  border-radius: 14px;
  background: linear-gradient(180deg, #fffbe6, #fff2b8);
  box-shadow: 0 0 0 3px var(--tf-yellow), 0 4px 0 #d9a900, 0 8px 14px rgba(0, 20, 60, .3);
  color: var(--tf-navy);
}
.tf-join__so { width: 64px; height: 64px; object-fit: contain; flex: 0 0 auto; }
.tf-join__text { flex: 1 1 260px; min-width: 0; }
.tf-join__lead { margin: 0; font-size: 17px; font-weight: 900; line-height: 1.8; }
.tf-join__list { display: flex; flex-wrap: wrap; gap: 2px 16px; margin: 2px 0 0; padding: 0; list-style: none; font-size: 14px; font-weight: 700; line-height: 1.9; }
.tf-join__list li::before { content: "✓ "; color: var(--tf-ok); font-weight: 900; }
.tf-join__list b { color: #e8700f; }
.tf-join__go { flex: 0 0 auto; text-decoration: none; }

/* ---------- アレンジの棚（2026-10-30。docs/CRAFT-ARRANGE-SHELF.md 決定 1・6 の A。views/shelf.js） ---------- */

/* コースの札（絵の左上。エントリー緑・ブロンズ銅・シルバー銀・ゴールド金） */
.tf-course {
  position: absolute;
  left: 0;
  top: 8px;
  padding: 1px 12px 1px 8px;
  clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
  background: linear-gradient(180deg, #5db2ff, var(--tf-blue));
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.6;
  letter-spacing: .04em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .25);
}
.tf-course:empty { display: none; }
.tf-course--entry { background: linear-gradient(180deg, #6fdc84, #2fae4c); }
.tf-course--bronze { background: linear-gradient(180deg, #f0b27a, #c06b2c); }
.tf-course--silver { background: linear-gradient(180deg, #f4f7fb, #a8b4c4); color: var(--tf-navy); text-shadow: none; }
.tf-course--gold { background: var(--tf-yellow-grad); color: var(--tf-navy); text-shadow: none; }

/* まだ見ていない最新のアレンジ（ゆっくり脈打つ。1 秒に 3 回より遅い） */
.tf-new {
  position: absolute;
  right: 6px;
  top: 6px;
  padding: 1px 7px;
  border-radius: 9px;
  background: #ff4f6d;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .06em;
  line-height: 1.5;
  box-shadow: 0 0 0 2px #fff, 0 2px 6px rgba(255, 79, 109, .55);
  animation: tf-new-pulse 2.4s ease-in-out infinite;
}
@keyframes tf-new-pulse { 50% { transform: scale(1.08); } }

.tf-shelf { display: flex; flex-direction: column; gap: 10px; }
.tf-shelf[hidden] { display: none; }
.tf-shelf__head { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin-top: 6px; }
.tf-shelf__title { margin: 0; font-size: 24px; line-height: 1.5; }
.tf-shelf__count { font-size: 15px; }
.tf-shelf__free {
  margin: 0;
  padding: 2px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.9;
}
.tf-shelf__rack {
  position: relative;
  border-radius: 12px;
  background:
    radial-gradient(ellipse 70% 90% at 50% 0, rgba(255, 244, 191, .28), transparent 70%),
    rgba(10, 50, 120, .3);
  box-shadow: inset 0 3px 8px rgba(0, 20, 60, .35), inset 0 0 0 2px rgba(255, 255, 255, .18);
}
/* 棚板（銀の板。カードはこの上に立つ） */
.tf-shelf__rack::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 12px;
  height: 14px;
  border-radius: 3px;
  background:
    var(--tf-rivet) left 10px center / 8px 8px no-repeat,
    var(--tf-rivet) right 10px center / 8px 8px no-repeat,
    linear-gradient(180deg, #fff 0, #e3e9f1 35%, #b7c2d0 100%);
  box-shadow: 0 3px 0 var(--tf-silver-d), 0 6px 10px rgba(0, 20, 60, .35);
  pointer-events: none;
}
.tf-shelf__row {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 16px;
  margin: 0;
  padding: 16px 58px 30px;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-padding: 0 58px;
  scrollbar-width: none;
}
.tf-shelf__row::-webkit-scrollbar { display: none; }
.tf-shelf__item { flex: 0 0 176px; display: flex; scroll-snap-align: start; }
/* 左右の送り（棚の両はし。銀の丸ボタン） */
.tf-shelf__nav {
  position: absolute;
  z-index: 2;
  top: 50%;
  width: 40px;
  height: 40px;
  margin-top: -28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff, var(--tf-silver));
  box-shadow: 0 0 0 2px var(--tf-silver-d), 0 3px 0 var(--tf-silver-d), 0 5px 10px rgba(0, 20, 60, .35);
  color: var(--tf-navy);
  font: 900 18px/1 var(--tf-font);
  cursor: pointer;
}
.tf-shelf__nav[hidden] { display: none; }
.tf-shelf__nav--prev { left: 8px; }
.tf-shelf__nav--next { right: 8px; }
.tf-shelf__nav:disabled { opacity: .35; cursor: default; }
/* まだ少ないときの空き札（ここに増えていくよ） */
.tf-shelf__ghost {
  flex: 0 0 176px;
  min-height: 172px;
  display: grid;
  place-items: center;
  padding: 12px;
  border: 3px dashed rgba(255, 255, 255, .55);
  border-radius: 14px;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.8;
  text-align: center;
  paint-order: stroke fill;
  -webkit-text-stroke: 2px var(--tf-navy);
}
.tf-shelf__ghost rt { -webkit-text-stroke-width: 1px; }

/* 棚のアレンジ（カード。白＋銀縁） */
.tf-shelfcard {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0;
  border: 4px solid #dfe6f2;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 4px 0 var(--tf-silver-d), 0 7px 12px rgba(0, 20, 60, .35);
  overflow: hidden;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: transform .15s ease;
}
.tf-shelfcard:hover { border-color: #fff4bf; transform: translateY(-3px); }
.tf-shelfcard--gold { border-color: #ffe27a; }
.tf-shelfcard__thumb {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  background: linear-gradient(180deg, #eaf4ff, #d8e8fb);
  border-bottom: 3px solid #dfe6f2;
}
.tf-shelfcard__thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.tf-shelfcard__thumb--empty img { inset: 22% 32%; width: 36%; height: 56%; object-fit: contain; opacity: .45; }
.tf-shelfcard__body {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 10px 8px;
}
.tf-shelfcard__stage { min-width: 0; overflow: hidden; font-size: 14px; font-weight: 900; line-height: 1.7; color: var(--tf-navy); white-space: nowrap; text-overflow: ellipsis; }
.tf-shelfcard__stars { flex: 0 0 auto; font-size: 14px; letter-spacing: -.05em; color: #f5b800; text-shadow: 0 1px 0 #b98a00; white-space: nowrap; }
/* ?shelf= で来たアレンジ（少しのあいだ黄色く光る） */
.tf-shelfcard.is-spot { border-color: var(--tf-yellow); animation: tf-shelf-spot 1.2s ease-in-out 2; }
@keyframes tf-shelf-spot {
  0%, 100% { box-shadow: 0 4px 0 var(--tf-silver-d), 0 0 0 0 rgba(255, 207, 31, 0); transform: translateY(0); }
  50% { box-shadow: 0 4px 0 var(--tf-silver-d), 0 0 0 6px rgba(255, 207, 31, .85), 0 0 22px 8px rgba(255, 230, 120, .8); transform: translateY(-4px); }
}

/* ---------- 棚のアレンジの窓（views/shelfSheet.js。.tf-dialog の語彙） ---------- */

/* .tf-dialog（幅 460px）より後ろの節にあるので、2 つのクラスで上書きする */
.tf-dialog.tf-sheet { width: min(calc(100% - 32px), 640px); max-height: calc(100% - 32px); overflow: auto; }
.tf-sheet .tf-dialog__box { position: relative; }
.tf-sheet__head { padding-right: 60px; }
.tf-sheet__body { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; padding: 16px 18px 6px; }
.tf-sheet__shot {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(180deg, #eaf4ff, #d8e8fb);
  box-shadow: 0 0 0 4px #dfe6f2, 0 4px 0 6px var(--tf-silver-d);
}
.tf-sheet__shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tf-sheet__shot--empty img { width: 36%; height: 56%; margin: 9% auto 0; object-fit: contain; opacity: .45; }
.tf-sheet__side { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tf-sheet__label { margin: 0; font-size: 14px; font-weight: 900; color: var(--tf-navy); }
/* カードの無い作品（アレンジではない作品）の一言 */
.tf-sheet__note { margin: 0; font-size: 15px; font-weight: 900; line-height: 2; color: var(--tf-navy); }
.tf-sheet__cards { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tf-sheet__cards[hidden] { display: none; }
.tf-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 10px;
  background: #f1f6fd;
  box-shadow: inset 0 0 0 2px #dbe6f4;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.8;
  color: var(--tf-navy);
}
.tf-chip__star { flex: 0 0 auto; color: #f5b800; text-shadow: 0 1px 0 #b98a00; letter-spacing: -.05em; }
.tf-chip__text { min-width: 0; }
.tf-sheet__stars { margin: auto 0 0; text-align: right; }
.tf-sheet__starbig { font-size: 30px; color: #f5b800; text-shadow: 0 2px 0 #b98a00; letter-spacing: -.04em; }
.tf-sheet__actions { display: flex; flex-direction: column; gap: 10px; padding: 14px 18px 18px; }
.tf-sheet__actions .tf-button { width: 100%; justify-content: center; }
.tf-sheet__play { min-height: 56px; font-size: 20px; }
.tf-sheet__play svg { width: 22px; height: 22px; fill: currentColor; }
.tf-sheet__btn { flex-direction: column; gap: 0; min-height: 64px; padding-top: 4px; padding-bottom: 8px; white-space: normal; line-height: 1.9; }
.tf-sheet__btn[aria-busy="true"] { cursor: progress; }
.tf-sheet__btnmain { font-size: 17px; }
.tf-sheet__btnsub { font-size: 12px; font-weight: 700; line-height: 2; opacity: .92; }
.tf-sheet__why { margin: -4px 4px 0; font-size: 13px; font-weight: 700; line-height: 1.8; color: #7a5a00; }
.tf-sheet__why[hidden] { display: none; }
.tf-sheet__fix { text-decoration: none; }
.tf-sheet__fix[hidden] { display: none; }
.tf-sheet__close {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  color: var(--tf-navy);
  font: 900 20px/1 var(--tf-font);
  cursor: pointer;
  box-shadow: 0 0 0 2px var(--tf-silver-d);
}
@media (max-width: 560px) {
  .tf-sheet__body { grid-template-columns: minmax(0, 1fr); }
  .tf-sheet__stars { margin-top: 0; }
}

/* ---------- 棚のアレンジで「あそぶ」重ね窓（views/playOverlay.js。遊ぶ専用の画面 /kadai/play/ の iframe） ---------- */

.tf-play {
  width: min(calc(100% - 24px), 1100px);
  height: min(calc(100% - 24px), 860px);
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(10, 40, 90, .35), var(--tf-silver-ring);
}
.tf-play::backdrop { background: rgba(20, 50, 90, .55); }
.tf-play__box { display: flex; flex-direction: column; height: 100%; }
.tf-play__head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 18px;
  background: linear-gradient(180deg, var(--tf-blue-l), var(--tf-blue) 45%, var(--tf-blue-d));
  box-shadow: inset 0 0 0 2px #ffd54a, inset 0 0 0 4px rgba(255, 255, 255, .35);
}
.tf-play__title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  color: #fff;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.8;
  paint-order: stroke fill;
  -webkit-text-stroke: 3px var(--tf-navy);
  text-shadow: 0 2px 0 var(--tf-navy);
}
.tf-play__title rt { -webkit-text-stroke: 1.5px var(--tf-navy); }
.tf-play__close {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--tf-navy);
  font: 900 20px/1 var(--tf-font);
  cursor: pointer;
  box-shadow: 0 0 0 2px var(--tf-silver-d), 0 2px 0 var(--tf-silver-d);
}
.tf-play__stage { position: relative; flex: 1 1 auto; min-height: 0; background: #eef3f8; }
.tf-play__wait { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--tf-navy); font-size: 16px; font-weight: 900; }
.tf-play.is-loaded .tf-play__wait { display: none; }
.tf-play__frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: transparent; }

@media (max-width: 767px) {
  .tf-shelf__row { gap: 12px; padding-left: 14px; padding-right: 14px; scroll-padding: 0 14px; }
  .tf-shelf__item, .tf-shelf__ghost { flex-basis: 150px; }
  .tf-shelf__nav { display: none; }
  .tf-shelf__title { font-size: 21px; }
  .tf-lockbay { min-height: 180px; }
  .tf-join { padding: 12px 14px; }
  .tf-join__so { width: 48px; height: 48px; }
  .tf-join__go { width: 100%; justify-content: center; }
}
/* 1 列の幅では、鍵の格納庫が 1 つずつ大きく縦に並んで棚が遠くなる。使える格納庫は幅いっぱい、鍵は小さく 2 列に */
@media (max-width: 520px) {
  .tf-grid.tf-grid--guest { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: auto; }
  .tf-grid--guest > .tf-grid__item:not(.tf-lockbay) { grid-column: 1 / -1; }
  .tf-grid--guest .tf-lockbay { min-height: 136px; padding-top: 24px; }
  .tf-grid--guest .tf-lockbay__in { gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .tf-new, .tf-shelfcard.is-spot { animation: none; }
  .tf-shelfcard { transition: none; }
  .tf-shelfcard.is-spot { box-shadow: 0 4px 0 var(--tf-silver-d), 0 0 0 5px rgba(255, 207, 31, .9); }
}

/* ---------- ① エディタ（iframe ＋ SO君パネル。§7.1） ---------- */

.tf-editor {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  background: #eef3f8;
}
.tf-editor__main { position: relative; flex: 1 1 auto; min-width: 0; }
/*
 * iframe の後ろに置く「準備中」。iframe が描けば隠れる（幕は iframe が出す。親は出さない）。
 * 見た目は iframe の中の「準備中」（prototypes/scratch-kadai/index.html の .sm-boot）と同じ（歩くキュン＋黄色い帯）
 */
.tf-editor__waiting {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--tf-navy);
}
.tf-editor__track { position: relative; width: 240px; height: 84px; overflow: hidden; border-bottom: 6px solid #9ad86f; border-radius: 0 0 6px 6px; }
.tf-editor__walker { position: absolute; left: 0; bottom: 0; width: 80px; height: 80px; animation: tfBootGo 3.2s linear infinite; }
.tf-editor__kyun {
  display: block;
  width: 80px;
  height: 80px;
  background: url("../../../wp-content/themes/cocoon-child-master/dist/images/monster-field/1.png") no-repeat 0 0 / 200% 100%;
  transform: scaleX(-1);
  animation: tfBootStep .8s steps(1, end) infinite;
}
@keyframes tfBootGo { from { transform: translateX(-80px); } to { transform: translateX(240px); } }
@keyframes tfBootStep { 0% { background-position: 0 0; } 50% { background-position: 100% 0; } }
.tf-editor__bar { position: relative; width: 240px; height: 10px; overflow: hidden; border-radius: 5px; background: #fff; box-shadow: 0 0 0 2px #c9d3df; }
.tf-editor__bar i { position: absolute; top: 0; bottom: 0; left: 0; width: 40%; border-radius: 5px; background: linear-gradient(90deg, #fff08a, #ffcf1f); animation: tfBootBar 1.4s ease-in-out infinite; }
@keyframes tfBootBar { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.tf-editor__waiting-text { margin: 6px 0 0; font-size: 17px; font-weight: 900; line-height: 2; }
@media (prefers-reduced-motion: reduce) {
  .tf-editor__walker, .tf-editor__kyun, .tf-editor__bar i { animation: none; }
  .tf-editor__walker { transform: translateX(80px); }
}
.tf-editor__frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: transparent;
}
.tf-editor.is-loaded .tf-editor__waiting { visibility: hidden; }
.tf-editor.is-loaded .tf-editor__waiting * { animation: none; }

/*
 * SO君パネル（P1「青い板の帯＋SO君」。2026-09-26 ユーザー選択）。幅 1400px 以上は横に並べ、未満は重ねる。
 * 上はエディタの帯と同じ青い板。2026-09-29 ユーザー指摘「セリフ欄が狭い」で帯を約 80px に細くした（SO君は約 72px で帯の中、
 * 題名の下にゲージ。会員はゲージを出すので状態行は隠す＝考え中は SO君の「…」の雲、作品を見せる中は入力欄の 📎 が黄色）。
 * 考え中は SO君の横に「…」の雲と黄色い「考え中…」の札。返事は黄色い名札「SO君」つきの吹き出し（会話の中の小さな顔は外す）。
 * ⚠️ 吹き出しの中身（.message・.content・.typing-indicator）の見た目は _chat-internals.css（C）。ここは #soPanel 付きで上書きだけ
 */
#soPanel {
  position: relative;
  z-index: 20;
  flex: 0 0 var(--tf-panel-w);
  width: var(--tf-panel-w);
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-left: 1px solid var(--tf-line);
  box-shadow: -2px 0 0 var(--tf-silver), -3px 0 0 var(--tf-silver-d);
}
.tf-editor[data-panel="closed"] #soPanel { display: none; }

.tf-so__head {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 80px;
  /* 左の 86px は SO君、右の 116px は ⋯ と畳むボタン（#soPanelToggle。パネルの外の要素を重ねている） */
  padding: 8px 116px 12px 86px;
  background: var(--tf-bar-grad);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .45),
    inset 0 -4px 0 var(--tf-silver),
    inset 0 -5px 0 var(--tf-silver-d),
    0 3px 8px rgba(0, 30, 80, .25);
}
/* SO君は帯の中（会話の上にはかけない。スクロールした文字と重なるので） */
.tf-so__avatar-wrap {
  position: absolute;
  left: 8px;
  bottom: 6px;
  width: 70px;
  height: 70px;
  transform-origin: 50% 100%;
}
.tf-so__avatar {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  /* 絵（500×500）の中の SO君は真ん中の 6 割ほど。足を銀のふちに合わせて寄せる */
  transform: scale(1.32);
  transform-origin: 50% 78%;
  filter: drop-shadow(0 3px 3px rgba(0, 30, 80, .35));
}
/* 考え中は SO君のとなりに「…」の雲 */
.tf-so__avatar-wrap::after {
  content: "";
  position: absolute;
  left: 46px;
  top: -2px;
  width: 36px;
  height: 24px;
  border-radius: 12px;
  background: #fff radial-gradient(circle, var(--tf-blue-d) 2.5px, transparent 3px) 5px 50% / 9px 8px repeat-x;
  box-shadow: 0 0 0 2px var(--tf-silver), 0 2px 0 3px var(--tf-silver-d);
  opacity: 0;
  transform: scale(.6);
  transition: opacity .2s, transform .2s;
  pointer-events: none;
}
.tf-so__avatar-wrap[data-so-state="thinking"]::after { opacity: 1; transform: scale(1); }
.tf-so__heading { flex: 1 1 auto; min-width: 0; }
.tf-so__title {
  color: #fff;
  font-size: 19px;
  font-weight: 900;
  line-height: 1.5;
  paint-order: stroke fill;
  -webkit-text-stroke: 3px var(--tf-navy);
  text-shadow: 0 2px 0 var(--tf-navy);
}
.tf-so__title rt { -webkit-text-stroke: 1.5px var(--tf-navy); }
/* 状態行は白い札（考え中は黄色）。文言は editor.js（SO君の姿に合わせる） */
.tf-so__status {
  display: inline-block;
  max-width: 100%;
  margin-top: 2px;
  padding: 1px 12px 1px 10px;
  border-radius: 999px;
  background: #fff;
  color: #2c6b2e;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.8;
  box-shadow: 0 2px 0 var(--tf-silver-d);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tf-so__status::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--tf-ok);
  vertical-align: 1px;
}
.tf-so__status[data-tone="thinking"] { background: #fff4bf; color: #7a5600; }
.tf-so__status[data-tone="thinking"]::before { background: var(--tf-yellow); box-shadow: 0 0 0 2px #f5b800; }
/* ⋯ は › のとなり（帯の縦の真ん中） */
.tf-so__icon {
  position: absolute;
  top: 18px;
  right: 64px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  cursor: pointer;
}
.tf-so__icon:hover, .tf-so__icon[aria-expanded="true"] { background: rgba(255, 255, 255, .3); }
.tf-so__icon svg { width: 20px; height: 20px; fill: currentColor; }

/*
 * 今日 SO君に聞ける回数のゲージ（§4.6）。題名の下（状態行の場所）に黄色い目盛り。
 * 上限が 10 より多いときは 10 目盛りに丸めて、右に「今日あと N 回」
 */
.tf-so__quota {
  position: absolute;
  left: 86px;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}
.tf-so__quota-cells {
  display: flex;
  gap: 2px;
  padding: 4px 5px;
  border-radius: 10px;
  background: rgba(18, 58, 122, .55);
  box-shadow: 0 0 0 2px var(--tf-silver), 0 0 0 3px var(--tf-silver-d);
}
.tf-so__quota-cell {
  position: relative;
  width: 6px;
  height: 12px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .22);
}
.tf-so__quota-cell.is-on {
  background: var(--tf-yellow-grad);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 0 4px rgba(255, 207, 31, .6);
}
/* 減った目盛りは 1 回だけ弾けて消える（動きを減らす設定では付けない＝quota.js） */
.tf-so__quota-cell.is-leaving::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 3px;
  background: var(--tf-yellow-grad);
  animation: tf-quota-leave .7s ease-out forwards;
}
@keyframes tf-quota-leave {
  0% { opacity: 1; transform: scale(1); }
  40% { opacity: 1; transform: scale(1.6) translateY(-3px); }
  100% { opacity: 0; transform: scale(.4) translateY(-10px); }
}
.tf-so__quota-text {
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.6;
  paint-order: stroke fill;
  -webkit-text-stroke: 2px var(--tf-navy);
  text-shadow: 0 1px 0 var(--tf-navy);
  white-space: nowrap;
}
.tf-so__quota-text b { font-size: 14px; color: var(--tf-yellow); }
.tf-so__quota-text rt { -webkit-text-stroke-width: 1px; }
.tf-so__quota-text.is-changed b { display: inline-block; animation: tf-quota-bump .5s ease-out; }
@keyframes tf-quota-bump { 0% { transform: scale(1); } 40% { transform: scale(1.45); } 100% { transform: scale(1); } }
/* ゲージを出しているとき（会員）は状態行を隠して、その場所をゲージにゆずる */
#soPanel:not([data-ai="guest"]):not([data-ai="prohibited"]) .tf-so__head:has(.tf-so__quota:not([hidden])) .tf-so__status { display: none; }
/* 回数はゲスト・禁止では出さない（使い切りのときは空のゲージのまま出す） */
#soPanel[data-ai="guest"] .tf-so__quota,
#soPanel[data-ai="prohibited"] .tf-so__quota { display: none !important; }

/* ゲスト・AI 禁止: SO君は灰色でおひるね。チャット欄とチップは出さない（⑥a／⑥b だけ） */
#soPanel[data-ai="guest"] .tf-so__avatar,
#soPanel[data-ai="prohibited"] .tf-so__avatar { filter: grayscale(1) drop-shadow(0 3px 3px rgba(0, 30, 80, .35)); opacity: .8; }
#soPanel[data-ai="guest"] .tf-so__status,
#soPanel[data-ai="prohibited"] .tf-so__status { color: #5d6f80; }
#soPanel[data-ai="guest"] .tf-so__status::before,
#soPanel[data-ai="prohibited"] .tf-so__status::before { background: var(--tf-silver-d); box-shadow: none; }
#soPanel[data-ai="guest"] .chat-area,
#soPanel[data-ai="prohibited"] .chat-area,
#soPanel[data-ai="guest"] #quickPromptChips,
#soPanel[data-ai="prohibited"] #quickPromptChips { display: none !important; }

/*
 * 今日の分を使い切った（data-ai="exhausted"。§4.6）: SO君は寝る。会話はそのまま読めるが、チップ・入力欄（作品を見せるスイッチを含む）
 * の代わりに #aiExhaustedCard。app.js は #inputArea に style.display を書くので !important で隠す
 */
#aiExhaustedCard { display: none; }
#soPanel[data-ai="exhausted"] #aiExhaustedCard { display: flex; }
#soPanel[data-ai="exhausted"] #quickPromptChips,
#soPanel[data-ai="exhausted"] #inputArea { display: none !important; }
#soPanel[data-ai="exhausted"] .tf-so__status::before { background: var(--tf-silver-d); }

/* 会話（app.js がこの .chat-area をスクロールする） */
#soPanel .chat-area {
  position: relative;
  inset: auto;
  flex: 1 1 auto;
  min-height: 0;
  width: auto;
  height: auto;
  max-width: none;
  margin: 0;
  padding: 14px;
  overflow-y: auto;
  overflow-x: hidden;
  /* 空の色の地 */
  background: linear-gradient(180deg, #dcefff 0, #eef6ff 180px, #f5f8fd 100%);
  transform: none;
}
#soPanel .messages-container { position: static; width: auto; max-width: none; margin: 0; padding: 0; }

/* SO君の返事は名札つきの吹き出し（丸い顔は上の大きい SO君に任せる。app.js の DOM はそのまま） */
#soPanel .message.assistant .avatar,
#soPanel .typing-indicator .avatar { display: none; }
#soPanel .message.assistant .content {
  position: relative;
  max-width: 100%;
  margin-top: 14px;
  padding: 18px 16px 12px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.85;
}
#soPanel .message.assistant .content::before {
  content: "創くん";
  position: absolute;
  left: 12px;
  top: -14px;
  padding: 2px 16px 2px 10px;
  background: var(--tf-yellow-grad);
  color: var(--tf-navy);
  clip-path: polygon(0 0, 100% 0, calc(100% - 9px) 100%, 0 100%);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.5;
}
#soPanel .messages-container .teacher-report-actions { padding-left: 8px; }

#soPanel #quickPromptChips {
  position: static;
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  flex-wrap: nowrap;
  gap: 6px;
  width: auto;
  margin: 0;
  padding: 8px 12px;
  /* 1 列に並べ、はみ出した分は横にスクロール（折り返すとセリフ欄が 3 段ぶん狭くなる） */
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  background: #f5f8fd;
  transform: none;
}
/* チップの押せる面は 44px（見た目は _chat-internals.css の .prompt-chip。高さだけここで決める） */
#soPanel .prompt-chip { flex: none; min-height: 44px; padding-top: 4px; padding-bottom: 4px; white-space: nowrap; }

#soPanel #inputArea {
  position: static;
  flex: 0 0 auto;
  width: auto;
  max-width: none;
  margin: 0;
  padding: 8px 12px 12px;
  background: #fff;
  border-top: 1px solid var(--tf-line);
  transform: none;
}

/*
 * 作品を見せる（トグル。§4.2）。入力欄の中、マイクの左の 44px の丸いボタン。OFF は灰、ON は黄色。
 * 「作品を見て」などのチップ（data-share）も同じスイッチを ON にする（app.js。送ったら自動で OFF に戻る）
 */
.tf-share {
  position: relative;
  flex: none;
  display: flex;
  margin: 0;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}
.tf-share__input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.tf-share__face {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #eef3f8;
  color: #5d6f80;
  font-size: 20px;
  line-height: 1;
  box-shadow: inset 0 0 0 2px var(--tf-line);
  filter: grayscale(.6);
  transition: background .15s, box-shadow .15s, filter .15s;
}
.tf-share:hover .tf-share__input:not(:disabled) + .tf-share__face { background: #e2ebf5; }
.tf-share__input:checked + .tf-share__face {
  filter: none;
  background: var(--tf-yellow-grad);
  color: var(--tf-navy);
  box-shadow: inset 0 0 0 2px #f5b800, 0 2px 0 var(--tf-silver-d);
}
.tf-share__input:focus-visible + .tf-share__face { outline: 3px solid var(--tf-blue); outline-offset: 2px; }
.tf-share__input:disabled + .tf-share__face { opacity: .5; cursor: default; }
.tf-share:has(.tf-share__input:disabled) { cursor: default; }

/* ⑥a（未ログイン）・⑥b（AI 禁止）。app.js は style.display を '' にして出すので、出ているときの形はここで決める */
.tf-rest {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px 22px;
  background: #f5f8fd;
  text-align: center;
}
.tf-rest__badge {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--tf-bar-grad);
  box-shadow: 0 0 0 4px #fff, var(--tf-silver-ring);
}
.tf-rest__badge img { width: 34px; height: auto; display: block; }
.tf-rest__so { width: 110px; height: 110px; object-fit: contain; filter: grayscale(1); opacity: .55; }
.tf-rest__title { font-size: 17px; font-weight: 900; line-height: 1.9; color: var(--tf-navy); text-wrap: balance; }
.tf-rest__text { font-size: 14px; font-weight: 700; line-height: 1.9; color: #3b4a6b; }
.tf-rest__line { display: block; text-wrap: balance; }
.tf-rest__cta { min-width: 240px; min-height: 52px; font-size: 17px; border-radius: 26px; }
.tf-rest__link {
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--tf-blue-d);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.9;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
/* 使い切りのカード: 会話の下に、入力欄の代わりに置く（パネル全体は埋めない） */
.tf-rest--done {
  flex: 0 0 auto;
  gap: 4px;
  padding: 16px 18px 20px;
  background: #fffbe0;
  border-top: 3px solid var(--tf-yellow);
  box-shadow: inset 0 1px 0 #fff, 0 -2px 8px rgba(10, 40, 90, .08);
}
.tf-rest--done .tf-rest__title { font-size: 18px; }
.tf-rest__adult {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  background: #fff8db;
  box-shadow: inset 0 0 0 1px #f5d77a;
  color: #6b4e00;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.7;
  text-align: left;
}

/* 畳む／開く（#soPanelToggle 1 つで両方。開いているときはパネル右上の「›」、畳んだら右端中央の SO君の顔のタブ） */
.tf-so-toggle {
  position: absolute;
  z-index: 30;
  padding: 0;
  border: 0;
  cursor: pointer;
}
.tf-editor[data-panel="open"] .tf-so-toggle {
  top: 16px;
  right: 12px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: var(--tf-navy);
  box-shadow: inset 0 0 0 2px var(--tf-silver), 0 2px 0 var(--tf-silver-d);
}
.tf-editor[data-panel="open"] .tf-so-toggle:hover { background: #f3f8ff; }
.tf-so-toggle__fold svg { width: 20px; height: 20px; display: block; }
.tf-editor[data-panel="open"] .tf-so-toggle__tab { display: none; }
.tf-editor[data-panel="closed"] .tf-so-toggle__fold { display: none; }
.tf-editor[data-panel="closed"] .tf-so-toggle {
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  width: 52px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 18px 0 0 18px;
  background: var(--tf-bar-grad);
  box-shadow: inset 2px 0 0 rgba(255, 255, 255, .45), -3px 0 0 var(--tf-silver), -4px 0 0 var(--tf-silver-d), -2px 4px 10px rgba(0, 30, 80, .3);
}
.tf-editor[data-panel="closed"] .tf-so-toggle:hover { filter: brightness(1.06); }
.tf-so-toggle__tab img {
  width: 40px;
  height: 40px;
  display: block;
  object-fit: cover;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 2px #fff;
}

/* 幅 1400px 未満: パネルは Scratch に重ねる（iframe は縮めない。§7.1） */
@media (max-width: 1399px) {
  #soPanel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    height: auto;
    box-shadow: -2px 0 0 var(--tf-silver), -3px 0 0 var(--tf-silver-d), -10px 0 24px rgba(0, 30, 80, .22);
  }
}

/* ---------- メニュー（ホームとパネルの「⋯」で共用） ---------- */

.tf-menu {
  position: fixed;
  z-index: 9000;
  min-width: 230px;
  max-width: calc(100vw - 24px);
  padding: 6px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(10, 40, 90, .25), var(--tf-silver-ring);
}
.tf-menu__list { list-style: none; padding: 0; }
.tf-menu__list a, .tf-menu__list button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 4px 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--tf-navy);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.8;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.tf-menu__list a:hover, .tf-menu__list button:hover,
.tf-menu__list a:focus-visible, .tf-menu__list button:focus-visible { background: #eaf2fc; outline: none; }
#furiganaStatus { margin-left: 4px; }
/* 未ログインでは会員だけの項目を出さない（page.js が :root[data-member] を付ける） */
:root:not([data-member="1"]) [data-tf-member] { display: none; }

/* カードの ⋯ の小さいメニュー */
.tf-cardmenu { min-width: 190px; }
.tf-cardmenu .tf-menu__danger { color: #b3261e; }

/* ---------- ダイアログ（free.css の .free-dialog: 白い箱＋銀縁、青い板の見出しに黄色の線。§7.3） ---------- */

.tf-dialog {
  width: min(calc(100% - 32px), 460px);
  max-width: none;
  max-height: calc(100% - 32px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: #fff;
  color: var(--tf-ink);
  overflow: visible;
  box-shadow: 0 12px 30px rgba(10, 40, 90, .35), var(--tf-silver-ring);
}
.tf-dialog::backdrop { background: rgba(20, 50, 90, .32); }
.tf-dialog__box { display: block; margin: 0; overflow: hidden; border-radius: 16px; }
.tf-dialog__head {
  padding: 14px 18px 12px;
  background: linear-gradient(180deg, var(--tf-blue-l), var(--tf-blue) 45%, var(--tf-blue-d));
  box-shadow: inset 0 0 0 2px #ffd54a, inset 0 0 0 4px rgba(255, 255, 255, .35);
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.7;
  paint-order: stroke fill;
  -webkit-text-stroke: 3px var(--tf-navy);
  text-shadow: 0 2px 0 var(--tf-navy);
}
.tf-dialog__head rt { -webkit-text-stroke: 1.5px var(--tf-navy); }
.tf-dialog__body {
  padding: 16px 18px 6px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.9;
}
.tf-dialog__body p + p { margin-top: 8px; }
.tf-dialog__label { display: block; margin-bottom: 4px; font-size: 14px; font-weight: 900; color: var(--tf-navy); }
.tf-dialog__input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  box-shadow: inset 0 0 0 2px var(--tf-silver);
  font: inherit;
  font-size: 17px;
  font-weight: 800;
  color: var(--tf-ink);
  background: #fff;
}
.tf-dialog__input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--tf-blue), 0 0 0 3px rgba(47, 134, 234, .25); }
.tf-dialog__input[aria-invalid="true"] { box-shadow: inset 0 0 0 2px var(--tf-warn); }
.tf-dialog__hint { margin-top: 4px; font-size: 12px; color: #5d6f80; }
.tf-dialog__error {
  margin-top: 8px;
  padding: 6px 12px;
  border-radius: 10px;
  background: #fff3e6;
  color: #8a380e;
  font-size: 13px;
  font-weight: 800;
}
.tf-dialog__choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; border: 0; padding: 0; }
.tf-dialog__choices legend { padding: 0; margin-bottom: 4px; font-size: 14px; font-weight: 900; color: var(--tf-navy); }
.tf-choice { position: relative; display: block; cursor: pointer; }
.tf-choice input { position: absolute; opacity: 0; pointer-events: none; }
.tf-choice__face {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 92px;
  padding: 10px;
  border-radius: 14px;
  background: #f0f5fb;
  box-shadow: inset 0 0 0 2px #dbe6f3;
  text-align: center;
}
.tf-choice__icon { font-size: 30px; line-height: 1.2; }
.tf-choice__img { width: 40px; height: 40px; object-fit: contain; display: block; }
.tf-choice__name { font-size: 15px; font-weight: 900; line-height: 1.7; color: var(--tf-navy); }
.tf-choice__sub { font-size: 12px; font-weight: 700; line-height: 1.6; color: #5d6f80; }
.tf-choice input:checked + .tf-choice__face { background: #fffbe0; box-shadow: inset 0 0 0 3px #f5b800, 0 2px 0 var(--tf-silver-d); }
.tf-choice input:focus-visible + .tf-choice__face { outline: 3px solid var(--tf-blue); outline-offset: 2px; }
.tf-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 12px 18px 18px;
}

/* ---------- お知らせ（ページの操作。app.js のトーストは #toastContainer で別） ---------- */

.tf-toasts {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 9995;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(420px, calc(100vw - 32px));
  pointer-events: none;
}
.tf-toast {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px 10px 14px;
  border-radius: 12px;
  background: #fff;
  color: var(--tf-ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.9;
  box-shadow: 0 6px 18px rgba(10, 40, 90, .2), 0 0 0 3px var(--tf-silver), 0 0 0 4px var(--tf-silver-d);
  pointer-events: auto;
}
.tf-toast--warn { box-shadow: 0 6px 18px rgba(10, 40, 90, .2), 0 0 0 3px #ffd2ad, 0 0 0 4px var(--tf-warn); }
.tf-toast__text { flex: 1 1 auto; }
.tf-toast__close {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
}

/* ---------- 入口の下の説明文（SEO） ---------- */

.tf-seo {
  position: relative;
  padding: 56px 20px 64px;
  background: #fff;
  border-top: 6px solid #dfe6f2;
  box-shadow: 0 -3px 0 var(--tf-silver-d);
}
.tf-seo .seo-content { max-width: 1100px; margin: 0 auto; color: #33414f; font-size: 16px; line-height: 2; }
.tf-seo__block + .tf-seo__block { margin-top: 56px; }
.tf-seo__heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 4px solid var(--tf-yellow);
  color: var(--tf-navy);
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 900;
  line-height: 1.6;
}
.tf-seo__heading-icon { flex: 0 0 auto; width: 52px; height: 52px; object-fit: contain; }
.tf-seo__intro { font-size: 16px; line-height: 2; }
.tf-seo__intro b { color: var(--tf-navy); font-weight: 900; background: linear-gradient(transparent 62%, #fff08a 62%); }

/*
 * 一回りの流れ（§15.1 #4）: 課題をクリア → コインをゲット → 動く素材と交換 → 創くんと作る → また修行へ。
 * 絵（.tf-loop__art）は既存の画像を HTML で組んだもの（新しい画像ファイルは足していない）。中の文字は飾り（aria-hidden）。
 * 4 枚を横に並べて ➜ でつなぎ、下の「また修行へ」の帯で最初に戻る。1023px 以下は 2 列、520px 以下は 1 列（番号で順を見せる）。
 */
.tf-loop {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 34px;
  counter-reset: tf-loop;
}
.tf-loop__step {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 12px 12px 16px;
  border: 4px solid #dfe6f2;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 5px 0 var(--tf-silver-d);
}
/* つなぎの矢印（最後の 1 枚の右には出さない） */
.tf-loop__step:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -33px;
  top: 30%;
  width: 26px;
  height: 30px;
  background: var(--tf-yellow-grad);
  clip-path: polygon(0 18%, 55% 18%, 55% 0, 100% 50%, 55% 100%, 55% 82%, 0 82%);
  filter: drop-shadow(0 2px 0 #b98a00);
}
.tf-loop__art {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 12px;
  background: linear-gradient(180deg, #dcefff, #f5f8fd);
  box-shadow: inset 0 0 0 2px #e3ebf5;
}
.tf-loop__art img { display: block; }
.tf-loop__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--tf-navy);
  font-size: 17px;
  font-weight: 900;
  line-height: 1.7;
}
.tf-loop__no {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--tf-bar-grad);
  color: #fff;
  font-size: 15px;
  line-height: 1;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--tf-silver-d);
}
.tf-loop__text { margin-top: 4px; font-size: 14px; line-height: 1.9; }

/* 1. 課題をクリア: スクラッチモンスターの課題エディタ（小）に CLEAR! のはんこ */
.tf-loop__win {
  position: absolute;
  inset: 10% 8% 10%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 3px solid #fff;
  border-radius: 10px;
  background: linear-gradient(180deg, #bfe3ff 0 60%, #8fd07a 60% 100%);
  box-shadow: 0 0 0 2px var(--tf-silver-d), 0 8px 16px rgba(0, 30, 80, .25);
}
.tf-loop__winbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 6px 2px;
  background: var(--tf-bar-grad);
  box-shadow: inset 0 -2px 0 var(--tf-silver);
}
.tf-loop__winbar img { width: auto; height: 17px; }
.tf-loop__wintag {
  padding: 0 10px 0 6px;
  background: var(--tf-yellow-grad);
  color: var(--tf-navy);
  clip-path: polygon(0 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.6;
}
.tf-loop__winbody { position: relative; flex: 1 1 auto; }
.tf-loop__kyun { position: absolute; left: 4%; bottom: 4%; width: 36%; height: auto; }
.tf-loop__stamp {
  position: absolute;
  right: 5%;
  top: 10%;
  color: #fff;
  font-family: "Arial Black", "Arial", sans-serif;
  font-size: clamp(18px, 1.9vw, 26px);
  font-style: italic;
  font-weight: 900;
  letter-spacing: -.04em;
  paint-order: stroke fill;
  -webkit-text-stroke: 4px #163b60;
  text-shadow: 1px 3px 0 #163b60;
  transform: rotate(-8deg);
  animation: tf-loop-stamp 3s ease-out infinite;
}
@keyframes tf-loop-stamp {
  0%, 12% { opacity: 0; transform: rotate(-8deg) scale(1.8); }
  20% { opacity: 1; transform: rotate(-8deg) scale(.94); }
  26%, 90% { opacity: 1; transform: rotate(-8deg) scale(1); }
  100% { opacity: 0; transform: rotate(-8deg) scale(1); }
}

/* 2. コインをゲット: 光るコインと +100、まわりの小さいコインが浮く */
.tf-loop__art--coin { background: radial-gradient(circle at 50% 50%, #fff7cc, #dcefff 70%); }
.tf-loop__halo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 70%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 240, 150, .95), rgba(255, 207, 31, .4) 55%, transparent);
  transform: translate(-50%, -50%);
  animation: tf-sc-glow 1.5s ease-in-out infinite;
}
.tf-loop__bigcoin { position: absolute; left: 50%; top: 50%; width: 38%; height: auto; transform: translate(-50%, -50%); filter: drop-shadow(0 4px 0 rgba(120, 80, 0, .35)); }
.tf-loop__minicoin { position: absolute; width: 14%; height: auto; animation: tf-sc-float 2s ease-in-out infinite; }
.tf-loop__minicoin--1 { left: 12%; top: 16%; }
.tf-loop__minicoin--2 { right: 12%; top: 22%; animation-delay: -.7s; }
.tf-loop__minicoin--3 { left: 18%; bottom: 14%; animation-delay: -1.3s; }
.tf-loop__plus {
  position: absolute;
  right: 8%;
  bottom: 10%;
  color: #ffe253;
  font-family: "Arial Black", "Arial", sans-serif;
  font-size: clamp(20px, 2.2vw, 28px);
  font-weight: 900;
  paint-order: stroke fill;
  -webkit-text-stroke: 4px #704622;
  text-shadow: 0 2px 0 #704622;
  transform: rotate(-6deg);
}

/* 3. 動く素材と交換: 🔒100 のタイル ➜ ✓ のタイル（交換したティラノは歩く） */
.tf-loop__art--trade { display: flex; align-items: center; justify-content: center; gap: 6%; padding: 0 6%; }
.tf-loop__tile {
  position: relative;
  flex: 0 0 38%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(180deg, #f7fbff, #e3edf8);
  box-shadow: inset 0 0 0 2px #dfe6f2, 0 3px 0 var(--tf-silver-d);
}
.tf-loop__tile > img { width: 84%; height: 84%; object-fit: contain; }
.tf-loop__tile.is-open { box-shadow: inset 0 0 0 3px var(--tf-ok), 0 0 14px 4px rgba(60, 195, 90, .45), 0 3px 0 var(--tf-silver-d); }
.tf-loop__lock {
  position: absolute;
  left: 50%;
  bottom: -9px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 1px 7px 1px 6px;
  border-radius: 999px;
  background: var(--tf-navy);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.5;
  white-space: nowrap;
  box-shadow: 0 0 0 2px #fff;
  transform: translateX(-50%);
}
.tf-loop__lock img { width: 14px; height: 14px; }
.tf-loop__arrow { flex: 0 0 auto; color: #f5b800; font-size: 26px; font-weight: 900; text-shadow: 0 2px 0 #b98a00; }
.tf-loop__walk { position: relative; width: 92%; aspect-ratio: 786 / 360; overflow: hidden; }
.tf-loop__walk .tf-strip, .tf-loop__trex .tf-strip, .tf-mat__trex .tf-strip { --frames: 5; --dur: .6s; }
.tf-loop__ok {
  position: absolute;
  left: 50%;
  bottom: -9px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--tf-ok);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 0 0 2px #fff;
  transform: translateX(-50%);
}

/* 4. 創くんと作る: 遺跡のステージでティラノが歩き、創くんがひらめきをくれる */
.tf-loop__stage { position: absolute; inset: 7% 26% 22% 5%; overflow: hidden; border-radius: 8px; box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--tf-silver-d); }
.tf-loop__bg { width: 100%; height: 100%; object-fit: cover; }
.tf-loop__trex { position: absolute; left: 4%; bottom: 10%; height: 30%; aspect-ratio: 786 / 360; overflow: hidden; animation: tf-loop-walk 6s linear infinite; }
@keyframes tf-loop-walk { 0% { transform: translateX(0); } 50% { transform: translateX(80%); } 50.01% { transform: translateX(80%) scaleX(-1); } 99.99% { transform: translateX(0) scaleX(-1); } 100% { transform: translateX(0); } }
.tf-loop__so { position: absolute; right: -4%; bottom: -6%; width: 52%; height: auto; transform: scaleX(-1); filter: drop-shadow(0 4px 6px rgba(0, 30, 80, .3)); }
.tf-loop__hint {
  position: absolute;
  right: 30%;
  top: 44%;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 3px solid var(--tf-silver);
  border-radius: 50%;
  background: #fff;
  font-size: 18px;
  box-shadow: 0 2px 0 var(--tf-silver-d);
  animation: tf-sc-float 2s ease-in-out infinite;
}

/* また修行へ（一回りの帯。最初の 1 に戻る） */
.tf-loop__again {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
  padding: 10px 18px;
  border: 3px dashed #f5b800;
  border-radius: 999px;
  background: #fffbe0;
  color: var(--tf-navy);
  font-size: 17px;
  font-weight: 900;
  line-height: 1.8;
  text-align: center;
}
.tf-loop__again-icon {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--tf-yellow-grad);
  font-size: 22px;
  line-height: 1;
  box-shadow: 0 2px 0 #b98a00;
}

/* 3 枚目のカード「使う：動く素材」: 動く素材の実物（入口の場面と同じ絵と動き） */
.tf-mat { position: relative; overflow: hidden; background: #bfe3ff; }
.tf-mat img { display: block; }
.tf-mat__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tf-mat__ptera { position: absolute; left: 52%; top: 4%; width: 24%; aspect-ratio: 547 / 360; animation: tf-sc-bob 2s ease-in-out infinite; }
.tf-mat__ptera .tf-f0 { animation: tf-sc-f2a .5s step-end infinite; }
.tf-mat__ptera .tf-f1 { opacity: 0; animation: tf-sc-f2b .5s step-end infinite; }
.tf-mat__chest { position: absolute; left: 76%; bottom: 44%; width: 17%; aspect-ratio: 1; }
.tf-mat__chest > img { width: 100%; height: 100%; object-fit: contain; }
.tf-mat__sparkle { position: absolute; left: -10%; top: -55%; width: 120%; aspect-ratio: 1; }
.tf-mat__sparkle .tf-f0 { animation: tf-sc-f2a .8s step-end infinite; }
.tf-mat__sparkle .tf-f1 { opacity: 0; animation: tf-sc-f2b .8s step-end infinite; }
.tf-mat__trex { position: absolute; left: 30%; bottom: 30%; height: 22%; aspect-ratio: 786 / 360; overflow: hidden; }
.tf-mat__hero { position: absolute; left: 2%; bottom: 2%; height: 44%; aspect-ratio: 1; }
.tf-mat__hero .tf-f0 { animation: tf-sc-hero0 4s step-end infinite; }
.tf-mat__hero .tf-f1 { opacity: 0; animation: tf-sc-hero1 4s step-end infinite; }
.tf-mat__hero .tf-f2 { opacity: 0; animation: tf-sc-hero2 4s step-end infinite; }
.tf-mat__mage { position: absolute; left: 44%; bottom: 3%; height: 38%; aspect-ratio: 1; animation: tf-sc-float 2s ease-in-out infinite; }
.tf-mat__mage img { width: 100%; height: 100%; object-fit: contain; }
.tf-mat__slime { position: absolute; right: 6%; bottom: 4%; width: 13%; aspect-ratio: 301 / 360; transform-origin: 50% 100%; animation: tf-sc-slime 4s ease-in-out infinite; }
.tf-mat__slime img { width: 100%; height: 100%; object-fit: contain; }
.tf-seo__features { list-style: none; padding: 0; margin-top: 24px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.tf-seo__feature {
  padding: 14px 14px 18px;
  border: 4px solid #dfe6f2;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 5px 0 var(--tf-silver-d);
}
.tf-seo__feature-image { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 12px; display: block; }
.tf-seo__feature-title { margin: 12px 0 4px; font-size: 18px; font-weight: 900; line-height: 1.7; color: var(--tf-blue-d); }
.tf-seo__feature-text { font-size: 14px; line-height: 1.9; }
.tf-seo__faq { display: grid; gap: 14px; }
.tf-seo__faq-item { padding: 16px 18px; border-radius: 16px; background: #f5f8fd; box-shadow: inset 0 0 0 2px #e3ebf5; }
.tf-seo__faq-item h3 { font-size: 17px; font-weight: 900; line-height: 1.8; color: var(--tf-blue-d); }
.tf-seo__faq-item p { margin-top: 4px; font-size: 15px; line-height: 2; }
.tf-seo__panel { padding: 18px 20px; border-radius: 16px; background: #f5f8fd; box-shadow: inset 0 0 0 2px #e3ebf5; }
.tf-seo__panel + .tf-seo__panel { margin-top: 16px; }
.tf-seo__subtitle { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 18px; font-weight: 900; line-height: 1.7; color: var(--tf-navy); }
.tf-seo__subtitle-icon { width: 36px; height: 36px; object-fit: contain; }
.tf-seo__safety { list-style: none; padding: 0; display: grid; gap: 12px; }
.tf-seo__safety li { padding-left: 28px; position: relative; }
.tf-seo__safety li::before { content: "✓"; position: absolute; left: 4px; top: 0; color: var(--tf-ok); font-weight: 900; }
.tf-seo__safety strong { display: block; font-size: 15px; line-height: 1.9; color: var(--tf-navy); }
.tf-seo__safety small { display: block; font-size: 13px; line-height: 1.9; color: #4a5a6a; }
.tf-seo__footnote { margin-top: 12px; font-size: 12px; line-height: 1.8; color: #5d6f80; }
.tf-seo__privacy { margin-top: 16px; }
.tf-seo__privacy a { display: inline-block; padding: 8px 0; color: var(--tf-blue-d); font-weight: 800; }
.tf-seo__services { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.tf-seo__service {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border: 4px solid #dfe6f2;
  border-radius: 18px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  box-shadow: 0 5px 0 var(--tf-silver-d);
}
.tf-seo__service:hover { border-color: #fff4bf; }
.tf-seo__service-logo { flex: 0 0 auto; width: 120px; display: grid; place-items: center; }
.tf-seo__service-logo img { max-width: 100%; max-height: 64px; object-fit: contain; }
.tf-seo__service-info { display: flex; flex-direction: column; min-width: 0; }
.tf-seo__service-name { font-size: 18px; font-weight: 900; line-height: 1.7; color: var(--tf-navy); }
.tf-seo__service-desc { font-size: 14px; line-height: 1.9; }

/* ---------- フッター（サイト共通。旧 fullscreen-ui.css から移植、見た目は今のまま） ---------- */

.teacher-footer {
  background: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%);
  color: #ffffff;
  padding: 40px 20px;
  font-family: 'M PLUS Rounded 1c', sans-serif;
  position: relative;
  z-index: 1;
}
.teacher-footer .footer-content { max-width: 900px; margin: 0 auto; text-align: center; }
.teacher-footer .footer-logo-link { display: inline-block; margin-bottom: 24px; text-decoration: none; transition: transform 0.15s ease; }
.teacher-footer .footer-logo-link:hover { transform: translateY(-2px); }
.teacher-footer .footer-logo-img { height: 80px; width: auto; display: block; filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.35)); }
.teacher-footer .footer-links { margin-bottom: 20px; }
.teacher-footer .footer-links a { color: #ffffff; text-decoration: none; font-size: 14px; transition: color 0.2s; }
.teacher-footer .footer-links a:hover { color: #4285f4; }
.teacher-footer .footer-divider { color: rgba(255, 255, 255, 0.3); margin: 0 12px; }
.teacher-footer .footer-services { margin-bottom: 20px; }
.teacher-footer .footer-services a { color: #aaaaaa; text-decoration: none; font-size: 13px; transition: color 0.2s; }
.teacher-footer .footer-services a:hover { color: #4285f4; }
.teacher-footer .footer-service-icon-img { width: 18px; height: 18px; border-radius: 3px; object-fit: contain; vertical-align: middle; margin-right: 4px; }
.teacher-footer .footer-copyright { font-size: 13px; color: rgba(255, 255, 255, 0.6); margin: 0; }
.teacher-footer .scratch-credit {
  font-size: 11px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.4);
  margin: 12px auto 0;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  max-width: 800px;
  text-align: center;
}
.teacher-footer .scratch-credit a { color: rgba(255, 255, 255, 0.55); text-decoration: underline; }
.teacher-footer .scratch-credit a:hover { color: rgba(255, 255, 255, 0.8); }
.teacher-footer .yahoo-credit { margin: 12px auto 0; text-align: center; }
.teacher-footer .yahoo-credit a { color: rgba(255, 255, 255, 0.55); text-decoration: underline; }
.teacher-footer .yahoo-credit a:hover { color: rgba(255, 255, 255, 0.8); }

/* ---------- 幅（§7.2: 1024px 以上はモックの配置、768〜1023px は世界を小さく・板は幅いっぱい・カード 2 列） ---------- */

@media (max-width: 1279px) {
  .tf-seo__features { gap: 14px; }
}

@media (max-width: 1023px) {
  /* 入口の幅は ④入口の節の中（場面と一緒に持つ） */

  /* ホーム: 吹き出しと小さい SO君を板の上に。丸太とモンスターは出さない */
  .tf-home__body { grid-template-columns: minmax(0, 1fr); padding: 14px 16px 24px; gap: 12px; }
  .tf-home__side {
    position: static;
    height: auto;
    min-height: 0;
    flex-direction: row-reverse;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    padding: 0;
  }
  /* 世界の鳥小屋はホームでは出さず、吹き出しの横に小さい鳥小屋（創くんは鳥小屋の上にはみ出すので、そのぶん上を空ける） */
  :root[data-screen="home"] .tf-world__pod { display: none; }
  .tf-home__world { display: block; flex: 0 0 auto; width: 130px; padding-top: 62px; --tf-pod-w: 130px; }
  .tf-bubble { max-width: none; flex: 1 1 auto; }
  .tf-bubble::after { left: -18px; top: 50%; bottom: auto; width: 22px; height: 24px; transform: translateY(-50%); clip-path: polygon(100% 0, 100% 100%, 0 50%); }
  .tf-board { min-height: 0; padding: 28px 16px 16px; }
  .tf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .tf-newcard { min-height: 200px; }

  .tf-seo__features { grid-template-columns: minmax(0, 1fr); }
  .tf-loop { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .tf-loop__step::after { display: none; }
}

@media (max-width: 767px) {
  .tf-bar { gap: 8px; padding-left: 10px; padding-right: 10px; }
  .tf-bar__brand img { height: 34px; }
  .tf-bar__wide { display: none; }
  .tf-pill { padding: 0 12px; font-size: 13px; }
  .tf-grid { gap: 10px; }
  .tf-card__body { padding-right: 50px; }
  .tf-seo__services { grid-template-columns: minmax(0, 1fr); }
  .teacher-footer { padding: 30px 15px; }
  .teacher-footer .footer-logo-img { height: 56px; }
  .teacher-footer .footer-links,
  .teacher-footer .footer-services { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 0; }
  .teacher-footer .footer-divider { margin: 0 8px; }
}

@media (max-width: 520px) {
  .tf-bar { gap: 6px; padding-left: 8px; padding-right: 8px; }
  .tf-bar__brand img { height: 24px; }
  .tf-pill { padding: 0 10px; font-size: 12px; }
  .tf-coin { padding-right: 8px; font-size: 13px; }
  .tf-coin__icon { width: 22px; height: 22px; }
  .tf-grid { grid-template-columns: minmax(0, 1fr); }
  .tf-loop { grid-template-columns: minmax(0, 1fr); }
  .tf-loop__again { border-radius: 18px; font-size: 15px; }
}

/*
 * ホームの帯（ロゴ・コイン・修行にもどる・ベル・⋯）は幅 480px 以下で入りきらず、ベルと⋯が画面の外に切れていた
 * （文字のロゴ 1000×243 で 414〜430px も切れるようになった）。ホームではロゴを隠す（押した先は今の画面）
 */
@media (max-width: 480px) {
  .tf-home .tf-bar__brand { display: none; }
}

/* 入口の帯のロゴ（文字のロゴは旧ロゴより横長）は高さ 50px のままだと幅 320px でログインが切れる。360px 未満だけ縮める。
   ホームの「修行にもどる」は矢印だけにする（読み上げの名前は残す） */
@media (max-width: 359px) {
  .tf-bar--landing .tf-bar__brand img { height: 40px; }
  .tf-home #tfBackToMonster { min-width: 44px; }
  .tf-home #tfBackToMonster .tf-pill__label {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0; border: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

/* 動きを減らす設定: 呼吸・羽ばたき・Z マークを止める（コマ送りは soCharacter.js が止める） */
@media (prefers-reduced-motion: reduce) {
  [data-so-host] .tf-pod__so,
  .tf-so__avatar-wrap { animation: none !important; }
  .tf-zmark { animation: none !important; opacity: 0 !important; }
  .tf-cta, .tf-button { transition: none; }
  .tf-seo *, .tf-bar__brand { animation: none !important; transition: none !important; }
  .tf-so__quota-cell.is-leaving::after { display: none; }
  .tf-so__quota-text.is-changed b { animation: none; }
}

/* ---------- 冒険の記録から基地に着いたときの場面（?arrive=records。名札 goldFinale。src/free/views/recordsArrival.js） ---------- */

/* 上の金の帯「冒険の記録が 基地に届いた！」。上から下りてきて、しばらくしたら上へ帰る（棚へ送っても見えるように画面に固定） */
.tf-arrive {
  position: fixed;
  left: 50%;
  top: calc(var(--tf-bar-h, 56px) + 10px);
  z-index: 30;
  max-width: calc(100% - 32px);
  padding: 6px 28px 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fffbe0, #ffe066 45%, #f5b400);
  box-shadow: 0 0 0 2px #fff7cc, 0 0 0 4px #a97a00, 0 0 22px 6px rgba(255, 225, 73, .7);
  color: var(--tf-navy);
  font-size: 22px;
  font-weight: 900;
  line-height: 1.6;
  text-align: center;
  white-space: nowrap;
  transform: translateX(-50%);
  pointer-events: none;
  animation: tf-arrive-in .7s cubic-bezier(.2, 1.3, .4, 1) both;
}
.tf-arrive rt { font-size: .5em; }
.tf-arrive.is-leaving { animation: tf-arrive-out .6s ease-in forwards; }
@keyframes tf-arrive-in { from { opacity: 0; translate: 0 -40px; } }
@keyframes tf-arrive-out { to { opacity: 0; translate: 0 -40px; } }

/* 棚の札が左から飛んでくる（光の尾つき）。--tf-fly-delay は recordsArrival.js が札ごとに入れる */
.tf-shelf__item.is-flying { position: relative; animation: tf-shelf-fly .9s cubic-bezier(.2, 1.2, .4, 1) var(--tf-fly-delay, 0s) both; }
.tf-shelf__item.is-flying::after {
  content: "";
  position: absolute;
  right: 100%;
  top: 40%;
  width: 180px;
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(90deg, rgba(255, 240, 170, 0), rgba(255, 240, 170, .9));
  filter: blur(1px);
  pointer-events: none;
  animation: tf-shelf-trail .9s ease-out var(--tf-fly-delay, 0s) both;
}
@keyframes tf-shelf-fly { from { opacity: 0; translate: -520px -120px; rotate: -20deg; } }
@keyframes tf-shelf-trail { 0% { opacity: 0; } 30% { opacity: 1; } 100% { opacity: 0; } }

/* 格納庫の先頭の「卒業制作」（光る格納庫。光はゆっくり 1.6 秒で行き来＝点滅しない） */
.tf-gradbay { display: flex; padding: 20px 10px 18px; }
.tf-gradbay__in {
  position: relative;
  width: 100%;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 10px;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff3b0, var(--tf-yellow) 60%, #f09a00);
  box-shadow: inset 0 0 0 3px #fff, 0 0 26px 8px rgba(255, 216, 74, .85);
  color: var(--tf-navy);
  text-decoration: none;
  animation: tf-gradbay-glow 1.6s ease-in-out infinite alternate;
}
.tf-gradbay__in:hover { filter: brightness(1.05); }
.tf-gradbay__bp {
  position: relative;
  width: 84px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background:
    repeating-linear-gradient(0deg, transparent 0 9px, rgba(18, 58, 122, .25) 9px 10px),
    repeating-linear-gradient(90deg, transparent 0 9px, rgba(18, 58, 122, .25) 9px 10px),
    rgba(255, 255, 255, .7);
  color: var(--tf-navy);
  font-size: 36px;
  font-weight: 900;
  line-height: 1;
}
.tf-gradbay__name { font-size: 22px; line-height: 1.6; }
.tf-gradbay__sub { font-size: 13px; font-weight: 800; }
.tf-gradbay rt { font-size: .5em; }
.tf-gradbay__new {
  position: absolute;
  right: 4px;
  top: 4px;
  z-index: 2;
  padding: 2px 12px 3px;
  border: 2px solid #c2410c;
  border-radius: 999px;
  background: #fff;
  color: #c2410c;
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 3px 6px rgba(0, 0, 0, .35);
}
@keyframes tf-gradbay-glow { to { box-shadow: inset 0 0 0 3px #fff, 0 0 40px 14px rgba(255, 216, 74, 1); } }

@media (max-width: 767px) {
  .tf-arrive { font-size: 17px; padding: 4px 18px 6px; white-space: normal; }
  .tf-gradbay__in { min-height: 160px; }
}
@media (prefers-reduced-motion: reduce) {
  .tf-arrive, .tf-arrive.is-leaving, .tf-shelf__item.is-flying, .tf-shelf__item.is-flying::after, .tf-gradbay__in { animation: none; }
}

/* ===== ログインする前の作品の引き継ぎ（docs/TEACHER-FREE-PROJECTS.md §5.2） ===== */
.tf-transfer-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  padding: 8px;
  border: 2px solid #cfd8e3;
  border-radius: 10px;
  background: #f5f8fc;
}
.tf-transfer-card__thumb {
  position: relative;
  display: block;
  flex: 0 0 72px;
  width: 72px;
  height: 54px;
  overflow: hidden;
  border-radius: 6px;
}
.tf-transfer-card__thumb img { position: absolute; }
.tf-transfer-card__text { display: block; min-width: 0; }
.tf-transfer-card__text strong { display: block; overflow-wrap: anywhere; }
.tf-transfer-card__text small { display: block; margin-top: 2px; font-size: 12px; color: #5d6f80; }

.tf-transfer-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding: 8px 12px;
  border: 2px solid #f2c94c;
  border-radius: 10px;
  background: #fff8dc;
}
.tf-transfer-strip[hidden] { display: none; }
.tf-transfer-strip__text { flex: 1 1 220px; margin: 0; font-size: 14px; color: #33475b; overflow-wrap: anywhere; }
.tf-transfer-strip__button { flex: 0 0 auto; }
