/* ==========================================================================
 * 蘭陽映誌 · LANYANG FIELD CINEMA — Apple Liquid Glass (iOS 26 / visionOS)
 * Translucent refractive glass capsules, specular edge caustics, spring motion,
 * 2.39:1 cinema letterbox transitioning seamlessly into fullscreen Free Walk & 4K Compare.
 * ========================================================================== */

:root {
  /* 2.39:1 寬銀幕電影比例畫框尺寸與安全邊界，讓所有 Liquid Glass UI 皆浮於電影畫面環境內部 */
  --cinema-ratio: 2.39;
  --stage-w: min(100vw, calc(100dvh * var(--cinema-ratio)));
  --stage-h: min(100dvh, calc(100vw / var(--cinema-ratio)));
  --frame-x: max(0px, calc((100vw - var(--stage-w)) * 0.5));
  --frame-y: max(0px, calc((100dvh - var(--stage-h)) * 0.5));
  --frame: var(--stage-h);
  --ui-pad-x: clamp(14px, 2.2vw, 28px);
  --interaction-hud-bottom: 72px;
  --gold: #f1d9a4;
  --gold-soft: rgba(241, 217, 164, 0.72);
  --teal: #8ff5de;
  --ink: rgba(248, 250, 252, 0.96);
  --ink-dim: rgba(232, 238, 245, 0.68);

  /* Core Apple Liquid Glass surface tokens */
  --lg-bg: linear-gradient(
    148deg,
    rgba(255, 255, 255, 0.22) 0%,
    rgba(18, 28, 40, 0.30) 52%,
    rgba(12, 22, 34, 0.36) 100%
  );
  --lg-bg-deep: linear-gradient(
    152deg,
    rgba(255, 255, 255, 0.16) 0%,
    rgba(14, 24, 36, 0.52) 52%,
    rgba(8, 16, 26, 0.64) 100%
  );
  --lg-border: rgba(255, 255, 255, 0.34);
  --lg-border-subtle: rgba(255, 255, 255, 0.22);
  --lg-blur: blur(20px) saturate(185%) brightness(1.06);
  --lg-shadow:
    inset 0 1px 0.5px rgba(255, 255, 255, 0.62),
    inset 0 -1px 1px rgba(170, 224, 255, 0.20),
    inset 1px 0 0.5px rgba(255, 255, 255, 0.24),
    0 14px 40px rgba(0, 0, 0, 0.36),
    0 2px 10px rgba(0, 0, 0, 0.22);
  --lg-shadow-hover:
    inset 0 1px 1px rgba(255, 255, 255, 0.78),
    inset 0 -1px 1px rgba(241, 217, 164, 0.28),
    0 18px 46px rgba(0, 0, 0, 0.42);
  --spring: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #060d15;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

button, select, input { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; }
button:focus-visible, select:focus-visible {
  outline: 2px solid rgba(241, 217, 164, 0.78);
  outline-offset: 2px;
}
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  outline: none;
}
input[type="range"]:focus,
input[type="range"]:focus-visible {
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(145deg, #ffffff 0%, #f1d9a4 100%);
  border: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.42), 0 0 0 2px rgba(255, 255, 255, 0.18);
  cursor: pointer;
  transition: transform 0.18s var(--spring), box-shadow 0.18s var(--spring);
}
input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.14);
  box-shadow: 0 2px 14px rgba(241, 217, 164, 0.65), 0 0 0 3px rgba(255, 255, 255, 0.28);
}
#compare input[type="range"]::-webkit-slider-thumb {
  background: linear-gradient(145deg, #ffffff 0%, #8ff5de 100%);
}
[hidden], body:not([data-mode="walk"]) #wave9-interact-hud { display: none !important; }

/* 2.39:1 寬銀幕電影比例實境畫框（置中於純黑劇院背景，UI 全置於電影畫面內部） */
#stage {
  position: fixed;
  left: var(--frame-x);
  top: var(--frame-y);
  width: var(--stage-w);
  height: var(--stage-h);
  overflow: hidden;
  background: #050f19;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 24px 80px rgba(0, 0, 0, 0.78);
}
#world {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  outline: none;
  cursor: grab;
}
#world:active { cursor: grabbing; }
body:not([data-gpu-state="ready"]) #stage {
  background: #050f19 url("./opening.webp") center / cover no-repeat;
}
body:not([data-gpu-state="ready"]) #world { visibility: hidden; }

/* 電影比例已由 #stage 本身承載，隱藏舊版蓋在畫面外的毛玻璃上下黑條 */
.cinema-matte {
  display: none;
}

