/* ===== 土台 ===== */
html, body { height: 100%; margin: 0; }
#tour {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  border: 0; z-index: 0;
}

/* ===== 画面幅ごとのスケール（計算済みの値） ===== */
:root {
  --scale: 1;           /* 全体用 */
  --scale-bubble: 1;    /* セリフ用（#bubble, .inline-btn）*/
  --scale-narrator: 1;  /* ナレーター用（#narrator）*/
}
/* 1600px～ */
@media (min-width: 1600px) {
  :root {
    --scale: 1.15;
    --scale-bubble: 1.38;    /* 1.15 * 1.2 */
    --scale-narrator: 1.495; /* 1.15 * 1.3 */
  }
}
/* 1920px～ */
@media (min-width: 1920px) {
  :root {
    --scale: 1.35;
    --scale-bubble: 1.62;   /* 1.35 * 1.2 */
    --scale-narrator: 1.755;/* 1.35 * 1.3 */
  }
}
/* 2560px～ */
@media (min-width: 2560px) {
  :root {
    --scale: 1.60;
    --scale-bubble: 1.92;   /* 1.60 * 1.2 */
    --scale-narrator: 2.08; /* 1.60 * 1.3 */
  }
}

/* ===== ローディング ===== */
#loader {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: #ffe9ff; z-index: 9999;
  opacity: 1; transition: opacity .4s ease;
}
#loader img {
  width: calc(420px * var(--scale));  /* 全体スケールで拡大 */
  height: auto; max-width: 90vw;
}
#loader.hide { opacity: 0; pointer-events: none; }

/* ===== ナレーター（右下） ===== */
#narrator {
  position: fixed; right: 16px; bottom: 0;
  width: calc(110px * var(--scale-narrator)); /* 個別スケール */
  max-height: 100vh; object-fit: contain;
  z-index: 12; pointer-events: none;
  filter: drop-shadow(0 6px 18px rgba(0,0,0,.35));
}

/* ===== セリフ帯 ===== */
#speech {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 11;
  padding: calc(16px * var(--scale)); /* 全体スケール */
  text-align: center;
  z-index: 13;
  pointer-events: none; /* ← これでセリフ帯自体は“触れない” */
}

/* ただし、セリフ内のボタンは操作可能に戻す */
#speech .inline-btn,
#speech .choice-btn {
  pointer-events: auto; /* ← ボタンだけクリック/タップ可 */
}

/* 選択肢ボタン群 */
.choice-group{
  margin-top: 12px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  z-index: 14;
}
.choice-btn{
  padding: calc(8px * var(--scale-bubble, 1)) calc(14px * var(--scale-bubble, 1));
  border: 3px solid rgba(255,255,255,0.7); /* ← 細い白グレーの縁 */
  border-radius: 9999px;
  font-size: calc(15px * var(--scale-bubble, 1));
  font-weight: 600;
  cursor: pointer;
  background: rgb(255,36,70);
  color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
  z-index: 14;
}
.choice-btn:active{ transform: translateY(1px); }


/* ===== 吹き出し ===== */
#bubble {
  display: inline-block;
  background: rgba(255,255,255,.92); color: #222;
  border-radius: 14px;
  padding: calc(14px * var(--scale-bubble)) calc(16px * var(--scale-bubble));
  line-height: 1.8;
  font-family: "Yu Gothic","Segoe UI",sans-serif;
  font-size: calc(16px * var(--scale-bubble));           /* 個別スケール */
  box-shadow: 0 6px 18px rgba(0,0,0,.15);
  max-width: min(90vw, calc(960px * var(--scale-bubble)));/* 個別スケール */
  word-wrap: break-word; margin: 0 auto;
}

/* タイプ文字の改行維持 */
#typed { white-space: pre-wrap; }

/* ===== インラインボタン ===== */
.inline-btn {
  display: inline-block; margin-left: .5em;
  padding: calc(8px * var(--scale-bubble)) calc(14px * var(--scale-bubble));
  border: 3px solid rgba(255,255,255,0.7); /* ← 細い白グレーの縁 */
  border-radius: 9999px;
  font-size: calc(15px * var(--scale-bubble));
  font-weight: 600; cursor: pointer;
  background: rgb(255,36,70); 
  color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}

.inline-btn:active { transform: translateY(1px); }
