* {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

:root {
  --bg:          #0a0c0f;

  --panel:       rgba(20, 23, 28, 0.68);
  --panel-hi:    rgba(44, 50, 60, 0.85);
  --panel-solid: rgba(16, 18, 22, 0.96);

  --stroke:      rgba(255, 255, 255, 0.10);
  --stroke-hi:   rgba(255, 255, 255, 0.22);

  --text:        #eceff4;
  --text-dim:    rgba(236, 239, 244, 0.58);

  --accent:      #e0a86a;
  --accent-rgb:  224, 168, 106;
  --accent-dim:  rgba(224, 168, 106, 0.16);
  --accent-ring: rgba(224, 168, 106, 0.45);

  --shadow:      0 10px 30px rgba(0, 0, 0, 0.50);
  --blur:        blur(16px) saturate(140%);

  --r-sm: 10px;
  --r-md: 13px;
  --r-lg: 18px;
  --r-pill: 999px;

  --ctrl: 44px;
  --pad:  14px;
  --title-h: 0px;
  --ease: cubic-bezier(.4, 0, .2, 1);
}

.mobile { --ctrl: 46px; }

html, body {
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  overflow: hidden;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px;
  background-color: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color-scheme: dark;
}

a, a:hover, a:active, a:visited {
  text-decoration: none;
  color: inherit;
}

#pano {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(120% 120% at 50% 40%, #14181e 0%, var(--bg) 100%);
}

.ctrl:focus-visible,
.scene:focus-visible,
.viewControlButton:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px;
  padding: var(--pad);

  pointer-events: none;
}

.topbar-group {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.topbar-left  { margin-right: auto; }
.topbar-right { margin-left: auto; }

.ctrl {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: var(--ctrl);
  height: var(--ctrl);
  border: 1px solid var(--stroke);
  border-radius: var(--r-md);
  background: var(--panel);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: var(--shadow);
  color: var(--text);
  cursor: pointer;
  pointer-events: auto;
  transition: background .2s var(--ease),
              border-color .2s var(--ease),
              color .2s var(--ease),
              transform .12s var(--ease);
}

.no-touch .ctrl:hover {
  background: var(--panel-hi);
  border-color: var(--stroke-hi);
}

.ctrl:active { transform: scale(.94); }

.ctrl .icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  opacity: .92;
  pointer-events: none;
}

.ctrl-svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

#backHome {
  width: auto;
  padding: 0 14px;
  gap: 8px;
}

#backHome .ctrl-label {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .02em;
  white-space: nowrap;
}

.no-touch #backHome:hover {
  color: var(--accent);
  border-color: var(--accent-ring);
}

#backHome .ctrl-svg { transition: transform .2s var(--ease); }
.no-touch #backHome:hover .ctrl-svg { transform: translateX(-2px); }

@media (max-width: 640px) {
  #backHome { width: var(--ctrl); padding: 0; }
  #backHome .ctrl-label { display: none; }
}

#titleBar {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

#titleBar .sceneName {
  max-width: 100%;
  margin: 0;
  padding: 0 18px;
  height: var(--ctrl);
  line-height: var(--ctrl);
  border: 1px solid var(--stroke);
  border-radius: var(--r-pill);
  background: var(--panel);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: var(--shadow);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: auto;
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

@media (max-width: 640px) {
  :root { --title-h: 36px; }

  #titleBar {
    order: 3;
    flex-basis: 100%;
  }
  #titleBar .sceneName {
    font-size: 12.5px;
    height: var(--title-h);
    line-height: var(--title-h);
  }
}

#fullscreenToggle { display: none; }
body.fullscreen-enabled #fullscreenToggle { display: flex; }

#fullscreenToggle .icon.on,
#autorotateToggle .icon.on { display: none; }
#fullscreenToggle .icon.off,
#autorotateToggle .icon.off { display: block; }

#fullscreenToggle.enabled .icon.on,
#autorotateToggle.enabled .icon.on { display: block; }
#fullscreenToggle.enabled .icon.off,
#autorotateToggle.enabled .icon.off { display: none; }

#autorotateToggle.enabled {
  background: var(--accent-dim);
  border-color: var(--accent-ring);
}

#sceneListToggle .icon.on { display: none; }
#sceneListToggle .icon.off { display: block; }
#sceneListToggle.enabled .icon.on { display: block; }
#sceneListToggle.enabled .icon.off { display: none; }

#sceneListToggle.enabled {
  background: var(--accent-dim);
  border-color: var(--accent-ring);
}

#toggleDeviceOrientation { display: none; }
.mobile #toggleDeviceOrientation { display: flex; }