/* Reusable Apple Liquid Glass Capsule Surface（含肩部折射色散高光與游標反射流光） */
.lg-capsule {
  position: relative;
  background: var(--lg-bg);
  border: 1px solid var(--lg-border);
  backdrop-filter: var(--lg-blur);
  -webkit-backdrop-filter: var(--lg-blur);
  box-shadow:
    inset 0 1px 0.8px rgba(255, 255, 255, 0.72),
    inset 0 -1.5px 1.5px rgba(143, 245, 222, 0.24),
    inset 1.5px 0 1.2px rgba(241, 217, 164, 0.20),
    inset -1.5px 0 1.2px rgba(143, 245, 222, 0.16),
    0 14px 40px rgba(0, 0, 0, 0.36),
    0 2px 10px rgba(0, 0, 0, 0.22);
  border-radius: 999px;
  overflow: hidden;
  transition: box-shadow 0.3s var(--spring), border-color 0.3s var(--spring), transform 0.3s var(--spring);
}
.lg-capsule::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(125% 95% at var(--mx, 22%) var(--my, 0%), rgba(255, 255, 255, 0.36) 0%, rgba(241, 217, 164, 0.08) 32%, rgba(255, 255, 255, 0.0) 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.0) 38%, rgba(143, 245, 222, 0.08) 100%);
  pointer-events: none;
}
.lg-capsule::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.68) 0%, rgba(241, 217, 164, 0.26) 35%, rgba(143, 245, 222, 0.30) 70%, rgba(255, 255, 255, 0.45) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.65;
  pointer-events: none;
}
.lg-capsule:hover {
  box-shadow:
    inset 0 1px 1.2px rgba(255, 255, 255, 0.84),
    inset 0 -1.5px 2px rgba(143, 245, 222, 0.32),
    inset 1.5px 0 1.5px rgba(241, 217, 164, 0.28),
    0 18px 46px rgba(0, 0, 0, 0.44);
}
body[data-weather="rain"] .lg-capsule,
body[data-weather="rain"] .lg-panel {
  border-color: rgba(182, 228, 255, 0.42);
  box-shadow:
    inset 0 1px 1px rgba(220, 244, 255, 0.72),
    inset 0 -1.5px 2px rgba(120, 215, 255, 0.30),
    0 16px 44px rgba(4, 14, 24, 0.48);
}

.lg-panel {
  position: fixed;
  z-index: 26;
  background: var(--lg-bg-deep);
  border: 1px solid var(--lg-border);
  backdrop-filter: blur(22px) saturate(195%) brightness(1.06);
  -webkit-backdrop-filter: blur(22px) saturate(195%) brightness(1.06);
  box-shadow:
    inset 0 1px 1.2px rgba(255, 255, 255, 0.68),
    inset 0 -1.5px 1.5px rgba(143, 245, 222, 0.24),
    inset 1px 0 1px rgba(241, 217, 164, 0.18),
    0 24px 64px rgba(0, 0, 0, 0.52);
  border-radius: 24px;
  padding: 18px 20px;
  overflow: hidden;
  transform: perspective(920px) rotateX(var(--py, 0deg)) rotateY(var(--px, 0deg));
  transition:
    transform 0.28s var(--spring),
    box-shadow 0.3s var(--spring),
    border-color 0.3s var(--spring);
  will-change: transform;
}
.lg-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(95% 70% at var(--mx, 20%) var(--my, 0%), rgba(255, 255, 255, 0.24) 0%, rgba(241, 217, 164, 0.08) 32%, rgba(255, 255, 255, 0.0) 60%),
    linear-gradient(165deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.0) 42%);
  pointer-events: none;
}
/* HorizonX BorderGlow 雙色光譜微邊緣流光（隨游標 --mx / --my 動態點亮邊框） */
.lg-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.25px;
  background:
    radial-gradient(220px circle at var(--mx, 20%) var(--my, 10%), rgba(255, 248, 224, 0.85) 0%, rgba(241, 217, 164, 0.38) 36%, rgba(143, 245, 222, 0.26) 66%, transparent 100%),
    linear-gradient(140deg, rgba(255, 255, 255, 0.42) 0%, rgba(143, 245, 222, 0.18) 52%, rgba(241, 217, 164, 0.24) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.78;
  pointer-events: none;
}
body[data-weather="rain"] .lg-panel::after {
  background:
    radial-gradient(220px circle at var(--mx, 20%) var(--my, 10%), rgba(220, 246, 255, 0.88) 0%, rgba(124, 216, 255, 0.42) 40%, rgba(143, 245, 222, 0.22) 72%, transparent 100%),
    linear-gradient(140deg, rgba(210, 240, 255, 0.45) 0%, rgba(110, 205, 255, 0.22) 100%);
}
@keyframes lgPanelIn {
  from { opacity: 0; transform: perspective(920px) translateY(8px) scale(0.975); }
  to { opacity: 1; transform: perspective(920px) rotateX(var(--py, 0deg)) rotateY(var(--px, 0deg)) translateY(0) scale(1); }
}
#card:not([hidden]),
#settingsPanel:not([hidden]),
#chapterPanel:not([hidden]) {
  animation: lgPanelIn 0.26s var(--spring) both;
}

