/* =========================================================
   Rendez-View — style.css
   ダーク × ネオン。Cesium コンテナの上に HUD を重ねる構成。
   ========================================================= */

:root {
  --bg: #05070f;
  --bg-2: #0a1020;
  --panel: rgba(10, 16, 34, 0.78);
  --panel-border: rgba(120, 170, 255, 0.18);
  --text: #e8eeff;
  --text-dim: #8fa0c8;
  --cyan: #22e5ff;
  --pink: #ff3d9a;
  --violet: #8a6bff;
  --header-h: 60px;
  --radius: 14px;
  --font-ui: "Noto Sans JP", system-ui, -apple-system, "Hiragino Sans", "Yu Gothic", sans-serif;
  --font-logo: "Outfit", "Noto Sans JP", sans-serif;
  --brass: #d9b25f;
  --mr-size: 188px;   /* Memoring（羅針盤リング）の直径 */
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button { font-family: inherit; }
a { color: inherit; }

/* ---------- Header ---------- */
.app-header {
  position: relative;
  z-index: 20;
  height: var(--header-h);
  padding: 0 clamp(12px, 3vw, 28px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(180deg, rgba(8, 12, 28, 0.96), rgba(5, 7, 15, 0.9));
  border-bottom: 1px solid var(--panel-border);
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.5);
}

.logo {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  text-decoration: none;
  white-space: nowrap;
}
.logo-heart {
  color: var(--pink);
  font-size: 18px;
  text-shadow: 0 0 10px var(--pink), 0 0 22px rgba(255, 61, 154, 0.6);
  animation: heartbeat 2.4s ease-in-out infinite;
  align-self: center;
}
.logo-text {
  font-family: var(--font-logo);
  font-weight: 700;
  font-size: clamp(20px, 4.6vw, 26px);
  letter-spacing: 0.04em;
}
.logo-a {
  background: linear-gradient(90deg, #ffffff, var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 8px rgba(34, 229, 255, 0.45));
}
.logo-dash { color: var(--violet); font-weight: 300; padding: 0 1px; }
.logo-b {
  background: linear-gradient(90deg, var(--pink), #ffb36b);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 8px rgba(255, 61, 154, 0.45));
}
.logo-sub {
  font-family: var(--font-logo);
  font-size: 10px;
  letter-spacing: 0.32em;
  color: var(--text-dim);
}
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  12% { transform: scale(1.25); }
  24% { transform: scale(1); }
}

/* ---------- Mode toggle ---------- */
.mode-toggle {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
}
.mode-btn {
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}
.mode-btn:hover { color: var(--text); }
.mode-btn.is-active {
  color: #fff;
  background: linear-gradient(135deg, rgba(34, 229, 255, 0.28), rgba(255, 61, 154, 0.28));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14) inset, 0 0 16px rgba(34, 229, 255, 0.25);
}
.mode-btn:focus-visible,
.btn:focus-visible,
.ghost-btn:focus-visible,
.chip:focus-visible,
.card-close:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* ---------- Main / views ---------- */
.app-main {
  position: relative;
  height: calc(100vh - var(--header-h));
  height: calc(100dvh - var(--header-h));
}
.view {
  position: absolute;
  inset: 0;
}
.view[hidden] { display: none; }

/* 3Dマップは visibility で隠す（サイズを保持したまま描画ループだけ止める） */
#map-view.is-hidden {
  visibility: hidden;
  pointer-events: none;
}

#cesiumContainer {
  position: absolute;
  inset: 0;
  background: var(--bg);
}
/* Cesium 既定ウィジェットの調整 */
.cesium-viewer-bottom { opacity: 0.55; }
.cesium-widget-credits { font-size: 10px; }

/* ---------- HUD ---------- */
.hud { position: absolute; z-index: 5; display: flex; gap: 8px; align-items: center; }
.hud-top-left { top: 12px; left: 12px; }

.chip-mini {
  font-family: var(--font-logo);
  font-size: 11px;
  letter-spacing: 0.2em;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--cyan);
  background: var(--panel);
  border: 1px solid rgba(34, 229, 255, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.ghost-btn {
  font-size: 12px;
  color: var(--text);
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.ghost-btn:hover { border-color: var(--cyan); box-shadow: 0 0 14px rgba(34, 229, 255, 0.25); }

/* ---------- Spot chips (bottom) ---------- */
.spot-chips {
  position: absolute;
  z-index: 5;
  left: 12px;
  right: calc(var(--mr-size) + 28px);
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}
.chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  transition: transform 0.15s, border-color 0.2s, box-shadow 0.2s;
}
.chip:hover { transform: translateY(-2px); border-color: var(--pink); box-shadow: 0 0 16px rgba(255, 61, 154, 0.3); }
.chip.is-active {
  border-color: var(--pink);
  background: linear-gradient(135deg, rgba(255, 61, 154, 0.25), rgba(138, 107, 255, 0.2));
  box-shadow: 0 0 18px rgba(255, 61, 154, 0.35);
}
.chip-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 8px var(--pink);
}
.chip.is-visited .chip-dot { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }

/* ---------- Spot card ---------- */
.spot-card {
  position: absolute;
  z-index: 6;
  top: 12px;
  right: 12px;
  width: min(360px, calc(100% - 24px));
  padding: 18px 18px 16px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55), 0 0 30px rgba(138, 107, 255, 0.12);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: cardIn 0.45s cubic-bezier(.2,.8,.2,1);
  max-height: calc(100% - var(--mr-size) - 96px);
  overflow-y: auto;
}
.spot-card[hidden] { display: none; }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
.spot-card h2 {
  margin: 8px 0 6px;
  font-size: 22px;
  line-height: 1.25;
  text-shadow: 0 0 18px rgba(34, 229, 255, 0.35);
}
.spot-card p { margin: 0 0 8px; font-size: 13.5px; line-height: 1.7; color: #cfd9f5; }
.card-address { color: var(--text-dim) !important; font-size: 12px !important; }
.card-close {
  position: absolute;
  top: 8px; right: 10px;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.card-close:hover { background: rgba(255, 255, 255, 0.14); }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.badge {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: 999px;
  color: var(--pink);
  border: 1px solid rgba(255, 61, 154, 0.5);
  background: rgba(255, 61, 154, 0.08);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  padding: 8px 13px;
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, border-color 0.2s, background 0.2s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); border-color: var(--cyan); box-shadow: 0 0 14px rgba(34, 229, 255, 0.25); }
.btn-primary {
  border-color: transparent;
  background: linear-gradient(135deg, #1fb8d6, #6a5cff);
  box-shadow: 0 0 16px rgba(106, 92, 255, 0.35);
}
.btn-fly {
  border-color: transparent;
  background: linear-gradient(135deg, var(--pink), var(--violet));
  box-shadow: 0 0 16px rgba(255, 61, 154, 0.35);
}
.btn[aria-pressed="true"] {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(34, 229, 255, 0.1);
}

/* ---------- Table view ---------- */
.table-view {
  overflow: auto;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(138, 107, 255, 0.14), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(255, 61, 154, 0.1), transparent 60%),
    var(--bg);
}
.table-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px clamp(12px, 3vw, 28px) 48px;
}
.table-head { margin-bottom: 14px; }
.table-head h1 {
  margin: 0 0 4px;
  font-size: clamp(18px, 3.6vw, 24px);
  font-weight: 700;
  background: linear-gradient(90deg, #fff, var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.table-summary { margin: 0; font-size: 12.5px; color: var(--text-dim); }

.spot-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
  font-size: 13.5px;
}
.spot-table th {
  text-align: left;
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  padding: 6px 12px;
}
.spot-table td {
  padding: 14px 12px;
  vertical-align: top;
  background: var(--panel);
  border-top: 1px solid var(--panel-border);
  border-bottom: 1px solid var(--panel-border);
}
.spot-table td:first-child { border-left: 1px solid var(--panel-border); border-radius: var(--radius) 0 0 var(--radius); }
.spot-table td:last-child { border-right: 1px solid var(--panel-border); border-radius: 0 var(--radius) var(--radius) 0; }
.spot-table tbody tr:hover td { background: rgba(20, 30, 62, 0.85); }
.cell-name { font-weight: 700; font-size: 15px; white-space: nowrap; }
.cell-desc { color: #c3cff0; line-height: 1.65; min-width: 220px; }
.cell-addr { color: var(--text-dim); min-width: 150px; }
.col-visited, .cell-visited { text-align: center; }
.cell-actions { display: flex; flex-wrap: wrap; gap: 6px; min-width: 190px; }

.visit-toggle {
  width: 22px; height: 22px;
  accent-color: var(--cyan);
  cursor: pointer;
}

/* ---------- Loader / toast ---------- */
.loader {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  background: var(--bg);
  color: var(--text-dim);
  font-size: 13px;
  letter-spacing: 0.1em;
  transition: opacity 0.6s ease;
}
.loader.is-done { opacity: 0; pointer-events: none; }
.loader-ring {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--pink);
  border-right-color: var(--cyan);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: absolute;
  z-index: 40;
  left: 50%;
  top: 14px;
  transform: translateX(-50%);
  max-width: min(560px, calc(100% - 24px));
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.6;
  white-space: pre-line;
  color: #ffe9f3;
  background: rgba(60, 12, 36, 0.9);
  border: 1px solid rgba(255, 61, 154, 0.55);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}
.toast[hidden] { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  :root { --header-h: 56px; }
  .logo-sub { display: none; }
  .mode-btn { padding: 7px 10px; font-size: 12px; }

  :root { --mr-size: 142px; }

  /* カードは上部に表示（右下の Memoring と重ならないように） */
  .spot-card {
    top: 56px;
    right: 12px;
    left: 12px;
    width: auto;
    bottom: auto;
    max-height: calc(100% - 56px - var(--mr-size) - 100px);
    padding: 14px 14px 12px;
  }
  .spot-card h2 { font-size: 18px; }

  /* テーブルはカード表示に変換 */
  .spot-table, .spot-table tbody, .spot-table tr, .spot-table td { display: block; width: 100%; }
  .spot-table thead { display: none; }
  .spot-table tr { margin-bottom: 12px; }
  .spot-table td,
  .spot-table td:first-child,
  .spot-table td:last-child {
    border: 0;
    border-radius: 0;
    padding: 6px 14px;
    background: transparent;
  }
  .spot-table tr {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius);
    padding: 8px 0;
  }
  .spot-table tbody tr:hover td { background: transparent; }
  .cell-visited, .col-visited { text-align: left; }
  .cell-visited::before { content: "行った："; color: var(--text-dim); font-size: 12px; margin-right: 6px; vertical-align: middle; }
  .cell-desc, .cell-addr { min-width: 0; }
  .cell-actions { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .logo-heart, .loader-ring { animation: none; }
  .spot-card { animation: none; }
  .mr-neon-ring, .mr-gate, .mr-glow { animation: none !important; }
  .memoring .blade { transition: none !important; }
}

/* ---------- Diagnostics (暫定) ---------- */
.debug-panel {
  position: absolute;
  z-index: 7;
  top: 56px;
  left: 12px;
  margin: 0;
  padding: 8px 10px;
  max-width: min(520px, calc(100% - 24px));
  font: 11px/1.5 ui-monospace, "SF Mono", Menlo, monospace;
  color: #bfe9ff;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(34, 229, 255, 0.3);
  border-radius: 8px;
  white-space: pre-wrap;
  pointer-events: none;
}

/* =========================================================
   Phase 2 — Memoring（円筒形カメラレンズ × デジタル計器）
   サイバー・ノワール：ダークネイビー / 真鍮ゴールド / ネオンブルー / ピンク
   ========================================================= */

.memoring {
  --d: -60px;            /* シャッター羽根の開き具合（-60=全開 / -15=ほぼ閉じ） */
  --sh-t: 0.18s;
  position: absolute;
  z-index: 6;
  right: 12px;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  width: var(--mr-size);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  user-select: none;
  -webkit-user-select: none;
  transform-origin: 100% 100%;
  transition: transform 0.25s cubic-bezier(.2,.8,.2,1);
}
@media (hover: hover) and (pointer: fine) {
  .memoring:hover { transform: scale(1.16); }   /* ピンを選びやすいよう、マウスを乗せると少し拡大 */
}

.memoring[data-shutter="open"]    { --d: -60px; --sh-t: 0.18s; }
.memoring[data-shutter="closing"] { --d: -15px; --sh-t: 0.6s; }

.mr-body {
  position: relative;
  width: var(--mr-size);
  height: var(--mr-size);
}

/* 本体の外側のネオン・グロー */
.mr-glow {
  position: absolute;
  inset: -12%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 229, 255, 0.30) 0%, rgba(255, 61, 154, 0.16) 50%, transparent 72%);
  filter: blur(6px);
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 0.3s;
}
.memoring.is-locking .mr-glow { opacity: 0.95; animation: mrLockPulse 0.45s ease-in-out infinite; }
.memoring.is-locking .mr-gate { animation: mrGateLock 0.45s ease-in-out infinite; }
.memoring.is-locking .mr-monitor {
  box-shadow:
    0 0 0 2px rgba(255, 224, 160, 1),
    0 0 0 4px #120d04,
    inset 0 0 18px rgba(0, 0, 0, 0.9),
    0 0 26px rgba(255, 61, 154, 0.55);
}
/* 回転に頼らないロックオン演出：光のパルス */
@keyframes mrLockPulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.06); }
}
@keyframes mrGateLock {
  0%, 100% { filter: brightness(1) saturate(1.1); }
  50%      { filter: brightness(1.9) saturate(1.5); }
}

