:root {
  --accent: #1f7a8c;
  --accent-light: #5cc3d6;
  --glass: rgba(14, 20, 28, 0.62);
  --glass-border: rgba(255, 255, 255, 0.14);
  --text: #f2f5f8;
  --muted: #b5bfcc;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0b0f14; }
body { font-family: Inter, system-ui, sans-serif; color: var(--text); }

#panorama { position: fixed; inset: 0; }

/* Pannellum's own title box duplicates the top bar */
.pnlm-panorama-info { display: none !important; }

/* Leave room for the top bar */
.pnlm-controls-container { top: 64px !important; }

.tour-bar {
  position: fixed; top: 12px; left: 12px; right: 12px;
  display: flex; align-items: center; gap: 16px;
  padding: 8px 14px;
  background: var(--glass); backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border); border-radius: 10px;
  pointer-events: auto; z-index: 10;
}
.tour-bar .home {
  color: var(--accent-light); text-decoration: none; font-weight: 600; white-space: nowrap;
}
.tour-bar .home:hover { text-decoration: underline; }
.tour-bar .bar-action {
  margin-left: auto; color: var(--text); text-decoration: none; font-weight: 600; white-space: nowrap;
  padding: 4px 10px; border: 1px solid var(--glass-border); border-radius: 6px;
}
.tour-bar .bar-action + .bar-action { margin-left: 0; }
.tour-bar .bar-action:hover { background: rgba(255, 255, 255, 0.1); }
.scene-strip[hidden] { display: none; }
.titles { display: flex; gap: 10px; align-items: baseline; min-width: 0; }
#tour-title { font-weight: 700; white-space: nowrap; }
#scene-title { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#scene-title:not(:empty)::before { content: "/ "; }

.scene-strip {
  position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%);
  max-width: calc(100% - 24px);
  display: flex; gap: 8px; padding: 8px;
  overflow-x: auto;
  background: var(--glass); backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border); border-radius: 12px;
  z-index: 10;
}
.scene-strip button {
  flex: 0 0 auto; width: 150px; padding: 0;
  background: none; border: 2px solid transparent; border-radius: 8px;
  color: var(--text); font: inherit; font-size: 0.85rem; cursor: pointer;
  overflow: hidden; text-align: left;
}
.scene-strip button img { display: block; width: 100%; height: 56px; object-fit: cover; }
.scene-strip button span { display: block; padding: 4px 8px; background: rgba(0, 0, 0, 0.35); }
.scene-strip button:hover { border-color: var(--glass-border); }
.scene-strip button.active { border-color: var(--accent-light); }
.scene-strip button:focus-visible { outline: 2px solid var(--accent-light); outline-offset: 2px; }

.tour-error {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  max-width: min(480px, calc(100% - 32px));
  padding: 20px 24px; border-radius: 10px;
  background: var(--glass); border: 1px solid var(--glass-border);
  line-height: 1.5; z-index: 20;
}
.tour-error a { color: var(--accent-light); }

@media (max-width: 600px) {
  /* Title on the first line, buttons in a compact row underneath */
  .tour-bar { flex-wrap: wrap; gap: 6px 8px; padding: 8px 12px; }
  .tour-bar .titles { flex: 1 1 100%; order: -1; }
  .tour-bar .home { order: -2; flex: 1 1 100%; }
  .tour-bar .bar-action { margin-left: 0; padding: 3px 10px; font-size: 0.85rem; }
  .scene-strip button { width: 110px; }
  .scene-strip button img { height: 44px; }
}
.tour-bar .private-badge {
  font-size: 0.72rem; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.12); color: var(--muted); border: 1px solid var(--glass-border);
}

/* Hotspot markers: visible but unobtrusive. The drawn circle is 30px; the
   element itself is 44px so it's easy to tap. (Pannellum centres the element
   on the hotspot's position itself.) */
.vhs {
  width: 44px; height: 44px; cursor: pointer;
  display: grid; place-items: center;
}
.vhs-dot {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(12, 18, 26, 0.38); border: 1.5px solid rgba(255, 255, 255, 0.85);
  color: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  opacity: 0.8; transition: opacity .15s, transform .15s, background .15s;
}
.vhs-dot svg { width: 18px; height: 18px; }
.vhs-info .vhs-dot { font: 600 15px/1 Georgia, 'Times New Roman', serif; }
.vhs:hover .vhs-dot, .vhs:focus-visible .vhs-dot, .vhs.open .vhs-dot {
  opacity: 1; transform: scale(1.12); background: rgba(12, 18, 26, 0.6);
}
.vhs-label, .vhs-card {
  position: absolute; left: 50%; top: 38px; transform: translateX(-50%);
  padding: 3px 9px; border-radius: 6px; white-space: nowrap; pointer-events: none;
  font: 600 12px/1.3 Inter, system-ui, sans-serif; color: #fff; background: rgba(12, 18, 26, 0.72);
  opacity: 0; transition: opacity .15s;
}
.vhs:hover .vhs-label { opacity: 1; }
.vhs-card {
  white-space: normal; width: max-content; max-width: 240px; font-weight: 400; font-size: 13px;
  line-height: 1.45; padding: 8px 11px; text-align: left;
}
.vhs.open .vhs-card { opacity: 1; pointer-events: auto; }
@media (hover: none) { .vhs-label { display: none; } }   /* phones: tapping an arrow just goes there */