/* ==========================================================================
 * Top Cinema Header (Apple Liquid Glass Pills)
 * ========================================================================== */
.cinema-header {
  position: fixed;
  top: calc(var(--frame-y) + 14px);
  left: calc(var(--frame-x) + var(--ui-pad-x));
  right: calc(var(--frame-x) + var(--ui-pad-x));
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}
.cinema-header > * { pointer-events: auto; }

.identity-pill {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 7px 18px 7px 9px;
}
.seal-badge {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font: 600 18px/1 "Noto Serif TC", "PMingLiU", Georgia, serif;
  color: var(--gold);
  background: linear-gradient(145deg, rgba(241, 217, 164, 0.28), rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(241, 217, 164, 0.65);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.72), 0 4px 12px rgba(0, 0, 0, 0.25);
  font-style: normal;
  flex-shrink: 0;
}
.identity-text { display: flex; flex-direction: column; gap: 1px; }
.identity-text h1 {
  margin: 0;
  font: 600 16px/1.15 "Noto Serif TC", "PMingLiU", serif;
  letter-spacing: 0.12em;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
}
.identity-text small {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--gold);
  opacity: 0.92;
  white-space: nowrap;
}

.tools-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px 6px;
}
.glass-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  color: rgba(250, 252, 255, 0.92);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
  transition: background 0.24s var(--spring), color 0.24s var(--spring), box-shadow 0.24s var(--spring), transform 0.2s var(--spring);
}
.glass-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}
.glass-btn:active { transform: scale(0.96); }
.glass-btn[aria-pressed="true"],
.glass-btn[aria-expanded="true"],
.glass-btn.active {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.34), rgba(241, 217, 164, 0.22));
  color: #fff9e8;
  box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, 0.72), 0 4px 14px rgba(0, 0, 0, 0.22);
}
.glass-btn .tag-state {
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(241, 217, 164, 0.20);
  color: var(--gold);
  border: 1px solid rgba(241, 217, 164, 0.38);
}
.glass-btn.icon-only { padding: 7px 11px; font-size: 15px; line-height: 1; }

/* ==========================================================================
 * Editorial Floating Chapter Caption (Bottom-Left above Transport Bar)
 * ========================================================================== */
#caption {
  position: fixed;
  left: calc(var(--frame-x) + clamp(20px, 3vw, 44px));
  bottom: calc(var(--frame-y) + 74px);
  z-index: 12;
  pointer-events: none;
  transition: opacity 0.45s var(--spring), transform 0.55s var(--spring);
}
#caption small {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.24em;
  color: var(--gold);
  background: rgba(10, 22, 34, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
#caption h2 {
  margin: 10px 0 0;
  font: 500 clamp(30px, 3.6vw, 60px)/1.18 "Noto Serif TC", "PMingLiU", Georgia, serif;
  letter-spacing: 0.16em;
  color: #fff;
  text-shadow: 0 4px 28px rgba(0, 0, 0, 0.62), 0 1px 4px rgba(0, 0, 0, 0.5);
}
body[data-mode="walk"] #caption,
body[data-mode="orbit"] #caption,
body[data-mode="pano"] #caption,
body[data-card-open="true"] #caption {
  opacity: 0;
  transform: translateY(14px);
}

/* ==========================================================================
 * Bottom Cinema Transport Bar & Liquid Glass Segmented Mode Switcher
 * ========================================================================== */
.cinema-footer {
  position: fixed;
  bottom: calc(var(--frame-y) + 14px);
  left: calc(var(--frame-x) + var(--ui-pad-x));
  right: calc(var(--frame-x) + var(--ui-pad-x));
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  pointer-events: none;
}
.cinema-footer > * { pointer-events: auto; }

