/* かけがわーるど(旧名 掛川の街3D)。マルシャンタウン3D の作り(カード・丸ボタン)を掛川の色(藍・白・茶)で */
:root {
  --ai: #1f3a5f; --ai2: #2e5585; --cha: #966432; --paper: #fbf8ef; --ink: #22252b; --line: #d8d2c2;
  --ok: #2f8f4e; --ng: #c0392b; --r: 12px;
  font-family: system-ui, -apple-system, "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #a9c8e6; color: var(--ink); -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; }
input, select { font: inherit; }
[hidden] { display: none !important; }
#world { position: fixed; inset: 0; touch-action: none; }
#world canvas { display: block; width: 100%; height: 100%; }

.loading { position: fixed; inset: 0; display: grid; place-items: center; background: linear-gradient(#42a3f4 50%, #f6e5cd); z-index: 50; color: #174a1f; }
/* ロゴと人物を切らず、縦画面では専用の構図を表示する。 */
.loading-art { position: absolute; inset: 0; }
.loading-art img { display: block; width: 100%; height: 100%; object-fit: contain; }
.loading-card { position: absolute; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 24px); padding: 8px 18px; border-radius: 14px; text-align: center; background: rgba(255,250,237,.96); box-shadow: 0 2px 14px rgba(39,61,21,.15); }
.loading-card p { margin: 0; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.loading .bar { width: min(180px, 55vw); height: 3px; background: #d6dfba; border-radius: 2px; overflow: hidden; margin: 7px auto 0; }
.loading .bar i { display: block; width: 40%; height: 100%; background: #5d8a12; animation: load 1.2s infinite ease-in-out; }
@media (orientation: landscape) and (max-height: 500px) {
  .loading-art { bottom: 48px; }
  .loading-card { bottom: calc(5px + env(safe-area-inset-bottom, 0px)); padding: 5px 14px; }
  .loading-card p { font-size: 11px; }
  .loading .bar { margin-top: 4px; }
}
@media (prefers-reduced-motion: reduce) { .loading .bar i { animation: none; width: 100%; opacity: .6; } }
@keyframes load { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }
.closed-card { background: var(--paper); color: var(--ink); padding: 28px 36px; border-radius: var(--r); text-align: center; }

.hud-top { position: fixed; top: 8px; left: 8px; right: 8px; display: flex; align-items: center; gap: 10px; pointer-events: none; z-index: 10; }
.hud-top > * { pointer-events: auto; }
.title { background: var(--ai); color: #fff; padding: 6px 12px; border-radius: 999px; font-size: 14px; }
.compass { margin: 0 0 0 auto; width: 48px; height: 48px; border-radius: 50%; background: rgba(251,248,239,.92); border: 2px solid var(--ai); position: relative; }
.compass .dial { position: absolute; inset: 0; transform: rotate(var(--r, 0deg)); }
.compass .dial span { position: absolute; font-size: 10px; font-weight: 700; color: #555; line-height: 1; }
.compass .dial .n { top: 2px; left: 50%; transform: translateX(-50%); color: #c0392b; font-size: 12px; }
.compass .dial .s { bottom: 2px; left: 50%; transform: translateX(-50%); }
.compass .dial .e { right: 3px; top: 50%; transform: translateY(-50%); }
.compass .dial .w { left: 3px; top: 50%; transform: translateY(-50%); }
/* 自分の進む向き(画面に対して)。矢印は中心から上向きの三角 */
.compass .head { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform: translate(-50%, -50%) rotate(var(--h, 0deg)); }
.compass .head::before { content: ''; position: absolute; left: -7px; top: -13px; border: 7px solid transparent; border-bottom: 14px solid var(--ai); border-top: 0; }
.compass .head::after { content: ''; position: absolute; left: -3px; top: 1px; width: 6px; height: 6px; border-radius: 50%; background: var(--ai); }
.heading { margin: 0 auto 0 0; background: rgba(251,248,239,.92); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-size: 13px; font-weight: 700; font-style: normal; color: var(--ai); white-space: nowrap; }
.heading:empty { display: none; }
.net { background: rgba(251,248,239,.92); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; display: flex; gap: 6px; align-items: center; font-size: 13px; margin-right: 150px; }
.net i { width: 8px; height: 8px; border-radius: 50%; background: #999; }
body[data-net="online"] .net i { background: #3bb15d; }
body[data-net="connecting"] .net i { background: #e8c547; }

/* 投稿・掲示板・アート(2026-11-07) */
.hud-left .pair { display: flex; gap: 4px; }
.hud-left .pair button { min-width: 0; flex: 1; padding: 7px 6px; font-size: 12px; white-space: nowrap; background: #7a4a8c; }
.hud-left .art { background: #b8557a; }
.po-form label { display: block; font-size: 12px; color: #555; margin: 6px 0; }
.po-form input, .po-form textarea, .po-form select { display: block; width: 100%; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; margin-top: 2px; font-size: 14px; }
.po-form textarea { resize: vertical; }
.po-row { display: flex; gap: 6px; }
.po-row label { flex: 1; }
.po-form .primary { width: 100%; }
.bp-note { font-size: 12px; color: #a0522d; margin: 4px 0; }
.bd-list { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; max-height: 50vh; max-height: 50dvh; overflow: auto; }
.bd-item { background: #fff; border-radius: 8px; padding: 6px 9px; font-size: 13px; }
.bd-item.bd-re { margin-left: 18px; background: #f3f0e6; border-left: 3px solid var(--line); }
.bd-meta { display: flex; gap: 8px; align-items: baseline; font-size: 12px; color: #666; }
.bd-meta b { color: var(--ai); font-size: 13px; }
.bd-meta i { font-style: normal; background: #e8eef6; border-radius: 999px; padding: 0 6px; font-size: 10px; }
.bd-body { white-space: pre-wrap; word-break: break-word; margin: 2px 0; }
.bd-btns { display: flex; gap: 6px; }
.bd-btns button { border: 0; background: none; color: var(--ai2); font-size: 12px; padding: 2px 4px; }
.bd-btns .bd-rep { color: #b00; }
.bd-reto { font-size: 12px; color: #666; background: #eef2f7; border-radius: 8px; padding: 4px 8px; margin-bottom: 4px; }
.bd-reto button { border: 0; background: none; color: var(--ai2); font-size: 12px; }
.po-mine .ic-sub { margin-top: 10px; }
.lb-post { background: #7a4a8c; color: #fff; font-weight: 700; }
.ic-kind.user { background: #7a4a8c; }
.ic-report { border: 1px solid #b00 !important; color: #b00 !important; margin-left: auto; }
.sp-list button.user { border-left: 3px solid #7a4a8c; }
.person-card { position: fixed; left: 50%; bottom: 120px; transform: translateX(-50%); width: min(300px, calc(100vw - 24px)); background: var(--paper); border-radius: var(--r); box-shadow: 0 6px 24px rgba(0,0,0,.3); padding: 10px 12px; z-index: 14; border-top: 5px solid #7a4a8c; }
.pc-head { display: flex; justify-content: space-between; align-items: center; }
.pc-head b { font-size: 16px; color: var(--ai); }
.pc-head button { border: 0; background: none; font-size: 22px; line-height: 1; }
.chat-hint { background: rgba(122,74,140,.92); color: #fff; border-radius: 8px; padding: 4px 10px; font-size: 12px; margin-bottom: 4px; }
.board-hint { position: fixed; left: 50%; bottom: 120px; transform: translateX(-50%); z-index: 12; border: 0; border-radius: 999px; background: #5e3d27; color: #fff; padding: 10px 18px; font-size: 15px; font-weight: 700; box-shadow: 0 3px 10px rgba(0,0,0,.35); }
body.touch .board-hint, body.touch .person-card { bottom: 190px; }
.ar-row { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin: 6px 0; font-size: 12px; }
.ar-row .primary { margin: 0 0 0 auto; }
.ar-pal { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; margin: 6px 0; }
.ar-pal .sw { aspect-ratio: 1; border: 2px solid #fff; border-radius: 6px; box-shadow: 0 0 0 1px var(--line); }
.ar-pal .sw.on { box-shadow: 0 0 0 3px var(--ai); }
.ar-cv { display: block; width: 100%; max-width: 320px; aspect-ratio: 1; margin: 6px auto; border: 1px solid var(--line); border-radius: 6px; background: #fff; touch-action: none; cursor: crosshair; image-rendering: pixelated; }
.ar-title { display: block; font-size: 12px; color: #555; margin: 6px 0; }
.ar-title input { display: block; width: 100%; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; margin-top: 2px; font-size: 14px; }
.ar-gal { display: flex; flex-direction: column; gap: 4px; max-height: 55vh; max-height: 55dvh; overflow: auto; }
.ar-item { display: grid; grid-template-columns: 48px 1fr auto; gap: 8px; align-items: center; background: #fff; border-radius: 8px; padding: 5px 8px; font-size: 13px; }
.ar-item small { display: block; color: #777; font-size: 11px; }
.ar-item button { border: 1px solid var(--ai); color: var(--ai); background: #fff; border-radius: 6px; padding: 4px 8px; font-size: 12px; }
.ar-thumb { width: 48px; height: 48px; border-radius: 4px; border: 1px solid var(--line); image-rendering: pixelated; }

/* アカウント(任意)。入口の画面(welcome)より上に出す */
.acc-foot { border: 0; background: rgba(255,255,255,.75); border-radius: 999px; width: 26px; height: 26px; font-size: 15px; line-height: 1; padding: 0; margin-right: 6px; }
.account { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.account-card { width: 100%; max-width: 380px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto; background: var(--paper, #fff); color: #222; border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.35); padding: 14px 16px; border-top: 5px solid #1f3a5f; }
.account-card p { margin: 6px 0; font-size: 14px; }
.account-card .acc-note { font-size: 12.5px; color: #555; }
.account-card label { display: block; margin: 8px 0; font-size: 13px; }
.account-card input { display: block; width: 100%; box-sizing: border-box; margin-top: 3px; padding: 9px 10px; border: 1px solid #aab; border-radius: 8px; font-size: 16px; background: #fff; }
.account-card .acc-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.account-card .acc-row button { padding: 9px 14px; border-radius: 9px; border: 1px solid #1f3a5f; background: #fff; color: #1f3a5f; font-size: 14px; }
.account-card .acc-row button.primary { background: #1f3a5f; color: #fff; }
.account-card .acc-row button.danger { border-color: #b03030; color: #b03030; }
.account-card .acc-msg { min-height: 1.3em; font-size: 13px; color: #b03030; }
.side-panel { position: fixed; left: 136px; top: 64px; width: min(360px, calc(100vw - 150px)); max-height: calc(100vh - 120px); max-height: calc(100dvh - 120px); overflow: auto; background: var(--paper); border-radius: var(--r); box-shadow: 0 6px 24px rgba(0,0,0,.25); padding: 12px; z-index: 12; }
.sp-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.sp-head button, .bp-x { border: 0; background: none; font-size: 22px; line-height: 1; }
.sp-spots { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.sp-spots button, .chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 10px; font-size: 13px; }
.chip.on { background: var(--ai); color: #fff; border-color: var(--ai); }
#move-q, .sp-ll input, .bp-text { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.sp-list { display: flex; flex-direction: column; gap: 2px; margin: 8px 0; max-height: 50vh; max-height: 50dvh; overflow: auto; }
.sp-list button { text-align: left; border: 0; background: #fff; padding: 7px 9px; border-radius: 6px; }
.sp-list button:hover { background: #eef2f7; }
.sp-list small { display: block; color: #777; font-size: 11px; }
.sp-ll { display: flex; gap: 6px; }
.sp-ll button { white-space: nowrap; border: 0; background: var(--ai); color: #fff; border-radius: 8px; padding: 0 12px; }
.sp-hint, .bp-hint { color: #666; font-size: 12px; margin: 6px 0; }

.build-panel { position: fixed; right: 8px; top: 64px; width: min(380px, calc(100vw - 16px)); max-height: calc(100vh - 140px); max-height: calc(100dvh - 140px); overflow: auto; background: var(--paper); border-radius: var(--r); box-shadow: 0 6px 24px rgba(0,0,0,.25); padding: 10px; z-index: 12; border-top: 5px solid var(--cha); }
.bp-head { display: flex; align-items: center; gap: 8px; }
.bp-quota { font-size: 11px; color: #555; flex: 1; }
.bp-note { font-size: 12px; color: #a0522d; margin: 4px 0; }
.bp-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0; }
.bp-tabs button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 5px 8px; font-size: 13px; }
.bp-tabs button.on { background: var(--cha); color: #fff; border-color: var(--cha); }
.bp-row, .bp-grid { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0; }
.bp-slider { display: grid; grid-template-columns: 70px 1fr 52px; align-items: center; gap: 6px; font-size: 12px; margin: 4px 0; }
.bp-sel { display: flex; gap: 8px; align-items: center; font-size: 13px; margin: 6px 0; }
.bp-colors { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; margin: 6px 0; }
.bp-colors .sw { aspect-ratio: 1; border: 2px solid #fff; border-radius: 6px; box-shadow: 0 0 0 1px var(--line); }
.bp-colors .sw.on { box-shadow: 0 0 0 2px var(--ai); }
.bp-list { display: flex; flex-direction: column; gap: 4px; }
.bp-item { background: #fff; border-radius: 8px; padding: 6px 8px; display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; font-size: 13px; }
.bp-item small { grid-column: 1; color: #777; font-size: 11px; }
.bp-item button, .bp-item em { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-size: 12px; }
.bp-item button { border: 1px solid var(--ai); color: var(--ai); background: #fff; border-radius: 6px; padding: 4px 8px; }
.bp-item em { color: #999; }
.bp-desc { font-size: 13px; }
.bp-status { margin-top: 8px; font-size: 12px; background: #fff; border-radius: 8px; padding: 6px 8px; color: #444; }
.primary { background: var(--ai); color: #fff; border: 0; border-radius: 10px; padding: 9px 14px; font-size: 14px; margin: 6px 0; }
.build-panel .primary { background: var(--cha); }

.minimap { position: fixed; right: 8px; top: 8px; width: 140px; height: 140px; border-radius: 12px; border: 3px solid var(--ai); background: #ddd center / cover no-repeat; z-index: 11; overflow: hidden; cursor: pointer; }
.minimap i, .cm-img i { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: #e0302a; border: 2px solid #fff; }
.minimap { background-size: 100% 100%; background-repeat: no-repeat; background-color: #cfd8c4; }
.minimap i { left: 50%; top: 50%; transform: rotate(var(--h, 0deg)); }
.minimap i::after { content: ''; position: absolute; left: 50%; top: -9px; margin-left: -4px; border: 4px solid transparent; border-bottom: 7px solid #e0302a; border-top: 0; }
body.building .minimap { display: none; }
.citymap { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: grid; place-items: center; z-index: 42; } /* はじめての案内(30)・すすめ(39)・知らせ(40)より上(2026-11-13。スマホで案内の札が × に重なった) */
.cm-card { background: var(--paper); padding: 10px; border-radius: var(--r); position: relative; max-height: 92vh; max-height: 92dvh; }
.cm-card > button { position: absolute; right: 14px; top: 14px; width: 40px; height: 40px; border: 2px solid var(--ai); border-radius: 50%; background: rgba(251,248,239,.95); color: var(--ai); font-size: 24px; line-height: 1; z-index: 2; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.cm-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 2px 0; font-size: 13px; }
.cm-foot button { min-height: 40px; padding: 0 18px; border: 2px solid var(--ai); border-radius: 20px; background: var(--ai); color: #fff; font-size: 15px; font-weight: 700; cursor: pointer; }
.cm-img { position: relative; overflow: hidden; touch-action: none; }
.cm-pan { position: relative; transform-origin: 0 0; will-change: transform; }
.cm-pan i { transform: scale(var(--inv, 1)); }
.cm-img.zoomed img { cursor: grab; }
.cm-img.dragging img { cursor: grabbing; }
.cm-zoom { position: absolute; left: 8px; bottom: 8px; display: flex; flex-direction: column; gap: 6px; z-index: 2; }
.cm-zoom button { width: 40px; height: 40px; border: 2px solid var(--ai); border-radius: 10px; background: rgba(251,248,239,.95); color: var(--ai); font-size: 22px; font-weight: 700; line-height: 1; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.cm-img img { display: block; max-height: calc(92vh - 76px); max-height: calc(92dvh - 76px); max-width: 90vw; cursor: crosshair; }

/* 会話:左の列(〜134px)と重ならないよう、その右の下に置く(2026-11-09。前は left 8px で つくる・BGM の上に重なっていた)。横のパネルを開いている間はパネルの右へ */
.chat { position: fixed; left: 146px; bottom: 30px; width: min(340px, calc(100vw - 160px)); z-index: 10; }
body:not(.compact):has(.side-panel:not([hidden])) .chat { left: 508px; width: min(340px, calc(100vw - 520px)); }
.chat-log:empty { display: none; }
.chat-log { max-height: 160px; overflow: auto; font-size: 13px; display: flex; flex-direction: column; gap: 2px; margin-bottom: 4px; }
.chat-row { background: rgba(251,248,239,.85); border-radius: 8px; padding: 3px 8px; align-self: flex-start; }
.chat-row.mine { background: rgba(214,228,245,.9); }
.chat-row.sys { color: #666; font-size: 12px; }
.chat-report { border: 0; background: none; color: #b00; font-size: 12px; }
.chat form { display: flex; gap: 4px; }
.chat input { flex: 1; padding: 7px 10px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.95); }
.chat form button { border: 0; background: var(--ai); color: #fff; border-radius: 999px; padding: 0 12px; }
.chat-fixed { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.chat-fixed[hidden], .chat-pick[hidden] { display: none; }
.chat-quick { display: flex; gap: 4px; flex-wrap: wrap; }
.chat-quick button, .chat-more { border: 1px solid var(--line); background: rgba(255,255,255,.95); border-radius: 999px; padding: 0 10px; min-height: 36px; font-size: 13px; white-space: nowrap; }
.chat-more { background: var(--ai); color: #fff; border-color: transparent; font-weight: 700; }
.chat-quick button:disabled, .chat-more:disabled, .cp-grid button:disabled { opacity: .45; }
.chat-pick { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 8px 10px 10px; margin-bottom: 6px; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.cp-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.cp-head button { border: 0; background: none; font-size: 20px; min-width: 44px; min-height: 44px; }
.cp-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 6px; }
.cp-tabs button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 0 10px; min-height: 36px; font-size: 13px; }
.cp-tabs button[aria-selected="true"] { background: var(--ai); color: #fff; border-color: transparent; }
.cp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.cp-grid button { border: 1px solid var(--line); background: #fff; border-radius: 10px; min-height: 44px; padding: 4px 8px; font-size: 14px; text-align: left; }

.stick, .jump, .fly-ctl, .build-touch { display: none; }
/* iPad(WebKit)は viewport の user-scalable=no を無視する:2 本指・ダブルタップで頁ごと拡大されると、左下の触った所がスティックの範囲から外れて動かなくなる。
   頁の拡大・長押しの選択と呼び出しを止める(2026-11-11)。文字を打つ所は選べるまま */
body.touch { touch-action: manipulation; touch-action: pan-x pan-y; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.touch input, body.touch textarea, body.touch [contenteditable] { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
body.touch .stick { display: block; position: fixed; left: 24px; bottom: 40px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,.3); border: 2px solid rgba(255,255,255,.7); z-index: 9; touch-action: none; }
body.touch .stick i { position: absolute; left: 35px; top: 35px; width: 50px; height: 50px; border-radius: 50%; background: rgba(31,58,95,.8); }
body.touch .jump { display: block; position: fixed; right: 24px; bottom: 50px; width: 72px; height: 72px; border-radius: 50%; border: 0; background: rgba(31,58,95,.8); color: #fff; z-index: 9; }
body.touch.flying .fly-ctl, body.touch.riding .fly-ctl { display: flex; flex-direction: column; gap: 8px; position: fixed; right: 110px; bottom: 50px; z-index: 9; }
.fly-ctl button { width: 56px; height: 56px; border-radius: 50%; border: 0; background: rgba(31,58,95,.8); color: #fff; font-size: 20px; }
body.touch.building .build-touch { display: grid; grid-template-columns: repeat(3, 56px); gap: 6px; position: fixed; right: 12px; bottom: 140px; z-index: 13; }
body.touch.building .jump { display: none; }
.build-touch button { width: 56px; height: 56px; border-radius: 12px; border: 0; background: var(--cha); color: #fff; font-size: 13px; }
body.touch.building .build-panel { max-height: 45vh; max-height: 45dvh; top: auto; bottom: 8px; right: 200px; width: min(380px, calc(100vw - 210px)); }
body.touch.building .chat { display: none; }

.toasts { position: fixed; left: 50%; top: 84px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; z-index: 40; pointer-events: none; }
.toast { background: rgba(31,58,95,.95); color: #fff; padding: 8px 14px; border-radius: 10px; font-size: 14px; transition: opacity .5s; }
.toast.error { background: rgba(192,57,43,.95); }
.toast.out { opacity: 0; }

.compat-notice { position: fixed; inset: 0; display: grid; place-items: center; background: #1f3a5f; z-index: 100; color: #fff; padding: 20px; }
@media (max-height: 520px) {
  .minimap { width: 100px; height: 100px; }
  .chat-log { max-height: 90px; }
}

/* いまいる場所(ミニ地図の下) */
.here { position: fixed; right: 8px; top: 154px; width: 140px; z-index: 11; background: rgba(251,248,239,.94); border: 2px solid var(--ai); border-radius: 10px; padding: 4px 7px; font-size: 12px; line-height: 1.35; pointer-events: none; }
.here b { display: block; color: var(--ai); font-size: 13px; }
.here small { display: block; color: #666; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.here small:empty { display: none; }
body.building .here { display: none; }
body.aerial .here { border-color: var(--cha); }

/* 上空ビューの「あなた」の目印(画面の外なら端に寄せて矢印) */
.me-mark { position: fixed; left: 0; top: 0; z-index: 9; border: 3px solid #fff; border-radius: 16px; padding: 4px 12px 4px 8px; background: #e0302a; color: #fff; font-size: 15px; font-weight: 700; animation: me-pulse 1.6s ease-in-out infinite; white-space: nowrap; box-shadow: 0 1px 5px rgba(0,0,0,.45); cursor: pointer; }
.me-mark::after { content: ''; position: absolute; left: 50%; bottom: -9px; margin-left: -7px; border: 7px solid transparent; border-bottom: 0; border-top-color: #e0302a; }
.me-mark i { display: none; font-style: normal; margin-right: 4px; transform: rotate(var(--a, 0)); }
.me-mark b::before { content: ''; display: inline-block; width: 9px; height: 9px; margin-right: 5px; border-radius: 50%; background: #fff; vertical-align: 1px; }
.me-mark.off b::before { display: none; }
.me-mark.off { opacity: .92; animation: none; }
@keyframes me-pulse { 50% { box-shadow: 0 0 0 6px rgba(224,48,42,.35), 0 1px 5px rgba(0,0,0,.45); } }
.me-mark.off::after { display: none; }
.me-mark.off i { display: inline-block; }

/* 上空ビューの地名・施設名 */
.labels { position: fixed; inset: 0; pointer-events: none; z-index: 8; overflow: hidden; }
.lb { position: absolute; left: 0; top: 0; pointer-events: auto; border: 0; white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; border-radius: 6px; padding: 2px 6px; font-size: 12px; background: rgba(255,255,255,.88); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.lb:hover { outline: 2px solid var(--ai); z-index: 2; }
.lb-zone { font-size: 18px; font-weight: 700; background: none; box-shadow: none; color: #fff; text-shadow: 0 0 4px #1f3a5f, 0 0 2px #1f3a5f, 0 1px 3px #000; }
.lb-place { font-size: 15px; font-weight: 700; background: none; box-shadow: none; color: #fff; text-shadow: 0 0 3px #3a2a10, 0 0 2px #3a2a10, 0 1px 2px #000; }
.lb-ev { background: #c0392b; color: #fff; font-weight: 700; }
.lb-big { background: var(--ai); color: #fff; font-weight: 700; }
.lb-sight { background: #fff5dc; color: #6b4210; }
.lb-pub { background: #e8eef6; color: #1f3a5f; }
.lb-food { background: #fde8e0; color: #8a2d12; }
.lb-shop { background: #fff; color: #333; }
.lb-water { background: none; box-shadow: none; color: #0d4f8b; font-style: italic; text-shadow: 0 0 3px #fff, 0 0 2px #fff; }
.lb-bus { background: #f0f0f0; color: #555; font-size: 11px; }

/* 詳細カード(施設・イベント) */
.info-card { position: fixed; right: 8px; top: 216px; width: min(360px, calc(100vw - 16px)); max-height: calc(100vh - 260px); max-height: calc(100dvh - 260px); overflow: auto; background: var(--paper); border-radius: var(--r); box-shadow: 0 6px 24px rgba(0,0,0,.3); padding: 12px 14px; z-index: 14; border-top: 5px solid var(--ai); }
.ic-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.ic-head h2 { font-size: 18px; margin: 2px 0; color: var(--ai); }
.ic-head > button { border: 0; background: none; font-size: 24px; line-height: 1; }
.ic-kind { display: inline-block; font-size: 11px; background: var(--ai); color: #fff; border-radius: 999px; padding: 1px 8px; }
.ic-kind.ev { background: #c0392b; }
.ic-kana { color: #888; font-size: 11px; }
.info-card dl { display: grid; grid-template-columns: 76px 1fr; gap: 4px 8px; font-size: 13px; margin: 10px 0; }
.info-card dt { color: #777; }
.info-card dd { margin: 0; word-break: break-word; }
.info-card dd small { color: #888; margin-left: 4px; }
.info-card a { color: var(--ai2); }
.ic-link { border: 0; background: none; padding: 0; color: var(--ai2); text-decoration: underline; font-size: 13px; }
.ic-sub { font-size: 12px; color: #666; margin-top: 6px; }
.ic-btns { display: flex; gap: 8px; align-items: center; }
.ic-btns button:not(.primary) { border: 1px solid var(--ai); color: var(--ai); background: #fff; border-radius: 10px; padding: 8px 12px; }
.ic-credit { font-size: 11px; color: #888; margin: 8px 0 0; }
.ic-list { margin: 0; padding-left: 1.1em; } /* 主な事業(2026-11-17 追加 37) */
.ic-list li { margin: 1px 0; }

/* 検索・一覧 */
.sp-q { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.sp-chips { margin-top: 8px; }
.sp-check { display: block; font-size: 13px; margin: 6px 0; }
.sp-row { display: flex; gap: 2px; }
.sp-row > button:first-child { flex: 1; }
.sp-i { width: 30px; border: 0; background: #eef2f7; border-radius: 6px; color: var(--ai); font-weight: 700; font-family: Georgia, serif; }
.sp-list button.ev { border-left: 3px solid #c0392b; }
.sp-list button.now { background: #fff1ee; }

body.aerial .jump { display: none; }
@media (max-height: 520px) {
  .here { top: 112px; width: 100px; font-size: 11px; }
  .here b { font-size: 12px; }
  .info-card { top: auto; bottom: 8px; max-height: 70vh; max-height: 70dvh; }
}
@media (max-width: 640px) {
  .info-card { top: auto; bottom: 8px; max-height: 60vh; max-height: 60dvh; }
}
.sp-spots button.primary { background: var(--ai); color: #fff; border-color: var(--ai); padding: 8px 14px; }

/* 乗り物・武器・バトル・学び(2026-11-07) */
.fire, .dismount { display: none; }
body.touch.armed .fire { display: block; position: fixed; right: 24px; bottom: 140px; width: 72px; height: 72px; border-radius: 50%; border: 0; background: rgba(192,40,40,.85); color: #fff; font-weight: 700; z-index: 9; }
body.touch.riding .dismount { display: block; position: fixed; right: 110px; bottom: 180px; padding: 8px 12px; border-radius: 999px; border: 0; background: rgba(31,58,95,.8); color: #fff; z-index: 9; }
body.touch.riding .jump { display: none; }
.battle-hud { position: fixed; left: 50%; top: 8px; transform: translateX(-50%); z-index: 10; background: rgba(20,24,30,.78); color: #fff; border-radius: 10px; padding: 6px 10px; min-width: 220px; font-size: 13px; }
.bh-hp { position: relative; height: 14px; background: #3a3f48; border-radius: 7px; overflow: hidden; }
.bh-hp i { display: block; height: 100%; background: linear-gradient(90deg, #e0473a, #5fd16f); transition: width .2s; }
.bh-hp span { position: absolute; inset: 0; text-align: center; font-size: 11px; line-height: 14px; font-weight: 700; text-shadow: 0 1px 2px #000; }
.bh-row { display: flex; gap: 12px; justify-content: center; margin-top: 4px; }
body.hurt #world::after { content: ''; position: fixed; inset: 0; background: rgba(220,40,40,.28); pointer-events: none; z-index: 7; }
.crosshair { display: none; position: fixed; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border: 2px solid rgba(255,255,255,.9); border-radius: 50%; box-shadow: 0 0 3px #000; pointer-events: none; z-index: 8; }
body.armed .crosshair { display: block; }
.ln-table { border-collapse: collapse; font-size: 12px; margin: 6px 0; width: 100%; }
.ln-table th, .ln-table td { border-bottom: 1px solid var(--line); padding: 3px 6px; text-align: left; }
.ln-legend { font-size: 11px; line-height: 1.9; margin: 6px 0; }
.ln-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin: 0 4px 0 8px; vertical-align: -2px; border: 1px solid rgba(0,0,0,.2); }
.ln-here b { color: #c0392b; }
.learn-card { position: fixed; left: 50%; bottom: 56px; transform: translateX(-50%); width: min(560px, calc(100vw - 24px)); max-height: 46vh; max-height: 46dvh; overflow: auto; background: var(--paper); border-radius: var(--r); box-shadow: 0 6px 24px rgba(0,0,0,.3); padding: 12px 14px; z-index: 13; border-top: 5px solid #2e7d4f; font-size: 14px; line-height: 1.6; }
.lc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.lc-head b { font-size: 16px; }
.lc-head span { color: #666; font-size: 12px; }
.lc-ask { background: #eef5ef; border-radius: 8px; padding: 8px 10px; margin: 8px 0; }
.lc-choices { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.lc-choices button, .lc-btns button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 13px; }
.lc-btns { display: flex; gap: 6px; margin-top: 8px; }
.lc-btns .primary, .sp-spots .primary { background: var(--ai); color: #fff; border-color: var(--ai); }
.lc-score b { font-size: 24px; color: #c0392b; }
body.touch .learn-card { bottom: 130px; max-height: 38vh; max-height: 38dvh; }
/* 案内のカードは画面の右下に(真ん中の人物を隠さない)。見出しをつかんで動かす・－で見出しだけ・×で隠す(learn.js の initCardDock。2026-11-10) */
.learn-card { left: auto; right: 12px; transform: none; width: min(420px, calc(100vw - 24px)); }
.learn-card .lc-head { cursor: move; user-select: none; touch-action: none; gap: 6px; }
.learn-card .lc-head b { flex: 1; min-width: 0; }
.lc-tools { display: flex; gap: 4px; flex: none; }
.lc-tools button { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 16px; line-height: 1; padding: 0; cursor: pointer; }
.learn-card.min { width: auto; max-width: min(360px, calc(100vw - 24px)); padding: 6px 10px; }
.learn-card.min > :not(.lc-head) { display: none; }
.learn-card.min .lc-head { margin-bottom: 0; }
.learn-card.min .lc-head b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.learn-reopen { position: fixed; left: 12px; bottom: 56px; z-index: 13; border: 0; border-radius: 999px; background: #2e7d4f; color: #fff; padding: 8px 14px; font-size: 14px; font-weight: 700; box-shadow: 0 3px 10px rgba(0,0,0,.35); cursor: pointer; }
body.touch .learn-reopen { left: auto; right: 12px; bottom: 140px; }

/* 観光マップ(2026-11-07) */
.hud-left .kankou { background: #c0702a; }
.kk-count { margin: 2px 0 8px; font-size: 14px; }
.kk-count b { font-size: 20px; color: #c0392b; }
.kk-count small { display: block; color: #666; font-size: 11px; }
.kk-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; border: 1px solid rgba(0,0,0,.15); }
.sp-list button.kk-row.done { background: #f1f7ec; }
.sp-list button.kk-row.done small { color: #2e7d4f; }
.kk-go { width: 44px; font-family: inherit; font-size: 12px; font-weight: 400; }
.kk-src { font-size: 11px; }
/* エモートのパネル(ui/emote.js):3 段の絵文字ボタン・数字キーの段・いっしょに踊る */
.em-row { margin: 6px 0 10px; }
.em-label { display: flex; align-items: baseline; gap: 6px; margin-bottom: 4px; }
.em-label small { color: #777; font-size: 11px; flex: 1; }
.em-keyrow { border: 1px solid var(--line); background: #fff; border-radius: 6px; font-size: 11px; padding: 1px 6px; color: #666; }
.em-keyrow.on { background: var(--ai); color: #fff; border-color: var(--ai); }
.em-btns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.em-btn { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 6px 2px 4px; font-size: 11px; line-height: 1.1; }
.em-btn.on { background: var(--ai); color: #fff; border-color: var(--ai); }
.em-btn i { position: absolute; left: 4px; top: 3px; font-style: normal; font-size: 10px; color: #999; }
.em-btn.on i { color: #dde; }
.em-emoji { font-size: 22px; }
.em-join { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.em-with { background: #fff4d6; border-color: #e8c547; text-align: left; }
.em-foot { display: flex; align-items: center; gap: 8px; }
.em-foot .sp-hint { margin: 0; }
body.emoting .hud-left #btn-emote { outline: 3px solid #e8c547; }
/* 買い物・もちもの(2026-11-07) */
.hud-left .shop { background: #1f8f4e; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.hud-left .shop .coin { font-style: normal; background: rgba(255,255,255,.2); border-radius: 999px; padding: 1px 7px; font-size: 12px; white-space: nowrap; }
.shop-hint { position: fixed; left: 50%; bottom: 166px; transform: translateX(-50%); z-index: 12; border: 0; border-radius: 999px; background: #1f8f4e; color: #fff; padding: 10px 18px; font-size: 15px; font-weight: 700; box-shadow: 0 3px 10px rgba(0,0,0,.35); }
body.touch .shop-hint { bottom: 236px; }
.sh-coin { margin-left: auto; margin-right: 8px; font-weight: 700; color: var(--cha); font-size: 14px; }
.sh-h { font-size: 15px; margin: 10px 0 4px; color: var(--ai); }
.sh-h small { display: block; font-weight: 400; color: #777; font-size: 11px; }
.sh-desc { display: block; color: #888; font-size: 11px; }
.sh-buy, .sh-use { border: 1px solid var(--ai); color: var(--ai); background: #fff; border-radius: 6px; padding: 3px 8px; font-size: 12px; white-space: nowrap; }
.sh-use { border-color: #1f8f4e; color: #1f8f4e; }
.sh-buy:disabled { opacity: .4; cursor: default; }
.sh-near { display: flex; flex-direction: column; gap: 2px; margin: 6px 0; }
.sh-near button { display: flex; gap: 6px; align-items: center; text-align: left; border: 0; background: #fff; padding: 6px 9px; border-radius: 6px; font-size: 13px; }
.sh-near button span { color: #777; font-size: 11px; flex: 1; }
.sh-near button em { font-style: normal; color: var(--ai2); font-size: 12px; }
.sh-how { font-size: 12px; color: #555; padding-left: 18px; margin: 4px 0; line-height: 1.7; }
.sh-how b { color: #1f8f4e; }
/* ゲーム・体験(オービー・茶摘み・タイムアタック) */
.hud-left .games { background: #c0672e; }
.game-hud { position: fixed; left: 50%; top: 64px; transform: translateX(-50%); z-index: 11; display: flex; align-items: center; gap: 10px; background: rgba(20,24,30,.8); color: #fff; border-radius: 10px; padding: 6px 12px; font-size: 13px; }
.game-hud em { font-style: normal; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.game-hud button { border: 0; background: #4a4f57; color: #fff; border-radius: 999px; padding: 4px 10px; font-size: 12px; }
body.gaming .toasts { top: 112px; }
.gm-list { display: flex; flex-direction: column; gap: 8px; }
.gm-item { background: #fff; border-radius: 8px; padding: 8px 10px; }
.gm-item small { display: block; color: #666; font-size: 12px; margin: 2px 0 4px; }
.gm-rec { font-size: 12px; color: #c0392b; margin-bottom: 4px; }
.gm-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.gm-btns button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 10px; font-size: 13px; margin: 0; }
.gm-btns .primary { background: var(--ai); color: #fff; border-color: var(--ai); }
/* まつり(掛川祭の屋台・遠州横須賀の祢里。2026-11-07) */
.hud-left #btn-festival { background: #b8302a; }
body.festival .hud-left #btn-festival { outline: 3px solid #e8c547; }
.fs-card { background: #fff; border-radius: 8px; padding: 8px 10px; margin: 6px 0; font-size: 13px; }
.fs-card b { color: var(--ai); font-size: 15px; }
.fs-card small { display: block; color: #666; font-size: 11px; margin: 2px 0 4px; }
.fs-card p { margin: 4px 0; line-height: 1.5; }
.fs-card .fs-src { color: #888; font-size: 11px; }
.fs-btns { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.fs-btns button:not(.primary) { border: 1px solid var(--ai); color: var(--ai); background: #fff; border-radius: 10px; padding: 8px 12px; }
.fs-btns .primary { background: #b8302a; margin: 0; }
.festival-hint { bottom: 170px; background: #b8302a; }
.enter-hint { bottom: 216px; background: #b07a1a; }
.vehicle-hint { bottom: 262px; background: #1f5f9f; }
body.touch .vehicle-hint { bottom: 332px; }
body.touch .enter-hint { bottom: 286px; }
body.touch .festival-hint { bottom: 240px; }

/* ===== スマホ(body.compact:タッチ、または幅 760 px 未満・高さ 520 px 未満。2026-11-07 夜) =====
   左の列は ☰ メニューに畳み、上には「☰ メニュー・移動・目線・会話」だけ。パネル・詳細カード・会話は下から出るシート。街を触ると閉じる */
/* パネル・詳細カード・名札のカード → 下からのシート */
body.compact .side-panel, body.compact .info-card, body.compact .person-card { left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: min(60vh, 540px); max-height: min(60dvh, 540px); border-radius: 16px 16px 0 0; padding: 8px 14px calc(12px + env(safe-area-inset-bottom)); transform: none; box-shadow: 0 -6px 24px rgba(0,0,0,.3); overscroll-behavior: contain; }
body.compact .side-panel { z-index: 15; }
body.compact .info-card, body.compact .person-card { z-index: 16; }
body.compact .side-panel::before, body.compact .info-card::before, body.compact .person-card::before { content: ''; display: block; width: 40px; height: 4px; border-radius: 2px; background: #ccc; margin: 0 auto 8px; }
body.compact .sp-list, body.compact .bd-list, body.compact .ar-gal { max-height: none; }
body.compact .sp-list button, body.compact .sh-near button { padding: 10px 10px; font-size: 14px; }
body.compact .sp-spots button, body.compact .chip, body.compact .gm-btns button, body.compact .lc-choices button, body.compact .lc-btns button { padding: 8px 12px; font-size: 14px; }
body.compact .sp-head button, body.compact .ic-head > button { font-size: 30px; padding: 0 6px; }
body.compact .sp-i { width: 40px; }
body.compact .kk-go { width: 52px; }
body.compact .sh-buy, body.compact .sh-use, body.compact .bp-item button, body.compact .ar-item button { padding: 7px 10px; font-size: 13px; }
body.compact .em-btn { min-height: 60px; }
/* 文字入力は 16 px 以上(iOS が勝手に拡大しないように) */
body.compact #move-q, body.compact .sp-q, body.compact .sp-ll input, body.compact .chat input, body.compact .po-form input, body.compact .po-form textarea, body.compact .po-form select, body.compact .bp-text, body.compact .ar-title input { font-size: 16px; }
body.compact .learn-card { left: 8px; right: 8px; width: auto; transform: none; max-height: 32vh; max-height: 32dvh; }
body.compact .learn-card.min { left: auto; right: 8px; }
body.touch.compact .learn-card { bottom: 172px; }
body.compact .learn-card.moved { right: auto; width: calc(100vw - 16px); }
body.compact .learn-card.moved.min { width: auto; }
/* 会話 → 💬 で下から出るシート(閉じている間の発言は 💬 に件数) */
body.compact .chat { display: none; }
body.compact.chat-open .chat { display: block; left: 0; right: 0; bottom: 0; width: auto; z-index: 15; background: var(--paper); border-radius: 16px 16px 0 0; padding: 10px 12px calc(12px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 24px rgba(0,0,0,.3); }
body.compact.chat-open .chat-log { max-height: 32vh; max-height: 32dvh; }
/* 右上の地図・住所・知らせ・バトルとゲームの表示 */
body.compact .minimap { width: 100px; height: 100px; }
body.compact .here { top: 112px; width: 100px; font-size: 11px; padding: 3px 6px; }
body.compact .here b { font-size: 12px; }
body.compact .toasts { top: 104px; left: 8px; right: 8px; transform: none; align-items: flex-start; }
body.compact .toast { font-size: 13px; padding: 7px 12px; }
body.compact .battle-hud, body.compact .game-hud { top: 104px; left: 8px; transform: none; min-width: 0; }
body.compact.armed .toasts, body.compact.battle .toasts, body.compact.gaming .toasts { top: 160px; }
body.compact .board-hint, body.compact .shop-hint, body.compact .festival-hint, body.compact .enter-hint, body.compact .vehicle-hint { font-size: 14px; padding: 9px 16px; }
/* つくる:板は下からのシート。「▾」で頭だけにしてスティックで歩ける。タッチのボタンは板のすぐ上 */
body.compact .bp-min { display: inline-block; }
body.compact.building .build-panel { left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: 42vh; max-height: 42dvh; border-radius: 16px 16px 0 0; padding: 8px 12px calc(10px + env(safe-area-inset-bottom)); }
body.compact.building .build-panel.min > :not(.bp-head) { display: none; }
body.compact.building .build-touch { right: 8px; bottom: calc(42vh + 10px); bottom: calc(42dvh + 10px); grid-template-columns: repeat(5, 52px); gap: 5px; }
body.compact.building .build-touch button { width: 52px; height: 52px; font-size: 12px; }
body.compact.building .build-panel.min ~ .build-touch { bottom: 70px; }
body.compact.building .chat, body.compact.building .quick, body.compact.building .here { display: none; }

/* オープニング(intro.js)。黒い帯 + 字幕 + とばす。HUD は body.intro で隠す */
.intro { position: fixed; inset: 0; z-index: 44; pointer-events: auto; cursor: pointer; animation: intro-in 1.2s ease-out; }
@keyframes intro-in { from { background: #000; } to { background: transparent; } }
.intro .bars::before, .intro .bars::after { content: ''; position: absolute; left: 0; right: 0; height: 11vh; height: 11dvh; background: #0b0f14; }
.intro .bars::before { top: 0; } .intro .bars::after { bottom: 0; }
.intro .caps { position: absolute; left: 0; right: 0; bottom: 16vh; bottom: 16dvh; text-align: center; padding: 0 16px; }
.intro .caps h1, .intro .caps p { position: absolute; left: 0; right: 0; margin: 0; opacity: 0; transform: translateY(8px); transition: opacity .7s ease, transform .7s ease; pointer-events: none; }
.intro .caps h1 { bottom: 56px; font-size: clamp(38px, 8vw, 76px); letter-spacing: .16em; color: #fff; font-weight: 700; transition: opacity .4s ease; }
.intro .caps h1 span { display: inline-block; opacity: 0; transform: translateY(26px) scale(1.5); filter: blur(6px); background: linear-gradient(180deg, #fff8e0 0%, #ffd766 45%, #c9871a 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; text-shadow: none; }
.intro .caps h1.on span { animation: intro-letter .8s cubic-bezier(.2,.9,.3,1.2) forwards; animation-delay: calc(var(--j) * .11s); }
@keyframes intro-letter { to { opacity: 1; transform: none; filter: blur(0); } }
.intro .caps h1::before { content: ''; position: absolute; left: 50%; top: 50%; width: 140%; height: 220%; transform: translate(-50%, -50%); background: radial-gradient(ellipse at center, rgba(255,214,110,.35), rgba(255,214,110,0) 60%); z-index: -1; pointer-events: none; }
.intro .caps h1 small { display: block; margin-top: 10px; font-size: clamp(11px, 1.6vw, 16px); letter-spacing: .5em; color: #fff3cc; font-weight: 400; text-shadow: 0 1px 8px rgba(0,0,0,.7); opacity: 0; transition: opacity .9s ease 1s; }
.intro .caps h1.on small { opacity: 1; }
.intro .rays { position: absolute; inset: -30%; background: conic-gradient(from 0deg at 50% 50%, rgba(255,235,170,0) 0deg, rgba(255,235,170,.16) 8deg, rgba(255,235,170,0) 16deg, rgba(255,235,170,0) 40deg, rgba(255,235,170,.12) 48deg, rgba(255,235,170,0) 58deg, rgba(255,235,170,0) 90deg, rgba(255,235,170,.14) 100deg, rgba(255,235,170,0) 112deg, rgba(255,235,170,0) 150deg, rgba(255,235,170,.1) 158deg, rgba(255,235,170,0) 170deg, rgba(255,235,170,0) 220deg, rgba(255,235,170,.13) 230deg, rgba(255,235,170,0) 242deg, rgba(255,235,170,0) 300deg, rgba(255,235,170,.1) 310deg, rgba(255,235,170,0) 322deg, rgba(255,235,170,0) 360deg); animation: intro-rays 30s linear infinite; mix-blend-mode: screen; pointer-events: none; opacity: .9; }
@keyframes intro-rays { to { transform: rotate(360deg); } }
.intro canvas.fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.intro .vignette { position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(0,0,0,0) 55%, rgba(0,0,0,.45) 100%); pointer-events: none; }
.intro.landed .bars::before, .intro.landed .bars::after { transition: height .9s ease; height: 0; }
.intro .caps p { bottom: 0; font-size: clamp(16px, 2.6vw, 24px); letter-spacing: .08em; color: #fff; text-shadow: 0 1px 10px rgba(0,0,0,.7), 0 0 2px rgba(0,0,0,.9); line-height: 1.7; }
.intro .caps .on { opacity: 1; transform: none; }
.intro .skip { position: absolute; right: 16px; bottom: calc(11vh + 12px); bottom: calc(11dvh + 12px); background: rgba(251,248,239,.9); color: var(--ai); border: 0; border-radius: 999px; padding: 8px 14px; font-size: 14px; cursor: pointer; }
body.intro .hud-top, body.intro .quick, body.intro .pc-dock, body.intro .ctx, body.intro .coach, body.intro .hud-left, body.intro .minimap, body.intro .here, body.intro .hud-foot, body.intro .me-mark, body.intro .stick, body.intro .jump, body.intro .fly-ctl, body.intro #chat, body.intro .toasts { visibility: hidden; }

/* 目あてと称号(story.js)。上の中央の札と一覧の板 */
.story { position: fixed; left: 50%; top: 44px; transform: translateX(-50%); z-index: 11; display: flex; align-items: center; gap: 8px; background: rgba(251,248,239,.94); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px 5px 6px; font-size: 13px; cursor: pointer; max-width: 46vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.story b { background: var(--cha); color: #fff; border-radius: 999px; padding: 2px 8px; font-size: 12px; }
.story-card { position: fixed; left: 50%; top: 84px; transform: translateX(-50%); z-index: 46; width: min(440px, 92vw); background: var(--paper); border-radius: var(--r); box-shadow: 0 10px 30px rgba(0,0,0,.3); padding: 12px 14px; font-size: 13px; max-height: 80vh; max-height: 80dvh; overflow: auto; }
.story-card .story-head { display: flex; justify-content: space-between; align-items: center; }
.story-card .story-head button { border: 0; background: transparent; font-size: 18px; cursor: pointer; }
.story-card ol { padding-left: 20px; margin: 8px 0; }
.story-card li { margin: 4px 0; }
.story-card li.done { color: #6a7a6a; }
.story-card li small { display: block; color: #666; font-size: 11px; }
.story-card .row button { background: var(--ai); color: #fff; border: 0; border-radius: 8px; padding: 8px 12px; cursor: pointer; }
body.compact .story { top: 100px; left: 8px; transform: none; max-width: calc(100vw - 16px); font-size: 12px; }
body.compact .story-card { top: 136px; }
body.compact .toasts { top: 136px; }
body.intro .story, body.aerial .story { visibility: hidden; }

/* 防災の体験(2026-11-07 夜):水深の目盛り、水の中のカメラの青み */
.lc-meter-row { margin: 6px 0 2px; font-size: 13px; }
.lc-meter-row b { font-size: 18px; color: #1d3f8a; }
.lc-meter { height: 10px; background: #e3e6ea; border-radius: 5px; overflow: hidden; }
.lc-meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #8cc0ec, #1d3f8a); transition: width .3s; }
.ln-legend small { color: #666; margin-right: 2px; }
body.underwater::after { content: ''; position: fixed; inset: 0; background: rgba(18, 56, 100, .42); pointer-events: none; z-index: 5; }

/* キャラクター(2026-11-07 夜):ようこそ画面の 10 人の札、きせかえ画面、オープニングの仲間の帯 */
.look-editor { position: fixed; inset: 0; z-index: 47; background: rgba(0,0,0,.5); display: grid; place-items: center; padding: 12px; }
.le-card { background: var(--paper); border-radius: var(--r); box-shadow: 0 10px 30px rgba(0,0,0,.35); width: min(860px, 100%); max-height: 94vh; max-height: 94dvh; display: flex; flex-direction: column; overflow: hidden; }
.le-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.le-head b { font-size: 16px; color: var(--ai); flex: 1; }
.le-coin { background: #fff3cc; border-radius: 999px; padding: 3px 10px; font-size: 13px; }
.le-x { border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; }
.le-body { display: grid; grid-template-columns: 280px 1fr; gap: 12px; padding: 12px 14px; overflow: auto; }
.le-left { display: flex; flex-direction: column; gap: 8px; }
.le-stage { width: 260px; height: 320px; border-radius: 12px; background: radial-gradient(ellipse at 50% 90%, rgba(31,58,95,.16), rgba(31,58,95,0) 60%), linear-gradient(180deg, #e9f2fb, #f7f3e8); cursor: grab; overflow: hidden; }
.le-stage canvas { display: block; }
.le-poses { display: flex; flex-wrap: wrap; gap: 4px; }
.le-poses .chip { font-size: 12px; padding: 4px 8px; }
.le-presets b { display: block; font-size: 12px; margin: 4px 0; }
.le-pre { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.lk-pre { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 4px 6px; font-size: 11px; text-align: left; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lk-pre.on { background: var(--ai); color: #fff; border-color: var(--ai); }
.le-tabs { display: flex; gap: 4px; margin-bottom: 8px; flex-wrap: wrap; }
.le-tabs button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 12px; font-size: 13px; cursor: pointer; }
.le-tabs button.on { background: var(--ai); color: #fff; border-color: var(--ai); }
.lk-row { margin-bottom: 8px; }
.lk-row > b { display: block; font-size: 12px; color: #555; margin-bottom: 3px; }
.lk-items { display: flex; flex-wrap: wrap; gap: 4px; }
.lk-opt { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 5px 9px; font-size: 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.lk-opt em { font-style: normal; font-size: 10px; background: #fff3cc; border-radius: 999px; padding: 1px 5px; color: #7a5a00; }
.lk-opt.locked { background: #f6f3ea; color: #666; }
.lk-opt.on { background: var(--ai); color: #fff; border-color: var(--ai); }
.lk-opt.on em { background: rgba(255,255,255,.9); }
.lk-sw { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); background: var(--c); padding: 0; cursor: pointer; }
.lk-sw.on { box-shadow: 0 0 0 2px var(--ai); transform: scale(1.1); }
.le-hint { font-size: 11px; color: #666; margin: 8px 0 0; line-height: 1.5; }
.le-foot { display: flex; gap: 6px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); }
.le-sp { flex: 1; }
.le-ok { background: var(--ai); color: #fff; border: 0; border-radius: 10px; padding: 10px 16px; font-size: 14px; cursor: pointer; }
body.compact .le-body { grid-template-columns: 1fr; }
body.compact .le-left { flex-direction: row; flex-wrap: wrap; }
body.compact .le-stage { width: 150px; height: 190px; }
body.compact .le-presets { flex: 1; min-width: 150px; }
body.compact .le-pre { grid-template-columns: 1fr; }
body.compact .le-poses { width: 100%; }
/* オープニングの仲間の帯(題名のあいだ) */
.intro .cast { position: absolute; left: 0; right: 0; bottom: calc(11vh + 4px); bottom: calc(11dvh + 4px); display: flex; justify-content: center; align-items: flex-end; gap: 2px; pointer-events: none; padding: 0 8px; }
.intro .cast img { width: clamp(44px, 9vw, 110px); aspect-ratio: 176 / 216; object-fit: contain; opacity: 0; transform: translateY(60px) scale(.4) rotate(-12deg); filter: drop-shadow(0 6px 10px rgba(0,0,0,.5)); }
.intro.strip .cast img { animation: intro-cast-in .55s cubic-bezier(.2,1.2,.3,1) forwards, intro-cast-bob 1.1s ease-in-out .55s infinite alternate; animation-delay: calc(var(--j) * .08s), calc(.55s + var(--j) * .08s); }
@keyframes intro-cast-in { to { opacity: 1; transform: none; } }
@keyframes intro-cast-bob { from { translate: 0 0; } to { translate: 0 -10px; } }
.intro .caps p { bottom: clamp(60px, 13vw, 130px); }
.intro.strip .caps h1 { bottom: clamp(110px, 20vw, 190px); }

/* ---- 📖 掛川ガイドブック・観光案内所・道案内・空から見る(2026-11-08。web/src/guide/) ---- */
.guide { position: fixed; inset: 0; z-index: 30; background: rgba(20,24,32,.45); display: flex; align-items: center; justify-content: center; padding: 12px; }
/* 窓は街の上に浮かべる(後ろを暗くしない・街を触れる)。既定は右寄せ。見出しをつかんで移動、PC は右下のつまみで大きさ、－で見出しだけ(ui/dock.js。2026-11-11) */
.guide { background: transparent; pointer-events: none; justify-content: flex-end; }
.guide .gb-card { pointer-events: auto; }
.gb-head { cursor: move; user-select: none; touch-action: none; }
.gb-card.moved { position: fixed; }
.guide .gb-card.sized { width: var(--dw); height: var(--dh); max-width: calc(100vw - 8px); max-height: calc(100dvh - 8px); }
.guide .gb-card.min { width: auto; height: auto; max-width: min(360px, calc(100vw - 16px)); }
.gb-card.min > :not(.gb-head) { display: none; }
.gb-card.min .gb-head { padding: 6px 8px 6px 12px; }
.gb-card.min .gb-head b { font-size: 15px; }
.gb-card.min .gb-back { display: none; }
.gb-card.min:not(.moved) { position: fixed; top: 56px; right: 12px; }
body:not(.compact) .gb-card { width: min(600px, 100%); resize: both; min-width: 320px; min-height: 240px; }
body:not(.compact) .gb-card.min { resize: none; min-width: 0; min-height: 0; }
.guide[hidden] { display: none; }
.gb-card { width: min(980px, 100%); height: min(760px, calc(100vh - 24px)); height: min(760px, calc(100dvh - 24px)); background: var(--paper); color: var(--ink); border-radius: 16px; box-shadow: 0 12px 40px rgba(0,0,0,.4); display: flex; flex-direction: column; overflow: hidden; border-top: 6px solid #1f5fa8; }
.gb-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px 6px; }
.gb-head b { font-size: 18px; flex: 1; }
.gb-head button { border: 0; background: #ece6d6; border-radius: 999px; padding: 6px 12px; font-size: 14px; }
.gb-head [data-close] { font-size: 20px; padding: 2px 12px; }
.gb-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px 12px 8px; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.gb-tabs button { flex: none; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 14px; white-space: nowrap; }
.gb-tabs button i { font-style: normal; margin-right: 4px; }
.gb-tabs button.on { background: #1f5fa8; color: #fff; border-color: #1f5fa8; }
.gb-body { flex: 1; overflow-y: auto; padding: 12px 14px 20px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.gb-body h3 { font-size: 15px; margin: 16px 0 8px; border-left: 5px solid #1f5fa8; padding-left: 8px; }
.gb-body h4 { font-size: 14px; margin: 14px 0 6px; }
.gb-wait { text-align: center; color: #777; padding: 40px 0; }
.gb-note { font-size: 13px; color: #555; line-height: 1.6; }
.gb-src { font-size: 11px; color: #888; margin-top: 14px; line-height: 1.5; }
.gb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; }
.gb-grid.one { grid-template-columns: minmax(0, 340px); }
.gb-tile { display: flex; flex-direction: column; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 0 0 8px; overflow: hidden; font-size: 14px; position: relative; cursor: pointer; color: var(--ink); }
.gb-tile:hover { box-shadow: 0 3px 10px rgba(0,0,0,.15); }
.gb-tile b { padding: 6px 8px 0; line-height: 1.35; }
.gb-tile small { padding: 2px 8px 0; color: #666; font-size: 12px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gb-tile em { position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,.6); color: #fff; font-style: normal; font-size: 11px; padding: 2px 7px; border-radius: 999px; }
.gb-img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: #dfe6ec; }
.gb-img.big { border-radius: 12px; max-height: 360px; }
.gb-ph { display: flex; align-items: center; justify-content: center; background: var(--c); background-image: linear-gradient(135deg, rgba(255,255,255,0), rgba(255,255,255,.35)); }
.gb-ph i { font-style: normal; font-size: 34px; filter: drop-shadow(0 2px 3px rgba(0,0,0,.3)); color: #fff; }
.gb-pam { border-top: 5px solid var(--c); }
.gb-more { grid-column: 1 / -1; border: 1px dashed var(--line); background: #fff; border-radius: 10px; padding: 10px; }
.gb-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.gb-chips .chip.on { background: #1f5fa8; color: #fff; border-color: #1f5fa8; }
.gb-q { width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font-size: 16px; }
.gb-count { font-size: 12px; color: #777; margin: 6px 0; }
.gb-kiosk { display: flex; gap: 12px; align-items: center; background: #e8f0fa; border-radius: 12px; padding: 10px; }
.gb-kiosk .gb-face { width: 96px; flex: none; aspect-ratio: 1; border-radius: 50%; }
.gb-kiosk small { color: #1f5fa8; font-weight: 700; }
.gb-kiosk p { margin: 4px 0; line-height: 1.6; }
.gb-first { display: block; width: 100%; margin: 10px 0 0; border: 0; border-radius: 12px; padding: 12px; font-size: 15px; font-weight: 700; color: #fff; background: linear-gradient(90deg, #1f5fa8, #2a9d8f); animation: gbPulse 1.6s ease-in-out infinite; }
@keyframes gbPulse { 50% { filter: brightness(1.15); } }
.gb-rows { display: grid; gap: 6px; }
.gb-row { display: flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; }
.gb-row span { flex: 1; font-size: 14px; }
.gb-row small { display: block; color: #777; font-size: 12px; }
.gb-row button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 10px; }
.gb-btns { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.gb-btns button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 12px; font-size: 14px; color: var(--ink); }
.gb-btns button.primary { background: #1f5fa8; color: #fff; border-color: #1f5fa8; margin: 0; }
.gb-entry h2 { margin: 12px 0 2px; font-size: 22px; }
.gb-sub { color: #666; font-size: 13px; margin: 0 0 8px; }
.gb-lead { font-size: 16px; font-weight: 700; margin: 6px 0; }
.gb-story { background: #fff; border-left: 4px solid #2e7d4f; border-radius: 8px; padding: 8px 12px; margin: 10px 0; line-height: 1.7; }
.gb-story small { color: #2e7d4f; font-weight: 700; }
.gb-story p { margin: 4px 0 0; }
.gb-lines p { background: #fff; border-radius: 12px; padding: 8px 12px; margin: 6px 0; border: 1px solid var(--line); line-height: 1.6; }
.gp-cover { position: relative; }
.gp-cover .gb-img.big { max-height: 420px; }
.gp-title { position: absolute; left: 0; right: 0; bottom: 0; color: #fff; padding: 40px 16px 14px; border-radius: 0 0 12px 12px; background: linear-gradient(transparent, rgba(0,0,0,.72)); }
.gp-title small { opacity: .9; }
.gp-title h2 { margin: 2px 0 4px; font-size: 26px; }
.gp-title p { margin: 0 0 4px; line-height: 1.6; }
.gp-title em { font-style: normal; background: var(--c); padding: 2px 10px; border-radius: 999px; font-size: 13px; }
.gp-stops { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 14px; }
.gp-stops li { display: grid; grid-template-columns: minmax(0, 300px) 1fr; gap: 12px; background: #fff; border-radius: 12px; padding: 10px; border: 1px solid var(--line); break-inside: avoid; }
.gp-stops .gb-img { border-radius: 8px; }
.gp-stops h3 { border: 0; padding: 0; margin: 0 0 6px; font-size: 17px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gp-stops h3 span { display: inline-flex; width: 26px; height: 26px; border-radius: 50%; background: var(--c); color: #fff; align-items: center; justify-content: center; font-size: 14px; flex: none; }
.gp-stops h3 small { font-size: 12px; background: #eee; border-radius: 999px; padding: 1px 8px; font-weight: 400; }
.gp-stops p { margin: 0; line-height: 1.7; font-size: 14px; }
.gp-foot { margin-top: 16px; }
.gm-wrap { display: grid; grid-template-columns: 200px 1fr; gap: 14px; }
.gm-toc { display: flex; flex-direction: column; gap: 4px; }
.gm-toc button { text-align: left; border: 0; background: transparent; border-radius: 8px; padding: 7px 8px; font-size: 14px; color: var(--ink); }
.gm-toc button i { font-style: normal; margin-right: 6px; }
.gm-toc button.on { background: #1f5fa8; color: #fff; }
.gm-page h2 { margin: 10px 0 8px; }
.gm-page p { line-height: 1.8; margin: 6px 0; }
.gm-keys { border-collapse: collapse; margin: 12px 0 0; width: 100%; max-width: 560px; font-size: 14px; }
.gm-keys caption { text-align: left; font-weight: 700; padding: 4px 0; }
.gm-keys th, .gm-keys td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; background: #fff; }
.gm-keys th { width: 42%; background: #f1ece0; }
.gv-main video { width: 100%; max-height: 480px; background: #000; border-radius: 12px; }
.gv-main b { display: block; margin-top: 6px; font-size: 16px; }
.kiosk-hint { bottom: 168px; background: #1f5fa8; }
body.touch .kiosk-hint { bottom: 238px; }
body.compact .kiosk-hint { font-size: 14px; padding: 9px 16px; }
.guide-nav { position: fixed; top: 56px; left: 50%; transform: translateX(-50%); z-index: 11; display: flex; align-items: center; gap: 8px; background: rgba(31,58,95,.92); color: #fff; border-radius: 999px; padding: 6px 8px 6px 12px; box-shadow: 0 3px 10px rgba(0,0,0,.3); font-size: 14px; max-width: calc(100vw - 24px); }
.guide-nav[hidden] { display: none; }
.guide-nav b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guide-nav i { font-style: normal; display: inline-block; color: #ffd650; font-size: 18px; transition: transform .25s; }
.guide-nav button { border: 0; background: rgba(255,255,255,.2); color: #fff; border-radius: 999px; padding: 2px 9px; }
body.compact .guide-nav { top: 104px; }
.guide-cine { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; pointer-events: none; padding: 0 16px calc(18px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgba(0,0,0,.6)); color: #fff; }
.guide-cine[hidden] { display: none; }
.gc-cap { max-width: 720px; }
.gc-cap small { opacity: .85; }
.gc-cap b { display: block; font-size: 24px; margin: 2px 0; text-shadow: 0 2px 6px rgba(0,0,0,.5); }
.gc-cap p { margin: 0 0 8px; line-height: 1.6; font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.gc-bar { height: 3px; background: rgba(255,255,255,.3); border-radius: 2px; }
.gc-bar i { display: block; height: 100%; width: 0; background: #ffd650; border-radius: 2px; }
.guide-cine button { pointer-events: auto; position: fixed; top: 60px; right: 12px; border: 0; border-radius: 999px; padding: 8px 14px; background: rgba(0,0,0,.6); color: #fff; font-size: 14px; }
body.guide-cine .hud-left, body.guide-cine .side-panel, body.guide-cine .quick, body.guide-cine .pc-dock, body.guide-cine .ctx, body.guide-cine .minimap, body.guide-cine .here, body.guide-cine .story, body.guide-cine .board-hint, body.guide-cine .labels, body.guide-cine .stick, body.guide-cine .jump, body.guide-cine .me-mark, body.guide-cine .guide-nav { display: none !important; }
#hud-left button.guide-btn { background: #1f5fa8; color: #fff; }
#hud-left button.guide-btn.new, #quick button.new { animation: gbPulse 1.4s ease-in-out infinite; box-shadow: 0 0 0 3px #ffd650; }
/* 撮影(pipeline/guide/capture.mjs):画面の飾りを全部隠す */
body.guide-shot > *:not(#world) { display: none !important; }
body.compact .gb-card { height: 100%; border-radius: 14px; }
body.compact .gb-card.min:not(.moved) { top: calc(110px + env(safe-area-inset-top, 0px)); right: 8px; }
body.compact .gb-card.moved:not(.min) { width: calc(100vw - 12px); height: calc(100dvh - 12px); }
body.compact .guide { padding: 6px; padding-top: max(6px, env(safe-area-inset-top)); }
@media (max-width: 640px) {
  .gb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .gm-wrap { grid-template-columns: 1fr; }
  .gm-toc { flex-direction: row; overflow-x: auto; }
  .gm-toc button { flex: none; white-space: nowrap; }
  .gp-stops li { grid-template-columns: 1fr; }
  .gp-title h2 { font-size: 20px; }
  .gb-kiosk .gb-face { width: 72px; }
}
@media print {
  body.guide-printing > *:not(#guide) { display: none !important; }
  body.guide-printing .guide { position: static; background: none; padding: 0; display: block; }
  body.guide-printing .gb-card { height: auto; box-shadow: none; border: 0; display: block; }
  body.guide-printing .gb-head, body.guide-printing .gb-tabs, body.guide-printing .gb-btns { display: none !important; }
  body.guide-printing .gb-body { overflow: visible; }
  body.guide-printing .gp-stops li { grid-template-columns: 220px 1fr; }
}

/* 正式名「かけがわーるど」のロゴとメイン画像(design/brand/)。ようこそ画面の背景はメイン画像、カードの上にロゴ */
.intro .caps h1.logo { letter-spacing: 0; }
.intro .caps h1.logo::before { width: 120%; height: 160%; }
/* ロゴに filter(ぼかし・影)を付けない:iPad(WebKit)で WebGL と重なるとロゴの箱が白い長方形になった(2026-11-11)。縁取りはロゴの絵にある */
.intro .caps h1.logo img { display: block; width: min(560px, 82vw); height: auto; margin: 0 auto; opacity: 0; transform: translateY(26px) scale(1.25); }
.intro .caps h1.logo.on img { animation: intro-logo 1s cubic-bezier(.2,.9,.3,1.2) forwards; }
@keyframes intro-logo { to { opacity: 1; transform: none; } }
@media (max-height: 500px) { .intro .caps h1.logo img { width: min(360px, 60vw); } }

/* ---- 今いる場所モード(GPS。ui/gps.js・gps/mates.js。2026-11-09) ---- */
.gps-chip { position: fixed; top: 96px; left: 50%; transform: translateX(-50%); z-index: 13; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; color: #fff; background: rgba(90,90,90,.94); border-radius: 14px; padding: 6px 8px 6px 12px; box-shadow: 0 3px 10px rgba(0,0,0,.35); font-size: 13px; max-width: calc(100vw - 24px); }
.gps-chip[hidden] { display: none; }
.gps-chip.team { background: rgba(30,110,200,.95); }
.gps-chip.all { background: rgba(200,110,20,.95); }
.gps-chip b { white-space: nowrap; }
.gps-chip span { opacity: .92; white-space: nowrap; }
.gps-chip button { border: 0; background: rgba(255,255,255,.22); color: #fff; border-radius: 999px; padding: 3px 10px; font-weight: 700; }
.gps-chip button[data-act="stop"] { background: #fff; color: #333; }
body.gps-on .guide-nav { top: 140px; }
body.compact .gps-chip { top: 102px; left: 8px; transform: none; justify-content: flex-start; max-width: calc(100vw - 132px); font-size: 12px; padding: 4px 6px 4px 10px; gap: 4px 6px; }
body.compact .gps-chip .long { display: none; }
body.compact.gps-on .guide-nav { top: 170px; }
body.compact #qbtn-gps { padding: 0 10px; }
body.compact #qbtn-gps span { display: none; }
.gps-panel header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.gps-panel header button { border: 0; background: none; font-size: 20px; }
.gps-sec { border-top: 1px solid rgba(0,0,0,.1); padding: 8px 0; }
.gps-sec:first-of-type { border-top: 0; }
.gps-h { font-weight: 700; margin: 6px 0 4px; display: flex; justify-content: space-between; align-items: center; }
.gps-note { font-size: 13px; line-height: 1.55; margin: 4px 0; }
.gps-note.small, .gps-panel small { font-size: 12px; color: #555; }
.gps-ng { color: #a33; font-weight: 700; }
.gps-msg { color: #a33; font-size: 13px; background: #fff3f0; border-radius: 8px; padding: 6px 8px; }
.gps-modes { display: grid; gap: 6px; }
.gps-mode { display: grid; grid-template-columns: auto 1fr; gap: 0 8px; align-items: center; border: 2px solid rgba(0,0,0,.12); border-radius: 10px; padding: 6px 8px; cursor: pointer; }
.gps-mode input { grid-row: span 2; }
.gps-mode.on { border-color: #555; }
.gps-mode.team.on { border-color: rgb(30,110,200); }
.gps-mode.all.on { border-color: rgb(200,110,20); }
.gps-mode.ng { opacity: .5; cursor: default; }
.gps-ok { display: block; font-size: 13px; margin: 6px 0; }
.gps-go { width: 100%; margin-top: 8px; }
.gps-warn { background: #fff4e0; border: 2px solid rgb(200,110,20); border-radius: 10px; padding: 8px; font-size: 13px; margin-top: 8px; }
.gps-now { border-radius: 10px; padding: 8px; color: #fff; background: rgb(110,110,110); display: grid; gap: 2px; }
.gps-now.team { background: rgb(30,110,200); }
.gps-now.all { background: rgb(200,110,20); }
.gps-panel .row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; align-items: center; }
.gps-panel .row input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: 2px; font-size: 16px; padding: 6px 8px; }
.gps-panel button.danger { color: #a33; }
.gps-panel button.mini { font-size: 12px; padding: 2px 8px; }
.gps-code { display: flex; gap: 8px; align-items: center; background: #f1f4f8; border-radius: 8px; padding: 6px 8px; margin: 4px 0; }
.gps-code b { font-size: 20px; letter-spacing: 3px; font-family: ui-monospace, monospace; }
.gps-code.url small { flex: 1; overflow-wrap: anywhere; }
.gps-list { list-style: none; margin: 4px 0; padding: 0; display: grid; gap: 4px; }
.gps-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 4px 6px; border-radius: 8px; background: #f6f6f6; }
.gps-list li.on { background: #e8f1fb; }
.gps-list li b { flex: 1; }
.gps-list li em { font-style: normal; font-size: 11px; color: #666; margin-left: 6px; }
.mate-dot { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: rgb(30,110,200); border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.3); pointer-events: none; }
.mate-dot.edge { width: 8px; height: 8px; margin: -4px 0 0 -4px; }
.mate-dot.faded { opacity: .45; }
.lb-mate { background: rgb(30,110,200); color: #fff; font-weight: 700; }
.lb-live { background: rgb(200,110,20); color: #fff; font-weight: 700; }
.lb.faded { opacity: .5; }
body.compact.gps-on .story { display: none; }

/* 2026-11-09:武器はバトル中だけ(左の列の ⚔ 武器も参加中だけ出す) */
body:not(.battle) #btn-arms { display: none; }

/* 地図を動かす・隠す(ui/minimap_dock.js。2026-11-09)。スマホの縦は既定を左下(スティックの上)にして、上の列のボタンを隠さない */
.minimap { touch-action: none; }
.minimap.dragging { cursor: grabbing; opacity: .85; outline: 3px dashed #ffd650; }
.mm-hide { position: absolute; right: 2px; top: 2px; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: rgba(31,58,95,.85); color: #fff; font-size: 14px; line-height: 22px; text-align: center; cursor: pointer; z-index: 2; }
.minimap-show { position: fixed; right: 8px; top: 8px; z-index: 11; width: 40px; height: 40px; border: 2px solid var(--ai); border-radius: 12px; background: rgba(251,248,239,.94); font-size: 20px; cursor: pointer; }
body.mm-off .minimap, body.mm-off .here { display: none; }
body.intro .minimap-show, body.building .minimap-show, body.guide-cine .minimap-show { display: none; }

/* 客室 ⇔ 外から(cabin.js)と、レスキューを呼ぶ(modes/rescue.js)。2026-11-09 */
.cabin-btn { bottom: 310px; background: #3d6f4a; font-size: 13px; }
body.touch .cabin-btn { bottom: 380px; }
.rescue-hint { bottom: 170px; background: #d2462e; animation: gbPulse 1.4s ease-in-out infinite; }
body.touch .rescue-hint { bottom: 240px; }
/* 天浜線・路線バス(2026-11-10 追加 22。ui/lines.js) */
.go-btn { bottom: 360px; background: #c0571f; font-size: 14px; }
body.touch .go-btn { bottom: 430px; }
.ln-box { background: rgba(47,138,85,.08); border: 1px solid rgba(47,138,85,.3); border-radius: 10px; padding: 6px 8px; margin: 4px 0; font-size: 13px; line-height: 1.6; }
.ln-box small { color: #5a6268; }
.ln-sta .chip { font-size: 12px; padding: 4px 8px; }
.ln-map { width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); margin: 4px 0; cursor: pointer; }
.tt-modal { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; }
.tt-card { background: #fff; color: #222; border-radius: 14px; padding: 12px 14px; width: min(96vw, 1100px); max-height: 88vh; max-height: 88dvh; display: flex; flex-direction: column; box-shadow: 0 8px 30px rgba(0,0,0,.4); }
.tt-scroll { overflow: auto; flex: 1; }
.tt-table { width: auto; white-space: nowrap; }
.tt-table td:first-child, .tt-table th:first-child { position: sticky; left: 0; background: #fff; font-weight: 700; }
.tt-table td.past { color: #b0b4b8; }
.tt-table td.run, .tt-table th.run { background: #fde7c8; font-weight: 700; }

/* 浮かぶスティック(2026-11-10。player.js の joystick)。休みのときは左下にうすく出し(ここを触ると歩ける合図)、触ると指の所へ移る */
body.touch .stick { opacity: .6; transition: opacity .15s; }
body.touch .stick.on { opacity: 1; bottom: auto; transition: none; }
body.touch .stick.run { border-color: #ffd650; box-shadow: 0 0 0 3px rgba(255,214,80,.45); }
body.touch .stick::after { content: 'さわって うごく'; position: absolute; left: 50%; bottom: 7px; transform: translateX(-50%); white-space: nowrap; font-size: 12px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.75); pointer-events: none; }
body.touch .stick.used::after { display: none; }

/* 「プレイヤー」(ui/people.js。2026-11-10):地図の点・人数の札・一覧・上空の札 */
.pl-dot { position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: #ff8a1f; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.35); pointer-events: none; }
.pl-dot.near { width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; }
.pl-dot.edge { width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; opacity: .85; }
.pl-chip { position: absolute; left: 4px; top: 4px; z-index: 2; padding: 1px 7px; border: 0; border-radius: 10px; background: rgba(255,255,255,.92); color: #1f3a5f; font: 700 12px/1.5 system-ui, sans-serif; box-shadow: 0 1px 3px rgba(0,0,0,.3); cursor: pointer; }
.pl-list .pl-row { display: flex; align-items: center; gap: 6px; padding: 6px 2px; border-bottom: 1px solid rgba(0,0,0,.08); }
.pl-list .pl-row > div { flex: 1; min-width: 0; }
.pl-list .pl-row b { font-size: 14px; }
.pl-list .pl-row small { display: block; color: #555; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-list .pl-row em { margin-left: 6px; padding: 0 6px; border-radius: 8px; background: #2e7d32; color: #fff; font-size: 11px; font-style: normal; }
.pl-list .pl-row em.g { background: #c86e14; }
.pl-list .pl-row.me b { color: #1f3a5f; }
.pl-list .pl-row button { flex: none; padding: 5px 9px; font-size: 12px; margin: 0; border: 1px solid #c9d3df; }
.pl-list .pl-row button.primary { background: var(--ai); color: #fff; border-color: var(--ai); font-weight: 700; }
.pl-note { margin: 6px 0; font-size: 13px; }
.pl-note button { margin-left: 6px; }
.pl-key { display: inline-block; width: 9px; height: 9px; margin: 0 2px; border-radius: 50%; background: #ff8a1f; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.35); vertical-align: middle; }
.lb-player { background: #ff8a1f; color: #fff; font-weight: 700; }

/* iPhone(2026-11-11):viewport-fit=cover なので、横向きのノッチ・角の丸み・ホームバーの下に操作が潜らないよう、端の物を安全域の分だけずらす。
   translate は transform と別に重なる(元の位置の指定はそのまま)。安全域の無い端末では 0 */
body.touch { --sl: env(safe-area-inset-left, 0px); --sr: env(safe-area-inset-right, 0px); --st: env(safe-area-inset-top, 0px); --sb: env(safe-area-inset-bottom, 0px); }
body.touch .hud-top { padding-left: var(--sl); padding-right: var(--sr); translate: 0 var(--st); }
body.touch #menu-btn { translate: var(--sl) var(--st); }
body.touch #qbtn-move, body.touch #qbtn-view, body.touch #qbtn-ride, body.touch .ctx { translate: calc(-1 * var(--sr)) calc(-1 * var(--sb)); }
body.touch .minimap, body.touch .here { translate: calc(-1 * var(--sr)) var(--st); }
body.touch .toasts { translate: 0 var(--st); }
body.touch .stick:not(.on) { translate: var(--sl) calc(-1 * var(--sb)); }
body.touch .jump, body.touch .fire, body.touch .fly-ctl, body.touch .dismount, body.touch .hud-foot, body.touch .build-touch, body.touch .learn-reopen, body.touch .intro .skip { translate: calc(-1 * var(--sr)) calc(-1 * var(--sb)); }
body.touch.compact .side-panel, body.touch.compact .info-card, body.touch.compact .person-card, body.touch.compact.menu-open .hud-left, body.touch.compact.chat-open .chat, body.touch.compact.building .build-panel { left: var(--sl); right: var(--sr); }
/* iPhone は 16 px 未満の入力欄を触ると頁を拡大し、拡大を止めているので戻せなくなる。タッチの端末では入力欄を 16 px 以上に(2026-11-11) */
body.touch input:not([type=checkbox]):not([type=radio]):not([type=range]), body.touch select, body.touch textarea { font-size: max(16px, 1em); }

/* 街づくりの名札(2026-11-11。whodid.js):作った・壊した物の上に、した人の名前を小さく・半透明に。人の名札より小さく、押せない */
.who-tags { position: fixed; inset: 0; pointer-events: none; z-index: 8; overflow: hidden; }
.who-tag { position: absolute; left: 0; top: 0; padding: 1px 6px; border-radius: 8px; background: rgba(251,248,239,.82); color: #3a3f47; font-size: 10px; line-height: 1.5; white-space: nowrap; box-shadow: 0 1px 3px rgba(0,0,0,.18); will-change: transform; }
body.intro .who-tags, body.aerial .who-tags { visibility: hidden; }

/* 移動のパネルの見出し(代表的な場所・作り込んだ施設・天浜線の駅・学校。2026-11-11) */
.sp-group { margin: 8px 0 4px; font-size: 12px; font-weight: 700; color: #5a4a2a; }
.sp-list .sp-group { margin: 10px 4px 2px; border-bottom: 1px solid var(--line); padding-bottom: 2px; }

/* 天守の階のボタン(ui/keep_floors.js。2026-11-11):天守の中・廻縁・屋根の上にいる間だけ右の中ほどに */
.keep-floors { position: fixed; right: calc(12px + var(--sr, 0px)); top: 50%; transform: translateY(-40%); z-index: 12; display: flex; flex-direction: column; gap: 5px; background: rgba(40, 28, 18, .72); padding: 8px 7px; border-radius: 14px; box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.keep-floors[hidden] { display: none; }
.keep-floors .kf-title { color: #f4e4c1; font-size: 12px; text-align: center; font-weight: 700; letter-spacing: .1em; }
.keep-floors button { display: flex; align-items: center; gap: 6px; min-width: 92px; border: 0; border-radius: 10px; padding: 8px 10px; background: #fff8ea; color: #3a2a1a; font-size: 14px; font-weight: 700; cursor: pointer; }
.keep-floors button b { display: inline-block; min-width: 20px; text-align: center; }
.keep-floors button.on { background: #b07a1a; color: #fff; cursor: default; }
.keep-floors button:not(.on):hover { background: #ffe7b8; }
body.compact .keep-floors { top: 46%; padding: 6px 5px; gap: 4px; }
body.compact .keep-floors button { min-width: 0; padding: 7px 8px; font-size: 13px; }

/* ================================================================================================
   2026-11-12 入口・操作・再訪(設計 00_context/20261112_設計_入口と操作と再訪と分析.md の 3〜6 節。見本 design/ux/20261112-entrance-mock/)
   ================================================================================================ */
:root { --go: #e8532a; --gold: #c9a227; }
.notice { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: grid; place-items: center; z-index: 46; padding: 16px; }
.notice-card { background: var(--paper); border-radius: var(--r); padding: 18px 20px; max-width: 460px; width: 100%; box-shadow: 0 10px 30px rgba(0,0,0,.3); max-height: 92vh; max-height: 92dvh; overflow: auto; }
.notice-card button { margin-top: 8px; }
.bp-min { display: none; }
.quick { display: none; }
.hud-left button i { font-style: normal; }

/* ---- 読み込み中の背景(メイン画像)。ようこその板の後ろ。3D ができたら薄れて消える ---- */
.loading { z-index: 44; transition: opacity .6s; }
.loading.fade { opacity: 0; pointer-events: none; }
.loading-card { display: none; }
body.closed .loading { z-index: 50; }

/* ---- ようこそ ---- */
.welcome { position: fixed; inset: 0; z-index: 45; }
.welcome::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,25,45,.30) 0%, rgba(10,25,45,0) 26%, rgba(10,25,45,0) 55%, rgba(10,25,45,.42) 100%); pointer-events: none; }
.w-live { position: absolute; left: 50%; top: calc(10px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); z-index: 3; background: rgba(20,30,45,.62); color: #fff; font-size: 12px; padding: 4px 12px; border-radius: 999px; white-space: nowrap; max-width: calc(100vw - 16px); overflow: hidden; text-overflow: ellipsis; }
.w-live b { color: #7dffa0; margin-right: 4px; }
.w-hero { position: absolute; left: 0; right: 0; top: 0; padding: calc(40px + env(safe-area-inset-top, 0px)) 16px 0; text-align: center; pointer-events: none; }
.w-hero .welcome-logo { display: inline-block; width: min(330px, 62vw); height: auto; margin: 0; }
.w-hero h1 { margin: 4px 0 0; font-size: clamp(18px, 2.6vw, 30px); color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.7); letter-spacing: .02em; }
.welcome-card { position: absolute; background: rgba(251,248,239,.97); box-shadow: 0 -6px 30px rgba(0,0,0,.28); color: var(--ink); }
.w-me { display: flex; align-items: center; gap: 10px; }
.w-big { width: 76px; height: auto; aspect-ratio: 176 / 216; object-fit: contain; flex: none; background: radial-gradient(ellipse at 50% 88%, rgba(31,58,95,.16), rgba(31,58,95,0) 62%); }
.w-big.sil { background: radial-gradient(ellipse at 50% 40%, #b9c4d3 0 22%, transparent 23%), radial-gradient(ellipse at 50% 80%, #b9c4d3 0 34%, transparent 35%); }
.w-who { flex: 1; min-width: 0; }
.w-who b { display: block; font-size: 15px; color: var(--ai); }
.w-who small { display: block; color: #6b6b6b; font-size: 12px; }
.w-name { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; border: 1px dashed #b9ad8e; border-radius: 999px; padding: 2px 4px 2px 12px; font-size: 13px; background: #fff; color: #444; max-width: 100%; }
.w-name input { border: 0; background: transparent; font: inherit; width: 13em; min-width: 0; padding: 4px 6px; outline: none; color: var(--ink); }
.w-name input:focus { background: #f6f1e3; border-radius: 999px; }
.welcome .looks { display: flex; gap: 8px; overflow-x: auto; padding: 8px 2px 6px; scrollbar-width: none; scroll-snap-type: x proximity; }
.welcome .looks::-webkit-scrollbar { display: none; }
.welcome .looks .cast-card { position: relative; flex: none; width: 58px; height: 66px; margin: 0; border-radius: 14px; border: 2px solid var(--line); background: #fff; padding: 0; cursor: pointer; scroll-snap-align: start; display: grid; place-items: center; overflow: hidden; }
.welcome .looks .cast-card input { position: absolute; opacity: 0; pointer-events: none; }
.welcome .looks .cast-card img { width: 50px; height: 61px; object-fit: contain; margin-top: 2px; display: block; }
.welcome .looks .cast-card.on { border-color: var(--ai); box-shadow: 0 0 0 3px rgba(31,95,168,.2); background: #f1f7ff; }
.welcome .looks .cast-card.custom::after { content: 'いまの姿'; position: absolute; left: 0; right: 0; bottom: 0; font-size: 9px; background: rgba(31,58,95,.8); color: #fff; text-align: center; }
.welcome .looks .more { flex: none; width: 58px; height: 66px; border-radius: 14px; border: 2px dashed #b9ad8e; background: #fff; font-size: 11px; color: var(--ai); font-weight: 700; line-height: 1.3; padding: 0; }
.w-go { position: relative; display: block; width: 100%; height: 60px; border: 0; border-radius: 16px; background: var(--go); color: #fff; font-size: 22px; font-weight: 800; letter-spacing: .08em; box-shadow: 0 5px 0 #b33a17, 0 10px 18px rgba(232,83,42,.35); cursor: pointer; overflow: hidden; margin: 4px 0 0; padding: 0 8px; }
.w-go span, .w-go small { position: relative; }
.w-go small { display: block; font-size: 12px; font-weight: 600; letter-spacing: 0; opacity: .95; margin-top: -2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-go .w-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(255,255,255,.22); transition: width .4s; display: none; }
.welcome.loading .w-go { background: #c7683f; }
.welcome.loading .w-go .w-bar { display: block; }
.welcome.reserved .w-go { background: #2f8f4e; box-shadow: 0 5px 0 #1f6a37, 0 10px 18px rgba(47,143,78,.35); }
.welcome.failed .w-go { background: #7a7f87; box-shadow: 0 5px 0 #50545a; }
.w-go:active { transform: translateY(2px); box-shadow: 0 3px 0 #b33a17; }
.w-sub2 { display: block; width: 100%; margin-top: 8px; min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--ai); font-size: 13.5px; font-weight: 700; }
.w-free { text-align: center; font-size: 12.5px; color: #555; margin: 9px 0 2px; font-weight: 600; }
.w-free span { display: inline-block; margin: 0 5px; }
.w-opts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 6px; }
.w-chip { position: relative; display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 12.5px; color: var(--ai); cursor: pointer; min-height: 40px; margin: 0; }
.w-chip input { position: absolute; opacity: 0; pointer-events: none; }
.w-chip b.on { color: #1c8f4b; } .w-chip b.off { color: #999; display: none; }
.w-chip input:not(:checked) ~ span b.on { display: none; } .w-chip input:not(:checked) ~ span b.off { display: inline; }
.w-note { text-align: center; font-size: 12px; color: #a0522d; margin: 4px 0 0; }
.welcome-card .credit { margin: 8px 0 0; font-size: 10.5px; color: #777; text-align: center; line-height: 1.5; }
.welcome-card .credit a { color: #24527a; }
/* 場所の入口ページへのリンク(2026-11-14 SEO。板のいちばん下。押せる高さはリンクの上下の余白で) */
.welcome-card .w-places { margin: 2px 0 0; font-size: 10.5px; color: #777; text-align: center; line-height: 1.5; }
.welcome-card .w-places a { color: #24527a; display: inline-block; padding-block: 6px; }
/* おかえりなさい:キャラクターの列の代わりに「きょうの 3 枚」。自分の欄を押すと列を出す */
.w-today { display: flex; gap: 8px; margin: 8px 0 6px; }
.w-today[hidden] { display: none; }
.w-today > div { flex: 1; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 7px 8px; font-size: 11.5px; line-height: 1.4; color: #555; min-width: 0; }
.w-today > div b { display: block; font-size: 12.5px; color: var(--ai); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-today .card7 { display: flex; gap: 3px; margin-top: 3px; }
.w-today .card7 i { flex: 1; height: 14px; border-radius: 4px; background: #eee6d0; font-style: normal; font-size: 9px; text-align: center; line-height: 14px; color: #fff; }
.w-today .card7 i.on { background: var(--gold); }
.w-today .card7 i.now { background: var(--go); }
.welcome.back:not(.pick) .looks { display: none; }
.welcome.back .w-me { cursor: pointer; }
.welcome.back:not(.pick) .w-who small::after { content: '(押すとキャラクターをかえる)'; color: #999; }
.w-video-box { position: fixed; inset: 0; z-index: 48; background: rgba(0,0,0,.7); display: grid; place-items: center; padding: 12px; }
.w-video-box > div { position: relative; width: min(960px, 100%); }
.w-video-box video { width: 100%; max-height: 86vh; max-height: 86dvh; background: #000; border-radius: 12px; display: block; }
.w-video-box button { position: absolute; right: -6px; top: -14px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: #fff; font-size: 24px; line-height: 1; }
/* PC:左下の板(幅 440 px)。街は右と上に大きく見える */
@media (min-width: 760px) {
  .w-hero { text-align: left; padding: 26px 0 0 40px; }
  .w-hero .welcome-logo { width: 300px; }
  .welcome-card { left: 36px; bottom: 36px; width: 440px; border-radius: 22px; padding: 16px 18px 12px; max-height: calc(100vh - 160px); max-height: calc(100dvh - 160px); overflow-y: auto; }
}
/* スマホ縦:下からの板。「あそぶ」は必ず 1 画面目 */
@media (max-width: 759px) {
  .welcome-card { left: 0; right: 0; bottom: 0; border-radius: 22px 22px 0 0; padding: 12px 14px calc(10px + env(safe-area-inset-bottom, 0px)); max-height: 66vh; max-height: 66dvh; overflow-y: auto; }
  .w-hero { padding-top: calc(44px + env(safe-area-inset-top, 0px)); }
}
@media (max-width: 759px) and (max-height: 700px) {
  .w-big { width: 58px; }
  .w-hero .welcome-logo { width: min(260px, 56vw); }
  .w-hero { padding-top: calc(34px + env(safe-area-inset-top, 0px)); }
  .w-hero h1 { font-size: 17px; }
  .welcome .looks { padding: 6px 2px 4px; }
  .w-free { margin: 6px 0 0; }
}
/* スマホ横(高さが低い):板は右、題名は左 */
@media (max-height: 500px) and (min-width: 560px) {
  .w-hero { text-align: left; padding: calc(14px + env(safe-area-inset-top, 0px)) 0 0 calc(18px + env(safe-area-inset-left, 0px)); right: auto; width: 42vw; }
  .w-hero .welcome-logo { width: min(260px, 36vw); }
  .w-hero h1 { font-size: 16px; }
  .welcome-card { left: auto; right: calc(8px + env(safe-area-inset-right, 0px)); top: 8px; bottom: 8px; width: min(420px, 54vw); border-radius: 18px; padding: 8px 12px; max-height: none; overflow-y: auto; }
  .w-big { width: 50px; }
  .w-who small { display: none; }
  .welcome .looks { padding: 4px 2px 2px; }
  .welcome .looks .cast-card, .welcome .looks .more { width: 50px; height: 56px; }
  .welcome .looks .cast-card img { width: 42px; height: 51px; }
  .w-go { height: 52px; font-size: 19px; }
  .w-free { margin: 5px 0 0; font-size: 11.5px; }
  .w-opts { margin-top: 4px; }
  .w-chip { min-height: 34px; padding: 4px 10px; }
  .welcome-card .credit { margin-top: 4px; font-size: 10px; }
  .w-today { margin: 4px 0; }
}
body.touch .w-name input { font-size: 16px; }

/* ---- PC の左の列(近道)とメニュー ---- */
.pc-dock { position: fixed; left: 8px; top: 8px; z-index: 10; display: flex; flex-direction: column; gap: 6px; width: 118px; }
.pc-dock .dock-logo { width: 118px; height: auto; margin-bottom: 2px; }
.pc-dock button { display: flex; align-items: center; gap: 6px; background: var(--ai); color: #fff; border: 0; border-radius: 10px; padding: 8px 10px; min-height: 40px; font-size: 14px; text-align: left; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.pc-dock button:hover { background: var(--ai2); }
.pc-dock button i { font-style: normal; }
.pc-dock kbd { font: 10px/1.4 ui-monospace, monospace; background: rgba(255,255,255,.22); border-radius: 4px; padding: 0 4px; margin-left: 2px; }
.pc-dock .build { background: var(--cha); }
.pc-dock .guide-btn { background: #1f5fa8; }
.pc-dock .menu { background: #3d5a80; }
.pc-dock .view { background: #2f6f62; }
.pc-dock .view em { font-style: normal; }
.pc-dock .help { background: #6a4c93; }
body.menu-open .pc-dock .menu { outline: 3px solid #e8c547; }
body.riding .pc-dock #dock-ride { outline: 3px solid #e8c547; }
body.compact .pc-dock { display: none; }
.hud-top { left: 136px; right: 156px; justify-content: flex-end; }
.hud-top .title { display: none; }
.hud-top .compass { margin: 0; }
.heading { margin: 0; }
.net { margin-right: 0; }
.hud-left { display: none; }
body.menu-open .hud-left { display: block; position: fixed; left: 136px; top: 8px; width: min(470px, calc(100vw - 150px)); max-height: calc(100vh - 60px); max-height: calc(100dvh - 60px); overflow-y: auto; background: var(--paper); border-radius: var(--r); box-shadow: 0 6px 24px rgba(0,0,0,.28); padding: 10px 12px 12px; z-index: 13; overscroll-behavior: contain; }
.menu-head { display: flex; align-items: center; gap: 8px; }
.menu-head b { font-size: 16px; color: var(--ai); flex: 1; }
.menu-head .coin { font-style: normal; background: #fff4d6; border: 1px solid #e8c547; border-radius: 999px; padding: 2px 10px; font-size: 13px; font-weight: 700; }
.hud-left .menu-head button { border: 0; background: none; font-size: 28px; line-height: 1; padding: 0 6px; box-shadow: none; min-width: 44px; min-height: 44px; color: var(--ink); }
.menu-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 6px 0 4px; }
.hud-left .menu-cards button { display: flex; align-items: center; gap: 8px; min-height: 50px; border: 0; border-radius: 12px; padding: 8px 10px; font-size: 13px; font-weight: 700; color: #fff; text-align: left; box-shadow: 0 2px 6px rgba(0,0,0,.18); }
.hud-left .menu-cards button i { font-size: 22px; }
.hud-left .menu-cards b { display: block; font-size: 15px; }
.hud-left .menu-cards .daily { background: linear-gradient(135deg, #e8532a, #c9a227); }
.hud-left .menu-cards .record { background: linear-gradient(135deg, #2e7d4f, #1f5fa8); }
.hud-left .grp { margin: 8px 0 0; }
.hud-left .grp > h4 { margin: 0 0 4px; font-size: 12px; color: #6b5a3a; border-bottom: 1px solid var(--line); padding-bottom: 2px; }
.hud-left .grp > div { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.hud-left .grp > div > button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; min-height: 62px; padding: 6px 3px; border: 0; border-radius: 12px; background: var(--ai); color: #fff; font-size: 11.5px; line-height: 1.2; text-align: center; box-shadow: 0 2px 5px rgba(0,0,0,.18); }
.hud-left .grp > div > button:hover { filter: brightness(1.1); }
.hud-left .grp > div > button i { font-size: 22px; margin: 0; }
.hud-left .grp > div > button .coin { font-style: normal; font-size: 10px; background: rgba(255,255,255,.22); border-radius: 999px; padding: 0 6px; }
.hud-left .shop { flex-direction: column; justify-content: center; }
.hud-left .grp #btn-record2 { background: #2e7d4f; }
.hud-left .grp #btn-photo { background: #5b6f99; }
.hud-left .grp #btn-settings { background: #4a4f57; }
.hud-left .grp .season { background: #b4573a; }
body.riding .hud-left #btn-ride, body.armed .hud-left #btn-arms, body.battle .hud-left #btn-battle { outline: 3px solid #e8c547; }
.menu-news { margin-top: 10px; font-size: 12px; }
.menu-news:empty { display: none; }
.menu-news h4 { margin: 0 0 4px; font-size: 12px; color: #6b5a3a; }
.menu-news li { margin: 2px 0; color: #444; }
.menu-news li em { font-style: normal; color: #e8532a; font-weight: 700; margin-right: 4px; }
.menu-news ul { margin: 0; padding-left: 16px; }
@media (max-height: 640px) { body:not(.compact) .pc-dock .dock-logo { display: none; } }

/* ---- 設定の板 ---- */
.settings-panel .set-row { display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.settings-panel .set-row > b { width: 84px; flex: none; font-size: 13px; color: var(--ai); }
.settings-panel .set-row button:not(.chip) { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; min-height: 36px; font-size: 13px; color: var(--ink); }
.settings-panel .set-row .chip.on { background: var(--ai); color: #fff; }
.settings-panel .set-views, .settings-panel .set-q { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.settings-panel .set-v i { font-style: normal; }
.settings-panel .bgm button.off { background: #2a2c30; color: #aaa; }
.settings-panel .bgm-title { flex-basis: 100%; color: #666; font-size: 11px; padding-left: 92px; }
.settings-panel .net2 { display: inline-flex; align-items: center; gap: 6px; }
.settings-panel .bright, .settings-panel .lantern { display: inline-flex; align-items: center; gap: 6px; }
.settings-panel .bright input, .settings-panel .lantern input { width: 160px; accent-color: #c9a227; }
.settings-panel .lantern input { accent-color: #e8402a; }
.settings-panel .tod { border: 1px solid #b9ad8e; background: #fff; border-radius: 999px; padding: 6px 12px; min-height: 36px; font-size: 13px; color: #222; }
.settings-panel .tod[data-tod="night"] { background: #1f2a48; color: #ffe9a8; border-color: #1f2a48; }
.settings-panel .tod[data-tod="day"] { background: #fff4c8; }
.settings-panel .set-note { color: #888; font-size: 11px; }
.settings-panel .set-check { display: inline-flex; align-items: center; gap: 6px; }
.settings-panel .set-credit { margin-top: 8px; font-size: 11px; color: #666; line-height: 1.6; }
.settings-panel #legal { display: block; margin-top: 4px; }
.settings-panel #legal a { color: #24527a; margin-right: 6px; }
.settings-panel #legal .lg-sp { display: none; }
.settings-panel .acc-foot { width: auto; height: auto; }
/* 右下の帯(PC):空の札・設定・出典とご意見。スマホは出さない(中身は設定の板) */
.hud-foot { position: fixed; right: 8px; bottom: 6px; display: flex; align-items: center; gap: 6px; font-size: 12px; color: #222; background: rgba(251,248,239,.86); border-radius: 8px; padding: 3px 6px; z-index: 9; }
.hud-foot button, .hud-foot a { border: 1px solid #c9bfa3; background: #fff; border-radius: 999px; height: 28px; padding: 0 10px; font-size: 12px; color: #24384f; display: inline-flex; align-items: center; text-decoration: none; }
.hud-foot #sky-label { padding: 0 4px; }
body.compact .hud-foot { display: none; }
#fps, #version { color: #999; }

/* ---- 目の前のこと(8 つの案内のボタンは見た目だけ隠し、ui/ctx.js が 1 つを写す) ---- */
.board-hint, .shop-hint, .festival-hint, .enter-hint, .kiosk-hint, .vehicle-hint, .cabin-btn, .rescue-hint { opacity: 0 !important; pointer-events: none !important; animation: none !important; }
.ctx { position: fixed; left: 50%; bottom: 86px; transform: translateX(-50%); z-index: 12; display: flex; align-items: center; gap: 6px; }
.ctx[hidden] { display: none; }
.ctx-act { border: 0; border-radius: 999px; background: #5e3d27; color: #fff; padding: 0 20px; min-height: 48px; font-size: 16px; font-weight: 700; box-shadow: 0 3px 10px rgba(0,0,0,.35); white-space: nowrap; max-width: min(520px, calc(100vw - 120px)); overflow: hidden; text-overflow: ellipsis; }
.ctx-act.k-rescue { background: #d2462e; animation: gbPulse 1.4s ease-in-out infinite; }
.ctx-act.k-vehicle { background: #1f5f9f; } .ctx-act.k-enter { background: #b07a1a; } .ctx-act.k-festival { background: #b8302a; }
.ctx-act.k-kiosk { background: #1f5fa8; } .ctx-act.k-shop { background: #1f8f4e; } .ctx-act.k-cabin { background: #3d6f4a; }
.ctx-act kbd { font: 12px/1.4 ui-monospace, monospace; background: rgba(255,255,255,.25); border-radius: 4px; padding: 0 5px; margin-right: 6px; }
.ctx-more { border: 0; border-radius: 999px; background: rgba(31,58,95,.88); color: #fff; min-height: 44px; min-width: 44px; padding: 0 10px; font-size: 12px; }

/* ---- スマホ:四隅の役割を固定(左上 ☰・上の中央 目あて・右上 地図・右下 ジャンプと 3 つ・左下 スティック) ---- */
body.compact .hud-top { display: none; }
body.compact .quick { display: contents; }
body.compact .quick button { position: fixed; z-index: 10; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: rgba(31,58,95,.9); color: #fff; padding: 0; font-weight: 700; box-shadow: 0 2px 6px rgba(0,0,0,.3); width: 54px; height: 54px; }
body.compact .quick button i { font-style: normal; font-size: 20px; line-height: 1; }
body.compact .quick button span { font-size: 10px; line-height: 1.1; margin-top: 2px; white-space: nowrap; }
body.compact #menu-btn { left: 8px; top: 8px; width: 50px; height: 50px; background: var(--cha); }
body.compact #menu-btn span { display: none; }
body.compact #menu-btn i { font-size: 24px; }
body.compact.menu-open #menu-btn { background: var(--ai2); }
body.compact #qbtn-guide, body.compact #qbtn-gps { display: none; }
body.compact #qbtn-bosai { left: 11px; top: 66px; width: 44px; height: 44px; background: #c0392b; }
body.compact #qbtn-bosai i { font-size: 16px; }
body.compact #qbtn-bosai span { font-size: 9px; }
body.touch #qbtn-bosai { translate: var(--sl) var(--st); }
body.compact.aerial #qbtn-bosai, body.compact.building #qbtn-bosai { display: none; }
body.touch .jump { right: 18px; bottom: 40px; width: 78px; height: 78px; font-weight: 700; }
body.compact #qbtn-move { right: 122px; bottom: 52px; }
body.compact #qbtn-view { right: 96px; bottom: 118px; }
body.compact #qbtn-ride { right: 30px; bottom: 144px; }
body.compact #qbtn-chat { left: calc(50% + 8px); bottom: 14px; width: 46px; height: 46px; }
body.compact .quick [data-n]::after { content: attr(data-n); position: absolute; right: -4px; top: -4px; background: #e0302a; color: #fff; border-radius: 999px; font-size: 10px; min-width: 18px; height: 18px; line-height: 18px; text-align: center; padding: 0 3px; }
body.compact .ctx { left: auto; right: 12px; bottom: 210px; transform: none; }
body.compact .ctx-act { min-height: 48px; font-size: 15px; padding: 0 16px; max-width: calc(100vw - 90px); }
/* 乗っているとき:ジャンプは消え、▲▼・降りる が出る。3 つは右の列に */
body.compact.riding #qbtn-ride { right: 14px; bottom: 50px; }
body.compact.riding #qbtn-view { right: 14px; bottom: 112px; }
body.compact.riding #qbtn-move { right: 14px; bottom: 174px; }
body.touch.compact.flying .fly-ctl, body.touch.compact.riding .fly-ctl { right: 82px; bottom: 50px; }
body.touch.compact.riding .dismount { right: 82px; bottom: 186px; min-height: 44px; padding: 0 14px; font-size: 14px; }
body.compact.riding .ctx { bottom: 244px; }
/* 武器を持っているとき:撃つ は 乗る の上 */
body.touch.compact.armed .fire { right: 18px; bottom: 200px; }
body.compact.armed .ctx { bottom: 284px; }
body.compact.aerial #qbtn-ride, body.compact.aerial #qbtn-view { display: none; }
body.compact .minimap { width: 92px; height: 92px; top: 8px; right: 8px; }
body.compact .here { top: 104px; width: 92px; }
/* 日付と時計・季節と天気(スマホだけ。PC は右下の帯の #sky-label。2026-11-13) */
.here i { display: none; }
body.compact .here i { display: block; font-style: normal; font-size: 10.5px; line-height: 1.3; color: #24384f; white-space: pre-line; border-top: 1px dotted #c9bfa3; margin-top: 2px; padding-top: 2px; }
body.compact .here i:empty { display: none; }
body.compact .story { top: 8px; left: 66px; right: 108px; transform: none; max-width: none; min-width: 0; border-radius: 14px; white-space: normal; padding: 4px 6px; min-height: 50px; max-height: 58px; font-size: 12px; }
body.compact .toasts { top: 118px; left: 8px; right: 108px; }
body.compact .guide-nav { top: 72px; left: 66px; right: 108px; transform: none; max-width: none; }
body.compact .gps-chip { top: 8px; left: 66px; right: 108px; max-width: none; }
body.compact .battle-hud, body.compact .game-hud { top: 70px; left: 66px; }
body.compact.armed .toasts, body.compact.battle .toasts, body.compact.gaming .toasts { top: 150px; }
body.touch.compact .learn-card { bottom: 256px; }
body.touch .learn-reopen { left: auto; right: 12px; bottom: 256px; }
body.compact .story-card { top: 70px; }
@media (orientation: landscape) and (max-height: 520px) {
  body.compact .story { right: 120px; min-height: 40px; }
  body.compact .ctx { bottom: 150px; right: 160px; }
  body.compact.riding .ctx, body.compact.armed .ctx { bottom: 150px; right: 220px; }
}
/* メニュー(スマホ):下からのシート。群の見出し + 4 列 */
body.compact.menu-open .hud-left { display: block; left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: min(78vh, 640px); max-height: min(78dvh, 640px); border-radius: 16px 16px 0 0; padding: 8px 12px calc(12px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 24px rgba(0,0,0,.3); z-index: 15; }
body.compact .hud-left .grp > div { grid-template-columns: repeat(4, 1fr); }
@media (min-width: 600px) { body.compact .hud-left .grp > div { grid-template-columns: repeat(6, 1fr); } }
body.touch.compact.menu-open .hud-left { left: var(--sl); right: var(--sr); }

/* ---- 目あての札(story.js。5-3)---- */
.story { top: 8px; display: flex; align-items: center; gap: 6px; max-width: min(520px, calc(100vw - 880px)); min-width: 300px; padding: 4px 6px; }
.story .st-text { flex: 1; min-width: 0; display: flex; flex-direction: column; text-align: left; line-height: 1.3; }
.story .st-grp { font-size: 11px; color: #7a6a4a; display: flex; align-items: center; gap: 4px; white-space: nowrap; overflow: hidden; }
.story .st-dots i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #e0d6bd; margin-right: 2px; }
.story .st-dots i.on { background: var(--gold); }
.story .st-goal { font-size: 13px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.story .st-btn { flex: none; border: 0; border-radius: 999px; background: var(--ai); color: #fff; font-size: 12px; font-weight: 700; padding: 0 10px; min-height: 34px; white-space: nowrap; }
.story .st-btn.nav { background: #e8532a; }
@media (max-width: 1180px) { body:not(.compact) .story { top: 64px; max-width: 520px; } }
body.compact .story .st-goal { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 12px; }
body.compact .story .st-btn { min-height: 40px; padding: 0 8px; font-size: 11px; }
body.compact .story .st-grp { font-size: 10px; }
.story-card .sc-sec { margin: 8px 0 4px; font-size: 12px; font-weight: 700; color: #6b5a3a; border-bottom: 1px solid var(--line); }
.story-card li .coins { color: var(--cha); font-weight: 700; margin-left: 4px; }

/* ---- はじめての案内(ui/coach.js。5-1)---- */
.coach { position: fixed; z-index: 30; left: 50%; top: 64px; transform: translateX(-50%); width: min(380px, calc(100vw - 24px)); background: rgba(20,30,45,.92); color: #fff; border-radius: 16px; padding: 12px 14px 10px; box-shadow: 0 8px 24px rgba(0,0,0,.35); font-size: 15px; line-height: 1.55; }
.coach[hidden] { display: none; }
.coach .co-step { font-size: 11px; color: #ffd650; font-weight: 700; letter-spacing: .1em; }
.coach p { margin: 4px 0 8px; font-weight: 700; }
.coach .co-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.coach .co-dots i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.3); margin-right: 3px; }
.coach .co-dots i.on { background: #ffd650; }
.coach button { border: 0; border-radius: 999px; background: rgba(255,255,255,.16); color: #fff; min-height: 36px; padding: 0 12px; font-size: 12px; }
.coach .co-bar { height: 3px; background: rgba(255,255,255,.18); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.coach .co-bar i { display: block; height: 100%; width: 0; background: #ffd650; }
.coach-zone { position: fixed; z-index: 29; pointer-events: none; border: 3px dashed #ffd650; border-radius: 18px; background: rgba(255,214,80,.08); } /* 画面全体を暗くする大きな影は、3D の上で毎フレーム描き直しになり重いので使わない */
.coach-zone[hidden] { display: none; }
@media (max-width: 1180px) { body:not(.compact) .coach { top: 122px; } }
body.compact .coach { top: 28%; }

/* ---- 寄せる知らせ(ホーム画面に追加・登録のすすめ。6-11)---- */
.nudge { position: fixed; left: 50%; top: calc(66px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); z-index: 39; width: min(380px, calc(100vw - 24px)); background: #fffdf7; color: #2b2b2b; border-radius: 16px; box-shadow: 0 6px 24px rgba(0,0,0,.28); padding: 12px 14px; font-size: 14px; line-height: 1.55; }
.nudge[hidden] { display: none; }
.nudge h4 { margin: 0 30px 6px 0; font-size: 15px; color: var(--ai); }
.nudge p { margin: 4px 0; }
.nudge ol { margin: 4px 0; padding-left: 20px; font-size: 13px; }
.nudge .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.nudge .row button { border: 0; border-radius: 10px; padding: 0 14px; min-height: 40px; font-size: 14px; background: #eee; }
.nudge .row .go { background: var(--ai); color: #fff; }
.nudge .x { position: absolute; right: 4px; top: 2px; border: 0; background: none; font-size: 22px; width: 44px; height: 44px; }

/* ---- きょうのおだい・きろく・季節(6-3・6-5・6-6)---- */
.dl-item { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; margin: 6px 0; }
.dl-item.done { background: #f1f7ec; border-color: #b9d8b0; }
.dl-item .dl-mark { font-size: 22px; flex: none; width: 30px; text-align: center; }
.dl-item div { flex: 1; min-width: 0; }
.dl-item b { display: block; font-size: 14px; }
.dl-item small { display: block; color: #666; font-size: 12px; }
.dl-item .dl-bar { height: 5px; background: #eee6d0; border-radius: 3px; margin-top: 4px; overflow: hidden; }
.dl-item .dl-bar i { display: block; height: 100%; background: var(--gold); }
.dl-item button { flex: none; border: 1px solid var(--ai); background: #fff; color: var(--ai); border-radius: 999px; min-height: 40px; padding: 0 10px; font-size: 12px; }
.dl-sum { font-size: 13px; margin: 4px 0; }
.dl-sum b { color: #e8532a; }
.dl-next { font-size: 12px; color: #666; background: #f6f1e3; border-radius: 10px; padding: 6px 10px; margin-top: 8px; }
.rc-map { position: relative; width: 100%; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #cfd8c4; }
.rc-map canvas { display: block; width: 100%; height: auto; }
.rc-big { font-size: 14px; margin: 6px 0; }
.rc-big b { font-size: 22px; color: #2e7d4f; }
.rc-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: center; font-size: 13px; margin: 6px 0; }
.rc-row .rc-bar { grid-column: 1 / -1; height: 6px; background: #eee6d0; border-radius: 3px; overflow: hidden; }
.rc-row .rc-bar i { display: block; height: 100%; background: #2e7d4f; }
.rc-row em { font-style: normal; color: #777; font-size: 12px; }
.rc-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.rc-badges span { background: #fff4d6; border: 1px solid #e8c547; border-radius: 999px; padding: 3px 10px; font-size: 12px; }
.rc-badges span.gold { background: #c9a227; color: #fff; border-color: #c9a227; }
.rc-card { display: flex; gap: 4px; margin: 4px 0 8px; }
.rc-card i { flex: 1; height: 26px; border-radius: 6px; background: #eee6d0; font-style: normal; font-size: 12px; text-align: center; line-height: 26px; color: #fff; font-weight: 700; }
.rc-card i.on { background: var(--gold); }
.rc-card i.now { background: var(--go); animation: gbPulse 1s ease-in-out infinite; }
.card-pop { position: fixed; left: 50%; top: 30%; transform: translate(-50%, -50%) scale(.6); z-index: 41; background: #fffdf7; border-radius: 18px; padding: 12px 16px; box-shadow: 0 10px 30px rgba(0,0,0,.35); text-align: center; opacity: 0; transition: opacity .3s, transform .3s; pointer-events: none; width: min(320px, calc(100vw - 32px)); }
.card-pop.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.card-pop b { display: block; font-size: 15px; color: var(--ai); margin-bottom: 6px; }
.card-pop small { display: block; color: #666; font-size: 12px; }

/* ---- 記念写真(6-10)---- */
.photo { position: fixed; inset: 0; z-index: 47; background: rgba(0,0,0,.6); display: grid; place-items: center; padding: 12px; }
.photo[hidden] { display: none; }
.photo .ph-card { background: var(--paper); border-radius: 16px; padding: 12px; width: min(560px, 100%); max-height: 94vh; max-height: 94dvh; overflow: auto; }
.photo .ph-card img { display: block; width: 100%; height: auto; max-height: 62vh; max-height: 62dvh; object-fit: contain; border-radius: 10px; background: #000; }
.photo .ph-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.photo .ph-row button, .photo .ph-row a { border: 1px solid var(--line); background: #fff; color: var(--ai); border-radius: 999px; min-height: 44px; padding: 0 14px; font-size: 14px; display: inline-flex; align-items: center; text-decoration: none; }
.photo .ph-row .go { background: var(--ai); color: #fff; border-color: var(--ai); }
.photo .ph-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.photo .ph-head b { color: var(--ai); }
.photo .ph-head button { border: 0; background: none; font-size: 28px; width: 44px; height: 44px; }
.photo .ph-note { font-size: 12px; color: #666; margin: 6px 0 0; }
/* 案内はメニュー・板・ガイドを開いている間は隠す(下に回る) */
body.menu-open .coach, body.menu-open .coach-zone, body:has(.side-panel:not([hidden])) .coach, body:has(.side-panel:not([hidden])) .coach-zone, body:has(#guide:not([hidden])) .coach, body:has(#guide:not([hidden])) .coach-zone, body.building .coach, body.building .coach-zone { visibility: hidden; }
/* スマホ横(高さが低い):天守の階のボタンは上の中央に横並び(右下のジャンプ・移動/目線/乗る と重ならない。2026-11-12) */
@media (orientation: landscape) and (max-height: 520px) {
  body.compact .keep-floors { right: auto; left: 50%; top: 58px; transform: translateX(-50%); flex-direction: row; align-items: center; padding: 4px 6px; }
  body.compact .keep-floors .kf-title { writing-mode: horizontal-tb; }
}

/* ---- 🚩 まちの企画(ui/org.js。2026-11-13)---- */
.org-tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.org-tabs button, .org-back { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 14px; }
.org-tabs button.on { background: var(--ai); color: #fff; border-color: var(--ai); }
.org-body h3 { margin: 6px 0 4px; font-size: 17px; }
.org-body h4 { margin: 12px 0 4px; font-size: 14px; }
.org-body label { display: block; font-size: 13px; margin: 6px 0; }
.org-body input:not([type=checkbox]), .org-body select, .org-body textarea { width: 100%; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; font-size: 16px; box-sizing: border-box; }
.org-row { display: flex; gap: 6px; align-items: center; }
.org-row input, .org-row select { flex: 1; }
.org-btns { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.org-btns button, .org-row button, .org-pin button, .org-mini { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 7px 10px; font-size: 14px; min-height: 36px; }
.org-btns button.primary, .org-body button.primary { background: var(--ai); color: #fff; border-color: var(--ai); }
.org-btns button.on { background: #fde2e2; border-color: #e53935; }
.org-item { border-top: 1px solid var(--line); padding: 6px 0; }
.org-item small { color: #666; }
.org-spot { border: 1px solid var(--line); border-radius: 8px; padding: 6px; margin: 4px 0; background: #fafafa; }
.org-code { font-family: monospace; font-size: 18px; letter-spacing: 2px; }
.org-qr { display: block; margin: 6px auto; max-width: 100%; image-rendering: pixelated; }
.org-url { word-break: break-all; font-size: 12px; color: #444; }
.org-now { background: #eef6ff; border-radius: 8px; padding: 6px 8px; }
.evac-note { font-size: 12px; color: #555; background: #fff8e1; border-radius: 8px; padding: 6px 8px; }
.evac-res { padding-left: 18px; margin: 6px 0; }
.myevac { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 6px; }
.warn { color: #c62828; }
.site-day { font-weight: 700; padding: 6px 8px; border-radius: 8px; background: #e8f5e9; margin: 6px 0; }
.site-day.none, .site-day.closed, .site-day.off { background: #eceff1; }
.site-day.full { background: #fff3e0; }
.site-day small { font-weight: 400; color: #555; margin-left: 6px; }
.site-map { display: block; width: 100%; max-width: 300px; margin: 6px auto; border-radius: 8px; border: 1px solid var(--line); }
.site-st { color: #fff; border-radius: 6px; padding: 1px 6px; font-size: 12px; }
.site-dot, .site-rows i, .org-legend i, .org-pin i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.site-rows { width: 100%; border-collapse: collapse; font-size: 13px; }
.site-rows td, .site-rows th { border-bottom: 1px solid var(--line); padding: 3px 4px; text-align: left; }
.org-legend { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; }
.org-pin { padding: 4px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.org-big { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.org-big div { background: #eef6ff; border-radius: 10px; padding: 10px; text-align: center; font-size: 13px; }
.org-big b { display: block; font-size: 28px; }
.org-chip { top: 98px; background: rgba(46,85,60,.94); gap: 6px; flex-wrap: wrap; }
.org-chip span { white-space: nowrap; }
.org-chip .warn { color: #ffcdd2; }
.ic-kind.user.org { background: #2e7d32; color: #fff; }

/* となりの国に着いたときのイラスト(2026-11-13。ui/arrive.js)。画像は contain で国名・顔・足を切らない */
#arrive { position: fixed; inset: 0; z-index: 65; background: #0d2440; display: flex; flex-direction: column; align-items: center; justify-content: center; opacity: 0; transition: opacity .3s; cursor: pointer; }
#arrive.on { opacity: 1; }
#arrive img { flex: 1 1 auto; min-height: 0; width: 100%; height: 100%; object-fit: contain; }
#arrive .arrive-cap { position: absolute; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; justify-content: center; padding: 8px 16px; border-radius: 999px; background: rgba(13, 36, 64, .78); color: #fff; font-size: 15px; max-width: calc(100% - 24px); text-align: center; }
#arrive .arrive-cap b { font-size: 17px; }
#arrive .arrive-tap { opacity: .85; }

/* まちの企画:ラリー・ツアー・しごと図鑑(2026-11-13 夜) */
.org-pt { padding: 6px 0; border-bottom: 1px dashed rgba(0,0,0,.12); }
.org-pt.got b { color: #2e7d32; }
.org-word { width: 8em; min-height: 36px; font-size: 16px; }
.org-prize { font-weight: 700; color: #b33a17; }
.org-month { display: inline-flex; align-items: center; gap: 2px; margin: 0 6px 4px 0; white-space: nowrap; }
.org-filters { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.org-filters label { flex: 1 1 140px; }
.rally-done { text-align: center; }
.rally-live { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 10px 0; font-size: 22px; }
.rally-live i { width: 34px; height: 34px; border-radius: 50%; border: 5px solid #e8532a; border-top-color: transparent; animation: rally-spin 1s linear infinite; }
@keyframes rally-spin { to { transform: rotate(360deg); } }
.rally-redeem { min-height: 52px; font-size: 17px; position: relative; overflow: hidden; }
.rally-redeem.hold { background: #2e7d32; color: #fff; transition: background 1.5s; }
.tour-extra button.on { background: #ffe1e1; border-color: #e53935; }
body.tour-quiet #chat form { display: none; }
.wk-cards { display: grid; gap: 8px; margin: 8px 0; }
.wk-card { background: #f3f6fb; border-radius: 10px; padding: 8px 10px; }
.wk-card b { color: #1565c0; }
.wk-card p { margin: 4px 0 0; }
.org-body blockquote { margin: 6px 0; padding: 6px 10px; background: #fff8e6; border-left: 4px solid #f4b400; }
.org-body blockquote small { display: block; color: #666; }
.wq { margin: 6px 0; }
.wq p { margin: 2px 0; }
.wq .org-btns button.on { background: #1565c0; color: #fff; }
.wq-res { background: #eef5ff; border-radius: 10px; padding: 8px 10px; margin: 8px 0; }
.btn-link { display: inline-flex; align-items: center; min-height: 36px; padding: 0 10px; border: 1px solid #999; border-radius: 8px; text-decoration: none; color: inherit; }
#shiori-print { display: none; }
@media print {
  body.shiori-printing > *:not(#shiori-print) { display: none !important; }
  body.shiori-printing #shiori-print { display: block; color: #000; background: #fff; font-family: system-ui, sans-serif; }
  #shiori-print .sh-map { width: 100%; max-height: 90mm; object-fit: contain; }
  #shiori-print .sh-list { list-style: none; padding: 0; }
  #shiori-print .sh-list li { display: grid; grid-template-columns: 28px 1fr 26mm; gap: 8px; break-inside: avoid; border-bottom: 1px solid #ccc; padding: 6px 0; }
  #shiori-print .sh-n { font-weight: 800; font-size: 18px; color: #e8532a; }
  #shiori-print .sh-qr { width: 26mm; height: 26mm; }
  #shiori-print .sh-s, #shiori-print .sh-date, #shiori-print .sh-note { font-size: 11px; color: #333; }
  #shiori-print .sheet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6mm; }
  #shiori-print .sheet { border: 1px dashed #999; padding: 6mm; text-align: center; break-inside: avoid; height: 125mm; }
  #shiori-print .sheet img { width: 70mm; height: 70mm; }
  #shiori-print .sheet b { display: block; font-size: 18px; margin-top: 3mm; }
  #shiori-print .sheet p { font-size: 22px; font-weight: 800; margin: 2mm 0; }
}

/* 専用の入口(?e=。2026-11-14 設計 00_context/20261114_設計_専用の入口_URLで場所と条件を指定.md)。隠す部品は entry_run.js が <style id="entry-off"> に足す */
body.entry .w-places, body.entry #w-sub2, body.entry .sp-link { display: none !important; }
.w-entry { margin: 8px 0 0; padding: 8px 10px; border-radius: 10px; background: rgba(46,85,60,.1); border: 1px solid rgba(46,85,60,.35); font-size: 13px; line-height: 1.5; }
.w-entry b { display: block; font-size: 15px; color: #2e553c; }
.w-entry span { display: block; }
.w-entry p { margin: 2px 0; }
.w-entry small { display: block; color: #555; font-size: 11px; }
.entry-chip { position: fixed; top: 140px; left: 50%; transform: translateX(-50%); z-index: 11; display: flex; align-items: center; gap: 8px; color: #fff; background: rgba(46,85,60,.92); border-radius: 999px; padding: 4px 6px 4px 12px; box-shadow: 0 3px 10px rgba(0,0,0,.3); font-size: 13px; max-width: calc(100vw - 24px); }
.entry-chip[hidden] { display: none; }
.entry-chip b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.entry-chip button { min-height: 44px; border: 0; border-radius: 999px; background: #fff; color: #2e553c; font-weight: 700; padding: 0 12px; cursor: pointer; white-space: nowrap; }
.entry-chip.out { background: rgba(200,110,20,.96); }
.entry-chip.out button { animation: entry-pulse 1.2s ease-in-out infinite; }
@keyframes entry-pulse { 50% { transform: scale(1.06); } }
body.compact .entry-chip { top: 132px; left: 8px; transform: none; max-width: calc(100vw - 128px); font-size: 12px; }
body.compact .entry-chip b { max-width: 34vw; }
.entry-gate { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(20,30,40,.55); padding: 16px; }
.entry-gate .eg-card { max-width: 420px; width: 100%; background: #fbf8ef; color: var(--ink); border-radius: 16px; padding: 20px; text-align: center; box-shadow: 0 8px 30px rgba(0,0,0,.35); }
.entry-gate img { width: 220px; height: auto; }
.entry-gate h1 { font-size: 20px; margin: 10px 0 6px; }
.entry-gate .primary { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px; border: 0; border-radius: 12px; background: #2f6f4f; color: #fff; font-weight: 700; font-size: 16px; text-decoration: none; cursor: pointer; margin-top: 8px; }
/* 展示の端末:記念写真の保存・共有と、外へのリンクを出さない */
body.entry-kiosk #photo .ph-row a, body.entry-kiosk #photo [data-ph="share"], body.entry-kiosk #foot-legal, body.entry-kiosk .welcome-card .credit a { display: none !important; }
.sp-link { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0 0; }
.sp-link small { color: #666; font-size: 11px; }

/* PLATEAU レンズ(2026-11-17。lens.js)。PC は左下(ドックの右)、スマホは上(地図と現在地を隠して幅いっぱい) */
.pc-dock .lens, .hud-left .lens { background: #0f7c86; }
.lens-panel, .lens-card { position: fixed; z-index: 11; background: rgba(251,248,239,.97); color: var(--ink); border-radius: var(--r); box-shadow: 0 6px 24px rgba(0,0,0,.25); border-top: 4px solid #0f7c86; font-size: 13px; line-height: 1.45; }
.lens-panel { left: 136px; bottom: 16px; width: min(340px, calc(100vw - 150px)); padding: 8px 10px; }
.lens-card { left: calc(136px + min(340px, calc(100vw - 150px)) + 10px); bottom: 16px; width: 300px; max-height: calc(100vh - 120px); max-height: calc(100dvh - 120px); overflow: auto; padding: 8px 10px; }
.lens-panel[hidden], .lens-card[hidden] { display: none; }
.lens-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.lens-head b { font-size: 14px; }
.lens-head button { border: 0; background: transparent; font-size: 20px; line-height: 1; padding: 2px 6px; cursor: pointer; color: #555; }
.lens-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 6px; }
.lens-chips button { border: 1px solid #0f7c86; background: #fff; color: #0f5f66; border-radius: 999px; padding: 4px 10px; font-size: 13px; min-height: 30px; cursor: pointer; font-weight: 700; }
.lens-chips button[aria-pressed="true"] { background: #0f7c86; color: #fff; }
.lens-legend { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 12px; }
.lens-legend span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.lens-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 1px solid rgba(0,0,0,.25); }
.lens-panel p, .lens-card p { margin: 4px 0 0; }
.lens-msg { font-weight: 700; color: #0f5f66; }
.lens-msg.out { color: #8a4b00; }
.lens-note { font-size: 12px; color: #8a2c1f; }
.lens-src { font-size: 11px; color: #666; }
.lens-card dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 0; }
.lens-card dt { color: #555; white-space: nowrap; }
.lens-card dd { margin: 0; font-weight: 700; }
.lens-card dd small { display: block; font-weight: 400; color: #555; font-size: 12px; }
.lens-bosai { display: block; width: 100%; margin: 0 0 8px; border: 0; border-radius: 10px; background: #0f7c86; color: #fff; padding: 8px 10px; font-size: 14px; font-weight: 700; text-align: left; cursor: pointer; }
body.intro .lens-panel, body.intro .lens-card, body.guide-cine .lens-panel, body.guide-cine .lens-card { display: none; }
body.compact #qbtn-lens { left: 11px; top: 118px; width: 44px; height: 44px; background: #0f7c86; }
body.compact #qbtn-lens i { font-size: 16px; }
body.compact #qbtn-lens span { font-size: 9px; }
body.touch #qbtn-lens { translate: var(--sl) var(--st); }
body.compact.building #qbtn-lens { display: none; }
body.compact.lens-on .minimap, body.compact.lens-on .here, body.compact.lens-on .story, body.compact.lens-on .story-card { display: none; } /* 上の幅をレンズの窓に使う(閉じれば戻る) */
body.compact .lens-panel { left: 64px; right: 8px; top: 8px; bottom: auto; width: auto; max-height: 176px; overflow: auto; padding: 6px 8px; font-size: 12px; }
body.compact .lens-panel .lens-chips button { min-height: 36px; padding: 4px 9px; font-size: 12px; }
body.compact .lens-panel .lens-legend { flex-wrap: nowrap; overflow-x: auto; }
body.compact .lens-card { left: 64px; right: 8px; top: 192px; bottom: auto; width: auto; max-height: min(42vh, 340px); max-height: min(42dvh, 340px); font-size: 12px; }
body.touch .lens-panel, body.touch .lens-card { translate: 0 var(--st); }
