.control-bar {
  top: max(34px, calc(env(safe-area-inset-top, 0px) + 24px));
  bottom: auto;
  width: min(90vw, 1728px);
  color: rgba(34, 34, 34, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.72);
  background:
    radial-gradient(circle at 50% -44%, rgba(255, 255, 255, 0.9), transparent 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.46) 54%, rgba(255, 255, 255, 0.34));
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.82),
    inset 0 -18px 34px rgba(255, 255, 255, 0.16),
    0 18px 42px rgba(20, 20, 20, 0.14);
  backdrop-filter: blur(22px) saturate(165%);
  -webkit-backdrop-filter: blur(22px) saturate(165%);
}

.control-bar,
.control-bar *,
.neen-joystick,
.neen-joystick * {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.control-bar .ctrl-item {
  position: relative;
  flex: 1 1 0;
  flex-direction: row;
  justify-content: center;
  gap: 0;
  min-height: 48px;
  min-width: 48px;
  padding: 6px 12px;
  color: rgba(34, 34, 34, 0.46);
  border-radius: 999px;
  outline: none;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.6);
  isolation: isolate;
  transition:
    flex-grow 220ms ease,
    background 220ms ease,
    color 220ms ease,
    gap 220ms ease,
    padding 220ms ease;
}

.control-bar .ctrl-item svg {
  margin-bottom: 0;
}

.control-bar .ctrl-item span {
  display: inline-block;
  max-width: 0;
  margin: 0;
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-4px);
  transition:
    max-width 220ms ease,
    opacity 180ms ease,
    transform 220ms ease;
}

.control-bar .ctrl-item i,
.control-bar .ctrl-item svg {
  color: currentColor;
}

.control-bar .ctrl-item svg path[fill="#fff"],
.control-bar .ctrl-item svg path[fill="#FFF"],
.control-bar .ctrl-item svg path[fill="white"] {
  fill: currentColor;
}

.control-bar .ctrl-item svg path[stroke="#fff"],
.control-bar .ctrl-item svg path[stroke="#FFF"],
.control-bar .ctrl-item svg path[stroke="white"] {
  stroke: currentColor;
}

.control-bar .ctrl-item:focus,
.control-bar .ctrl-item:focus-visible {
  outline: none;
}

.control-bar .ctrl-item:active {
  background: transparent;
  opacity: 0.82;
}

.ctrl-item.neen-move-active {
  flex-grow: 2.3;
  gap: 10px;
  padding-inline: 18px;
  color: rgba(10, 10, 10, 0.95);
  text-shadow:
    0 1px 1px rgba(255, 255, 255, 0.75),
    0 0 14px rgba(255, 255, 255, 0.66);
}

.control-bar .ctrl-item.active,
.control-bar .ctrl-item[aria-selected="true"] {
  flex-grow: 2.3;
  gap: 10px;
  padding-inline: 18px;
  color: rgba(10, 10, 10, 0.95);
}

.ctrl-item.neen-move-active span,
.control-bar .ctrl-item.active span,
.control-bar .ctrl-item[aria-selected="true"] span {
  max-width: 90px;
  opacity: 1;
  transform: translateX(0);
}

.ctrl-item.neen-move-active::before,
.control-bar .ctrl-item.active::before,
.control-bar .ctrl-item[aria-selected="true"]::before {
  content: "";
  position: absolute;
  inset: 0 2px;
  z-index: -1;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  background:
    radial-gradient(circle at 42% 12%, rgba(255, 255, 255, 0.9), transparent 62%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0.22));
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.9),
    inset 0 -14px 24px rgba(255, 255, 255, 0.18),
    0 12px 28px rgba(28, 24, 20, 0.14);
  backdrop-filter: blur(18px) saturate(170%);
  -webkit-backdrop-filter: blur(18px) saturate(170%);
}

.ctrl-item.neen-move-active i {
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.72));
}