/* embed.php: a slimmer bar inside other websites' frames */
body.embed .tour-bar { top: 8px; left: 8px; right: 8px; gap: 10px; padding: 5px 10px; font-size: 0.85rem; flex-wrap: nowrap; }
body.embed .tour-bar .titles { flex: 1 1 auto; order: 0; }
body.embed .tour-bar .bar-action { padding: 2px 8px; font-size: 0.8rem; }
body.embed .pnlm-controls-container { top: 48px !important; }

/* ---------- 3D scenes (Gaussian splats, assets/js/splat-view.js) ---------- */
#splat-view { position: fixed; inset: 0; background: #0b0f14; }
#splat-view[hidden], #panorama[hidden] { display: none; }
#splat-view canvas { display: block; touch-action: none; }
.splat-controls { position: absolute; top: 12px; right: 12px; display: flex; gap: 6px; z-index: 5; }
.splat-controls button {
  padding: 7px 12px; min-height: 36px;
  background: var(--glass); backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border); border-radius: 8px;
  color: var(--text); font: inherit; font-size: 0.85rem; cursor: pointer;
}
.splat-controls button:hover { border-color: var(--accent-light); }
.splat-controls .ico { display: none; }   /* the editor shows icons instead of the labels (editor.css) */
.splat-help {
  position: absolute; left: 50%; bottom: 112px; transform: translateX(-50%);
  max-width: calc(100% - 24px); padding: 6px 12px; border-radius: 8px;
  background: var(--glass); color: var(--muted); font-size: 0.8rem; text-align: center;
  pointer-events: none; z-index: 5;
}
.splat-help[hidden] { display: none; }
.splat-loading {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  padding: 10px 16px; border-radius: 8px; background: var(--glass); z-index: 5;
}
.splat-loading[hidden] { display: none; }
.scene-strip button.is-3d { position: relative; }
.scene-strip button.is-3d::after {
  content: "3D"; position: absolute; top: 4px; right: 4px;
  padding: 1px 5px; border-radius: 4px; background: rgba(0, 0, 0, 0.6);
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.03em;
}
body.embed .splat-controls { top: 48px; }
@media (max-width: 600px) { .splat-help { bottom: 92px; } }
.splat-debug {
  position: absolute; left: 12px; top: 64px; padding: 3px 8px; border-radius: 6px;
  background: rgba(0, 0, 0, 0.6); color: #fff; font: 12px ui-monospace, monospace; z-index: 5; pointer-events: none;
}

/* Tour page (not embed): a close button instead of a title bar, and for the tour's owner a "⋯" menu */
.tour-close, .tour-owner summary {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: var(--glass); backdrop-filter: blur(8px); border: 1px solid var(--glass-border);
  color: var(--text); cursor: pointer;
}
.tour-close { position: fixed; top: 12px; left: 12px; z-index: 10; }
.tour-close svg, .tour-owner summary svg { width: 20px; height: 20px; }
.tour-owner summary svg { fill: currentColor; }
.tour-close:hover, .tour-owner summary:hover { border-color: var(--accent-light); }
.tour-owner { position: fixed; top: 12px; left: 62px; z-index: 10; }
.tour-owner summary { list-style: none; }
.tour-owner summary::-webkit-details-marker { display: none; }
.tour-owner-menu {
  position: absolute; top: 50px; left: 0; min-width: 190px;
  display: flex; flex-direction: column; gap: 2px; padding: 6px;
  background: var(--glass); backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border); border-radius: 10px;
}
.tour-owner-menu a { color: var(--text); text-decoration: none; padding: 8px 10px; border-radius: 6px; white-space: nowrap; }
.tour-owner-menu a:hover { background: rgba(255, 255, 255, 0.1); }
.tour-owner-menu .private-badge {
  align-self: flex-start; margin: 4px 10px; font-size: 0.72rem; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.12); color: var(--muted); border: 1px solid var(--glass-border);
}

/* Hotspot markers over a 3D scene (splat-view.js setHotspots): positioned each frame */
.splat-hotspots { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 3; }
.splat-hs { position: absolute; left: 0; top: 0; pointer-events: auto; transform-origin: 0 0; }
.splat-hs.vhs, .splat-hs.ehs { transform-origin: center; }
