/* ミナトとハルの街めぐり・島めぐりの窓 (10-18 夜・tour_ui.js)。いつもは上の真ん中・遊んでいる間は右下の「案内に戻る」だけ・
   波乗り小屋の 1 問の間 (.overDlg) は下に出す (小屋の窓の上の段を隠さない)。重なり = 21 (窓 8〜9・船旅 20 より上) */
.tourBox {
  position: fixed; left: 50%; top: 58px; transform: translateX(-50%) scale(var(--tz, 1)); transform-origin: 50% 0; z-index: 21;
  width: min(820px, calc((100vw - 16px) / var(--tz, 1))); box-sizing: border-box;
  display: grid; grid-template-columns: 92px minmax(0, 1fr) 92px; gap: 10px; align-items: end;
  padding: 10px 12px; background: rgb(255, 250, 240); color: #2b2620;   /* (不透明 = 11-07 小さい画面の案 3・nao OK: 0.97 だと後ろの札の字が透けて見えた) */
  border: 2px solid #c9a65a; border-radius: 14px; box-shadow: 0 6px 22px rgba(0, 0, 0, 0.28); font-size: 17px;
}
.tourBox.hidden { display: none; }
.tourBox.overDlg { top: auto; bottom: 10px; transform-origin: 50% 100%; }
/* 光らせた画面の部品 (スマホの横の左上の Lv の帯・ポイントの札など) が窓の下に隠れる時は下に出す (10-21・tour_ui.js の avoidGlow) */
.tourBox.lowGlow { top: auto; bottom: 10px; transform-origin: 50% 100%; }
/* 窓の大きさ (10-19 nao「− 100% +」・tour_ui.js の paintSize が --tz = 0.7〜1.3 を入れる)。窓ごと拡大・縮小 (幅は拡大しても画面に収まる) */
/* ドラッグで動かした所 (10-19・tour_ui.js の applyPos が --tx / --ty を入れる)。字は選ばない・指で動かせる (説明の札は指で上下に送れる) */
.tourBox { touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
.tourBox.dragging { cursor: grabbing; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.38); }
.tourBox button { cursor: pointer; }
.tourBox .tourCard { touch-action: pan-y; user-select: text; -webkit-user-select: text; cursor: auto; }
.tourBox.moved, .tourBox.moved.overDlg { left: var(--tx); top: var(--ty); bottom: auto; transform: scale(var(--tz, 1)); transform-origin: 0 0; }
.tourFace { width: 92px; height: 92px; border-radius: 12px; background: #dbe8f1; opacity: 0.45; filter: grayscale(0.45); transition: opacity 0.2s, filter 0.2s; }
.tourFace.now { opacity: 1; filter: none; box-shadow: 0 0 0 3px #f0c24a; }
.tourMain { min-width: 0; }
.tourName { display: inline-block; margin-bottom: 4px; padding: 1px 10px; border-radius: 10px; font-size: 15px; font-weight: bold; color: #fff; background: #4f6fae; }
.tourName.ha { background: #4f8fb4; }
.tourName.nao { background: #3f7d5a; }
.tourText { margin: 0 0 8px; min-height: 3.2em; line-height: 1.6; overflow-wrap: anywhere; }
.tourBtns { display: flex; flex-wrap: wrap; gap: 8px; }
.tourBtns button, .tourTool, .tourBack {
  font: inherit; color: #2b2620; cursor: pointer; min-height: 44px; padding: 4px 14px;
  background: #fff; border: 1px solid #b89a5a; border-radius: 10px;
}
.tourBtns button.main { background: #2f5f8f; border-color: #2f5f8f; color: #fff; font-weight: bold; }
/* 「◀ 前へ」「🔁 もう一度」(10-19 nao): 次へ・選ぶボタンより控えめ */
.tourBtns button.tourNav { padding: 4px 10px; font-size: 0.86em; color: #5a4a2a; background: #fbf5e6; }
.tourBtns button:disabled, .tourTool:disabled { opacity: 0.4; cursor: default; }
.tourBtns button.tourNav.again { margin-right: auto; }
/* 選ぶボタンの下の小さな注 (10-27 nao「ゲーム全部やった時の時間の目安も書いといたら？」) */
.tourBtns .tourNote { flex-basis: 100%; margin: 2px 2px 0; font-size: 0.84em; line-height: 1.5; color: #5a4a2a; }
.tourBtns button:focus-visible, .tourTool:focus-visible, .tourBack:focus-visible { outline: 3px solid #f0b400; outline-offset: 2px; }
.tourTools { display: flex; justify-content: flex-end; gap: 6px; margin-top: 6px; }
.tourTool { min-height: 32px; padding: 2px 10px; font-size: 13px; }
.tourTool.on { background: #fff3c8; }
.tourTool.stop { color: #8a2a2a; }
.tourTool.pause { color: #2f5f8f; }
/* 窓の大きさ「− 100% +」(押しやすく = − と + は幅を取る・真ん中の % を押すと 100%) */
.tourSize { display: inline-flex; margin-right: auto; border: 1px solid #b89a5a; border-radius: 10px; overflow: hidden; }
.tourSize .tourTool { border: 0; border-radius: 0; }
.tourSize .tourTool.sz { min-width: 40px; padding: 0 8px; font-size: 18px; font-weight: bold; line-height: 1; }
.tourSize .tourTool.szNow { min-width: 50px; padding: 0 4px; border-left: 1px solid #e3d3ad; border-right: 1px solid #e3d3ad; font-variant-numeric: tabular-nums; }
/* 中断した案内の札 (10-19・「街めぐり 途中 ▶ 再開」・いつでも押せる)。左下のボタンの並びのすぐ上 (.anchored・tour_ui.js の paintResume が left / bottom を入れる)・
   並びが無い時は画面の上の真ん中。案内の窓が出ている間は出さない */
.tourResume {
  position: fixed; left: 50%; top: 58px; transform: translateX(-50%); z-index: 6;   /* (左下の並び 3・会話の欄 5 より上・窓 7〜9 より下 = 宿の主人などの窓に重ならない) */
  display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 4px 6px 4px 14px;
  font: inherit; font-size: 15px; color: #2b2620; cursor: pointer;
  background: rgba(255, 250, 240, 0.96); border: 2px solid #c9a65a; border-radius: 22px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}
.tourResume.hidden { display: none; }
.tourResume.anchored { top: auto; transform: none; }
.tourResume b { padding: 4px 12px; border-radius: 16px; background: #2f5f8f; color: #fff; }
.tourResume:hover b { background: #244c74; }
.tourResume:focus-visible { outline: 3px solid #f0b400; outline-offset: 2px; }
.tourCard { grid-column: 1 / -1; max-height: 34vh; overflow: auto; padding: 8px 12px; font-size: 14px; background: #fdf6e3; border: 1px dashed #c9a65a; border-radius: 10px; }
.tourCard h3 { margin: 0 0 4px; font-size: 16px; }
.tourCard p { margin: 0 0 4px; }
.tourCard ul { margin: 4px 0 0; padding-left: 1.2em; }
.tourCard li.rule { color: #5a4a2a; }
.tourCard.hidden, .tourBack.hidden { display: none; }
/* 遊んでいる間 = 右下の「案内に戻る」だけ (遊びの窓を隠さない) */
.tourBox.playing, .tourBox.moved.playing { left: auto; right: 12px; top: auto; bottom: 150px; transform: none; width: auto; display: block; padding: 0; background: transparent; border: 0; box-shadow: none; cursor: auto; }
.tourBox.playing > :not(.tourBack) { display: none !important; }
.tourBack { background: #2f5f8f; border-color: #2f5f8f; color: #fff; font-weight: bold; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3); }
/* 光らせる画面の部品 */
.tourGlow { outline: 3px solid #f0b400 !important; outline-offset: 2px; animation: tourGlow 0.9s ease-in-out infinite alternate; }
@keyframes tourGlow { from { outline-color: rgba(240, 180, 0, 0.4); } to { outline-color: rgba(240, 180, 0, 1); } }
@media (max-width: 600px) {
  .tourBox { top: 50px; grid-template-columns: 60px minmax(0, 1fr) 60px; gap: 6px; padding: 8px; font-size: 15px; }
  .tourFace { width: 60px; height: 60px; }
  .tourBox.playing, .tourBox.moved.playing { bottom: 170px; right: 8px; }
  /* 下の段が 1 行に入らない時は 2 行に (10-29 nao「チュートリアル100の右の+が見えない」= 縮んで「+」が切れ・字が縦に折れていた) */
  .tourTools { flex-wrap: wrap; row-gap: 6px; }
  .tourSize { flex: none; }
  .tourTool { white-space: nowrap; }
  /* (11-07 小さい画面の見回り: スマホの縦で「− 100% + 声 自動 中断 やめる」が高さ 32 画素で押しにくかった → 40 画素) */
  .tourTool, .tourSize .tourTool.sz, .tourSize .tourTool.szNow { min-height: 40px; }
}
/* 背の低い画面 (スマホの横など・10-18 夜): 窓を低くする = 顔を小さく・字を小さく・「次へ」と「声 / 自動 / やめる」を 1 行に・上の端に寄せる (街が窓の下に見える) */
@media (max-height: 520px) {
  .tourBox { top: 4px; grid-template-columns: 52px minmax(0, 1fr) 52px; gap: 6px; padding: 6px 8px; font-size: 14px; align-items: center; }
  .tourFace { width: 52px; height: 52px; border-radius: 9px; }
  .tourMain { display: flex; flex-wrap: wrap; align-items: center; column-gap: 8px; }
  .tourName { margin-bottom: 2px; padding: 0 8px; font-size: 12px; }
  .tourText { flex: 1 1 100%; margin: 0 0 4px; min-height: 0; line-height: 1.45; }
  .tourBtns { flex: 1 1 auto; gap: 6px; }
  .tourBtns button { min-height: 34px; padding: 2px 12px; }
  .tourTools { margin-top: 0; }
  .tourTool { min-height: 30px; padding: 1px 8px; font-size: 12px; }
  .tourSize .tourTool.sz { min-width: 40px; min-height: 34px; font-size: 18px; }
  .tourSize .tourTool.szNow { min-height: 34px; }
  .tourBtns button.tourNav { padding: 2px 8px; }
  .tourCard { max-height: 38vh; font-size: 13px; }
  .tourBox.playing, .tourBox.moved.playing { bottom: 110px; }
  .tourResume { top: 4px; min-height: 34px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { .tourGlow { animation: none; } .tourFace { transition: none; } }