/* 真鍮の羅針盤リング（回転は JS が transform を書き換える） */
.mr-ring {
  position: absolute;
  inset: 0;
  will-change: transform;
  filter: drop-shadow(0 3px 7px rgba(0, 0, 0, 0.65));
}
.mr-ring svg { display: block; width: 100%; height: 100%; }

.mr-neon-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  animation: mrSpin 40s linear infinite reverse;
}
@keyframes mrSpin { to { transform: rotate(360deg); } }

/* 円形モニター */
.mr-monitor {
  position: absolute;
  inset: 17%;
  border-radius: 50%;
  overflow: hidden;
  isolation: isolate;
  background: #050a18;
  box-shadow:
    0 0 0 2px rgba(217, 178, 95, 0.9),
    0 0 0 4px #120d04,
    inset 0 0 18px rgba(0, 0, 0, 0.9),
    0 0 20px rgba(34, 229, 255, 0.35);
}
/* ガラスの反射とスキャンライン */
.mr-monitor::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  z-index: 5;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 28% 10%, rgba(255, 255, 255, 0.16), transparent 46%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 3px);
}

/* 奥の空間ゲート（淡く脈動。ワープ時にネオン発光） */
.mr-gate {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(34, 229, 255, 0) 38%, rgba(34, 229, 255, 0.32) 64%, rgba(255, 61, 154, 0.40) 84%, rgba(5, 7, 15, 0) 100%),
    conic-gradient(from 0deg, #0a1a3a, #162f66, #0a1a3a, #1a1650, #0a1a3a);
  animation: mrGate 3.6s ease-in-out infinite;
}
@keyframes mrGate {
  0%, 100% { filter: brightness(0.9) saturate(1); }
  50%      { filter: brightness(1.25) saturate(1.2); }
}

.mr-radar {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  cursor: pointer;
  touch-action: manipulation;
}

.mr-flash {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95), rgba(34, 229, 255, 0.65) 42%, rgba(255, 61, 154, 0.25) 72%, transparent 100%);
}

/* シャッター羽根（6枚） */
.mr-shutter {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.memoring .blade {
  fill: url(#mr-blade);
  stroke: rgba(217, 178, 95, 0.85);
  stroke-width: 0.6;
  transform-origin: 50px 50px;
  transform: rotate(var(--a)) rotate(14deg) translateY(var(--d));
  transition: transform var(--sh-t) cubic-bezier(.3, 0, .2, 1);
}

/* ワープ時の発光（シャッターが開いた瞬間） */
.memoring.is-flash .mr-flash { animation: mrFlash 0.75s ease-out; }
.memoring.is-flash .mr-gate  { animation: mrGateFlash 0.95s ease-out; }
.memoring.is-flash .mr-glow  { animation: mrGlowFlash 0.95s ease-out; }
@keyframes mrFlash {
  0%   { opacity: 0; }
  14%  { opacity: 0.95; }
  100% { opacity: 0; }
}
@keyframes mrGateFlash {
  0%   { filter: brightness(3.4) saturate(1.8); }
  100% { filter: brightness(0.9) saturate(1); }
}
@keyframes mrGlowFlash {
  0%   { opacity: 1; transform: scale(1.3); }
  100% { opacity: 0.55; transform: scale(1); }
}

/* デジタル計器 */
.mr-readout {
  padding: 6px 10px 6px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(10, 16, 34, 0.9), rgba(5, 8, 20, 0.88));
  border: 1px solid rgba(217, 178, 95, 0.5);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55), inset 0 0 12px rgba(34, 229, 255, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: ui-monospace, "SF Mono", Menlo, "Outfit", monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
}
.mr-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 20px;
}
.mr-name {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 12px;
  color: var(--pink);
  text-shadow: 0 0 8px rgba(255, 61, 154, 0.7);
}
.mr-name.is-idle { color: var(--text-dim); text-shadow: none; font-weight: 500; }
.mr-dist { flex: 0 0 auto; color: var(--cyan); text-shadow: 0 0 8px rgba(34, 229, 255, 0.6); }
.mr-hdg  { color: #ffe0a0; white-space: nowrap; }
.mr-btns { display: inline-flex; gap: 4px; }
.mr-btn {
  width: 24px;
  height: 22px;
  padding: 0;
  font-size: 12px;
  line-height: 1;
  border-radius: 7px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--panel-border);
  cursor: pointer;
}
.mr-btn:hover { border-color: var(--cyan); box-shadow: 0 0 10px rgba(34, 229, 255, 0.3); }
.mr-btn[aria-pressed="true"] { border-color: var(--cyan); background: rgba(34, 229, 255, 0.14); }
.mr-btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
#mr-sound[aria-pressed="false"] { opacity: 0.55; }

/* =========================================================
   Phase 4 — 明るいパステル調 UI（freemap.jp 3D 風：白〜ミルキーブルーのガラス、やわらかい丸み、淡いピンク／スカイ／ラベンダー）
   ※ 既存のルールを作り直さず、色だけ後ろから上書きしています。元に戻したい時はこのブロックごと消せば OK。
   ========================================================= */

:root {
  --bg: #eef6ff;
  --bg-2: #ffffff;
  --panel: rgba(255, 255, 255, 0.84);
  --panel-border: rgba(130, 150, 205, 0.28);
  --text: #3b4260;
  --text-dim: #7b84a8;
  --cyan: #4fb8e8;       /* スカイブルー */
  --pink: #ff6fa6;       /* ふんわりピンク */
  --violet: #a493ff;     /* ラベンダー */
  --brass: #e7a9c6;
  --radius: 18px;
  --font-ui: "M PLUS Rounded 1c", "Noto Sans JP", system-ui, -apple-system, "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic", sans-serif;
  --soft-shadow: 0 8px 28px rgba(110, 125, 190, 0.22);
}

html, body { background: var(--bg); color: var(--text); }
/* 引き画面（高度150km以上）の背景：やさしいグラデーション。立体の日本列島は透明なキャンバスごしにこの上へ描かれる */
#cesiumContainer { background: linear-gradient(180deg, #f8faff 0%, #eaeff8 55%, #dde5f1 100%); }