#toggleDeviceOrientation .disable { display: none; }
#toggleDeviceOrientation.enabled .disable { display: block; }
#toggleDeviceOrientation.enabled .enable { display: none; }

#toggleDeviceOrientation.enabled {
  background: var(--accent-dim);
  border-color: var(--accent-ring);
}

#sceneList {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 25;
  display: flex;
  flex-direction: column;
  width: 290px;
  max-width: 82vw;

  margin: calc(var(--pad) + var(--ctrl) + 10px) 0 0 var(--pad);
  max-height: calc(100% - var(--pad) * 2 - var(--ctrl) - 10px);
  border: 1px solid var(--stroke);
  border-radius: var(--r-lg);
  background: var(--panel-solid);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: var(--shadow);
  overflow: hidden;

  opacity: 0;
  visibility: hidden;
  transform: translateX(-10px) scale(.98);
  transform-origin: top left;
  transition: opacity .22s var(--ease),
              transform .22s var(--ease),
              visibility .22s var(--ease);
}

#sceneList.enabled {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.sceneList-head {
  flex: 0 0 auto;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--stroke);
}

.sceneList-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.sceneList-count {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
}

#sceneList .scenes {
  flex: 1 1 auto;
  margin: 0;
  padding: 8px;
  list-style: none;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .18) transparent;
}

#sceneList .scenes::-webkit-scrollbar { width: 8px; }
#sceneList .scenes::-webkit-scrollbar-track { background: transparent; }
#sceneList .scenes::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .16);
  border-radius: var(--r-pill);
  border: 2px solid transparent;
  background-clip: content-box;
}
#sceneList .scenes::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, .28);
  background-clip: content-box;
}

#sceneList .scene {
  position: relative;
  display: block;
  border-radius: var(--r-sm);
  transition: background .16s var(--ease);
}

#sceneList .scene .text {
  display: block;
  padding: 11px 14px;
  font-size: 13.5px;
  line-height: 1.25;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color .16s var(--ease);
}

.no-touch #sceneList .scene:hover { background: rgba(255, 255, 255, .06); }
.no-touch #sceneList .scene:hover .text { color: var(--text); }

#sceneList .scene.current { background: var(--accent-dim); }

#sceneList .scene.current .text {
  color: var(--accent);
  font-weight: 600;
}

#sceneList .scene.current::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}

body.single-scene #sceneList,
body.single-scene #sceneListToggle { display: none; }

@media (max-width: 640px) {
  #sceneList {
    left: 0;
    right: 0;
    width: auto;
    max-width: none;
    margin: calc(var(--pad) + var(--ctrl) + 10px + var(--title-h) + 10px) var(--pad) var(--pad);
    max-height: calc(100% - var(--pad) * 2 - var(--ctrl) - var(--title-h) - 20px);
    transform: translateY(-8px) scale(.98);
    transform-origin: top center;
  }
}

.viewControls {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: none;
  align-items: center;
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--stroke);
  border-radius: var(--r-pill);
  background: var(--panel);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: var(--shadow);
}

body.view-control-buttons .viewControls { display: flex; }

.viewControls-sep {
  width: 1px;
  height: 22px;
  margin: 0 4px;
  background: var(--stroke);
}

.viewControlButton {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;

  margin: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: background .16s var(--ease);
}

.no-touch .viewControlButton:hover { background: rgba(255, 255, 255, .10); }
.viewControlButton:active { background: rgba(255, 255, 255, .16); }

.viewControlButton .icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  opacity: .9;
  pointer-events: none;
}

@media (max-width: 600px) {
  body.view-control-buttons .viewControls { display: none; }
}

#logo {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  width: 190px;
  opacity: .5;
  pointer-events: none;
}

.mobile #logo { width: 150px; bottom: 18px; }

#logo img {
  display: block;
  width: 100%;
  object-fit: contain;
}

body.view-control-buttons #logo { bottom: 84px; }

.link-hotspot {
  width: 56px;
  height: 56px;
  margin-left: -28px;
  margin-top: -28px;
  opacity: .88;

  transition: opacity .2s var(--ease);
}

.mobile .link-hotspot {
  width: 64px;
  height: 64px;
  margin-left: -32px;
  margin-top: -32px;
}

.no-touch .link-hotspot:hover { opacity: 1; }

.link-hotspot-icon {
  width: 100%;
  height: 100%;
  cursor: pointer;

  -webkit-filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .55));
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .55));
  -webkit-transition: -webkit-transform .2s var(--ease);
  transition: transform .2s var(--ease);
}

.no-touch .link-hotspot:hover .link-hotspot-icon {
  -webkit-transform: scale(1.1);
  transform: scale(1.1);
}

