/* gx.css — 3d-playable-homepage 基本設計体系
   DOM-first：生HTMLでは全文が表示状態。隠す（gx-locked）のは has-js が付いてから */

:root {
  --gx-bg: #07090E;
  --gx-ink: #E8EAF0;
  --gx-sub: #9AA3B5;
  --gx-key: #E8C87A;
  --gx-max: 1080px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--gx-bg);
  color: var(--gx-ink);
  font-family: "Zen Kaku Gothic New", system-ui, sans-serif;
  line-height: 1.9;
  word-break: auto-phrase;
  text-wrap: pretty;
}
img { max-width: 100%; height: auto; }

/* ---- 3D舞台（固定レイヤー） ---- */
.gx-stage { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.gx-stage canvas { display: block; width: 100%; height: 100%; }
.no-3d .gx-stage { display: none; }
/* WebGL不可のときの静的背景（縮退の絵） */
.no-3d body, .no-3d .gx-shell {
  background:
    radial-gradient(60% 50% at 50% 30%, rgba(232, 200, 122, .18), transparent 70%),
    var(--gx-bg);
}

/* ---- 本文シェル ---- */
.gx-shell { position: relative; z-index: 1; }
.gx-station {
  min-height: 100svh;
  display: flex; align-items: center;
  padding: 12svh 6vw;
}
.gx-station__inner { max-width: var(--gx-max); margin: 0 auto; width: 100%; }
.gx-meta { font-size: .78rem; letter-spacing: .14em; color: var(--gx-sub); }
.gx-station h2 { font-size: clamp(1.6rem, 4.2vw, 2.8rem); line-height: 1.5; margin: .4em 0; }
.gx-station p { max-width: 40em; }

/* 文字の背後に暗いベール（3Dの上でも読める。webgl-quality pitfalls §8） */
.has-3d .gx-station__inner {
  position: relative;
}
.has-3d .gx-station__inner::before {
  content: "";
  position: absolute; inset: -6% -8%;
  background: radial-gradient(80% 80% at 40% 50%, rgba(4, 6, 10, .62), transparent 75%);
  z-index: -1;
  border-radius: 24px;
}

/* ---- 解錠状態（JS起動後だけ有効。生HTMLでは全文可視） ---- */
.has-js .gx-locked {
  opacity: .14;
  filter: blur(2px) grayscale(.4);
  pointer-events: none;
  user-select: none;
  transition: opacity .8s ease, filter .8s ease;
}

/* ---- ホットスポット（DOM実体。ヒット44px以上） ---- */
.gx-hotspot {
  min-width: 44px; min-height: 44px;
  padding: 10px 22px;
  border: 1px solid rgba(232, 200, 122, .55);
  border-radius: 999px;
  background: rgba(232, 200, 122, .08);
  color: var(--gx-key);
  font: inherit; font-size: .92rem; letter-spacing: .08em;
  cursor: pointer;
}
.gx-hotspot:hover, .gx-hotspot:focus-visible { background: rgba(232, 200, 122, .2); }
.gx-hotspot.is-hint { animation: gx-pulse 1.2s ease-in-out infinite; }
@keyframes gx-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 200, 122, .45); }
  50%      { box-shadow: 0 0 0 12px rgba(232, 200, 122, 0); }
}

/* ---- PLAYゲート ---- */
.gx-gate {
  position: fixed; inset: 0; z-index: 40;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1.4rem;
  background: var(--gx-bg);
  transition: opacity .55s ease;
}
.gx-gate.is-gone { opacity: 0; pointer-events: none; }
.gx-gate__title { font-size: clamp(1.4rem, 3.4vw, 2.2rem); margin: 0; }
.gx-gate__enter {
  min-width: 44px; min-height: 44px;
  padding: 14px 44px;
  border: 1px solid var(--gx-key); border-radius: 999px;
  background: transparent; color: var(--gx-key);
  font: inherit; font-size: 1rem; letter-spacing: .2em;
  cursor: pointer;
}
.gx-gate__enter:hover { background: rgba(232, 200, 122, .14); }
.gx-gate__tour { background: none; border: none; color: var(--gx-sub); font: inherit; font-size: .82rem; cursor: pointer; text-decoration: underline; }
.no-3d .gx-gate { display: none; }
html.is-locked { overflow: hidden; }
.no-3d.is-locked, html.no-3d { overflow: auto; }

/* ---- HUD（v0.5 で配線。マークアップだけ先に置く） ---- */
.gx-hud {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px;
  pointer-events: none;
  font-size: .8rem; color: var(--gx-sub);
}
.gx-hud > * { pointer-events: auto; }
.gx-hud__dots { display: flex; gap: 8px; }
.gx-hud__dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(154, 163, 181, .4); border: 0; padding: 0; cursor: pointer; }
.gx-hud__dot.is-cleared { background: var(--gx-key); }
.gx-hud__dot.is-active { outline: 2px solid rgba(232, 200, 122, .6); outline-offset: 2px; }
.gx-hud__right { display: flex; gap: 14px; align-items: center; }
/* 自動回遊（右下・常駐1つだけ）。押している間は「止める」に変わる */
.gx-hud__auto {
  min-height: 44px; padding: 9px 20px;
  border: 1px solid rgba(232, 200, 122, .45); border-radius: 999px;
  background: rgba(7, 9, 14, .62); color: var(--gx-key);
  font: inherit; font-size: .82rem; letter-spacing: .04em; cursor: pointer;
  transition: background .3s ease, border-color .3s ease;
}
.gx-hud__auto:hover { background: rgba(232, 200, 122, .12); border-color: rgba(232, 200, 122, .8); }
html.is-auto .gx-hud__auto { border-color: rgba(232, 200, 122, .9); background: rgba(232, 200, 122, .16); }
/* 回遊中は矢印を出さない（独りでに進むので、押す合図が二重になる） */
html.is-auto .gx-station .gx-actions { opacity: 0; pointer-events: none; }
.no-3d .gx-hud { display: none; }