.neen-gallery-poster {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: linear-gradient(180deg, #fbfbfa 0%, #ded8d0 100%);
  opacity: 1;
  visibility: visible;
  transition:
    opacity 320ms ease,
    visibility 0s linear 320ms;
}

.neen-gallery-ready .neen-gallery-poster {
  opacity: 0;
  visibility: hidden;
}

.neen-gallery-poster__spinner {
  width: 34px;
  height: 34px;
  border: 4px solid rgba(158, 91, 108, 0.18);
  border-top-color: rgba(176, 59, 94, 0.72);
  border-radius: 50%;
  animation: neen-gallery-spin 900ms linear infinite;
}

.wrap > .spinner {
  display: none;
}

@keyframes neen-gallery-spin {
  to {
    transform: rotate(360deg);
  }
}

.neen-joystick {
  --neen-joystick-size: 104px;
  position: absolute;
  right: max(24px, env(safe-area-inset-right, 0px));
  bottom: max(52px, env(safe-area-inset-bottom, 0px));
  z-index: 12;
  display: none;
  touch-action: none;
  user-select: none;
  background: transparent;
  pointer-events: none;
}

.neen-joystick.is-floating {
  left: var(--neen-joystick-left);
  top: var(--neen-joystick-top);
  right: auto;
  bottom: auto;
  transform: translate(-50%, -50%);
}

.neen-joystick.is-visible {
  display: block;
  pointer-events: auto;
}

.neen-joystick-pad {
  position: relative;
  width: var(--neen-joystick-size);
  height: var(--neen-joystick-size);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 26%, rgba(255, 255, 255, 0.82), transparent 34%),
    radial-gradient(circle at 68% 78%, rgba(255, 255, 255, 0.16), transparent 46%),
    rgba(255, 255, 255, 0.28);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.78),
    inset 0 -18px 34px rgba(255, 255, 255, 0.12),
    0 16px 36px rgba(61, 52, 42, 0.18);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.neen-joystick-axis {
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  background: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.neen-joystick-axis-vertical {
  width: 2px;
  height: 64%;
}

.neen-joystick-axis-horizontal {
  width: 64%;
  height: 2px;
}

.neen-joystick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 48%;
  height: 48%;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.56) 38%, rgba(255, 255, 255, 0.24) 100%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.86),
    0 9px 22px rgba(54, 46, 38, 0.18);
  transform: translate(-50%, -50%) translate(0, 0);
  pointer-events: none;
}

.neen-vr-fallback-toast {
  position: fixed;
  left: 50%;
  top: max(156px, calc(env(safe-area-inset-top, 0px) + 128px));
  z-index: 20;
  width: min(520px, calc(100vw - 42px));
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  color: rgba(34, 34, 34, 0.92);
  background:
    radial-gradient(circle at 50% -30%, rgba(255, 255, 255, 0.86), transparent 62%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.38));
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.82),
    0 16px 38px rgba(41, 35, 27, 0.18);
  backdrop-filter: blur(22px) saturate(165%);
  -webkit-backdrop-filter: blur(22px) saturate(165%);
  font-size: 14px;
  line-height: 1.35;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -8px);
  transition:
    opacity 200ms ease,
    transform 200ms ease;
}

.neen-vr-fallback-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.neen-controller-panel {
  position: fixed;
  left: max(18px, env(safe-area-inset-left, 0px));
  bottom: max(24px, env(safe-area-inset-bottom, 0px));
  z-index: 13;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  max-width: min(270px, calc(100vw - 132px));
  color: rgba(34, 34, 34, 0.92);
  font-family: Raleway, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  pointer-events: auto;
}

.neen-controller-button {
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  color: rgba(34, 34, 34, 0.94);
  background:
    radial-gradient(circle at 45% -45%, rgba(255, 255, 255, 0.88), transparent 64%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.34));
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.84),
    0 10px 24px rgba(41, 35, 27, 0.13);
  backdrop-filter: blur(18px) saturate(155%);
  -webkit-backdrop-filter: blur(18px) saturate(155%);
  font: inherit;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.neen-controller-button:active {
  opacity: 0.82;
}

.neen-controller-status {
  max-width: 100%;
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 12px;
  color: rgba(40, 40, 40, 0.86);
  background: rgba(255, 255, 255, 0.36);
  backdrop-filter: blur(12px) saturate(135%);
  -webkit-backdrop-filter: blur(12px) saturate(135%);
  font-size: 11px;
  line-height: 1.25;
}