.link-hotspot:after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  padding: 0;
  -webkit-box-sizing: content-box;
  -moz-box-sizing: content-box;
  box-sizing: content-box;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  -webkit-transform: scale(.3);
  transform: scale(.3);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .15);
  animation: sonarEffect 2.2s ease-out infinite;
}

.link-hotspot-tooltip {
  position: absolute;
  left: 100%;
  top: 50%;
  margin-left: 6px;
  max-width: 260px;
  padding: 8px 12px;
  border: 1px solid var(--stroke);
  border-radius: var(--r-sm);
  background: var(--panel-solid);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .01em;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  -webkit-transform: translate(-8px, -50%);
  transform: translate(-8px, -50%);
  transition: -webkit-transform .25s var(--ease),
              transform .25s var(--ease),
              opacity .25s var(--ease);
}

.no-touch .link-hotspot:hover .link-hotspot-tooltip {
  opacity: 1;
  -webkit-transform: translate(0, -50%);
  transform: translate(0, -50%);
  pointer-events: all;
}

.tooltip-fallback .link-hotspot-tooltip { display: none; }
.no-touch .tooltip-fallback .link-hotspot:hover .link-hotspot-tooltip { display: block; }

@keyframes sonarEffect {
  0% {
    opacity: .6;
    -webkit-transform: scale(.3);
    transform: scale(.3);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .15);
  }
  25% {
    opacity: 1;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .15),
                0 0 12px 10px rgba(var(--accent-rgb), .85),
                0 0 0 12px rgba(255, 255, 255, .45);
  }
  100% {
    opacity: 0;
    -webkit-transform: scale(1.6);
    transform: scale(1.6);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .15),
                0 0 12px 10px rgba(var(--accent-rgb), .85),
                0 0 0 12px rgba(255, 255, 255, .45);
  }
}

.info-hotspot {
  line-height: 1.25;
  opacity: .9;
  transition: opacity .2s var(--ease);
}

.no-touch .info-hotspot:hover,
.info-hotspot.visible { opacity: 1; }

.info-hotspot .info-hotspot-header {
  display: flex;
  align-items: center;
  height: 42px;
  max-width: 42px;
  border: 1px solid var(--stroke);
  border-radius: var(--r-pill);
  background: var(--panel-solid);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: var(--shadow);
  cursor: pointer;
  overflow: hidden;
  transition: max-width .35s var(--ease);
}

.desktop.no-touch .info-hotspot:hover .info-hotspot-header { max-width: 320px; }

.info-hotspot .info-hotspot-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
}

.info-hotspot .info-hotspot-icon { width: 18px; height: 18px; }

.info-hotspot .info-hotspot-title-wrapper {
  display: flex;
  align-items: center;
  min-width: 0;
  padding-right: 16px;
}

.info-hotspot .info-hotspot-title {
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.info-hotspot .info-hotspot-close-wrapper,
.info-hotspot .info-hotspot-text { display: none; }

.info-hotspot-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 100;
  width: 440px;
  max-width: calc(100vw - 32px);
  max-height: 76vh;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--stroke);
  border-radius: var(--r-lg);
  background: var(--panel-solid);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
  opacity: 0;
  visibility: hidden;
  -webkit-transform: translate(-50%, -46%) scale(.96);
  transform: translate(-50%, -46%) scale(.96);
  transition: opacity .22s var(--ease),
              -webkit-transform .22s var(--ease),
              transform .22s var(--ease),
              visibility .22s var(--ease);
}

.info-hotspot-modal.visible {
  opacity: 1;
  visibility: visible;
  -webkit-transform: translate(-50%, -50%) scale(1);
  transform: translate(-50%, -50%) scale(1);
}

.info-hotspot-modal .info-hotspot-header {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 4px;
  padding: 6px 6px 6px 14px;
  border-bottom: 1px solid var(--stroke);
}

.info-hotspot-modal .info-hotspot-icon-wrapper { display: none; }

.info-hotspot-modal .info-hotspot-title-wrapper {
  flex: 1 1 auto;
  min-width: 0;
}

.info-hotspot-modal .info-hotspot-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.info-hotspot-modal .info-hotspot-close-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background .16s var(--ease);
}

.no-touch .info-hotspot-modal .info-hotspot-close-wrapper:hover {
  background: rgba(255, 255, 255, .10);
}

.info-hotspot-modal .info-hotspot-close-icon {
  width: 13px;
  height: 13px;
  opacity: .8;
}

.info-hotspot-modal .info-hotspot-text {
  flex: 1 1 auto;
  padding: 16px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-dim);
  overflow-y: auto;
  overscroll-behavior: contain;
}

@media (prefers-reduced-motion: reduce) {
  .link-hotspot:after { animation: none; }
  * { transition-duration: .01ms !important; }
}