/* ---- ステルス課題（3D側が本体の操作。ボタンはDOM-first・a11y・QAの裏経路） ----
   生HTML／no-3d／tour では普通に見える。3Dが立ったときだけ視覚的に隠す。
   Tabフォーカスで現れる（キーボード操作は生きている） */
.has-3d:not(.is-tour) .gx-stealth .gx-hotspot {
  position: absolute;
  width: 1px; height: 1px;
  clip-path: inset(50%);
  opacity: 0;
  pointer-events: none;
  min-width: 0; min-height: 0; padding: 0;
}
.has-3d:not(.is-tour) .gx-stealth .gx-hotspot:focus-visible {
  position: static; width: auto; height: auto;
  clip-path: none; opacity: 1; pointer-events: auto;
  min-width: 44px; min-height: 44px; padding: 10px 22px;
}
.gx-actions { position: relative; }

/* ---- 見つけると開く語り（data-reveals の開き先。生HTMLでは表示状態） ---- */
.has-js .gx-secret {
  display: none;
}
.has-js .gx-secret.is-open {
  display: block;
  animation: gx-open .9s ease both;
}
.no-3d .gx-secret, .is-tour .gx-secret { display: block !important; }
@keyframes gx-open {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ---- 課題の状態 ---- */
.gx-hotspot.is-found, .gx-hotspot.is-chosen {
  background: rgba(232, 200, 122, .3);
  color: #FFF3D6;
  border-color: var(--gx-key);
  animation: none;
}
.gx-hotspot:disabled { cursor: default; opacity: .85; }

/* ---- tour（見るだけモード）：全解錠のスクロール文書 ---- */
.is-tour .gx-locked {
  opacity: 1 !important;
  filter: none !important;
  pointer-events: auto !important;
  user-select: auto !important;
}
/* 「スキップして次へ」は廃止（2026-08-07 内田指示）。自動回遊が代わり */
/* tour では課題UI（目標文）も消す。固定表示のまま本文の上を流れると読みを妨げる */
.is-tour .gx-hud__objective { display: none; }

/* ---- フッター ---- */
.gx-footer { position: relative; z-index: 1; padding: 10svh 6vw; border-top: 1px solid rgba(154, 163, 181, .2); }

/* ---- reduced-motion：最終状態に固定（「何も表示されない」を防ぐ） ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .gx-locked { opacity: 1 !important; filter: none !important; pointer-events: auto !important; }
  .gx-secret { display: block !important; }
  .gx-gate { display: none !important; }
  .gx-panel { opacity: 1 !important; transform: none !important; }
  .gx-station .gx-actions { opacity: 1 !important; pointer-events: auto !important; }
  html.is-locked { overflow: auto !important; }
}

/* ================================================================
   かくれんぼ 専用の意匠（レストラン＆バー・夜の琥珀）
   ================================================================ */

:root {
  --gx-bg: #0B0805;
  --gx-ink: #EFE8DA;
  --gx-sub: #A6987F;
  --gx-key: #E8C87A;
}

h1, h2 {
  font-family: "Zen Old Mincho", "Yu Mincho", serif;
  font-weight: 600;
  letter-spacing: .05em;
}
h3 {
  font-family: "Zen Old Mincho", "Yu Mincho", serif;
  font-weight: 600;
  color: var(--gx-key);
  margin-top: 2.2em;
  font-size: 1.05rem;
  letter-spacing: .12em;
}

/* 扉のゲート */
/* 幕は「黒い板」ではなく“薄い紗”。背後の3D（灯りのともった閉じた扉）を主役として見せる。
   文字は**画面のど真ん中**（2026-08-07 内田指示）。以前は下三分の一に置いていたが、
   第一声は扉の正面に重ねたほうが強い。真ん中は幕がいちばん薄いところなので、
   文字の後ろにだけ楕円の暗がりを敷いて可読性を確保する（幕全体は濃くしない＝扉が沈む） */
.gx-gate {
  background:
    radial-gradient(ellipse 62% 26% at 50% 50%, rgba(11, 8, 5, .72) 0%, rgba(11, 8, 5, 0) 100%),
    linear-gradient(180deg,
      rgba(11, 8, 5, .62) 0%,
      rgba(11, 8, 5, .18) 32%,
      rgba(11, 8, 5, .58) 64%,
      rgba(11, 8, 5, .93) 100%);
  justify-content: center;
  padding: 0 6vw;
  gap: 1.1rem;
}
.gx-gate__title {
  text-align: center; line-height: 1.6;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .92), 0 0 44px rgba(0, 0, 0, .7);
}
/* 上下の小さい行は**流れから外す**。3行を同じ列に並べると、上の行と下の行の高さの差だけ
   見出しが中心からずれる（実測11px下）。見出しだけを在中させるためにこうする */
.gx-gate .gx-meta { position: absolute; top: 9vh; left: 6vw; right: 6vw; margin: 0; text-align: center; }
.gx-gate__sub { position: absolute; bottom: 10vh; left: 6vw; right: 6vw; text-align: center; }

/* 扉が開ききったところで出す一行（第二声）。ワールドが gx:dooropen を投げたときだけ現れる。
   pointer-events は常に none＝進行のクリックを1つも飲まない（透明な層がクリックを
   全部飲む事故を一度やっている。v4の重大バグ） */
.gx-openline {
  position: fixed; inset: 0; z-index: 6; margin: 0;
  display: grid; place-items: center; text-align: center;
  pointer-events: none; opacity: 0;
  /* 消えている間は visibility も伏せる。透明なだけだと、検品の文字重なり検査から見て
     「画面いっぱいの見えている文字」のままになり、全部と重なっていると判定される */
  visibility: hidden;
  transition: opacity 1.2s ease, visibility 0s linear 1.2s;
  color: var(--gx-ink, #F2E6CC);
  font-size: clamp(1.05rem, 2.4vw, 1.6rem); letter-spacing: .12em; line-height: 1.7;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .92), 0 0 44px rgba(0, 0, 0, .8);
}
.gx-openline.is-on { opacity: 1; visibility: visible; transition: opacity 1.1s ease .15s, visibility 0s; }
/* 読み物として全文を見る経路と静的表示では、演出の一行は出さない */
.no-3d .gx-openline, html.is-tour .gx-openline { display: none; }
/* 導入が終わるまでUIを伏せる（幕のときと同じ扱い）。
   幕が消える→扉が開く→中へ進む→一行、の間ずっと。店が現れた直後を「店と一行だけ」にする */
