body {
  margin: 0;
  padding: 0;
  overflow: hidden;
}

#canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  z-index: 1;
}

#switch-cam {
  position: absolute;
  top: 3%;
  right: 5%;
  z-index: 950;
}

#switch-button {
  height: 70px;
  width: 70px;
  background-image: url(assets/SwitchButton.png); /* Green background */
  background-size: contain; /* Ensure the image covers the button */
  background-position: center; /* Center the image */
  background-repeat: no-repeat; /* Preent tiling */
  background-color: transparent;
  border: none;
  user-select: none; /* Disable text selection */
  outline: none;
  transition: transform 0.2s ease; /* Smooth hover animation */
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

#switch-button:active {
  transform: translate(5%, 5%);
}

/* Hide switch button on desktop */
.desktop #switch-cam {
  display: none;
}

/* Lens picker — mobile-first: large touch targets, then desktop overrides */
/* Lens carousel — horizontal swipe at bottom */
#lens-carousel-wrapper {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 0  max(12px, env(safe-area-inset-bottom));
  z-index: 950;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent);
  pointer-events: none;
}

#lens-carousel-wrapper > * {
  pointer-events: auto;
}

#lens-carousel {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0 16px;
}

#lens-carousel::-webkit-scrollbar {
  display: none;
}

.lens-carousel-item {
  flex: 0 0 auto;
  width: 140px;
  scroll-snap-align: center;
  scroll-snap-stop: normal;
  padding: 14px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.2s, background 0.2s;
}

.lens-carousel-item:hover {
  background: rgba(0, 0, 0, 0.65);
}

.lens-carousel-item.active {
  border-color: rgba(255, 120, 120, 0.7);
  background: rgba(0, 0, 0, 0.65);
}

.lens-carousel-item .lens-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

@media (max-width: 430px) {
  .lens-carousel-item {
    width: 120px;
    padding: 12px 10px;
  }

  .lens-carousel-item .lens-name {
    font-size: 12px;
  }
}

.desktop .lens-carousel-item {
  width: 110px;
  padding: 10px 8px;
}

.desktop .lens-carousel-item .lens-name {
  font-size: 12px;
}

