:root {
  --ink: #17212b;
  --muted: #c7d3dc;
  --panel: rgba(18, 27, 34, 0.78);
  --line: rgba(255, 255, 255, 0.22);
  --teal: #17a398;
  --coral: #df6b57;
  --paper: #f6f2eb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: #111b22;
  color: #fff;
  font-family: Inter, "Segoe UI", Tahoma, Arial, sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
}

button,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

.tour-shell,
.tour-viewer,
.tour-pano {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
}

.tour-viewer {
  position: relative;
  overflow: hidden;
  background: #111b22;
}

.tour-pano {
  position: absolute;
  inset: 0;
  touch-action: none;
  user-select: none;
  will-change: opacity, transform;
}

.tour-pano canvas,
.tour-pano div {
  left: 0 !important;
  top: 0 !important;
}

.tour-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 24px;
  background: #111b22;
  color: #fff;
  text-align: center;
}

.tour-fallback strong {
  font-size: clamp(24px, 4vw, 42px);
}

.tour-pano.ready .tour-fallback {
  display: none;
}

.tour-zoom-ripple {
  position: absolute;
  z-index: 18;
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.65);
  animation: tour-zoom-ripple 620ms ease-out forwards;
}

.tour-zoom-fade {
  position: absolute;
  inset: 0;
  z-index: 17;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}

@keyframes tour-zoom-ripple {
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(3.1);
  }
}

.flat-scene {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #111b22;
}

.flat-scene img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #111b22;
}

.tour-controls {
  position: absolute;
  left: 18px;
  top: 50%;
  z-index: 8;
  display: grid;
  gap: 8px;
  transform: translateY(-50%);
}

.tour-controls button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: #fff;
  font-size: 22px;
}

.tour-hotspot {
  position: relative;
  z-index: 12;
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  padding: 0;
  color: #fff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.34);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.tour-hotspot::before {
  content: "";
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #fff;
}

.tour-hotspot span {
  position: absolute;
  top: calc(100% + 8px);
  min-width: 96px;
  max-width: 180px;
  overflow: hidden;
  padding: 6px 9px;
  border-radius: 7px;
  background: rgba(18, 27, 34, 0.84);
  color: #fff;
  font-size: 12px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tour-hotspot.hotspot-scene-link {
  border: 0;
  background: transparent !important;
  box-shadow: none;
}

.tour-hotspot.hotspot-scene-link::before {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  border: 7px solid rgba(255, 255, 255, 0.68);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.12), 0 12px 26px rgba(0, 0, 0, 0.2);
  box-sizing: border-box;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.tour-hotspot.hotspot-scene-link:hover::before,
.tour-hotspot.hotspot-scene-link:focus-visible::before {
  border-color: rgba(17, 27, 34, 0.84);
  background: rgba(17, 27, 34, 0.2);
  box-shadow: 0 0 0 8px rgba(17, 27, 34, 0.14), 0 16px 30px rgba(0, 0, 0, 0.26);
  transform: scale(1.08);
}

.tour-hotspot.hotspot-scene-link span {
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.tour-hotspot.hotspot-scene-link:hover span,
.tour-hotspot.hotspot-scene-link:focus-visible span {
  opacity: 1;
  transform: translateY(0);
}

.tour-toast {
  position: fixed;
  left: 22px;
  bottom: 120px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 44px));
  padding: 12px 14px;
  border-radius: 8px;
  background: #17212b;
  color: #fff;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.3);
}

@media (max-width: 720px) {
  .tour-controls {
    left: 12px;
    top: auto;
    bottom: max(14px, env(safe-area-inset-bottom));
    grid-auto-flow: column;
    grid-template-columns: repeat(3, 44px);
    transform: none;
  }

  .tour-controls button {
    width: 42px;
    height: 42px;
    border-radius: 9px;
    background: rgba(18, 27, 34, 0.72);
    backdrop-filter: blur(10px);
  }

  .tour-hotspot span {
    max-width: min(170px, 60vw);
    font-size: 11px;
  }
}