.transport-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 14px 5px 7px;
  flex: 1 1 320px;
  max-width: 660px;
  min-width: 220px;
}
.transport-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.90);
  transition: background 0.2s var(--spring), transform 0.18s var(--spring);
  flex-shrink: 0;
}
.transport-btn:hover { background: rgba(255, 255, 255, 0.18); color: #fff; }
.transport-btn:active { transform: scale(0.92); }
.transport-btn.play-main {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 12px;
}

#track {
  display: flex;
  gap: 5px;
  align-items: center;
  flex: 1;
  min-width: 80px;
  margin: 0 10px;
}
#track button {
  flex: 1;
  padding: 12px 0;
  display: flex;
  align-items: center;
}
#track i {
  display: block;
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  transition: background 0.25s, height 0.2s var(--spring);
}
#track button:hover i { height: 5px; background: rgba(255, 255, 255, 0.55); }
#track .past i { background: rgba(241, 217, 164, 0.72); }
#track .on i {
  height: 4px;
  background: linear-gradient(90deg, #f8e5b8 var(--progress, 0%), rgba(255, 255, 255, 0.26) var(--progress, 0%));
  box-shadow: 0 0 10px rgba(241, 217, 164, 0.55);
}

#timecode {
  font: 600 11.5px/1 "SF Mono", Consolas, monospace;
  color: var(--ink-dim);
  min-width: 42px;
  text-align: right;
  flex-shrink: 0;
}

/* Segmented Mode Switcher (Apple Liquid Glass Lens Tabs) */
.mode-switcher {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px;
  flex-shrink: 0;
}
.mode-switcher button {
  position: relative;
  padding: 8px 15px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  color: rgba(244, 248, 252, 0.86);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
  transition: all 0.28s var(--spring);
}
.mode-switcher button:hover { color: #fff; background: rgba(255, 255, 255, 0.12); }
.mode-switcher button.active {
  background: linear-gradient(150deg, rgba(255, 250, 236, 0.90) 0%, rgba(235, 212, 162, 0.84) 100%);
  color: #0e1c24;
  text-shadow: none;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.95),
    0 4px 16px rgba(0, 0, 0, 0.28);
}
.mode-switcher button#pano.active {
  background: linear-gradient(150deg, rgba(164, 252, 232, 0.90) 0%, rgba(92, 224, 198, 0.84) 100%);
  color: #06211d;
}

/* ==========================================================================
 * Liquid Glass Floating Popovers (Chapters, Settings, 3D Landmark Pin & Card)
 * ========================================================================== */
.lg-panel h3 {
  margin: 0 0 12px;
  font: 600 16px/1.2 "Noto Serif TC", "PMingLiU", serif;
  letter-spacing: 0.1em;
  color: var(--gold);
}

#chapterPanel {
  left: calc(var(--frame-x) + var(--ui-pad-x));
  bottom: calc(var(--frame-y) + 70px);
  width: min(340px, calc(var(--stage-w) - 28px));
  max-height: min(62vh, calc(var(--stage-h) - 144px));
  overflow-y: auto;
}
#chapterList { display: flex; flex-direction: column; gap: 3px; }
#chapterList button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 14px;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  color: rgba(248, 251, 255, 0.92);
  transition: background 0.2s var(--spring), transform 0.2s var(--spring);
}
#chapterList button:hover { background: rgba(255, 255, 255, 0.14); transform: translateX(2px); }
#chapterList button.current {
  background: linear-gradient(135deg, rgba(241, 217, 164, 0.26), rgba(143, 245, 222, 0.14));
  border: 1px solid rgba(241, 217, 164, 0.42);
  color: #fff8e4;
}
#chapterList small {
  width: 24px;
  font: 700 11px/1 "SF Mono", Consolas, monospace;
  color: var(--gold);
  flex-shrink: 0;
}

#settingsPanel {
  right: calc(var(--frame-x) + var(--ui-pad-x));
  top: calc(var(--frame-y) + 68px);
  width: 304px;
  max-height: calc(var(--stage-h) - 140px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(241, 217, 164, 0.36) transparent;
}
#settingsPanel::-webkit-scrollbar,
#chapterPanel::-webkit-scrollbar {
  width: 5px;
}
#settingsPanel::-webkit-scrollbar-track,
#chapterPanel::-webkit-scrollbar-track {
  background: transparent;
}
#settingsPanel::-webkit-scrollbar-thumb,
#chapterPanel::-webkit-scrollbar-thumb {
  background: rgba(241, 217, 164, 0.36);
  border-radius: 999px;
}
#settingsPanel::-webkit-scrollbar-thumb:hover,
#chapterPanel::-webkit-scrollbar-thumb:hover {
  background: rgba(241, 217, 164, 0.62);
}
.setting-row {
  margin: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
}
.setting-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: rgba(244, 248, 252, 0.92);
}
.setting-row output {
  font: 600 12px/1 "SF Mono", Consolas, monospace;
  color: var(--gold);
}
.setting-row input[type="range"] {
  width: 100%;
  accent-color: #f1d9a4;
  cursor: pointer;
}
.setting-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 0;
  font-size: 12.5px;
}
.setting-toggle-row > span {
  white-space: nowrap;
  flex-shrink: 0;
}
.mini-pill {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.24);
  transition: 0.2s var(--spring);
}
.mini-pill:hover { background: rgba(255, 255, 255, 0.22); }
.mini-pill.on {
  background: linear-gradient(135deg, rgba(241, 217, 164, 0.34), rgba(143, 245, 222, 0.22));
  border-color: rgba(241, 217, 164, 0.65);
  color: #fff6dc;
}
.setting-select {
  background: rgba(14, 26, 38, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 10px;
  padding: 5px 10px;
  font-size: 12px;
  color: #fff;
}
.telemetry-line {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font: 600 11px/1.4 "SF Mono", Consolas, monospace;
  color: var(--teal);
}
.portal-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--gold);
  text-decoration: none;
  opacity: 0.9;
}
.portal-link:hover { text-decoration: underline; opacity: 1; }

