/* =========================================================
   タヌくん 全部の画面で共通の部品（2026-11-10）
   本編・ポスト・ふれあい・第2章・ぽんぽこ・ラリー・シーソー・洗う が読みこむ。
   ここを直せば、全部の画面が一度にそろう。新しい画面を作るときも、これを読みこんで使う。

   ■「‹ もどる」… class="tanu-back"
     ・場所はいつも画面の左上（左から12px・上から12px。iPhone のでっぱりの分は自動で下げる）。中身がずれても動かない
     ・形は「3段階のルール」の ③ 道具：白く半分すけた丸・ふちなし・こげ茶の太字 15px・高さ36px
     ・横に並んでいる物（点数など）があるページは、すぐ後ろに <span class="tanu-back-slot"></span> を置くと、
       もどるの分の場所があく（もどるが hidden のときは、場所もあかない）
     ・各ページの CSS で場所や形が書かれていても、こちらが勝つように !important を付けている
       （ページごとに少しずつずれていたのを、2026-11-10 にそろえた。tools/check.js が全部の画面で確かめる）
     ・重なりの順番（z-index）は、ページごとに決める（思い出・パネルの下に来るように）
   ========================================================= */
.tanu-back {
  position: fixed !important;
  left: calc(env(safe-area-inset-left, 0px) + 12px) !important;
  top: calc(env(safe-area-inset-top, 0px) + 12px) !important;
  right: auto !important;
  bottom: auto !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  height: 36px !important;
  min-width: 0 !important;
  display: inline-flex;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 14px !important;
  border: 0 !important;
  border-radius: 999px !important;
  box-shadow: none !important;
  background: rgba(255, 255, 255, .7) !important;
  color: #4A2E16 !important;
  font-family: inherit;
  font-size: 15px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  letter-spacing: normal !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  transform: none !important;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tanu-back:active { background: rgba(255, 255, 255, .85) !important; }
.tanu-back[hidden] { display: none !important; }

/* もどるの分の場所（横に並ぶ物が、もどるに重ならないように） */
.tanu-back-slot { flex: none; display: inline-block; width: 84px; height: 36px; }
.tanu-back[hidden] + .tanu-back-slot { display: none; }

/* ■「𝕏 でポストする」… class="tanu-x"（2026-11-10。クリア・なでなでレポート・占い・ぽんぽこ・ラリー で同じ）
     ・X の公式の見た目に合わせて、黒地に白い字。「主役＝オレンジ」のただ1つの例外（X に出すボタンだと、ひと目で分かるように）
     ・まん丸・高さ52px・18px 太字。絵の上に重ねる所（占い）だけ .small（高さ44px・16px）。見た目は同じ
     ・すぐ下に「ほかのアプリで送る」の小さな文字のリンク（.tanu-share）。スマホの共有メニューが使えないブラウザでは「文章をコピー」になる
     ・2つを <div class="tanu-share-group"> でまとめる（中はせまく、次のボタンとは広くあける）
     ・並びはどの画面も「結果 → 𝕏 でポストする ＋ ほかのアプリで送る → 次の行き先（もう一回・とじる など）」 */
.tanu-share-group { display: flex; flex-direction: column; align-items: stretch; gap: 0; margin: 8px 0 16px !important; }
.tanu-x {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  width: 100%;
  height: 52px !important;
  margin: 0 !important;
  padding: 0 20px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: #111 !important;
  color: #fff !important;
  font-family: inherit;
  font-size: 18px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  letter-spacing: normal !important;
  text-decoration: none !important;
  text-align: center;
  white-space: nowrap !important;
  box-shadow: 0 4px 0 #444 !important;
  animation: none !important;
  transform: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tanu-x:active { box-shadow: 0 2px 0 #444 !important; transform: translateY(2px); }
.tanu-x.small { height: 44px !important; font-size: 16px !important; }
.tanu-share {
  display: block !important;
  align-self: center;
  box-sizing: border-box !important;
  min-height: 36px;
  margin: 6px auto 0 !important;
  padding: 8px 14px !important;
  border: 0 !important;
  background: none !important;
  box-shadow: none !important;
  color: #8A5A2B !important;
  font-family: inherit;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
  text-decoration: underline !important;
  text-underline-offset: 3px;
  animation: none !important;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tanu-share[hidden] { display: none !important; }

/* =========================================================
   💬 セリフの 枠（2026-11-16 ユーザー「章ごとに 枠の デザインが ちがって 違和感」→ 第2章の 形に そろえる）
   形：白い 角丸の カード・左上に オレンジの 名前札・太めの 文字・右下で ▼ が ゆれる（第2章 夜祭り matsuri/ と 同じ）
     <div class="tanu-talk">
       <img class="tanu-talk-face" alt="">   … ワイプ（顔）。複数の 人が 話す 場面だけ（.has-face を カードに 付ける）
       <span class="tanu-talk-name">タヌくん</span>
       <span class="tanu-talk-text">…</span>
       <span class="tanu-talk-more">▼</span>   … .on で 出す
     </div>
   ・地の文（ナレーション）は カードに .narr（名前札・ワイプを 出さない・少し 細い 字）
   ・場所（画面の 下からの 高さ）は ページごとに 決める。ここは 見た目だけ
   ・使って いる 所：第1章（思い出・index.html）・第2章 matsuri/・第3章 rally_story/・第4章 hanadan/story.html（2026-11-18 そろえた）・
     dot/walk/kosho.html（第7章の はじまり）・dot/walk/rpg.html（塔の お話）・dot/oyasumi/（第5章 第4話）
   ========================================================= */
.tanu-talk {
  position: relative; box-sizing: border-box; min-height: 5.2em; padding: 18px 20px 22px; border-radius: 22px;
  background: #fff; color: #3B2416; box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Maru Gothic ProN", "Noto Sans JP", sans-serif;
  font-size: clamp(17px, 4.8vw, 22px); font-weight: 700; line-height: 1.55; white-space: pre-line; text-align: left;
}
.tanu-talk-text b { color: #E0671F; font-weight: 900; }
.tanu-talk-name {
  position: absolute; left: 18px; top: -14px; background: #F08A3C; color: #fff; font-size: 14px; font-weight: 800;
  padding: 4px 14px; border-radius: 99px; box-shadow: 0 2px 0 #C8641E; line-height: 1.4; white-space: nowrap;
}
.tanu-talk-more { position: absolute; right: 16px; bottom: 8px; color: #C8641E; font-size: 14px; opacity: 0; }
.tanu-talk-more.on { opacity: 1; animation: tanu-talk-bob 1s ease-in-out infinite; }
@keyframes tanu-talk-bob { 50% { transform: translateY(3px); } }
/* ワイプ：カードの 左上に 乗る 顔（名前札は その 右に ずれる） */
.tanu-talk-face { display: none; position: absolute; left: 14px; bottom: calc(100% - 10px); width: 58px; height: 58px; border-radius: 14px;
  object-fit: cover; background: #FFE9C7; box-shadow: 0 0 0 3px #fff, 0 3px 8px rgba(0, 0, 0, .3); }
.tanu-talk.has-face .tanu-talk-face { display: block; }
.tanu-talk.has-face .tanu-talk-name { left: 84px; }
.tanu-talk.narr .tanu-talk-name, .tanu-talk.narr .tanu-talk-face { display: none; }
.tanu-talk.narr { font-weight: 600; color: #6B5040; }
@media (prefers-reduced-motion: reduce) { .tanu-talk-more.on { animation: none; } }
/* 中国語の とき：中国語の 字体を 優先（本編の style.css・各ページの body と 同じ。.tanu-talk は 字体を 決めて いるので、ここでも 書く。2026-11-18） */
html[lang|="zh"] .tanu-talk { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Noto Sans CJK SC", sans-serif; }