/* ---------- ヘッダー ---------- */
.app-header {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(240, 247, 255, 0.88));
  border-bottom: 1px solid var(--panel-border);
  box-shadow: 0 4px 22px rgba(110, 125, 190, 0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.logo-heart { color: var(--pink); text-shadow: 0 2px 10px rgba(255, 111, 166, 0.45); }
.logo-a {
  background: linear-gradient(90deg, #5aa8ff, #9a8cff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: none;
}
.logo-dash { color: #c9b8ff; }
.logo-b {
  background: linear-gradient(90deg, #ff6fa6, #ffb07a);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: none;
}
.logo-sub { color: var(--text-dim); }

.mode-toggle { background: rgba(255, 255, 255, 0.7); border: 1px solid var(--panel-border); box-shadow: 0 2px 10px rgba(110, 125, 190, 0.12); }
.mode-btn { color: var(--text-dim); }
.mode-btn:hover { color: var(--text); }
.mode-btn.is-active {
  color: #fff;
  background: linear-gradient(135deg, #6cc3ef, #b49cff);
  box-shadow: 0 3px 12px rgba(120, 140, 230, 0.4);
}

/* ---------- HUD・チップ ---------- */
.chip-mini {
  color: #4a9fd4;
  background: var(--panel);
  border: 1px solid rgba(79, 184, 232, 0.4);
  box-shadow: var(--soft-shadow);
}
.ghost-btn { color: var(--text); background: var(--panel); border: 1px solid var(--panel-border); box-shadow: var(--soft-shadow); }
.ghost-btn:hover { border-color: var(--cyan); box-shadow: 0 6px 20px rgba(79, 184, 232, 0.3); }

.chip { color: var(--text); background: var(--panel); border: 1px solid var(--panel-border); box-shadow: 0 4px 14px rgba(110, 125, 190, 0.16); }
.chip:hover { border-color: var(--pink); box-shadow: 0 6px 18px rgba(255, 111, 166, 0.3); }
.chip.is-active {
  border-color: var(--pink);
  background: linear-gradient(135deg, rgba(255, 214, 230, 0.95), rgba(224, 214, 255, 0.92));
  box-shadow: 0 6px 20px rgba(255, 111, 166, 0.32);
}
.chip-dot { background: var(--pink); box-shadow: 0 0 0 3px rgba(255, 111, 166, 0.2); }
.chip.is-visited .chip-dot { background: var(--cyan); box-shadow: 0 0 0 3px rgba(79, 184, 232, 0.22); }

/* ---------- スポットカード ---------- */
.spot-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: 0 14px 44px rgba(110, 125, 190, 0.3);
}
.spot-card h2 { color: var(--text); text-shadow: none; }
.spot-card p { color: #4d5577; }
.card-address { color: var(--text-dim) !important; }
.card-close { background: rgba(120, 135, 195, 0.12); color: var(--text); }
.card-close:hover { background: rgba(120, 135, 195, 0.24); }

.badge { color: #e0558f; border: 1px solid rgba(255, 111, 166, 0.5); background: rgba(255, 111, 166, 0.1); }

/* ---------- ボタン ---------- */
.btn { color: var(--text); background: rgba(255, 255, 255, 0.75); border: 1px solid var(--panel-border); }
.btn:hover { border-color: var(--cyan); box-shadow: 0 5px 16px rgba(79, 184, 232, 0.28); }
.btn-primary { color: #fff; border-color: transparent; background: linear-gradient(135deg, #5fc3ee, #9a8cff); box-shadow: 0 5px 16px rgba(120, 140, 230, 0.38); }
.btn-fly { color: #fff; border-color: transparent; background: linear-gradient(135deg, #ff7fae, #b49cff); box-shadow: 0 5px 16px rgba(255, 111, 166, 0.35); }
.btn[aria-pressed="true"] { border-color: var(--cyan); color: #2f8fc4; background: rgba(79, 184, 232, 0.14); }

/* ---------- 一覧テーブル（速さ重視のビュー：読みやすさ優先で白基調） ---------- */
.table-view {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(180, 156, 255, 0.22), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(255, 150, 190, 0.2), transparent 60%),
    var(--bg);
}
.table-head h1 {
  background: linear-gradient(90deg, #5aa8ff, #b07cff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.spot-table td { background: rgba(255, 255, 255, 0.86); }
.spot-table tbody tr:hover td { background: #ffffff; }
.cell-desc { color: #4d5577; }
.visit-toggle { accent-color: var(--pink); }

/* ---------- ローダー・通知 ---------- */
.loader { background: linear-gradient(180deg, #f4f9ff, #e6f1ff); color: var(--text-dim); }
.loader-ring { border-color: rgba(130, 150, 205, 0.22); border-top-color: var(--pink); border-right-color: var(--cyan); }
.toast {
  color: #7a2a52;
  background: rgba(255, 240, 247, 0.96);
  border: 1px solid rgba(255, 111, 166, 0.5);
  box-shadow: var(--soft-shadow);
}

/* Cesium のクレジット（明るい地図の上でも読めるように） */
.cesium-widget-credits, .cesium-widget-credits a { color: #3b4260 !important; text-shadow: 0 0 3px rgba(255, 255, 255, 0.9); }
.cesium-viewer-bottom { opacity: 0.8; }

/* ---------- Memoring（パステルのカメラレンズ） ---------- */
.mr-glow { background: radial-gradient(circle, rgba(255, 170, 205, 0.5) 0%, rgba(160, 190, 255, 0.28) 52%, transparent 72%); opacity: 0.7; }
.memoring.is-locking .mr-glow { opacity: 1; }
.mr-ring { filter: drop-shadow(0 4px 8px rgba(120, 100, 160, 0.35)); }
.mr-monitor {
  background: #f2f7ff;
  box-shadow:
    0 0 0 2px rgba(255, 190, 215, 0.95),
    0 0 0 4px #ffffff,
    inset 0 0 14px rgba(120, 140, 200, 0.28),
    0 6px 20px rgba(110, 125, 190, 0.3);
}
.memoring.is-locking .mr-monitor {
  box-shadow:
    0 0 0 2px rgba(255, 111, 166, 1),
    0 0 0 4px #ffffff,
    inset 0 0 14px rgba(120, 140, 200, 0.28),
    0 0 24px rgba(255, 111, 166, 0.55);
}
.mr-monitor::after {
  background:
    radial-gradient(120% 80% at 28% 10%, rgba(255, 255, 255, 0.55), transparent 46%),
    repeating-linear-gradient(0deg, rgba(120, 140, 200, 0.05) 0 1px, transparent 1px 3px);
}
.mr-gate {
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0) 38%, rgba(160, 200, 255, 0.4) 64%, rgba(255, 150, 195, 0.45) 84%, rgba(255, 255, 255, 0) 100%),
    conic-gradient(from 0deg, #eaf3ff, #d9e6ff, #eaf3ff, #f1e6ff, #eaf3ff);
}
.mr-flash { background: radial-gradient(circle, rgba(255, 255, 255, 0.98), rgba(255, 200, 225, 0.7) 42%, rgba(160, 200, 255, 0.3) 72%, transparent 100%); }
.memoring .blade { stroke: rgba(255, 255, 255, 0.9); }

.mr-readout {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(240, 246, 255, 0.9));
  border: 1px solid rgba(255, 190, 215, 0.7);
  box-shadow: var(--soft-shadow);
}
.mr-name { color: #e0558f; text-shadow: none; }
.mr-name.is-idle { color: var(--text-dim); }
.mr-dist { color: #3c96e6; text-shadow: none; }
.mr-hdg { color: #5a6496; }
.mr-btn { color: var(--text); background: rgba(255, 255, 255, 0.8); border: 1px solid var(--panel-border); }
.mr-btn:hover { border-color: var(--cyan); box-shadow: 0 3px 10px rgba(79, 184, 232, 0.3); }
.mr-btn[aria-pressed="true"] { border-color: var(--cyan); background: rgba(79, 184, 232, 0.16); }

/* ---------- 軽量モード（スマホ／?lite=1）：すりガラスと常時アニメを止める ---------- */
body.lite .app-header,
body.lite .chip,
body.lite .chip-mini,
body.lite .ghost-btn,
body.lite .spot-card,
body.lite .mr-readout {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
body.lite .mr-neon-ring,
body.lite .mr-gate,
body.lite .logo-heart { animation: none; }
body.lite .mr-glow { filter: none; }
body.lite .comfort-vignette { transition-duration: 0.4s; }

/* ---------- 酔い対策：飛行中の周辺ビネット（フチをふんわり淡く） ---------- */
.comfort-vignette {
  position: absolute;
  inset: 0;
  z-index: 4;                /* 3D の上・HUD(5)の下 */
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.7s ease;
  background: radial-gradient(ellipse 78% 74% at 50% 52%, transparent 55%, rgba(150, 140, 200, 0.22) 82%, rgba(130, 120, 190, 0.42) 100%);
}
body.is-flying .comfort-vignette { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .comfort-vignette { transition: none; }
}

/* ミニマップ拡大（⤢ボタン）— 見やすく・使えるマップに */
.memoring { transition: width .25s ease, transform .25s ease; }
.memoring.is-big { --mr-size: min(82vmin, 480px); z-index: 30; }

/* ミニマップ：リングを細くして地図を大きく。地図そのものをタップ／クリックで拡大 */
.mr-monitor { inset: 10%; }
.memoring.is-big { --mr-size: min(82vmin, 480px); }
.memoring:not(.is-big) .mr-radar { cursor: zoom-in; }
.memoring:not(.is-big) #mr-expand { display: none; }   /* 拡大ボタンは不要（地図をタップ）。拡大中だけ「戻す」ボタンとして表示 */
.mr-btn[aria-pressed="true"]#mr-expand { background: rgba(216, 49, 111, .14); }

/* ---------- 光のカバー：移動中の読み込みを隠す（3D の上・Memoring/HUD の下） ---------- */
.warp-cover {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.45s ease;
  background:
    radial-gradient(ellipse at 50% 52%, #ffffff 0%, #ffffff 32%, #fff3f8 62%, #ffdcec 100%);
  will-change: opacity;
}
.warp-cover.is-on { opacity: 1; }

/* ---------- ジオラマ：青空と白い雲（3Dのキャンバスは透明で、島のまわりはこの背景が透けて見える） ---------- */
body.diorama #cesiumContainer {
  overflow: hidden;
  background: linear-gradient(180deg, #74bff2 0%, #a2d9fa 36%, #d0edfc 70%, #f0faff 100%);
}
body.diorama #cesiumContainer::before {
  content: '';
  position: absolute;
  inset: -8% -16%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 22% 7% at 14% 70%, rgba(255, 255, 255, 0.95) 0 38%, transparent 72%),
    radial-gradient(ellipse 15% 6% at 25% 74%, rgba(255, 255, 255, 0.85) 0 34%, transparent 70%),
    radial-gradient(ellipse 26% 8% at 80% 62%, rgba(255, 255, 255, 0.92) 0 36%, transparent 72%),
    radial-gradient(ellipse 17% 6% at 92% 67%, rgba(255, 255, 255, 0.8) 0 34%, transparent 70%),
    radial-gradient(ellipse 22% 6% at 52% 90%, rgba(255, 255, 255, 0.9) 0 36%, transparent 72%),
    radial-gradient(ellipse 14% 5% at 8% 28%, rgba(255, 255, 255, 0.7) 0 34%, transparent 70%),
    radial-gradient(ellipse 18% 5% at 66% 20%, rgba(255, 255, 255, 0.7) 0 34%, transparent 70%);
  animation: rv-clouds 180s linear infinite alternate;
}
body.diorama.lite #cesiumContainer::before { animation: none; }
@keyframes rv-clouds { from { transform: translateX(-3%); } to { transform: translateX(5%); } }

/* =========================================================
   Phase 4 — 明るいパステル調 UI（freemap.jp 3D 風：白〜ミルキーブルーのガラス、やわらかい丸み、淡いピンク／スカイ／ラベンダー）
   ※ 既存のルールを作り直さず、色だけ後ろから上書きしています。元に戻したい時はこのブロックごと消せば OK。
   ========================================================= */

:root {
  --bg: #eef6ff;
  --bg-2: #ffffff;
  --panel: rgba(255, 255, 255, 0.84);
  --panel-border: rgba(130, 150, 205, 0.28);
  --text: #3b4260;
  --text-dim: #7b84a8;
  --cyan: #4fb8e8;       /* スカイブルー */
  --pink: #ff6fa6;       /* ふんわりピンク */
  --violet: #a493ff;     /* ラベンダー */
  --brass: #e7a9c6;
  --radius: 18px;
  --font-ui: "M PLUS Rounded 1c", "Noto Sans JP", system-ui, -apple-system, "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic", sans-serif;
  --soft-shadow: 0 8px 28px rgba(110, 125, 190, 0.22);
}

html, body { background: var(--bg); color: var(--text); }
/* 引き画面（高度150km以上）の背景：やさしいグラデーション。立体の日本列島は透明なキャンバスごしにこの上へ描かれる */
#cesiumContainer { background: linear-gradient(180deg, #f8faff 0%, #eaeff8 55%, #dde5f1 100%); }

/* ---------- ヘッダー ---------- */
.app-header {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(240, 247, 255, 0.88));
  border-bottom: 1px solid var(--panel-border);
  box-shadow: 0 4px 22px rgba(110, 125, 190, 0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.logo-heart { color: var(--pink); text-shadow: 0 2px 10px rgba(255, 111, 166, 0.45); }
.logo-a {
  background: linear-gradient(90deg, #5aa8ff, #9a8cff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: none;
}
.logo-dash { color: #c9b8ff; }
.logo-b {
  background: linear-gradient(90deg, #ff6fa6, #ffb07a);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: none;
}
.logo-sub { color: var(--text-dim); }

.mode-toggle { background: rgba(255, 255, 255, 0.7); border: 1px solid var(--panel-border); box-shadow: 0 2px 10px rgba(110, 125, 190, 0.12); }
.mode-btn { color: var(--text-dim); }
.mode-btn:hover { color: var(--text); }
.mode-btn.is-active {
  color: #fff;
  background: linear-gradient(135deg, #6cc3ef, #b49cff);
  box-shadow: 0 3px 12px rgba(120, 140, 230, 0.4);
}

/* ---------- HUD・チップ ---------- */
.chip-mini {
  color: #4a9fd4;
  background: var(--panel);
  border: 1px solid rgba(79, 184, 232, 0.4);
  box-shadow: var(--soft-shadow);
}
.ghost-btn { color: var(--text); background: var(--panel); border: 1px solid var(--panel-border); box-shadow: var(--soft-shadow); }
.ghost-btn:hover { border-color: var(--cyan); box-shadow: 0 6px 20px rgba(79, 184, 232, 0.3); }

.chip { color: var(--text); background: var(--panel); border: 1px solid var(--panel-border); box-shadow: 0 4px 14px rgba(110, 125, 190, 0.16); }
.chip:hover { border-color: var(--pink); box-shadow: 0 6px 18px rgba(255, 111, 166, 0.3); }
.chip.is-active {
  border-color: var(--pink);
  background: linear-gradient(135deg, rgba(255, 214, 230, 0.95), rgba(224, 214, 255, 0.92));
  box-shadow: 0 6px 20px rgba(255, 111, 166, 0.32);
}
.chip-dot { background: var(--pink); box-shadow: 0 0 0 3px rgba(255, 111, 166, 0.2); }
.chip.is-visited .chip-dot { background: var(--cyan); box-shadow: 0 0 0 3px rgba(79, 184, 232, 0.22); }

/* ---------- スポットカード ---------- */
.spot-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: 0 14px 44px rgba(110, 125, 190, 0.3);
}
.spot-card h2 { color: var(--text); text-shadow: none; }
.spot-card p { color: #4d5577; }
.card-address { color: var(--text-dim) !important; }
.card-close { background: rgba(120, 135, 195, 0.12); color: var(--text); }
.card-close:hover { background: rgba(120, 135, 195, 0.24); }

.badge { color: #e0558f; border: 1px solid rgba(255, 111, 166, 0.5); background: rgba(255, 111, 166, 0.1); }

/* ---------- ボタン ---------- */
.btn { color: var(--text); background: rgba(255, 255, 255, 0.75); border: 1px solid var(--panel-border); }
.btn:hover { border-color: var(--cyan); box-shadow: 0 5px 16px rgba(79, 184, 232, 0.28); }
.btn-primary { color: #fff; border-color: transparent; background: linear-gradient(135deg, #5fc3ee, #9a8cff); box-shadow: 0 5px 16px rgba(120, 140, 230, 0.38); }
.btn-fly { color: #fff; border-color: transparent; background: linear-gradient(135deg, #ff7fae, #b49cff); box-shadow: 0 5px 16px rgba(255, 111, 166, 0.35); }
.btn[aria-pressed="true"] { border-color: var(--cyan); color: #2f8fc4; background: rgba(79, 184, 232, 0.14); }

/* ---------- 一覧テーブル（速さ重視のビュー：読みやすさ優先で白基調） ---------- */
.table-view {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(180, 156, 255, 0.22), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(255, 150, 190, 0.2), transparent 60%),
    var(--bg);
}
.table-head h1 {
  background: linear-gradient(90deg, #5aa8ff, #b07cff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.spot-table td { background: rgba(255, 255, 255, 0.86); }
.spot-table tbody tr:hover td { background: #ffffff; }
.cell-desc { color: #4d5577; }
.visit-toggle { accent-color: var(--pink); }

/* ---------- ローダー・通知 ---------- */
.loader { background: linear-gradient(180deg, #f4f9ff, #e6f1ff); color: var(--text-dim); }
.loader-ring { border-color: rgba(130, 150, 205, 0.22); border-top-color: var(--pink); border-right-color: var(--cyan); }
.toast {
  color: #7a2a52;
  background: rgba(255, 240, 247, 0.96);
  border: 1px solid rgba(255, 111, 166, 0.5);
  box-shadow: var(--soft-shadow);
}

/* Cesium のクレジット（明るい地図の上でも読めるように） */
.cesium-widget-credits, .cesium-widget-credits a { color: #3b4260 !important; text-shadow: 0 0 3px rgba(255, 255, 255, 0.9); }
.cesium-viewer-bottom { opacity: 0.8; }

/* ---------- Memoring（パステルのカメラレンズ） ---------- */
.mr-glow { background: radial-gradient(circle, rgba(255, 170, 205, 0.5) 0%, rgba(160, 190, 255, 0.28) 52%, transparent 72%); opacity: 0.7; }
.memoring.is-locking .mr-glow { opacity: 1; }
.mr-ring { filter: drop-shadow(0 4px 8px rgba(120, 100, 160, 0.35)); }
.mr-monitor {
  background: #f2f7ff;
  box-shadow:
    0 0 0 2px rgba(255, 190, 215, 0.95),
    0 0 0 4px #ffffff,
    inset 0 0 14px rgba(120, 140, 200, 0.28),
    0 6px 20px rgba(110, 125, 190, 0.3);
}
.memoring.is-locking .mr-monitor {
  box-shadow:
    0 0 0 2px rgba(255, 111, 166, 1),
    0 0 0 4px #ffffff,
    inset 0 0 14px rgba(120, 140, 200, 0.28),
    0 0 24px rgba(255, 111, 166, 0.55);
}
.mr-monitor::after {
  background:
    radial-gradient(120% 80% at 28% 10%, rgba(255, 255, 255, 0.55), transparent 46%),
    repeating-linear-gradient(0deg, rgba(120, 140, 200, 0.05) 0 1px, transparent 1px 3px);
}
.mr-gate {
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0) 38%, rgba(160, 200, 255, 0.4) 64%, rgba(255, 150, 195, 0.45) 84%, rgba(255, 255, 255, 0) 100%),
    conic-gradient(from 0deg, #eaf3ff, #d9e6ff, #eaf3ff, #f1e6ff, #eaf3ff);
}
.mr-flash { background: radial-gradient(circle, rgba(255, 255, 255, 0.98), rgba(255, 200, 225, 0.7) 42%, rgba(160, 200, 255, 0.3) 72%, transparent 100%); }
.memoring .blade { stroke: rgba(255, 255, 255, 0.9); }

.mr-readout {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(240, 246, 255, 0.9));
  border: 1px solid rgba(255, 190, 215, 0.7);
  box-shadow: var(--soft-shadow);
}
.mr-name { color: #e0558f; text-shadow: none; }
.mr-name.is-idle { color: var(--text-dim); }
.mr-dist { color: #3c96e6; text-shadow: none; }
.mr-hdg { color: #5a6496; }
.mr-btn { color: var(--text); background: rgba(255, 255, 255, 0.8); border: 1px solid var(--panel-border); }
.mr-btn:hover { border-color: var(--cyan); box-shadow: 0 3px 10px rgba(79, 184, 232, 0.3); }
.mr-btn[aria-pressed="true"] { border-color: var(--cyan); background: rgba(79, 184, 232, 0.16); }

/* ---------- 軽量モード（スマホ／?lite=1）：すりガラスと常時アニメを止める ---------- */
body.lite .app-header,
body.lite .chip,
body.lite .chip-mini,
body.lite .ghost-btn,
body.lite .spot-card,
body.lite .mr-readout {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
body.lite .mr-neon-ring,
body.lite .mr-gate,
body.lite .logo-heart { animation: none; }
body.lite .mr-glow { filter: none; }
body.lite .comfort-vignette { transition-duration: 0.4s; }

/* ---------- 酔い対策：飛行中の周辺ビネット（フチをふんわり淡く） ---------- */
.comfort-vignette {
  position: absolute;
  inset: 0;
  z-index: 4;                /* 3D の上・HUD(5)の下 */
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.7s ease;
  background: radial-gradient(ellipse 78% 74% at 50% 52%, transparent 55%, rgba(150, 140, 200, 0.22) 82%, rgba(130, 120, 190, 0.42) 100%);
}
body.is-flying .comfort-vignette { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .comfort-vignette { transition: none; }
}

/* ミニマップ拡大（⤢ボタン）— 見やすく・使えるマップに */
.memoring { transition: width .25s ease, transform .25s ease; }
.memoring.is-big { --mr-size: min(82vmin, 480px); z-index: 30; }

/* ミニマップ：リングを細くして地図を大きく。地図そのものをタップ／クリックで拡大 */
.mr-monitor { inset: 10%; }
.memoring.is-big { --mr-size: min(82vmin, 480px); }
.memoring:not(.is-big) .mr-radar { cursor: zoom-in; }
.memoring:not(.is-big) #mr-expand { display: none; }   /* 拡大ボタンは不要（地図をタップ）。拡大中だけ「戻す」ボタンとして表示 */
.mr-btn[aria-pressed="true"]#mr-expand { background: rgba(216, 49, 111, .14); }

/* ---------- 光のカバー：移動中の読み込みを隠す（3D の上・Memoring/HUD の下） ---------- */
.warp-cover {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.45s ease;
  background:
    radial-gradient(ellipse at 50% 52%, #ffffff 0%, #ffffff 32%, #fff3f8 62%, #ffdcec 100%);
  will-change: opacity;
}
.warp-cover.is-on { opacity: 1; }

/* ---------- ジオラマ：青空と白い雲（3Dのキャンバスは透明で、島のまわりはこの背景が透けて見える） ---------- */
body.diorama #cesiumContainer {
  overflow: hidden;
  background: linear-gradient(180deg, #74bff2 0%, #a2d9fa 36%, #d0edfc 70%, #f0faff 100%);
}
body.diorama #cesiumContainer::before {
  content: '';
  position: absolute;
  inset: -8% -16%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 22% 7% at 14% 70%, rgba(255, 255, 255, 0.95) 0 38%, transparent 72%),
    radial-gradient(ellipse 15% 6% at 25% 74%, rgba(255, 255, 255, 0.85) 0 34%, transparent 70%),
    radial-gradient(ellipse 26% 8% at 80% 62%, rgba(255, 255, 255, 0.92) 0 36%, transparent 72%),
    radial-gradient(ellipse 17% 6% at 92% 67%, rgba(255, 255, 255, 0.8) 0 34%, transparent 70%),
    radial-gradient(ellipse 22% 6% at 52% 90%, rgba(255, 255, 255, 0.9) 0 36%, transparent 72%),
    radial-gradient(ellipse 14% 5% at 8% 28%, rgba(255, 255, 255, 0.7) 0 34%, transparent 70%),
    radial-gradient(ellipse 18% 5% at 66% 20%, rgba(255, 255, 255, 0.7) 0 34%, transparent 70%);
  animation: rv-clouds 180s linear infinite alternate;
}
body.diorama.lite #cesiumContainer::before { animation: none; }
@keyframes rv-clouds { from { transform: translateX(-3%); } to { transform: translateX(5%); } }

/* =========================================================
   Phase 4 — ポラロイド2枚（選択中：ピンクのテープ／いちばん近い：黄色のテープ）
   ========================================================= */
.polaroids {
  position: absolute;
  z-index: 5;
  left: 12px;
  top: 118px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  pointer-events: none;            /* すき間は3Dの操作を邪魔しない */
}
body:not(.diorama) .polaroids { display: none; }
.polaroid {
  --tilt: -3deg;
  position: relative;
  width: 118px;
  padding: 8px 8px 7px;
  border: 0;
  border-radius: 4px;
  background: #fffdf8;
  box-shadow: 0 8px 18px rgba(90, 80, 130, 0.28), 0 1px 0 rgba(255, 255, 255, 0.9) inset;
  transform: rotate(var(--tilt));
  transition: transform 0.25s cubic-bezier(.2, .8, .2, 1);
  cursor: pointer;
  pointer-events: auto;
  text-align: center;
  font-family: "Zen Kurenaido", "M PLUS Rounded 1c", var(--font-ui);
  color: #5a4a40;
}
#pol-near { --tilt: 2.6deg; }
.polaroid:hover { transform: rotate(0deg) scale(1.06); }
.polaroid.is-empty { cursor: default; }
.polaroid.is-empty:hover { transform: rotate(var(--tilt)); }
.pol-pic {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 2px;
  background: #dfeeff;
  box-shadow: inset 0 0 0 1px rgba(90, 80, 130, 0.15);
}
.polaroid.is-empty .pol-pic { filter: grayscale(1) opacity(0.45); }
.pol-name {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.pol-sub { display: block; min-height: 14px; font-size: 11px; color: #9a8478; }
.tape {
  position: absolute;
  left: 50%;
  top: -11px;
  transform: translateX(-50%) rotate(-2deg);
  padding: 2px 10px;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.02em;
  color: #6b3a4f;
  box-shadow: 0 1px 3px rgba(90, 80, 130, 0.25);
  background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.35) 0 4px, transparent 4px 8px);
  clip-path: polygon(0 0, 100% 0, 97% 50%, 100% 100%, 0 100%, 3% 50%);
}
.tape-pink { background-color: rgba(255, 150, 190, 0.92); }
.tape-yellow { background-color: rgba(255, 220, 100, 0.95); color: #6b5520; }
.polaroid.pol-swap { animation: polSwap 0.55s cubic-bezier(.2, .9, .25, 1.2); }
@keyframes polSwap {
  0%   { transform: translateY(-16px) rotate(calc(var(--tilt) * 3)) scale(0.92); opacity: 0.2; }
  100% { transform: rotate(var(--tilt)); opacity: 1; }
}
@media (max-width: 720px) {
  .polaroids { top: 104px; gap: 14px; }
  .polaroid { width: 88px; padding: 6px 6px 5px; }
  .pol-name { font-size: 11px; margin-top: 4px; }
  .pol-sub { font-size: 9.5px; }
  .tape { font-size: 9px; padding: 1px 7px; }
}
@media (prefers-reduced-motion: reduce) { .polaroid.pol-swap { animation: none; } }
body.door-on .polaroids { visibility: hidden; }

/* =========================================================
   Phase 5 — スクラップブック風の詳細カード／黄色いプロペラHUD／手描き風ミニマップ
   ========================================================= */

/* ---- スクラップ風カード（ジオラマ時）：紙・マスキングテープ・貼った写真・手書きの見出し ---- */
body.diorama .spot-card {
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 216, 230, 0.35) 0 14px, transparent 15px),
    radial-gradient(circle at 88% 82%, rgba(190, 225, 255, 0.4) 0 18px, transparent 19px),
    #fffaf0;
  border: 2px dashed rgba(224, 85, 143, 0.45);
  border-radius: 6px;
  box-shadow: 0 12px 30px rgba(90, 80, 130, 0.3), 0 0 0 6px #fffaf0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: #5a4a40;
  transform: rotate(0.9deg);
  padding-top: 26px;
  overflow: visible;
  overflow-y: auto;
}
body.diorama .spot-card::before {         /* 上のマスキングテープ */
  content: "";
  position: absolute;
  left: 50%; top: -12px;
  width: 96px; height: 22px;
  transform: translateX(-50%) rotate(-2.5deg);
  background-color: rgba(255, 150, 190, 0.85);
  background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0 5px, transparent 5px 10px);
  box-shadow: 0 1px 3px rgba(90, 80, 130, 0.25);
  clip-path: polygon(0 0, 100% 0, 97% 50%, 100% 100%, 0 100%, 3% 50%);
}
body.diorama .spot-card h2 {
  font-family: "Zen Kurenaido", "M PLUS Rounded 1c", var(--font-ui);
  font-size: 27px;
  color: #5a4a40;
  display: inline;
  background: linear-gradient(transparent 62%, rgba(255, 224, 110, 0.75) 62%);
  padding: 0 4px;
  margin: 0;
}
body.diorama .spot-card .badge {
  display: inline-block;
  transform: rotate(-3deg);
  background: #fff;
  color: #e0558f;
  border: 2px dashed #ff8db8;
  border-radius: 6px;
  font-family: "Zen Kurenaido", var(--font-ui);
  font-weight: 700;
  margin-bottom: 8px;
}
body.diorama .spot-card p { color: #6d5a4e; }
body.diorama .spot-card .card-address { color: #9a8478; }
body.diorama .spot-card .btn {
  border-radius: 10px;
  border: 2px solid #ffb5d0;
  background: #fff;
  color: #5a4a40;
  box-shadow: 2px 3px 0 rgba(255, 141, 184, 0.45);
}
body.diorama .spot-card .btn-primary {
  background: #ffd84a;
  border-color: #f0b429;
  color: #5a4520;
  box-shadow: 2px 3px 0 rgba(240, 180, 41, 0.5);
}
body.diorama .spot-card .card-close {
  background: #fff;
  border: 2px solid #ffb5d0;
  color: #e0558f;
}
.card-photo { display: none; }
body.diorama .card-photo {                   /* 貼り付けた小さな写真 */
  display: block;
  float: right;
  width: 92px; height: 92px;
  margin: 14px 4px 6px 10px;
  padding: 5px 5px 14px;
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 4px 10px rgba(90, 80, 130, 0.3);
  transform: rotate(4deg);
  object-fit: contain;
}
@media (max-width: 720px) {
  body.diorama .spot-card { transform: rotate(0.4deg); }
  body.diorama .card-photo { width: 70px; height: 70px; padding: 4px 4px 11px; }
  body.diorama .spot-card h2 { font-size: 22px; }
}

/* ---- 黄色いプロペラHUD ---- */
.prop-hud {
  position: absolute;
  z-index: 5;
  left: 12px;
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  display: none;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 8px;
  border-radius: 999px;
  background: rgba(255, 253, 240, 0.9);
  border: 2px solid #ffe27a;
  box-shadow: 0 6px 16px rgba(90, 80, 130, 0.22);
  font-family: "Zen Kurenaido", "M PLUS Rounded 1c", var(--font-ui);
  color: #5a4a40;
  pointer-events: none;
}
body.diorama .prop-hud { display: flex; }
body.door-on .prop-hud { visibility: hidden; }
.prop-svg { width: 38px; height: 38px; overflow: visible; }
#prop-rotor { transform-origin: 50px 50px; }
.prop-text { display: grid; line-height: 1.1; }
.prop-label { font-size: 10px; color: #9a8478; }
.prop-text b { font-size: 15px; letter-spacing: 0.02em; }

/* =========================================================
   扉の開始画面 — 木の板でできた、どこへでもつながりそうな扉
   ========================================================= */
.door-screen {
  position: fixed;
  inset: 0;
  z-index: 35;                       /* ローダー(30)の上・トースト(40)の下 */
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  color: #1c2733;
  background: linear-gradient(180deg, #a6cbe5 0%, #cde2ef 46%, #eef2f1 100%);
  transition: opacity 0.5s ease-out;
  -webkit-tap-highlight-color: transparent;
}
.door-screen[hidden] { display: none; }
.door-screen.is-leaving { opacity: 0; pointer-events: none; }
.door-screen.is-entering { opacity: 0; }

/* 空のかすみ（ゆっくり流れるだけ） */
.door-sky i { position: absolute; border-radius: 50%; pointer-events: none; }
.door-sky .h1, .door-sky .h2 { background: rgba(255, 255, 255, 0.5); filter: blur(48px); }
.door-sky .h1 { width: 70vw; height: 26vh; left: -14vw; top: 8%; animation: doorHaze 40s ease-in-out infinite alternate; }
.door-sky .h2 { width: 64vw; height: 22vh; right: -16vw; top: 50%; animation: doorHaze 52s ease-in-out infinite alternate-reverse; }
.door-sky .h3 {
  width: 58vmin; height: 58vmin; left: 50%; top: 4%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(255, 246, 222, 0.85) 0%, rgba(255, 246, 222, 0) 68%);
}
@keyframes doorHaze { to { transform: translateX(9vw); } }

.door-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }

.door-stage {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: grid;
  place-items: center;
  padding-top: clamp(24px, 6vh, 60px);
  transform-origin: 50% 50%;
  transition: transform 0.7s cubic-bezier(.6, 0, .9, .4), opacity 0.4s ease 0.25s;
}

.door-wrap {
  position: relative;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  perspective: 1400px;
  animation: doorBob 7s ease-in-out infinite;
}
.door-wrap:focus-visible { outline: 2px solid #1c2733; outline-offset: 14px; border-radius: 4px; }
@keyframes doorBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

/* 細い木の枠。扉のすき間からは、向こう側の光がもれている */
.door-frame {
  position: relative;
  display: block;
  height: clamp(250px, 50vh, 440px);
  aspect-ratio: 0.46;
  padding: 5px;
  border-radius: 3px;
  background: linear-gradient(90deg, #6b4a2f, #805a38 50%, #6b4a2f);
  box-shadow:
    0 0 0 1px rgba(40, 24, 10, 0.35),
    0 0 46px 6px rgba(255, 244, 214, 0.6),
    0 34px 50px -22px rgba(28, 39, 51, 0.5);
  transition: box-shadow 0.5s ease;
}
.door-light {
  position: absolute;
  inset: 5px;
  background:
    linear-gradient(180deg, transparent 0 56%, rgba(255, 255, 255, 0.95) 56.3%, transparent 57%),
    linear-gradient(180deg, #e6f3ff 0%, #ffffff 55%, #ffe9bf 100%);
  box-shadow: inset 0 0 40px rgba(255, 255, 255, 0.9);
}
.door-leaf {
  position: absolute;
  inset: 8px;
  display: flex;
  transform-origin: 0% 50%;
  transition: transform 0.45s cubic-bezier(.4, 0, .2, 1);
  box-shadow: 5px 0 16px rgba(20, 12, 4, 0.22);
  will-change: transform;
}
.door-leaf::after {                   /* 板の上をすべる、やわらかい光沢 */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(104deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 38%, rgba(0, 0, 0, 0.1) 100%);
}
.door-leaf .pl {
  position: relative;
  flex: 1 1 0;
  background:
    repeating-linear-gradient(90deg, rgba(74, 42, 16, 0.07) 0 1px, transparent 1px 6px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.07) 0 2px, transparent 2px 13px),
    repeating-linear-gradient(90deg, rgba(74, 42, 16, 0.05) 0 1px, transparent 1px 17px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.1)),
    var(--pl);
  background-position: var(--o, 0px) 0, calc(var(--o, 0px) * 2) 0, var(--o, 0px) 0, 0 0, 0 0;
}
.door-leaf .pl + .pl { box-shadow: inset 1px 0 0 rgba(56, 32, 12, 0.42), inset 2px 0 0 rgba(255, 255, 255, 0.1); }
.door-leaf .pl:nth-child(1) { --pl: #cfa676; --o: 0px; }
.door-leaf .pl:nth-child(2) { --pl: #c59a69; --o: 3px; }
.door-leaf .pl:nth-child(3) { --pl: #d3ab7d; --o: 7px; }
.door-leaf .pl:nth-child(4) { --pl: #c19563; --o: 2px; }
.door-leaf .pl:nth-child(5) { --pl: #cba172; --o: 5px; }
.door-pull {                          /* 細い真鍮の取っ手 */
  position: absolute;
  right: 11%;
  top: 44%;
  width: 5px;
  height: 15%;
  border-radius: 3px;
  background: linear-gradient(90deg, #f2e0b4, #b8924a 55%, #8a6a2c);
  box-shadow: 2px 3px 5px rgba(20, 12, 4, 0.4);
  z-index: 2;
}
.door-shadow {
  position: absolute;
  left: -14%; right: -14%;
  bottom: -26px;
  height: 22px;
  background: radial-gradient(50% 50% at 50% 50%, rgba(28, 39, 51, 0.32), transparent 72%);
  filter: blur(3px);
}
@media (hover: hover) {
  .door-wrap:hover .door-leaf { transform: rotateY(-8deg); }      /* ふれると、少しだけ開く */
  .door-wrap:hover .door-frame { box-shadow: 0 0 0 1px rgba(40, 24, 10, 0.35), 0 0 70px 14px rgba(255, 240, 200, 0.85), 0 34px 50px -22px rgba(28, 39, 51, 0.5); }
}

.door-copy {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 0 24px clamp(26px, 7vh, 62px);
  text-align: center;
  transition: opacity 0.35s ease;
}
.door-title {
  margin: 0;
  font-family: "Jost", "Zen Kaku Gothic New", sans-serif;
  font-weight: 300;
  font-size: clamp(32px, 6.4vw, 52px);
  line-height: 1;
  letter-spacing: 0.06em;
  color: #1c2733;
}
.door-title .dt-d { color: #b8924a; padding: 0 0.04em; }
.door-sub {
  margin: 0;
  font-family: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-weight: 500;
  font-size: clamp(14px, 2.6vw, 16px);
  line-height: 1.95;
  letter-spacing: 0.08em;
  color: #46525f;
}
.door-hint {
  margin: 6px 0 0;
  padding-bottom: 12px;
  position: relative;
  font-size: 12.5px;
  letter-spacing: 0.14em;
  color: #6b7886;
}
.door-hint::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 0;
  width: 32px; height: 1px;
  margin-left: -16px;
  background: #b8924a;
  transform-origin: 50% 50%;
  animation: doorLine 2.8s ease-in-out infinite;
}
@keyframes doorLine { 0%, 100% { transform: scaleX(0.25); opacity: 0.5; } 50% { transform: scaleX(1); opacity: 1; } }

/* ひらく：扉が開く → 光 → 手前へ吸い込まれる → 光で晴れる */
.door-screen.is-open .door-wrap { animation: none; pointer-events: none; }
.door-screen.is-open .door-leaf { transform: rotateY(-112deg); }
.door-screen.is-open .door-copy { opacity: 0; }
.door-screen.is-open .door-stage { transform: scale(7); opacity: 0; }
.door-flash {
  position: absolute; inset: 0; z-index: 4; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 50% 44%, #fff 0%, #fff 30%, rgba(255, 246, 226, 0.96) 70%, rgba(255, 255, 255, 0.92) 100%);
  transition: opacity 0.28s ease-in;
}
.door-screen.is-open .door-flash { opacity: 1; transition-delay: 0.2s; }
@media (prefers-reduced-motion: reduce) {
  .door-sky i, .door-wrap, .door-hint::after { animation: none; }
}
body.lite .door-sky .h1, body.lite .door-sky .h2 { animation: none; filter: none; }
body.door-on .memoring, body.door-on .hud, body.door-on .spot-chips { visibility: hidden; }

/* =========================================================
   全体の仕上げ — 静かで上質なUI（インク色・真鍮・やわらかな空）
   スポットの色（ピンク）は、地図の中のしるしだけに使う
   ========================================================= */
:root {
  --ink: #1c2733;
  --ink-2: #46525f;
  --ink-3: #7b8794;
  --brass: #b8924a;
  --brass-ink: #8a6a2c;
  --font-ui: "Zen Kaku Gothic New", "Noto Sans JP", system-ui, -apple-system, "Hiragino Sans", "Yu Gothic", sans-serif;
  --font-logo: "Jost", "Zen Kaku Gothic New", sans-serif;
  --font-serif: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --text: #1c2733;
  --text-dim: #7b8794;
  --panel: rgba(252, 253, 254, 0.86);
  --panel-border: rgba(28, 39, 51, 0.1);
  --soft-shadow: 0 6px 22px rgba(28, 39, 51, 0.12);
  --cyan: #b8924a;
  --radius: 10px;
}
body { font-family: var(--font-ui); }

/* ヘッダー */
.app-header {
  background: rgba(252, 253, 254, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--panel-border);
  box-shadow: none;
}
.logo { gap: 12px; align-items: center; }
.logo-text { font-family: var(--font-logo); font-weight: 400; font-size: clamp(19px, 4.2vw, 23px); letter-spacing: 0.06em; color: var(--ink); }
.logo-a, .logo-b { background: none; -webkit-background-clip: border-box; background-clip: border-box; color: var(--ink); filter: none; }
.logo-dash { color: var(--brass); font-weight: 300; }
.logo-sub { font-family: var(--font-logo); font-size: 11.5px; letter-spacing: 0.12em; color: var(--ink-3); padding-left: 12px; border-left: 1px solid var(--panel-border); }

.mode-toggle { background: rgba(28, 39, 51, 0.06); border: 0; box-shadow: none; padding: 3px; }
.mode-btn { color: var(--ink-3); font-weight: 500; font-size: 13px; letter-spacing: 0.04em; padding: 7px 17px; }
.mode-btn:hover { color: var(--ink); }
.mode-btn.is-active { color: var(--ink); background: #fff; box-shadow: 0 1px 2px rgba(28, 39, 51, 0.14), 0 4px 12px rgba(28, 39, 51, 0.08); }

/* マップ上の部品 */
.chip-mini { display: none; }
.ghost-btn { font-size: 12.5px; letter-spacing: 0.04em; color: var(--ink); background: var(--panel); border: 1px solid var(--panel-border); box-shadow: var(--soft-shadow); }
.ghost-btn:hover { border-color: var(--brass); box-shadow: var(--soft-shadow); }
.chip { font-size: 13px; letter-spacing: 0.03em; color: var(--ink); background: var(--panel); border: 1px solid var(--panel-border); box-shadow: 0 4px 14px rgba(28, 39, 51, 0.1); }
.chip:hover { transform: translateY(-1px); border-color: rgba(28, 39, 51, 0.28); box-shadow: 0 6px 16px rgba(28, 39, 51, 0.14); }
.chip.is-active { color: #fff; background: var(--ink); border-color: var(--ink); box-shadow: 0 6px 18px rgba(28, 39, 51, 0.3); }
.chip-dot { background: var(--pink); box-shadow: none; }
.chip.is-visited .chip-dot { background: #4f8fb8; box-shadow: none; }

/* ボタン */
.btn { color: var(--ink); background: #fff; border: 1px solid rgba(28, 39, 51, 0.16); border-radius: 8px; letter-spacing: 0.03em; box-shadow: none; }
.btn:hover { border-color: var(--brass); box-shadow: none; }
.btn-primary { color: #fff; background: var(--ink); border-color: var(--ink); box-shadow: none; }
.btn-fly { color: #fff; background: var(--brass-ink); border-color: var(--brass-ink); box-shadow: none; }
.btn[aria-pressed="true"] { border-color: var(--brass); color: var(--brass-ink); background: rgba(184, 146, 74, 0.1); }
.badge { color: var(--ink-2); border: 1px solid rgba(28, 39, 51, 0.2); background: transparent; letter-spacing: 0.04em; }
.table-head h1 { background: none; -webkit-background-clip: border-box; background-clip: border-box; color: var(--ink); }

/* 詳細カード（紙＋木のテープ。手書き風ではなく、明朝で静かに） */
body.diorama .spot-card {
  background: #fdfcfa;
  border: 1px solid rgba(28, 39, 51, 0.08);
  border-radius: 3px;
  box-shadow: 0 18px 40px rgba(28, 39, 51, 0.2), 0 2px 4px rgba(28, 39, 51, 0.08);
  color: var(--ink);
  transform: rotate(0.5deg);
}
body.diorama .spot-card::before {
  background-color: rgba(214, 186, 140, 0.9);
  background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.28) 0 4px, transparent 4px 8px);
}
body.diorama .spot-card h2 {
  display: block;
  margin: 4px 0 8px;
  padding: 0;
  background: none;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: 0.03em;
  color: var(--ink);
}
body.diorama .spot-card .badge {
  transform: none;
  background: transparent;
  color: var(--ink-2);
  border: 1px solid rgba(28, 39, 51, 0.22);
  border-radius: 999px;
  padding: 2px 11px;
  font-family: var(--font-ui);
  font-size: 11.5px;
  font-weight: 500;
}
body.diorama .spot-card p { color: var(--ink-2); font-size: 14px; line-height: 1.85; }
body.diorama .spot-card .card-address { color: var(--ink-3); font-size: 12.5px; }
body.diorama .spot-card .btn { border: 1px solid rgba(28, 39, 51, 0.16); border-radius: 8px; background: #fff; color: var(--ink); box-shadow: none; }
body.diorama .spot-card .btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: none; }
body.diorama .spot-card .card-close { background: #fff; border: 1px solid rgba(28, 39, 51, 0.16); color: var(--ink-2); }
body.diorama .card-photo { box-shadow: 0 4px 12px rgba(28, 39, 51, 0.28); }

/* ポラロイド */
.polaroid { font-family: var(--font-serif); color: var(--ink); border-radius: 2px; box-shadow: 0 10px 22px rgba(28, 39, 51, 0.24), 0 1px 0 #fff inset; }
.pol-name { font-family: var(--font-serif); font-size: 12.5px; font-weight: 700; letter-spacing: 0.04em; }
.pol-sub { font-family: var(--font-ui); font-size: 10.5px; color: var(--ink-3); letter-spacing: 0.04em; }
.tape { font-family: var(--font-ui); font-size: 10px; font-weight: 700; letter-spacing: 0.06em; color: #4d4046; }
.tape-pink { background-color: rgba(232, 164, 184, 0.92); }
.tape-yellow { background-color: rgba(236, 208, 124, 0.95); color: #5d4c1d; }
@media (max-width: 720px) { .pol-name { font-size: 11px; } }

/* プロペラHUD */
.prop-hud { background: var(--panel); border: 1px solid var(--panel-border); box-shadow: var(--soft-shadow); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-family: var(--font-ui); color: var(--ink); }
.prop-label { color: var(--ink-3); font-size: 10.5px; letter-spacing: 0.06em; }
.prop-text b { font-family: var(--font-logo); font-weight: 500; font-size: 15px; letter-spacing: 0.03em; }

/* ミニマップのまわり */
.mr-glow { background: radial-gradient(circle, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0) 70%); opacity: 0.7; }
.mr-ring { filter: drop-shadow(0 4px 10px rgba(28, 39, 51, 0.28)); }
.mr-monitor {
  background: #f3f5f7;
  box-shadow: 0 0 0 2px rgba(184, 146, 74, 0.95), 0 0 0 4px #fff, inset 0 0 12px rgba(28, 39, 51, 0.2), 0 6px 20px rgba(28, 39, 51, 0.25);
}
.mr-readout { background: var(--panel); border: 1px solid var(--panel-border); box-shadow: var(--soft-shadow); }
.mr-name { color: var(--ink); font-family: var(--font-ui); font-weight: 700; letter-spacing: 0.04em; }
.mr-name.is-idle { color: var(--ink-3); }
.mr-dist { color: var(--brass-ink); font-family: var(--font-logo); }
.mr-hdg { color: var(--ink-3); font-family: var(--font-logo); letter-spacing: 0.06em; }
.mr-btn { color: var(--ink-2); background: #fff; border: 1px solid rgba(28, 39, 51, 0.14); }
.mr-btn:hover { border-color: var(--brass); box-shadow: none; }
.mr-btn[aria-pressed="true"], .mr-btn[aria-pressed="true"]#mr-expand { border-color: var(--brass); background: rgba(184, 146, 74, 0.12); }

/* 読み込み・通知 */
.loader { background: linear-gradient(180deg, #cde2ef, #eef2f1); color: var(--ink-3); letter-spacing: 0.08em; }
.loader-ring { border-color: rgba(28, 39, 51, 0.12); border-top-color: var(--brass); border-right-color: transparent; }
.toast { color: var(--ink); background: rgba(253, 252, 250, 0.97); border: 1px solid rgba(28, 39, 51, 0.16); }

/* 扉のあと、島へ「瞬間移動」して着地する勢い（ほんの少し手前から引いて落ち着く） */
body.diorama #cesiumContainer.rv-arrive { animation: rv-arrive 1.1s cubic-bezier(.12, .7, .2, 1) both; }
@keyframes rv-arrive {
  from { transform: scale(1.14); filter: brightness(1.25) saturate(0.85); }
  to   { transform: scale(1);    filter: none; }
}
body.lite #cesiumContainer.rv-arrive { animation: none; }
@media (prefers-reduced-motion: reduce) { body.diorama #cesiumContainer.rv-arrive { animation: none; } }

/* 右下の小ボタン：絵文字をやめ、文字で何のボタンか分かるように */
.mr-btns { gap: 5px; }
.mr-btn { width: auto; min-width: 0; height: 24px; padding: 0 9px; font-family: var(--font-ui); font-size: 11px; font-weight: 600; letter-spacing: 0.03em; white-space: nowrap; }
#mr-sound[aria-pressed="false"] { opacity: 1; color: var(--ink-3); background: rgba(28, 39, 51, 0.05); border-color: rgba(28, 39, 51, 0.12); }

/* 右下ボタン：記号だけの正方形（現在地／音／戻す） */
.mr-btns { gap: 6px; flex: 0 0 auto; }
.mr-btn { width: 28px; height: 28px; padding: 0; display: inline-grid; place-items: center; }
.mr-btn svg { display: block; }

/* 空：扉の画面と同じ、かすんだやさしい空に（彩度を落として木の質感と合わせる） */
body.diorama #cesiumContainer { background: linear-gradient(180deg, #a6cbe5 0%, #cde2ef 50%, #eef2f1 100%); }
body.diorama #cesiumContainer::before {
  background:
    radial-gradient(ellipse 24% 8% at 14% 70%, rgba(255, 255, 255, 0.55) 0 30%, transparent 72%),
    radial-gradient(ellipse 28% 8% at 80% 62%, rgba(255, 255, 255, 0.5) 0 30%, transparent 72%),
    radial-gradient(ellipse 24% 7% at 52% 90%, rgba(255, 255, 255, 0.55) 0 30%, transparent 72%),
    radial-gradient(ellipse 18% 5% at 66% 20%, rgba(255, 255, 255, 0.4) 0 30%, transparent 70%);
  filter: blur(6px);
}
/* ふち取りのやわらかい影（写真のレンズのような周辺減光） */
body.diorama #cesiumContainer::after {
  content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(ellipse at 50% 52%, transparent 58%, rgba(60, 48, 40, 0.16) 100%);
}
body.lite #cesiumContainer::after { display: none; }

/* 空：明け方のようなやわらかい光。右上に太陽のにじみ、地平線に近いほど淡いピーチ */
body.diorama #cesiumContainer { background:
  radial-gradient(ellipse 46% 40% at 84% 4%, rgba(255, 240, 210, 0.85) 0%, rgba(255, 236, 205, 0.35) 45%, transparent 75%),
  linear-gradient(180deg, #8fbbe0 0%, #bcd9ec 38%, #e6eef0 70%, #fbeedd 100%); }

/* ===== Gemini 指示の仕上げ：空・ポラロイド・Memoringの木枠 ===== */
body.diorama #cesiumContainer { background:
  radial-gradient(ellipse 46% 40% at 84% 4%, rgba(255, 250, 235, 0.7) 0%, transparent 70%),
  linear-gradient(to bottom, #7ec0ee 0%, #b3dcf5 52%, #e0f6ff 100%); }
body.diorama #cesiumContainer::before { filter: blur(3px); opacity: 0.95; }

/* ポラロイド：紙の厚み・やわらかい落ち影・テープの透け感と、ギザギザの切り口 */
.polaroid {
  background: linear-gradient(165deg, #fffefa 0%, #f7f1e4 100%);
  box-shadow: none;
  filter: drop-shadow(0 1px 1px rgba(70, 45, 20, 0.30)) drop-shadow(0 7px 8px rgba(70, 45, 20, 0.22)) drop-shadow(0 16px 20px rgba(70, 45, 20, 0.18));
}
.polaroid::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: radial-gradient(ellipse at 20% 0%, rgba(255, 255, 255, 0.7), transparent 55%), linear-gradient(0deg, rgba(120, 90, 50, 0.06), transparent 30%);
}
.pol-pic { box-shadow: inset 0 0 0 1px rgba(60, 40, 20, 0.10), inset 0 3px 7px rgba(60, 40, 20, 0.18); }
.tape {
  background-image:
    linear-gradient(100deg, rgba(255, 255, 255, 0.38) 0 14%, transparent 14% 42%, rgba(255, 255, 255, 0.20) 42% 56%, transparent 56%),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.035) 0 1px, transparent 1px 3px);
  clip-path: polygon(0 0, 100% 0, 98% 12%, 100% 25%, 98% 38%, 100% 50%, 98% 62%, 100% 75%, 98% 88%, 100% 100%, 0 100%, 2% 88%, 0 75%, 2% 62%, 0 50%, 2% 38%, 0 25%, 2% 12%);
  mix-blend-mode: multiply;
}
.tape-pink { background-color: rgba(238, 150, 180, 0.85); }
.tape-yellow { background-color: rgba(244, 208, 96, 0.88); }

/* Memoring：木のリングフレームのやわらかい立体感 */
.mr-ring { filter: drop-shadow(0 2px 2px rgba(70, 40, 15, 0.35)) drop-shadow(0 8px 12px rgba(70, 40, 15, 0.28)); }


/* =========================================================
   仕上げ（phase28）：高度表示とスポットチップを、落ち着いた質感に統一
   ・かわいい黄色／ピンクをやめ、墨色＋真鍮の一色づかいに
   ・角丸・線の太さ・影を共通化（ヘアラインの枠＋ごく淡い影）
   ========================================================= */
body.diorama .prop-hud {
  gap: 10px;
  padding: 7px 16px 7px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(28, 39, 51, 0.08);
  box-shadow: 0 1px 2px rgba(28, 39, 51, 0.06), 0 8px 24px rgba(28, 39, 51, 0.10);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
}
body.diorama .prop-svg { width: 28px; height: 28px; }
body.diorama .prop-text { gap: 3px; line-height: 1; }
body.diorama .prop-label {
  font-family: var(--font-logo);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--ink-3);
}
body.diorama .prop-text b {
  font-family: var(--font-logo);
  font-weight: 400;
  font-size: 17px;
  letter-spacing: 0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

body.diorama .spot-chips { gap: 6px; padding: 4px 2px 10px; scrollbar-width: none; }
body.diorama .spot-chips::-webkit-scrollbar { display: none; }
body.diorama .chip {
  gap: 9px;
  padding: 0 16px;
  height: 36px;
  border-radius: 12px;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(28, 39, 51, 0.08);
  box-shadow: 0 1px 2px rgba(28, 39, 51, 0.06), 0 6px 18px rgba(28, 39, 51, 0.08);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  transition: transform 0.2s cubic-bezier(.2, .7, .2, 1), background 0.2s, box-shadow 0.2s, color 0.2s;
}
body.diorama .chip:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(28, 39, 51, 0.14);
  box-shadow: 0 1px 2px rgba(28, 39, 51, 0.08), 0 10px 24px rgba(28, 39, 51, 0.12);
}
body.diorama .chip.is-active {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
  box-shadow: 0 1px 2px rgba(28, 39, 51, 0.2), 0 10px 24px rgba(28, 39, 51, 0.24);
}
body.diorama .chip-dot { width: 5px; height: 5px; background: var(--brass); box-shadow: none; }
body.diorama .chip.is-visited .chip-dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--brass); }
body.diorama .chip.is-active .chip-dot { background: #e4c88a; box-shadow: none; }

/* Cesium の表記：法的に必要なので残しつつ、目立たなくする */
body.diorama .cesium-viewer-bottom { opacity: 0.5; }
body.diorama .cesium-widget-credits { font-size: 9px; }
body.diorama .cesium-credit-logoContainer { display: inline-block; transform: scale(0.8); transform-origin: left bottom; }

@media (max-width: 720px) {
  body.diorama .chip { padding: 0 13px; height: 34px; font-size: 12px; letter-spacing: 0.06em; }
  body.diorama .prop-text b { font-size: 15px; }
}

/* =========================================================
   スタジオ背景（phase30）：水色の空をやめ、あたたかいオフホワイトの無地スタジオに
   ?sky=1 で従来の青空に戻る（body.studio が付かない）
   ========================================================= */
body.studio.diorama #cesiumContainer {
  background:
    radial-gradient(ellipse 78% 68% at 50% 42%, #f6f3ee 0%, #efebe4 52%, #e4ded5 100%);
}
body.studio.diorama #cesiumContainer::before { display: none; }          /* 雲は出さない */
body.studio.diorama #cesiumContainer::after {                             /* 周辺減光：茶色でなく、ごく淡いベージュ */
  background: radial-gradient(ellipse at 50% 50%, transparent 62%, rgba(120, 100, 80, 0.10) 100%);
}
body.studio .loader { background: radial-gradient(ellipse 78% 68% at 50% 42%, #f6f3ee 0%, #e4ded5 100%); }


/* ===== お気に入り（?fav=1）：★ボタン・チップの★・入れ替えの小窓 ===== */
.card-fav.is-on { background: #fff3d6; border-color: #e0a73c; color: #8a5a10; }
.chip-star { color: #e0a73c; font-size: 12px; line-height: 1; margin-right: 2px; }
.fav-swap {
  position: fixed; z-index: 60; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(360px, calc(100vw - 32px)); padding: 18px 18px 14px;
  display: flex; flex-direction: column; gap: 8px;
  background: #fbf8f2; border: 1px solid #e4dccd; border-radius: 16px;
  box-shadow: 0 18px 48px rgba(60, 40, 20, 0.28);
}
.fav-swap-title { margin: 0 0 4px; font-size: 14px; line-height: 1.6; color: #3b3126; }
.fav-swap .btn { width: 100%; justify-content: center; }

/* 一覧の★ボタン（?fav=1） */
.fav-star { background: none; border: 0; padding: 0 6px 0 0; margin: 0; font-size: 18px; line-height: 1; color: #c9b9a0; cursor: pointer; }
.fav-star.is-on { color: #e0a73c; }

/* ---- カードのボタン：お気に入り／行った は色分け、リンクは下線 ---- */
body.diorama .spot-card #card-fav { background: #fff6e0; border-color: #e0a73c; color: #8a5a10; }
body.diorama .spot-card #card-fav.is-on { background: #ffe19a; border-color: #d28f1c; color: #6b4306; }
body.diorama .spot-card #card-visited { background: #eaf6ee; border-color: #6fb487; color: #25673e; }
body.diorama .spot-card #card-visited[aria-pressed="true"] { background: #3f9a62; border-color: #3f9a62; color: #fff; }
#card-official, #card-gmaps { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }

/* ヘッダーのお気に入り：ロゴの右に、飾りのない文字だけで静かに並べる（ボタンの枠・影・色面は使わない） */
.app-header { gap: 20px; }
.header-favs { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 22px; margin-left: 8px; padding-left: 20px; border-left: 1px solid var(--panel-border); overflow-x: auto; scrollbar-width: none; }
.header-favs::-webkit-scrollbar { display: none; }
.header-favs[hidden] { display: none; }
.hf-item { all: unset; box-sizing: border-box; display: inline-flex; align-items: baseline; gap: 7px; cursor: pointer; white-space: nowrap; font-size: 13px; letter-spacing: 0.05em; color: var(--ink-3); padding: 4px 0; border-bottom: 1px solid transparent; transition: color 0.18s, border-color 0.18s; }
.hf-item:hover { color: var(--ink); }
.hf-item:focus-visible { outline: 1px solid var(--brass); outline-offset: 3px; }
.hf-item.is-active { color: var(--ink); border-bottom-color: var(--ink); }
.hf-star { font-size: 9px; line-height: 1; color: #b8893a; transform: translateY(-1px); }
@media (max-width: 720px) { .header-favs { gap: 16px; padding-left: 12px; } .hf-item { font-size: 12px; } }

/* 一覧：追加日の列 */
.spot-table .col-added, .spot-table .cell-added { white-space: nowrap; font-size: 12.5px; letter-spacing: 0.04em; color: var(--ink-3); padding-left: 8px; padding-right: 8px; }

/* お気に入りの番号（コース順）と、ヘッダーと地図の連動 */
.hf-num { font-size: 11px; font-weight: 600; color: #8a5f14; margin-left: -4px; letter-spacing: 0; }
.hf-item.is-hover { color: var(--ink); border-bottom-color: #b8893a; }
.hf-item.is-drop { border-bottom-color: #b8893a; box-shadow: -10px 0 0 -9px #b8893a; }
.hf-item[draggable="true"] { cursor: grab; }

/* 一覧：文字が1文字ずつ折れないように（カテゴリ・行った・ボタンは改行しない） */
.spot-table th, .spot-table td.cell-visited, .spot-table .col-visited { white-space: nowrap; }
.spot-table .badge { display: inline-block; white-space: nowrap; padding: 4px 13px; border-radius: 999px; font-size: 12.5px; line-height: 1.4; }
@media (min-width: 900px) {
  .cell-actions { flex-wrap: nowrap; min-width: 0; }
  .cell-actions .btn { white-space: nowrap; padding-left: 12px; padding-right: 12px; }
}

/* ---- 行きたい場所の追加 ---- */
.table-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.btn-add-spot { font: inherit; font-size: 14px; font-weight: 600; letter-spacing: 0.04em; white-space: nowrap; padding: 9px 18px; border-radius: 8px; border: 1px solid var(--brass-ink); background: var(--brass-ink); color: #fff; cursor: pointer; }
.btn-add-spot:hover { filter: brightness(1.08); }
.btn-add-spot:focus-visible, .ad-input:focus-visible { outline: 2px solid var(--brass-ink); outline-offset: 2px; }
.btn-remove { color: #8a3b2e; }
.add-overlay { position: fixed; inset: 0; z-index: 3000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(40, 28, 16, 0.45); }
.add-panel { width: min(440px, 100%); max-height: 100%; overflow: auto; padding: 22px 22px 18px; border-radius: 14px; background: #fbf7f0; color: var(--ink); box-shadow: 0 18px 50px rgba(30, 20, 8, 0.35); }
.ad-title { margin: 0 0 12px; font-size: 18px; font-weight: 700; letter-spacing: 0.04em; }
.ad-field { display: block; margin: 0 0 12px; }
.ad-field > span { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; color: rgba(28, 39, 51, 0.7); }
.ad-input { width: 100%; box-sizing: border-box; font: inherit; font-size: 15px; padding: 9px 11px; border-radius: 8px; border: 1px solid rgba(28, 39, 51, 0.22); background: #fff; color: var(--ink); }
.ad-textarea { resize: vertical; min-height: 56px; }
.ad-help { display: block; margin: 5px 0 0; font-size: 12px; line-height: 1.5; color: rgba(28, 39, 51, 0.62); }
.ad-pinned { margin: 0 0 8px; }
.ad-coord { margin: 0 0 12px; font-size: 12px; color: rgba(28, 39, 51, 0.7); font-variant-numeric: tabular-nums; }
.ad-msg { min-height: 1.2em; margin: 0 0 8px; font-size: 13px; color: #8a3b2e; line-height: 1.5; }
.ad-actions { display: flex; justify-content: flex-end; gap: 10px; }
.ad-actions .btn { padding: 9px 18px; cursor: pointer; }
.ad-actions .btn:disabled { opacity: 0.45; cursor: not-allowed; }
.ad-gem { margin-bottom: 4px; padding-bottom: 6px; border-bottom: 1px dashed rgba(28, 39, 51, 0.18); }
.ad-copy { margin-bottom: 12px; padding: 8px 14px; cursor: pointer; }
.ad-check { margin: -4px 0 12px; padding: 7px 14px; cursor: pointer; }
.ad-links { margin: -4px 0 12px; font-size: 12px; color: rgba(28, 39, 51, 0.65); }
.ad-links a { margin-left: 10px; color: var(--brass-ink); text-decoration: underline; text-underline-offset: 3px; }
#card-insta { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.pin-bar { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 3100; width: min(480px, calc(100% - 24px)); padding: 14px 16px; border-radius: 14px; background: #fbf7f0; color: var(--ink); box-shadow: 0 12px 36px rgba(30, 20, 8, 0.35); text-align: center; }
.pin-bar-text { margin: 0 0 10px; font-size: 13px; line-height: 1.5; }
.pin-bar-actions { display: flex; justify-content: center; gap: 10px; }
.pin-bar-actions .btn { padding: 9px 20px; cursor: pointer; }

/* ミニマップ（Memoring）の大きさ：画面の高さと幅に合わせて、上のカード・左下のHUD・下の読み取り枠に被らない範囲でできるだけ大きく */
:root { --mr-size: 220px; }
@supports (height: 100dvh) {
  :root { --mr-size: clamp(200px, calc(100dvh - 475px), 320px); }
  @media (max-width: 720px) { :root { --mr-size: clamp(142px, min(calc(100dvh - 490px), calc(100vw - 170px)), 300px); } }
}
@supports not (height: 100dvh) {
  :root { --mr-size: clamp(200px, calc(100vh - 475px), 320px); }
  @media (max-width: 720px) { :root { --mr-size: clamp(142px, min(calc(100vh - 490px), calc(100vw - 170px)), 300px); } }
}

/* ミニマップにマウスを乗せたときの拡大は控えめに（上のカードに被らないように） */
@media (hover: hover) and (pointer: fine) { .memoring:hover { transform: scale(1.05); } }


/* =========================================================
   扉のあとの演出：雲の晴れ・暗い木の額縁・かすみ空・夕焼け
   ========================================================= */
.rv-clouds { position: absolute; inset: 0; z-index: 6; pointer-events: none; overflow: hidden; }
.rv-cloud {
  position: absolute; border-radius: 50%; will-change: transform, opacity;
  background: radial-gradient(ellipse at 50% 50%, #ffffff 0 42%, rgba(255, 255, 255, 0.85) 56%, rgba(255, 255, 255, 0) 74%);
  animation: rv-cloud-away 2.7s cubic-bezier(.45, 0, .75, .55) forwards;
}
@keyframes rv-cloud-away {
  0%   { opacity: 1; transform: none; }
  34%  { opacity: 1; transform: translate(calc(var(--dx) * 0.08), calc(var(--dy) * 0.08)) scale(1.04); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.55); }
}
.rv-fx { position: absolute; inset: 0; z-index: 3; pointer-events: none; --rv-whole: 0; }
.rv-fx > div { position: absolute; inset: 0; }
/* もや・夕焼けは外した（イメージ画像の明るい紙の背景に合わせる）。残すなら下の display を消す */
.rv-fx-haze, .rv-fx-sunset { display: none; }
/* 木の額縁：細く薄く（イメージに寄せて控えめ） */
.rv-fx-frame {
  box-shadow:
    inset 0 0 0 3px #6b4a2c, inset 0 0 0 4px #c9a36f,
    inset 0 0 40px 6px rgba(80, 50, 20, 0.12);
}
body.lite .rv-fx-sunset, body.lite .rv-fx-haze { display: none; }
@media (prefers-reduced-motion: reduce) { .rv-cloud { animation-duration: 0.9s; } }

/* 常設の雲：島全体を見渡すときだけ、島のふちにふわっと浮かぶ（ゆっくり漂う） */
.rv-fx-clouds { position: absolute; inset: 0; overflow: hidden; opacity: calc(var(--rv-whole, 0) * 0.78); transition: opacity 0.4s; }
.rv-fx-cloud {
  position: absolute; display: block; width: 30vw; height: 17vh; filter: blur(1.5px);
  background:
    radial-gradient(ellipse 26% 42% at 22% 62%, #fff 0 62%, rgba(255,255,255,0) 100%),
    radial-gradient(ellipse 30% 56% at 44% 42%, #fff 0 64%, rgba(255,255,255,0) 100%),
    radial-gradient(ellipse 26% 46% at 66% 56%, #fff 0 62%, rgba(255,255,255,0) 100%),
    radial-gradient(ellipse 22% 36% at 82% 68%, #fff 0 58%, rgba(255,255,255,0) 100%),
    radial-gradient(ellipse 60% 26% at 50% 86%, rgba(214, 205, 195, 0.55) 0 50%, rgba(255,255,255,0) 100%);
  animation: rv-cloud-drift 46s ease-in-out infinite alternate;
}
.rv-fxc-a { left: -9vw; top: 9vh; transform: scale(1.0); }
.rv-fxc-b { right: -8vw; top: 3vh; transform: scale(1.15); animation-duration: 58s; animation-delay: -12s; }
.rv-fxc-c { left: -12vw; bottom: 14vh; transform: scale(1.2); animation-duration: 52s; animation-delay: -20s; }
.rv-fxc-d { right: 10vw; bottom: -6vh; transform: scale(1.3); animation-duration: 64s; animation-delay: -30s; }
.rv-fxc-e { left: 36vw; top: -7vh; transform: scale(0.8); animation-duration: 70s; animation-delay: -6s; }
@keyframes rv-cloud-drift { from { translate: -1.8vw 0; } to { translate: 2.4vw 1.2vh; } }
body.lite .rv-fx-clouds { display: none; }
@media (prefers-reduced-motion: reduce) { .rv-fx-cloud { animation: none; } }

/* ===== 紙もの化（ノート風パネル）：スポットのカードを、方眼ノートにマステで貼った見た目に ===== */
body.diorama .spot-card {
  background-color: #f7f0dd;
  background-image:
    linear-gradient(rgba(120, 150, 175, 0.26) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 150, 175, 0.26) 1px, transparent 1px);
  background-size: 19px 19px;
  border: 1px solid #dccfa8;
  border-radius: 4px 6px 6px 4px;
  box-shadow: 0 10px 26px rgba(80, 58, 30, 0.28), 0 1px 0 rgba(255, 255, 255, 0.7) inset;
  backdrop-filter: none; -webkit-backdrop-filter: none;
  transform: rotate(0.7deg);
  padding-top: 24px;
}
body.diorama .spot-card::before {   /* 上のマスキングテープ */
  content: ''; position: absolute; top: -13px; left: 38%; width: 104px; height: 26px;
  transform: rotate(-3.5deg);
  background: repeating-linear-gradient(115deg, rgba(255, 214, 120, 0.88) 0 9px, rgba(255, 233, 170, 0.88) 9px 18px);
  box-shadow: 0 1px 3px rgba(90, 60, 20, 0.25); opacity: 0.92;
}
body.diorama .spot-card::after {   /* 左のとじ穴風の線 */
  content: ''; position: absolute; top: 10px; bottom: 10px; left: 9px; width: 0;
  border-left: 2px dotted rgba(150, 120, 90, 0.35);
}
body.diorama .spot-card h2 { font-family: "Zen Kurenaido", "Noto Sans JP", sans-serif; letter-spacing: 0.04em; color: #5a4636; }
body.diorama .spot-card p { font-family: "Zen Kurenaido", "Noto Sans JP", sans-serif; line-height: 1.9; }
body.diorama .spot-card .card-photo { background: #fff; padding: 7px 7px 20px; box-shadow: 0 3px 8px rgba(70, 50, 25, 0.3); transform: rotate(-2deg); border-radius: 2px; }

/* phase39b: 狭いスマホ幅でヘッダーが切れないように */
@media (max-width: 480px) {
  .mode-btn { padding: 6px 8px; font-size: 11px; letter-spacing: 0; white-space: nowrap; }
  .logo { font-size: 15px; }
  /* お気に入りはヘッダーの下に細い帯で出す（横にスクロール） */
  .header-favs:not([hidden]) { position: fixed; top: var(--header-h); left: 0; right: 0; z-index: 30; margin: 0; padding: 6px 14px; border-left: none; gap: 16px; background: rgba(251,248,242,0.9); border-bottom: 1px solid rgba(160,128,90,0.25); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
}


/* phase40: 扉のあと、3Dの準備ができるまで見せる高画質の静止画（見た目は3Dの全体ビューと同じ構図） */
.poster { position: absolute; inset: 0; z-index: 2; overflow: hidden; background: #efebe4; transition: opacity 0.8s ease; }
.poster[hidden] { display: none; }
.poster.is-out { opacity: 0; pointer-events: none; }
.poster-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; user-select: none; -webkit-user-drag: none; }
.poster-pill {
  position: absolute; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; padding: 7px 14px; border-radius: 999px;
  background: rgba(251, 248, 242, 0.92); border: 1px solid rgba(160, 128, 90, 0.35); color: #6b4a2c;
  font-size: 12px; letter-spacing: 0.08em; box-shadow: 0 4px 14px rgba(80, 50, 20, 0.14); white-space: nowrap;
}
.poster-pill-bar { display: block; width: 72px; height: 4px; border-radius: 2px; background: rgba(160, 128, 90, 0.25); overflow: hidden; }
.poster-pill-bar b { display: block; height: 100%; width: 0%; background: #c9a36f; border-radius: 2px; transition: width 0.3s ease; }
.poster.is-out .poster-pill { opacity: 0; transition: opacity 0.3s ease; }
body.poster-capture header, body.poster-capture .hud, body.poster-capture .memoring, body.poster-capture .polaroids,
body.poster-capture .rv-fx, body.poster-capture .rv-clouds, body.poster-capture .comfort-vignette, body.poster-capture .warp-cover,
body.poster-capture #door-screen, body.poster-capture .prop-hud, body.poster-capture .spot-chips, body.poster-capture .cesium-viewer-bottom, body.poster-capture .cesium-widget-credits, body.poster-capture .loader, body.poster-capture #poster { visibility: hidden !important; }

.poster.is-door .poster-pill { display: none; }


/* phase41: 暖色のビネット（四隅をうっすら茶色く）。上下のぼかしは重いので ?tilt=1 のときだけ */
body.studio.diorama #cesiumContainer::after {
  background: radial-gradient(ellipse at 50% 48%, transparent 58%, rgba(110, 78, 46, 0.17) 100%);
}
body.tilt .rv-tiltshift {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  backdrop-filter: blur(2.5px); -webkit-backdrop-filter: blur(2.5px);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 14%, transparent 82%, #000 100%);
  mask-image: linear-gradient(to bottom, #000 0%, transparent 14%, transparent 82%, #000 100%);
}