/* 3D Projected Floating Landmark Pin + Apple Liquid Glass USR Theater Drawer */
#pin {
  position: fixed;
  z-index: 18;
  transform: translate(-50%, -115%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(145deg, rgba(16, 36, 52, 0.72), rgba(10, 22, 34, 0.84));
  border: 1px solid rgba(241, 217, 164, 0.62);
  backdrop-filter: blur(20px) saturate(190%);
  -webkit-backdrop-filter: blur(20px) saturate(190%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68), 0 10px 28px rgba(0, 0, 0, 0.44);
  white-space: nowrap;
  max-width: min(460px, 88vw);
  transition: transform 0.22s var(--spring), background 0.22s, border-color 0.22s;
}
#pin:hover {
  transform: translate(-50%, -120%) scale(1.03);
  background: linear-gradient(145deg, rgba(28, 56, 76, 0.86), rgba(12, 28, 42, 0.92));
  border-color: rgba(143, 245, 222, 0.86);
}
#pin .pin-code {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  font: 700 11px/1 "SF Mono", Consolas, monospace;
  color: #0b1c26;
  background: linear-gradient(135deg, #f8e5b8, #d8b56c);
}
#pin .pin-name {
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.03em;
}
#pin .pin-cta {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  color: #07221d;
  background: linear-gradient(135deg, #98f7e4, #5ad8c2);
  flex-shrink: 0;
}

/* 升級版右側停靠 USR 計畫影音展演面板（全模式穩定可讀，不隨鏡頭抖動） */
#card {
  right: calc(var(--frame-x) + var(--ui-pad-x));
  top: calc(var(--frame-y) + 68px);
  bottom: auto;
  left: auto;
  width: min(510px, calc(100vw - 28px));
  max-height: calc(var(--stage-h) - 144px);
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.66;
  padding: 18px 20px 20px;
  z-index: 28;
  scrollbar-width: thin;
  scrollbar-color: rgba(241, 217, 164, 0.38) transparent;
}
#card::-webkit-scrollbar { width: 5px; }
#card::-webkit-scrollbar-thumb { background: rgba(241, 217, 164, 0.38); border-radius: 999px; }
.card-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.card-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fff3d2;
  background: rgba(241, 217, 164, 0.18);
  border: 1px solid rgba(241, 217, 164, 0.44);
}
#closeCard {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}
#closeCard:hover { background: rgba(255, 255, 255, 0.28); }
#cardTitle {
  margin: 0 0 6px;
  font: 600 18px/1.35 "Noto Serif TC", "PMingLiU", serif;
  letter-spacing: 0.04em;
  color: #fff;
}
.card-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 11.5px;
  color: var(--gold-soft);
  margin-bottom: 12px;
}