.neen-stereo-active {
  overflow: hidden;
  background: #000;
  width: 100vw;
  height: 100vh;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.neen-stereo-active .control-bar,
.neen-stereo-active .neen-joystick,
.neen-stereo-active .neen-controller-panel,
.neen-stereo-active .report-toggle-wrap {
  display: none !important;
}

.neen-stereo-active .viewer,
.neen-stereo-active main.wrap {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  overflow: hidden !important;
  background: #000 !important;
}

.neen-stereo-active .viewer canvas,
.neen-stereo-active canvas {
  width: 100vw !important;
  height: 100vh !important;
  background: #000;
}

.neen-stereo-active body::before,
body.neen-stereo-active::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  background:
    radial-gradient(ellipse 42% 72% at 25% 50%, transparent 0 63%, rgba(0, 0, 0, .94) 64% 100%),
    radial-gradient(ellipse 42% 72% at 75% 50%, transparent 0 63%, rgba(0, 0, 0, .94) 64% 100%),
    linear-gradient(90deg, #000 0 2.2%, transparent 9% 45.4%, #000 48.7% 51.3%, transparent 54.6% 91%, #000 97.8% 100%),
    linear-gradient(180deg, #000 0 3%, transparent 14% 86%, #000 97% 100%);
}

.neen-stereo-active body::after,
body.neen-stereo-active::after {
  content: "";
  position: fixed;
  left: 50%;
  top: 11vh;
  bottom: 7vh;
  z-index: 31;
  width: 2px;
  pointer-events: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 0 10px rgba(255, 255, 255, .2);
  transform: translateX(-50%);
}

.neen-stereo-exit {
  position: fixed;
  left: max(14px, env(safe-area-inset-left, 0px));
  top: max(12px, env(safe-area-inset-top, 0px));
  z-index: 40;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, 0.38);
  font: 300 32px/38px system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-align: center;
  cursor: pointer;
}

.neen-vr-hotspots {
  position: fixed;
  inset: 0;
  z-index: 34;
  display: none;
  pointer-events: none;
}

.neen-vr-hotspots.is-visible {
  display: block;
}

.neen-vr-hotspot {
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  color: #fff;
  background: rgba(16, 16, 16, 0.48);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.36),
    0 8px 18px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(12px) saturate(135%);
  -webkit-backdrop-filter: blur(12px) saturate(135%);
  font: 600 13px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-align: center;
  pointer-events: auto;
  cursor: pointer;
}

.neen-vr-hotspot.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.neen-vr-move-controls {
  position: fixed;
  left: max(18px, env(safe-area-inset-left, 0px));
  bottom: max(22px, env(safe-area-inset-bottom, 0px));
  z-index: 36;
  display: none;
  grid-template-columns: repeat(3, 42px);
  grid-template-rows: repeat(3, 42px);
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 24px;
  background: rgba(18, 18, 18, 0.34);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.22),
    0 14px 34px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
}

.neen-vr-move-controls.is-visible {
  display: grid;
}

.neen-vr-move-button {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  font: 500 24px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  cursor: pointer;
  touch-action: none;
}

.neen-vr-move-button:active {
  background: rgba(255, 255, 255, 0.24);
}

.neen-vr-move-forward {
  grid-column: 2;
  grid-row: 1;
}

.neen-vr-move-left {
  grid-column: 1;
  grid-row: 2;
}

.neen-vr-move-right {
  grid-column: 3;
  grid-row: 2;
}

.neen-vr-move-back {
  grid-column: 2;
  grid-row: 3;
}

@media (hover: hover) and (pointer: fine) {
  .neen-controller-panel {
    display: none;
  }
}

@media (max-width: 700px), (pointer: coarse) {
  .control-bar {
    top: max(68px, calc(env(safe-area-inset-top, 0px) + 38px));
    left: 50%;
    width: calc(100vw - 42px);
    padding: 7px 10px;
    min-height: 56px;
  }

  .control-bar .ctrl-item {
    min-height: 48px;
    padding: 5px 10px;
  }

  .ctrl-item.neen-move-active::before {
    inset: 0 2px;
  }

  .neen-joystick {
    --neen-joystick-size: 88px;
    right: max(18px, env(safe-area-inset-right, 0px));
    bottom: max(118px, calc(env(safe-area-inset-bottom, 0px) + 118px));
  }

  .neen-vr-fallback-toast {
    top: max(154px, calc(env(safe-area-inset-top, 0px) + 124px));
  }

  .neen-controller-panel {
    left: max(14px, env(safe-area-inset-left, 0px));
    bottom: max(132px, calc(env(safe-area-inset-bottom, 0px) + 132px));
    max-width: min(242px, calc(100vw - 132px));
  }

  .neen-controller-button {
    min-height: 32px;
    padding: 7px 10px;
    font-size: 11px;
  }

  .neen-controller-status {
    font-size: 10px;
  }

  .neen-vr-move-controls {
    left: max(12px, env(safe-area-inset-left, 0px));
    bottom: max(18px, env(safe-area-inset-bottom, 0px));
    grid-template-columns: repeat(3, 38px);
    grid-template-rows: repeat(3, 38px);
    gap: 5px;
    padding: 8px;
  }

  .neen-vr-move-button {
    width: 38px;
    height: 38px;
    font-size: 21px;
  }
}