/* **効き時間は素の側に書く。** is-intro の中だけに transition を書くと、クラスを外した瞬間に
   transition ごと消えて**パッと出る**（＝ふわっとしない）。実際そうなっていた */
.gx-map, .gx-fab, .gx-hud, .gx-shell { transition: opacity 1.4s ease; }
html.is-intro .gx-map,
html.is-intro .gx-fab,
html.is-intro .gx-hud,
html.is-intro .gx-shell { opacity: 0; pointer-events: none; }
.gx-gate .gx-meta, .gx-gate__sub { text-shadow: 0 1px 14px rgba(0, 0, 0, .9); }
/* 幕が薄くなったぶん、第一画面ではMAP・メニュー・本文パネルを引っ込める。
   幕が不透明だった頃はこれらが隠れていたので、薄くした途端に絵の上へ透けて出てくる。
   is-locked は「JSも3Dも生きていて幕が出ている間」だけ付く＝縮退時の可読性には影響しない */
html.is-locked .gx-map,
html.is-locked .gx-fab,
html.is-locked .gx-shell { opacity: 0; pointer-events: none; transition: opacity .8s ease; }
.gx-gate__sub { margin: 0; color: var(--gx-sub); letter-spacing: .3em; font-size: .9rem; }
.gx-gate__door {
  width: 104px; height: 150px;
  border-radius: 52px 52px 4px 4px;
  background: linear-gradient(175deg, #2E1D10 0%, #1C120A 55%, #120B06 100%);
  border: 1px solid rgba(232, 200, 122, .28);
  box-shadow: inset 0 0 34px rgba(0, 0, 0, .75), 0 0 60px rgba(232, 200, 122, .07);
  position: relative;
}
.gx-gate__door::before {
  content: ""; position: absolute; inset: 10px 10px 0 10px;
  border-radius: 42px 42px 0 0;
  border: 1px solid rgba(232, 200, 122, .14);
}
.gx-gate__knocker {
  position: absolute; left: 50%; top: 56px; transform: translateX(-50%);
  width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid rgba(216, 178, 108, .85);
  box-shadow: 0 3px 8px rgba(0, 0, 0, .5);
}
.gx-gate__knocker::before {
  content: ""; position: absolute; left: 50%; top: -7px; transform: translateX(-50%);
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(216, 178, 108, .9);
}

/* 席の見出し番号と本文 */
.gx-station__inner p { color: #D8CFBE; }
.gx-secret { border-left: 2px solid rgba(232, 200, 122, .4); padding-left: 1em; color: #CBBFA6; }

/* ================================================================
   v4 上品UI：左からすっと出るパネル・明快な動線・オーバーレイメニュー
   ================================================================ */

/* 駅のパネル（左）。生HTMLでは常に見える。JSが立ったら現在の駅だけ現れる */
.gx-station { position: relative; }
.gx-panel {
  position: relative;
  max-width: 480px;
  padding: 0;
  /* カード式はやめる（2026-08-06 内田指示）。背景なしの素のテキストを、影だけで3Dから浮かせて読ませる */
  text-shadow: 0 1px 3px rgba(0, 0, 0, .95), 0 0 16px rgba(0, 0, 0, .82), 0 2px 30px rgba(0, 0, 0, .55);
}
.gx-panel h2 { font-size: clamp(1.35rem, 2.9vw, 1.85rem); margin: .35em 0 .5em; color: #F5EEDF; }
.gx-panel .gx-line { margin: 0 0 .8em; font-size: .98rem; color: #EAE0CC; }
.has-js .gx-station:not(.is-live) .gx-panel {
  opacity: 0; transform: translateX(-26px);
  transition: none;
}
.has-js .gx-station.is-live .gx-panel {
  opacity: 1; transform: none;
  transition: opacity 1.1s ease .35s, transform 1.1s ease .35s;
}
.no-3d .gx-panel, .is-tour .gx-panel { opacity: 1 !important; transform: none !important; }

/* ゲーム中は、本文も矢印も**スクロールで動かさない**（2026-08-06 内田指示）。
   進むのは矢印を押したときだけ。スクロールで文字が流れると「読み物」に見えて、
   何をすればいいのか分からなくなる。※読み物モード（tour）と縮退時は普通に流す */
.has-3d:not(.is-tour) .gx-station:not(.gx-station--reading) .gx-panel {
  position: fixed; left: 6vw; right: auto; top: 50%;
  z-index: 12;
}
/* 固定にすると5つのパネルが同じ場所に積み重なる。見た目は不透明度で消えていても、
   読み上げ・文字選択・検品には「重なった文字」として残る（qa_play が検出）。
   だから現在の駅以外は visibility ごと畳む */
/* ※ visibility:hidden だけでは足りない。checkVisibility() は既定で visibility を見ないので
   検品には「重なった文字」として残り続ける。画面の外へ逃がすのが確実 */
.has-3d:not(.is-tour) .gx-station:not(.is-live) .gx-panel {
  transform: translate(-26px, -50%); pointer-events: none; visibility: hidden;
  left: -200vw;
}
.has-3d:not(.is-tour) .gx-station.is-live .gx-panel {
  transform: translateY(-50%); visibility: visible;
}
.has-3d:not(.is-tour) .gx-station .gx-actions { position: fixed; }
/* 矢印も5つが同じ場所に固定される。現在の駅のもの以外は画面の外へ逃がす */
.has-3d:not(.is-tour) .gx-station:not(.is-live) .gx-actions {
  visibility: hidden; left: -200vw;
}

/* 動線＝画面下の、さりげない矢印（2026-08-06 内田指示「ボタンはダサい。矢印で控えめに」）。
   丸ボタンの装飾は全部打ち消す。ただし **button 実体は残す**（キーボード・読み上げ・
   検品・縮退の経路がここを通る）。行き先だけを小さく置いて、矢印がゆっくり降りて誘う */
.gx-station .gx-actions {
  position: absolute; left: 50%; bottom: 9svh; transform: translateX(-50%);
  margin: 0;
}
.gx-next {
  border: 0; border-radius: 0; background: none;
  min-height: 44px; padding: 8px 20px 6px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: rgba(232, 200, 122, .72);
  font-family: "Zen Old Mincho", "Yu Mincho", serif;
  font-size: .72rem; letter-spacing: .28em; text-indent: .28em;
  text-shadow: 0 1px 12px rgba(0, 0, 0, .9);
  transition: color .6s ease;
}
.gx-next:hover, .gx-next:focus-visible { background: none; color: #F4E3B4; }
/* 細い縦線 → 山形の矢じり。文字が先、線が2番目、矢じりが3番目（order で並べる） */
.gx-next::before {
  content: ""; order: 2;
  width: 1px; height: 24px;
  background: linear-gradient(to bottom, rgba(232, 200, 122, 0), rgba(232, 200, 122, .7));
  animation: gx-arrow-line 3s ease-in-out infinite;
}
.gx-next::after {
  content: ""; order: 3; display: block;
  width: 8px; height: 8px; margin-top: -13px; font-size: 0;
  border-right: 1px solid rgba(232, 200, 122, .8);
  border-bottom: 1px solid rgba(232, 200, 122, .8);
  transform: rotate(45deg);
  animation: gx-arrow-head 3s ease-in-out infinite;
}
@keyframes gx-arrow-line {
  0%, 100% { transform: translateY(0); opacity: .75; }
  50%      { transform: translateY(5px); opacity: 1; }
}
@keyframes gx-arrow-head {
  0%, 100% { transform: rotate(45deg) translate(0, 0); }
  50%      { transform: rotate(45deg) translate(3.5px, 3.5px); }
}
/* 迷っている人向けの合図も、輪を光らせず「少し明るくする」だけにする */
.gx-next.is-hint { animation: none; color: #F4E3B4; }
@media (prefers-reduced-motion: reduce) {
  .gx-next::before, .gx-next::after { animation: none; }
}
.has-js .gx-station:not(.is-live) .gx-actions { opacity: 0; pointer-events: none; }
.has-js .gx-station.is-live .gx-actions { opacity: 1; transition: opacity 1s ease .9s; }
.no-3d .gx-actions, .is-tour .gx-actions { opacity: 1 !important; pointer-events: auto !important; position: static; transform: none; margin-top: 1em; }
.gx-actions--inline { margin-top: 1em; }

/* 「話を読む」＝控えめな文字リンク。開くとふわっと浮かび上がる */
.gx-more {
  background: none; border: none; padding: 4px 0;
  color: var(--gx-key); font: inherit; font-size: .85rem; letter-spacing: .12em;
  border-bottom: 1px solid rgba(232, 200, 122, .45);
  cursor: pointer; min-height: 32px;
}
.gx-panel .gx-secret { border-left: none; padding-left: 0; margin: .9em 0 0; font-size: .93rem; color: #DACFB6; max-width: 34em; }

/* 「この席のお話」＝リッチな白いカード（2026-08-06 内田指示）。
   本文パネルは背景なしのまま。開いた語りだけが、白い上質紙のカードとして浮かび上がる */
.gx-panel .gx-secret.gx-card {
  position: relative;
  margin-top: 1.1em;
  padding: 24px 26px 20px;
  max-width: 30em;
  background: linear-gradient(152deg, #FFFDF7 0%, #F6F1E4 52%, #EDE5D2 100%);
  border: 1px solid rgba(255, 255, 255, .85);
  border-radius: 6px;
  color: #3A3227;
  text-shadow: none;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .9) inset,
    0 18px 44px rgba(0, 0, 0, .55),
    0 3px 10px rgba(0, 0, 0, .38),
    0 0 44px rgba(232, 200, 122, .22);
  overflow: hidden;
}
.gx-panel .gx-secret.gx-card p { color: #3A3227; margin: 0 0 .85em; }
.gx-panel .gx-secret.gx-card p:last-child { margin-bottom: 0; }
/* 金の細い罫（上質紙の縁取り） */
.gx-panel .gx-secret.gx-card::before {
  content: "";
  position: absolute; inset: 7px;
  border: 1px solid rgba(184, 148, 74, .38);
  border-radius: 3px;
  pointer-events: none;
}
/* キラキラ＝斜めの光が一度だけ横切り、そのあとゆっくり呼吸する */
.gx-panel .gx-secret.gx-card::after {
  content: "";
  position: absolute; top: -60%; left: -140%;
  width: 60%; height: 220%;
  background: linear-gradient(100deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, .95) 45%,
    rgba(255, 246, 214, .7) 58%,
    rgba(255, 255, 255, 0) 100%);
  transform: rotate(12deg);
  pointer-events: none;
  animation: gx-shine 3.6s cubic-bezier(.3, 0, .2, 1) .35s 2;
}
@keyframes gx-shine {
  0%   { left: -140%; opacity: 0; }
  8%   { opacity: 1; }
  55%  { left: 150%; opacity: .9; }
  100% { left: 150%; opacity: 0; }
}
.has-js .gx-secret.gx-card.is-open { animation: gx-card-in 1s cubic-bezier(.2, .8, .25, 1) both; }
@keyframes gx-card-in {
  from { opacity: 0; transform: translateY(14px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .gx-panel .gx-secret.gx-card::after { display: none; }
}

/* 店内MAP（右上・実際の間取り。番号＝歩く順、クリックでその場所へ歩く） */
.gx-map {
  position: fixed; top: 18px; right: 20px; z-index: 55;
  width: 158px;
  padding: 10px 10px 4px;
  background: rgba(10, 8, 5, .66);
  border: 1px solid rgba(232, 200, 122, .22);
  border-radius: 4px;
  backdrop-filter: blur(4px);
}
.gx-map svg { display: block; width: 100%; height: auto; }
.gx-map__walls { fill: none; stroke: rgba(180, 165, 138, .85); stroke-width: 1.6; stroke-linecap: square; }
.gx-map__win { fill: none; stroke: rgba(180, 165, 138, .45); stroke-width: 1; stroke-dasharray: 2 2; }
.gx-map__furn {
  fill: rgba(166, 152, 127, .13);
  stroke: rgba(166, 152, 127, .55);
  stroke-width: .8;
  transition: fill .6s ease, stroke .6s ease;
}
.gx-map__route { fill: none; stroke: rgba(232, 200, 122, .42); stroke-width: 1; stroke-dasharray: 2.4 3.2; }
.gx-map__hit { fill: transparent; stroke: none; }
.gx-map__zone text {
  font-family: "Zen Kaku Gothic New", sans-serif;
  font-size: 9.5px;
  fill: #A6987F;
  text-anchor: middle;
  letter-spacing: .06em;
  transition: fill .5s ease;
}
.gx-map__num { font-size: 7.5px; fill: rgba(232, 200, 122, .65); }
.gx-map__zone { cursor: pointer; }
.gx-map__zone:hover text { fill: #E8C87A; }
.gx-map__zone.is-open text { fill: #D8C9A6; }
.gx-map__zone.is-here text { fill: #FFF3D6; }
.gx-map__zone.is-here .gx-map__furn { stroke: #E8C87A; fill: rgba(232, 200, 122, .22); }
/* 現在地＝地図のピン。灯りの輪／床のさざなみ／ピン本体の3層で「ここにいる」を示す */
.gx-map__me { transition: transform 1.8s cubic-bezier(.4, 0, .2, 1); }
.gx-map__halo {
  fill: url(#gxHalo);
  transform-box: fill-box; transform-origin: center;
  animation: gx-halo 3.4s ease-in-out infinite;
}
@keyframes gx-halo {
  0%, 100% { opacity: .34; transform: scale(.82); }
  50%      { opacity: .62; transform: scale(1.06); }
}
.gx-map__ripple {
  fill: none;
  stroke: rgba(255, 226, 160, .8);
  stroke-width: 1;
  transform-box: fill-box; transform-origin: center;
  animation: gx-ripple 2.6s cubic-bezier(.2, .6, .3, 1) infinite;
}
@keyframes gx-ripple {
  0%   { opacity: .9; transform: scale(.25); }
  70%  { opacity: 0;  transform: scale(1.15); }
  100% { opacity: 0;  transform: scale(1.15); }
}
.gx-map__pin {
  transform-box: fill-box; transform-origin: bottom center;
  animation: gx-pin-bob 2.6s cubic-bezier(.35, 0, .3, 1) infinite;
  filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, .8))
          drop-shadow(0 0 5px rgba(232, 200, 122, .75));
}
@keyframes gx-pin-bob {
  0%, 100% { transform: translateY(0) scaleY(1); }
  38%      { transform: translateY(-2.2px) scaleY(1.04); }
  62%      { transform: translateY(-.6px) scaleY(.99); }
}
.gx-map__pin-body { fill: url(#gxPin); stroke: rgba(70, 46, 12, .9); stroke-width: .8; }
.gx-map__pin-eye  { fill: #2A1D0A; }
/* 落ちてくる登場（駅が変わるたび） */
.gx-map__me.is-drop .gx-map__pin { animation: gx-pin-drop .7s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes gx-pin-drop {
  0%   { transform: translateY(-13px) scale(.7); opacity: 0; }
  60%  { transform: translateY(1.5px) scaleY(.86) scaleX(1.12); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .gx-map__halo, .gx-map__ripple, .gx-map__pin { animation: none !important; }
}
.gx-map__door { stroke: #A6987F; stroke-width: 1.1; fill: none; }
/* 引き戸の戸（開口の手前に一枚ある姿）。開き戸の弧と描き分ける */
.gx-map__slide { fill: rgba(166, 152, 127, .5); stroke: #A6987F; stroke-width: .8; }
.gx-map__in {
  font-family: "Zen Kaku Gothic New", sans-serif;
  font-size: 8px; fill: #A6987F; text-anchor: middle;
}
.gx-map__hint { margin: 5px 0 3px; font-size: .58rem; letter-spacing: .14em; color: #A6987F; text-align: center; }
.no-3d .gx-map { display: none; }
@media (max-width: 820px) {
  .gx-map { width: 118px; top: 12px; right: 12px; }
  .gx-fab { bottom: 122px; right: 16px; width: 56px; height: 56px; }   /* HUDの文字に重ねない */
}

/* 右下メニュー（fab）とオーバーレイ */
.gx-fab {
  position: fixed; right: 22px; bottom: 86px; z-index: 60;
  width: 62px; height: 62px; border-radius: 50%;
  background: rgba(10, 8, 5, .82);
  border: 1px solid rgba(232, 200, 122, .5);
  color: var(--gx-key); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.gx-fab span { width: 20px; height: 1px; background: currentColor; }
.gx-fab em { font-style: normal; font-size: .5rem; letter-spacing: .22em; margin-top: 3px; }
.gx-fab:hover { background: rgba(42, 32, 16, .9); }
.gx-overlay {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(6, 5, 3, .8);
  backdrop-filter: blur(14px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.2rem;
  opacity: 0; transition: opacity .55s ease;
  pointer-events: none;          /* 透明なまま画面を覆ってクリックを飲まない */
}
.gx-overlay[hidden] { display: none; }   /* display:flex が hidden 属性に勝つのを防ぐ */
.gx-overlay.is-open { opacity: 1; pointer-events: auto; }
.gx-overlay__nav { display: flex; flex-direction: column; gap: 1.7rem; text-align: center; }
.gx-overlay__nav a {
  font-family: "Zen Old Mincho", "Yu Mincho", serif;
  font-size: clamp(1.3rem, 3.2vw, 1.7rem); letter-spacing: .24em; text-indent: .24em;
  color: var(--gx-ink); text-decoration: none; opacity: .88;
}
.gx-overlay__nav a:hover { color: var(--gx-key); opacity: 1; }
.gx-overlay__close {
  position: absolute; top: 18px; right: 24px;
  background: none; border: none; color: var(--gx-sub);
  font-size: 2rem; cursor: pointer; min-width: 44px; min-height: 44px;
}

/* 写真（ところどころに・額装で上品に） */
.gx-photo {
  margin: 1.8em 0; padding: 10px;
  border: 1px solid rgba(232, 200, 122, .2);
  background: rgba(0, 0, 0, .28);
}
.gx-photo img { display: block; width: 100%; height: auto; }
.gx-photo figcaption { margin-top: 8px; }
.gx-photos { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }

/* 読み物の章 */
.gx-station--reading { min-height: auto; padding-bottom: 4svh; }
.gx-station--reading .gx-station__inner::before { display: none; }
.gx-station--reading h2 { font-size: clamp(1.3rem, 3vw, 1.9rem); }

/* ================= 読み物を「窓」にする（2026-08-08 内田
   「レストランについて、やメニューは、ヘッドラインと被る」）=================
   直す前：ゲーム中の駅の本文は position:fixed で画面に貼り付いている。そこへ
   右下メニューから #menu へ飛ぶと、**貼り付いたままの駅の見出しの上に読み物が重なって**
   どちらも読めなかった。読み物は独立した窓として前に出し、その間だけ駅の本文を畳む。
   ※生HTML・見るだけモード（tour）・WebGL不可のときは、これまでどおり素の文章として流す
     （文言はどの経路でも全部読める＝DOM-first の約束を崩さない） */
.has-js.has-3d:not(.is-tour) .gx-doc {
  position: fixed; inset: 0; z-index: 40;
  display: none; padding: 4svh 4vw;
  align-items: center; justify-content: center;
  background: rgba(4, 6, 10, .74);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.has-js.has-3d:not(.is-tour) .gx-doc.is-open { display: flex; }
.has-js.has-3d:not(.is-tour) .gx-doc .gx-station__inner {
  position: relative;
  max-width: 900px; max-height: 92svh; overflow-y: auto; overscroll-behavior: contain;
  padding: 32px clamp(20px, 4vw, 44px) 40px;
  background: linear-gradient(180deg, rgba(20, 16, 12, .96), rgba(10, 9, 8, .96));
  border: 1px solid rgba(232, 200, 122, .22);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .7);
}
.gx-doc__close {
  position: absolute; top: 8px; right: 10px;
  background: none; border: none; color: var(--gx-sub);
  font-size: 1.9rem; line-height: 1; cursor: pointer; min-width: 44px; min-height: 44px;
}
.gx-doc__close:hover { color: var(--gx-key); }
/* 生HTML・tour・縮退では窓ではなく普通の章なので、閉じるボタンは出さない */
.gx-doc__close { display: none; }
.has-js.has-3d:not(.is-tour) .gx-doc__close { display: block; }
/* 窓が出ている間は、駅の本文・矢印・地図・進行の点を引っ込める。
   visibility だけでは checkVisibility() に残る（＝検品が「重なった文字」と判定する）ので、
   既存の駅パネルと同じく画面の外へ逃がす */
.has-3d:not(.is-tour).is-reading .gx-station:not(.gx-station--reading) .gx-panel,
.has-3d:not(.is-tour).is-reading .gx-station .gx-actions {
  visibility: hidden !important; left: -200vw !important;
}
.is-reading .gx-map, .is-reading .gx-hud, .is-reading .gx-fab {
  opacity: 0; pointer-events: none;
}

/* ---- お品書き：種類ごとに面を分ける ---- */
.gx-tabs {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 1.4em 0 1.2em; padding-bottom: 12px;
  border-bottom: 1px solid rgba(232, 200, 122, .18);
}
.gx-tab {
  min-height: 44px; padding: 8px 16px;
  font-family: "Zen Old Mincho", "Yu Mincho", serif; font-size: .95rem; letter-spacing: .08em;
  color: var(--gx-sub); background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(232, 200, 122, .2); cursor: pointer;
  transition: color .25s ease, background .25s ease, border-color .25s ease;
}
.gx-tab:hover { color: var(--gx-ink); border-color: rgba(232, 200, 122, .45); }
.gx-tab.is-on {
  color: #17120C; background: var(--gx-key); border-color: var(--gx-key);
}
.gx-menu__cat h3 {
  font-family: "Zen Old Mincho", "Yu Mincho", serif;
  font-size: 1.15rem; letter-spacing: .1em; color: var(--gx-key); margin: .2em 0 .3em;
}
.gx-menu__cat .gx-line { color: #D8CFBE; margin: 0 0 1.1em; }
.gx-dishes {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px;
}
.gx-dish { margin: 0; }
.gx-dish img {
  display: block; width: 100%; height: auto; aspect-ratio: 560 / 425; object-fit: cover;
  border: 1px solid rgba(232, 200, 122, .18); background: rgba(0, 0, 0, .35);
}
.gx-dish figcaption {
  margin-top: 6px; font-size: .84rem; line-height: 1.5; color: #D8CFBE;
}
/* JSが動いているときだけ1面ずつ。生HTMLでは全種類が並んで読める */
.has-js .gx-menu__cat { display: none; }
.has-js .gx-menu__cat.is-on { display: block; }
.has-js.is-tour .gx-menu__cat, .no-3d .gx-menu__cat { display: block; }
.has-js.is-tour .gx-tabs, .no-3d .gx-tabs { display: none; }
/* 右下メニューの中の「メニューの種類」 */
.gx-overlay__sub {
  display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center;
  max-width: 30em; margin: -.7rem auto 0;
}
.gx-overlay__sub a { font-size: .95rem !important; letter-spacing: .12em !important; opacity: .6; }
.gx-overlay__sub a:hover { opacity: 1; }

/* ================= 次へ進む矢印を「押せるもの」にする（2026-08-08 内田
   「テーブル席を見る、の矢印をもう少しわかりやすくアニメーションにして、
     クリックできるのがはっきりわかるように」）=================
   直す前は「細い縦線＋小さな山形」で、絵として静かすぎて**装飾に見えていた**。
   丸い受け皿に山形を入れ、①ゆっくり上下する ②輪が2枚ずれて広がる（触ったときの波紋の予告）
   ③重ねると金で塗りつぶれる、の3つで「押せる」を伝える */
.gx-next::before, .gx-next::after { content: none; }   /* 旧・線と山形は使わない */
.gx-next { gap: 12px; font-size: .78rem; color: rgba(232, 200, 122, .9); }
.gx-next__label { order: 1; }
.gx-next__disc {
  order: 2; position: relative;
  width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--gx-key);
  border: 1px solid rgba(232, 200, 122, .55);
  background: rgba(232, 200, 122, .10);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .55);
  animation: gx-next-bob 2.6s ease-in-out infinite;
  transition: background .3s ease, color .3s ease, border-color .3s ease, transform .3s ease;
}
.gx-next__disc svg { display: block; }
/* 波紋2枚。ずらして出すと「連打しろ」ではなく「ここを押す」の合図になる */
.gx-next__disc::before, .gx-next__disc::after {
  content: ""; position: absolute; inset: -1px; border-radius: 50%;
  border: 1px solid rgba(232, 200, 122, .55);
  animation: gx-next-ring 2.6s ease-out infinite;
  pointer-events: none;
}
.gx-next__disc::after { animation-delay: 1.3s; }
.gx-next:hover, .gx-next:focus-visible { color: #F6E7BC; }
.gx-next:hover .gx-next__disc, .gx-next:focus-visible .gx-next__disc {
  background: var(--gx-key); color: #17120C; border-color: var(--gx-key);
  transform: scale(1.09); animation-play-state: paused;
}
.gx-next:active .gx-next__disc { transform: scale(.96); }
@keyframes gx-next-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}
@keyframes gx-next-ring {
  0% { transform: scale(1); opacity: .7; }
  60% { opacity: .12; }
  100% { transform: scale(2); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .gx-next__disc, .gx-next__disc::before, .gx-next__disc::after { animation: none; }
  .gx-next__disc::after { display: none; }
}

/* ================= 右下メニューの絵づくり（2026-08-08 内田
   「オーバーレイメニューは、もうちょっとデザインを入れたい」）=================
   直す前は、暗幕に明朝の行が4つ並ぶだけだった。店の名前・番号・罫線・間の取り方で
   「一枚の扉書き」にする。動きは順番に立ち上がるだけに留める（賑やかしにしない） */
.gx-overlay {
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(58, 40, 16, .55), transparent 62%),
    radial-gradient(90% 70% at 50% 108%, rgba(120, 30, 40, .22), transparent 60%),
    rgba(6, 5, 3, .88);
  gap: 1.4rem;
}
/* 金の細枠。画面いっぱいではなく、少し内側に引いて「額」に見せる */
.gx-overlay::before {
  content: ""; position: absolute; inset: 20px;
  border: 1px solid rgba(232, 200, 122, .16);
  pointer-events: none;
}
.gx-overlay__mark {
  text-align: center; margin: 0;
  font-family: "Zen Old Mincho", "Yu Mincho", serif;
  color: rgba(232, 200, 122, .92);
}
.gx-overlay__mark b {
  display: block; font-weight: 400;
  font-size: clamp(1.05rem, 2.6vw, 1.35rem); letter-spacing: .42em; text-indent: .42em;
}
.gx-overlay__mark small {
  display: block; margin-top: .7em;
  font-family: "Zen Kaku Gothic New", sans-serif;
  font-size: .58rem; letter-spacing: .3em; text-indent: .3em; color: var(--gx-sub);
}
.gx-overlay__mark::after {
  content: ""; display: block; width: 46px; height: 1px; margin: 1.1rem auto 0;
  background: linear-gradient(to right, transparent, rgba(232, 200, 122, .75), transparent);
}
/* align-items を center にしないと、行が『いちばん幅の広い子（種類の札の列）』まで
   伸びて、左肩の通し番号が文字からうんと離れる */
.gx-overlay__nav { counter-reset: gxnav; gap: 1.15rem; align-items: center; }
.gx-overlay__nav > a {
  position: relative; display: inline-block;
  padding: .35em 1.6em .5em;
  opacity: 0; transform: translateY(10px);
}
.gx-overlay.is-open .gx-overlay__nav > a {
  opacity: .9; transform: none;
  transition: opacity .5s ease, transform .5s ease, color .3s ease;
}
.gx-overlay.is-open .gx-overlay__nav > a:nth-of-type(1) { transition-delay: .10s; }
.gx-overlay.is-open .gx-overlay__nav > a:nth-of-type(2) { transition-delay: .18s; }
.gx-overlay.is-open .gx-overlay__nav > a:nth-of-type(3) { transition-delay: .26s; }
/* 通し番号を左肩に小さく */
.gx-overlay__nav > a::before {
  counter-increment: gxnav;
  content: "0" counter(gxnav);
  position: absolute; left: 0; top: .55em;
  font-family: "Zen Kaku Gothic New", sans-serif;
  font-size: .58rem; letter-spacing: .18em; color: var(--gx-sub);
  transition: color .3s ease;
}
/* 下線は「引かれる」動きで出す（ただの色替えより、行が生きて見える） */
.gx-overlay__nav > a::after {
  content: ""; position: absolute; left: 1.6em; right: 1.6em; bottom: .18em; height: 1px;
  background: rgba(232, 200, 122, .8);
  transform: scaleX(0); transform-origin: left center;
  transition: transform .42s cubic-bezier(.2, .7, .2, 1);
}
.gx-overlay__nav > a:hover::after, .gx-overlay__nav > a:focus-visible::after { transform: scaleX(1); }
.gx-overlay__nav > a:hover::before { color: var(--gx-key); }
/* メニューの種類は小さな札に */
.gx-overlay__sub {
  gap: 8px; margin: -.2rem auto .2rem; max-width: 34em;
  opacity: 0; transform: translateY(8px);
}
.gx-overlay.is-open .gx-overlay__sub {
  opacity: 1; transform: none;
  transition: opacity .5s ease .3s, transform .5s ease .3s;
}
.gx-overlay__sub a {
  font-family: "Zen Kaku Gothic New", sans-serif !important;
  font-size: .78rem !important; letter-spacing: .1em !important;
  padding: 7px 13px; opacity: .72;
  border: 1px solid rgba(232, 200, 122, .22);
  border-radius: 999px;
  transition: color .25s ease, border-color .25s ease, background .25s ease, opacity .25s ease;
}
.gx-overlay__sub a:hover {
  opacity: 1; color: #17120C; background: var(--gx-key); border-color: var(--gx-key);
}
.gx-overlay > .gx-meta { text-align: center; opacity: .7; }
.gx-overlay__close {
  border: 1px solid rgba(232, 200, 122, .28); border-radius: 50%;
  width: 46px; height: 46px; font-size: 1.5rem; line-height: 1;
  transition: color .25s ease, border-color .25s ease, transform .3s ease;
}
.gx-overlay__close:hover { color: var(--gx-key); border-color: var(--gx-key); transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) {
  .gx-overlay__nav > a, .gx-overlay__sub { opacity: .9 !important; transform: none !important; }
  .gx-overlay__close:hover { transform: none; }
}

/* ================= 2026-08-08（3回目）内田の4件 =================

   ①「何度か回遊して戻ってくると、テーブル席を見るの背景に四角い背景色が出る。ダサい」
   正体＝`tasks/tap.js` が押されたボタンに `is-found` を付け、`.gx-hotspot.is-found` の
   `background: rgba(232,200,122,.3)` が乗っていた。矢印は `border-radius: 0` なので**四角い板**になる。
   矢印は「押した跡」を四角で見せる必要がない。丸い受け皿の側で静かに示す */
.gx-hotspot.is-found:not(.gx-next), .gx-hotspot.is-chosen:not(.gx-next) {
  background: rgba(232, 200, 122, .3);
  color: #FFF3D6;
  border-color: var(--gx-key);
  animation: none;
}
.gx-next.is-found, .gx-next.is-chosen {
  background: none !important; border: 0 !important; color: rgba(232, 200, 122, .55);
}
.gx-next.is-found .gx-next__disc, .gx-next.is-chosen .gx-next__disc {
  background: rgba(232, 200, 122, .06); border-color: rgba(232, 200, 122, .3);
  animation: none;
}
.gx-next.is-found .gx-next__disc::before,
.gx-next.is-found .gx-next__disc::after,
.gx-next.is-chosen .gx-next__disc::before,
.gx-next.is-chosen .gx-next__disc::after { display: none; }
/* 押せなくなった矢印（disabled）は、押せるものと見分けがつくようにする */
.gx-next:disabled { opacity: .55; }
.gx-next:disabled .gx-next__disc { animation: none; }
.gx-next:disabled .gx-next__disc::before, .gx-next:disabled .gx-next__disc::after { display: none; }

/* ---- ②③ 店の中の物を押して開く（3D側の当たりと1対1のDOMボタン） ----
   3Dのクリックは演出。**行き先を持つのは必ずこのボタン**（タッチ・キーボード・検品が
   決定的に成立する。`references/input-and-ux.md` の約束）。
   ワールド側は raycast で当てたら、このボタンの click() を呼ぶだけ */
.gx-props { display: flex; flex-wrap: wrap; gap: 8px; margin: .9em 0 0; }
.gx-prop {
  min-height: 44px; padding: 8px 15px 8px 13px;
  display: inline-flex; align-items: center; gap: 8px;
  font-family: "Zen Kaku Gothic New", sans-serif; font-size: .82rem; letter-spacing: .06em;
  color: var(--gx-key); background: rgba(232, 200, 122, .07);
  border: 1px solid rgba(232, 200, 122, .38); border-radius: 999px;
  cursor: pointer;
  transition: color .25s ease, background .25s ease, border-color .25s ease;
}
.gx-prop::before {                      /* 地図の光る点と同じ意匠の小さな丸 */
  content: ""; width: 9px; height: 9px; border-radius: 50%;
  background: var(--gx-key); box-shadow: 0 0 0 0 rgba(232, 200, 122, .55);
  animation: gx-pulse 2.2s ease-in-out infinite;
}
.gx-prop:hover, .gx-prop:focus-visible {
  color: #17120C; background: var(--gx-key); border-color: var(--gx-key);
}
.gx-prop:hover::before, .gx-prop:focus-visible::before { background: #17120C; animation: none; }
@media (prefers-reduced-motion: reduce) { .gx-prop::before { animation: none; } }

/* ---- 本日のグラスワイン（メニューの窓の1面） ---- */
.gx-wine__head {
  margin: 1.4em 0 .5em; padding-bottom: .3em;
  font-family: "Zen Old Mincho", "Yu Mincho", serif;
  font-size: 1rem; letter-spacing: .3em; text-indent: .3em; color: var(--gx-key);
  border-bottom: 1px solid rgba(232, 200, 122, .18);
}
.gx-wines { list-style: none; margin: 0; padding: 0; }
.gx-wine { padding: .7em 0; border-bottom: 1px dotted rgba(232, 200, 122, .14); }
.gx-wine b {
  font-family: "Zen Old Mincho", "Yu Mincho", serif; font-weight: 400;
  font-size: 1.02rem; color: var(--gx-ink);
}
.gx-wine__origin {
  display: inline-block; margin-left: .8em;
  font-size: .74rem; letter-spacing: .08em; color: var(--gx-sub);
}
.gx-wine__note { display: block; margin-top: .3em; font-size: .86rem; color: #D8CFBE; }