/* 互動影片劇院盒（支援本機 MP4 / YouTube 分段與紀實海報預覽） */
.card-video-wrap {
  margin: 10px 0 12px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(6, 14, 22, 0.88);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.42);
}
.video-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.video-tab-btn {
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  color: rgba(235, 245, 252, 0.86);
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.16);
  transition: all 0.2s var(--spring);
}
.video-tab-btn:hover { background: rgba(255, 255, 255, 0.18); color: #fff; }
.video-tab-btn.active {
  background: linear-gradient(135deg, rgba(241, 217, 164, 0.36), rgba(143, 245, 222, 0.26));
  border-color: rgba(241, 217, 164, 0.72);
  color: #fffaf0;
}
.video-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #07111a;
  overflow: hidden;
}
.video-stage video,
.video-stage iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  object-fit: cover;
  background: #000;
}
.video-poster-card {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 14px 16px;
  background-size: cover;
  background-position: center;
}
.video-poster-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 16, 26, 0.18) 0%, rgba(6, 16, 26, 0.45) 45%, rgba(6, 16, 26, 0.92) 100%);
}
.video-poster-card > * { position: relative; z-index: 1; }
.vp-time-pill {
  position: absolute !important;
  top: 10px;
  left: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  font: 600 11px/1.2 "SF Mono", Consolas, monospace;
  color: #9bf7e5;
  background: rgba(6, 20, 30, 0.76);
  border: 1px solid rgba(143, 245, 222, 0.42);
}
.vp-title { font-size: 14px; font-weight: 700; color: #fff; margin-bottom: 3px; }
.vp-speaker { font-size: 11.5px; color: var(--gold); margin-bottom: 6px; }
.vp-caption { font-size: 12px; line-height: 1.5; color: rgba(240, 247, 255, 0.90); margin-bottom: 8px; }
.vp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.vp-btn {
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: #091a24;
  background: linear-gradient(135deg, #f8e5b8, #d8b56c);
  cursor: pointer;
}
.vp-btn.secondary {
  color: #e9f6ff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
}
.vp-btn:hover { filter: brightness(1.08); }
.video-clip-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  font-size: 11.5px;
  color: rgba(226, 238, 248, 0.86);
  background: rgba(255, 255, 255, 0.04);
  border-top: 1px solid rgba(255, 255, 255, 0.10);
}
.video-clip-foot strong { color: var(--gold); font-weight: 600; }

.card-portal-cta {
  width: 100%;
  margin: 0 0 10px;
  padding: 9px 14px;
  border-radius: 12px;
  font-size: 12.5px;
  font-weight: 700;
  color: #08201d;
  background: linear-gradient(135deg, #a4fce8 0%, #f1d9a4 100%);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  transition: transform 0.2s var(--spring), filter 0.2s;
}
.card-portal-cta:hover { transform: translateY(-1px); filter: brightness(1.06); }

#card p { margin: 8px 0 10px; color: rgba(245, 249, 255, 0.92); }
.card-highlights {
  margin: 0 0 12px;
  padding-left: 18px;
  color: rgba(235, 244, 252, 0.88);
  font-size: 12.2px;
}
.card-highlights li { margin: 4px 0; }
#cardSite { display: block; font-size: 11.5px; color: var(--gold-soft); margin-bottom: 8px; }
#cardSdgs { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px; }
.sdg-chip {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(143, 245, 222, 0.16);
  border: 1px solid rgba(143, 245, 222, 0.42);
  color: var(--teal);
}
.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}
.usr-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
  color: rgba(240, 248, 255, 0.94);
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.22);
  transition: all 0.2s var(--spring);
}
.usr-link-btn:hover { background: rgba(255, 255, 255, 0.22); color: #fff; }
.usr-link-btn.primary {
  color: #0b1b26;
  background: linear-gradient(135deg, #f8e5b8, #deb972);
  border-color: rgba(255, 242, 206, 0.85);
}
.card-sync-note {
  margin-top: 10px;
  font-size: 10.5px;
  color: rgba(196, 218, 232, 0.65);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

/* SDIR 畫作游標懸停提示 + 虛擬穿越現實光學過場劇院 */
#paintingTooltip {
  position: fixed;
  z-index: 32;
  pointer-events: none;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #fff9e8;
  background: rgba(10, 24, 38, 0.86);
  border: 1px solid rgba(241, 217, 164, 0.72);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(14px);
  transform: translate(14px, -110%);
  white-space: nowrap;
}
#stage {
  transition: filter 0.12s linear;
}
#realityFlash {
  position: fixed;
  inset: 0;
  z-index: 44;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 50% 50%, rgba(255, 250, 234, 0.96) 0%, rgba(164, 245, 230, 0.72) 48%, rgba(8, 22, 36, 0.92) 100%);
  transition: opacity 0.24s ease;
}
#realityPortal {
  position: fixed;
  inset: 0;
  z-index: 48;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(14px, 3vw, 34px);
  background: radial-gradient(circle at 50% 24%, rgba(14, 38, 56, 0.92) 0%, rgba(5, 13, 22, 0.97) 100%);
  backdrop-filter: blur(26px) saturate(160%);
  -webkit-backdrop-filter: blur(26px) saturate(160%);
  animation: lgPanelIn 0.38s var(--spring) both;
}
#realityPortal[hidden] { display: none; }
.rp-shell {
  width: min(1160px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 26px;
  padding: clamp(16px, 2.4vw, 28px);
  background: rgba(11, 24, 38, 0.86);
  border: 1px solid rgba(241, 217, 164, 0.45);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.68), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.rp-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.rp-eyebrow {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #9bf7e5;
  background: rgba(143, 245, 222, 0.14);
  border: 1px solid rgba(143, 245, 222, 0.38);
  margin-bottom: 6px;
}
.rp-header h2 {
  margin: 0;
  font: 600 clamp(19px, 2.2vw, 28px)/1.3 "Noto Serif TC", "PMingLiU", serif;
  color: #fff;
}
.rp-header p { margin: 4px 0 0; font-size: 13px; color: var(--gold-soft); }
.rp-back-btn {
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  color: #0b1c26;
  background: linear-gradient(135deg, #f8e5b8, #d8b56c);
  white-space: nowrap;
  flex-shrink: 0;
}
.rp-back-btn:hover { filter: brightness(1.08); }
.rp-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr);
  gap: 18px;
  align-items: start;
}
@media (max-width: 900px) {
  .rp-grid { grid-template-columns: 1fr; }
}
.rp-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.rp-segment-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rp-seg-card {
  width: 100%;
  text-align: left;
  padding: 11px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition: all 0.2s var(--spring);
}
.rp-seg-card:hover { background: rgba(255, 255, 255, 0.14); transform: translateX(2px); }
.rp-seg-card.active {
  background: linear-gradient(135deg, rgba(241, 217, 164, 0.24), rgba(143, 245, 222, 0.16));
  border-color: rgba(241, 217, 164, 0.72);
}
.rp-seg-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}
.rp-seg-time {
  font: 600 11px/1 "SF Mono", Consolas, monospace;
  color: var(--teal);
}
.rp-seg-sub {
  margin-top: 3px;
  font-size: 11.5px;
  color: rgba(230, 240, 250, 0.78);
}

/* Split-Screen 4K Cycles 原畫對照 Curtain */
#divide {
  position: fixed;
  top: var(--frame-y);
  bottom: var(--frame-y);
  left: calc(var(--frame-x) + var(--stage-w) * var(--split, 0.5));
  width: 2px;
  z-index: 15;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,0.2), rgba(255,255,255,0.92), rgba(255,255,255,0.2));
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.65);
}
#compare {
  position: fixed;
  bottom: calc(var(--frame-y) + 70px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 22;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 18px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
#compare input[type="range"] {
  width: 150px;
  accent-color: #8ff5de;
  cursor: ew-resize;
}

/* Center Loading & Toast Status Pill */
#ult-status {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 35;
  padding: 13px 26px;
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
  transition: opacity 0.4s var(--spring);
  width: max-content;
  max-width: calc(var(--stage-w) - 36px);
  text-align: center;
}
#ult-retry {
  position: fixed;
  z-index: 36;
  bottom: calc(var(--frame-y) + max(24px, 12%));
  left: 50%;
  transform: translateX(-50%);
}
#notice {
  position: fixed;
  top: calc(var(--frame-y) + 76px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 600;
  color: #fff9ea;
}

/* ==========================================================================
 * Wave 9 v5.3 — 頂部探索方位羅盤條 & 可收合 Liquid Glass 迷你探索小地圖
 * ========================================================================== */
.compass-pill {
  position: fixed;
  top: calc(var(--frame-y) + 14px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 19;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 16px 5px;
  min-width: 248px;
  max-width: min(310px, calc(var(--stage-w) - 380px));
  pointer-events: none;
}
.compass-tape-wrap {
  position: relative;
  width: 248px;
  max-width: 100%;
  height: 26px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 14%, #000 86%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 14%, #000 86%, transparent 100%);
}
.compass-canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.compass-caret {
  position: absolute;
  left: 50%;
  top: 0;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--gold);
  filter: drop-shadow(0 0 4px rgba(241, 217, 164, 0.8));
}
.compass-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 1px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: rgba(244, 248, 252, 0.9);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
}
.compass-deg {
  font-family: "SF Mono", Consolas, monospace;
  color: var(--gold);
}
.compass-dot { opacity: 0.45; }
.compass-near { color: var(--teal); }

.minimap-card {
  left: calc(var(--frame-x) + var(--ui-pad-x));
  bottom: calc(var(--frame-y) + 74px);
  z-index: 19;
  width: 190px;
  padding: 10px 11px 9px;
  border-radius: 22px;
}
.minimap-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 7px;
}
.minimap-title {
  font: 600 11.5px/1 "Noto Serif TC", "PMingLiU", serif;
  letter-spacing: 0.12em;
  color: var(--gold);
}
.minimap-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.minimap-mini-btn {
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  color: rgba(245, 250, 255, 0.9);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  transition: background 0.18s var(--spring), transform 0.16s var(--spring);
}
.minimap-mini-btn:hover {
  background: rgba(241, 217, 164, 0.26);
  border-color: rgba(241, 217, 164, 0.55);
}
.minimap-mini-btn:active { transform: scale(0.93); }
.minimap-canvas-box {
  position: relative;
  width: 168px;
  height: 168px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.20);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.45);
}
.minimap-canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.minimap-north-tag {
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  padding: 1px 5px;
  border-radius: 999px;
  font: 700 9px/1.2 "SF Mono", Consolas, monospace;
  color: var(--gold);
  background: rgba(8, 18, 28, 0.72);
  border: 1px solid rgba(241, 217, 164, 0.38);
  pointer-events: none;
}
.minimap-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 7px;
  font-size: 10px;
  color: var(--ink-dim);
}
.mm-zone {
  font-weight: 600;
  color: rgba(248, 252, 255, 0.92);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mm-legend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9.5px;
  white-space: nowrap;
}
.mm-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-left: 2px;
}
.mm-dot-bridge { background: #ffd97d; }
.mm-dot-lm { background: #8ff5de; }
.mm-dot-eco { background: #6ad6ff; }

.minimap-collapsed-pill {
  position: fixed;
  left: calc(var(--frame-x) + var(--ui-pad-x));
  bottom: calc(var(--frame-y) + 74px);
  z-index: 19;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 11.5px;
  font-weight: 600;
  color: rgba(248, 252, 255, 0.94);
}
.mm-pill-icon { color: var(--gold); font-size: 13px; }
.minimap-collapsed-pill kbd {
  padding: 1px 5px;
  border-radius: 6px;
  font: 700 10px/1.2 "SF Mono", Consolas, monospace;
  color: var(--gold);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.24);
}

/* Mobile Touch D-Pad (shown only on coarse pointers in Walk mode) */
#joystick {
  position: fixed;
  right: calc(var(--frame-x) + 16px);
  bottom: calc(var(--frame-y) + 124px);
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
#joystick > div { display: flex; gap: 5px; }
#joystick button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--lg-bg);
  border: 1px solid var(--lg-border);
  backdrop-filter: var(--lg-blur);
  -webkit-backdrop-filter: var(--lg-blur);
  box-shadow: var(--lg-shadow);
  font-size: 15px;
  touch-action: none;
}

@media (max-width: 1020px) {
  .mode-switcher button { padding: 7px 11px; font-size: 12px; }
  .transport-pill { padding: 4px 10px 4px 6px; }
}
@media (max-width: 760px) {
  :root { --ui-pad-x: 6px; --interaction-hud-bottom: 34px; }
  .cinema-header { top: calc(var(--frame-y) + 4px); }
  .identity-pill { padding: 2px 6px; gap: 4px; }
  .seal-badge { width: 22px; height: 22px; font-size: 13px; }
  .identity-text small { display: none; }
  .identity-text h1 { font-size: 13px; }
  .glass-btn, .glass-btn.icon-only { padding: 3px 6px; font-size: 11px; }
  .tools-pill { padding: 2px; }
  .cinema-footer { bottom: calc(var(--frame-y) + 4px); gap: 3px; }
  .transport-pill { flex: 0 1 auto; min-width: 0; padding: 2px; gap: 1px; }
  .transport-btn { width: 21px; height: 22px; font-size: 13px; }
  #timecode, #track { display: none; }
  .mode-switcher { padding: 2px; }
  .mode-switcher button { font-size: 10px; padding: 5px 3px; }
  #caption { left: 8px; bottom: calc(var(--frame-y) + 33px); }
  #caption h2 { margin: 2px 0; font-size: 18px; }
  #caption small { padding: 1px 4px; font-size: 9px; }
  #settingsPanel, #chapterPanel, #card {
    top: calc(var(--frame-y) + 32px) !important; bottom: auto;
    max-height: calc(var(--stage-h) - 64px); overflow-y: auto; padding: 8px;
  }
  #compare { bottom: calc(var(--frame-y) + 35px); font-size: 10px; padding: 4px; gap: 5px; }
  #compare input { max-width: 24vw; }
  #joystick { bottom: calc(var(--frame-y) + 34px); gap: 1px; }
  #joystick button { width: 22px; height: 22px; font-size: 11px; }
  #wave9-interact-hud { max-height: calc(var(--stage-h) - 72px); overflow: auto; }
  #notice { top: calc(var(--frame-y) + 46px); max-width: 90vw; }
  .compass-pill {
    top: calc(var(--frame-y) + 34px);
    min-width: 170px;
    max-width: calc(var(--stage-w) - 16px);
    padding: 2px 10px 3px;
  }
  .compass-tape-wrap { width: 158px; height: 20px; }
  .compass-meta { font-size: 9.5px; }
  .minimap-card { bottom: calc(var(--frame-y) + 36px); width: 154px; padding: 7px 8px; }
  .minimap-canvas-box { width: 136px; height: 136px; }
  .minimap-collapsed-pill { bottom: calc(var(--frame-y) + 36px); padding: 4px 9px; font-size: 10.5px; }
}
