* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  overflow: hidden; /* Prevent scrolling */
  position: fixed; /* Ensure no scrolling */
  touch-action: none; /* Disable touch scrolling behaviors */
}

body {
  background-color:hsl(0, 0%, 0%);
  font-family: 'Lato', sans-serif;
  font-size: 0.7rem;
  color:hsl(0, 0%, 100%);
  -webkit-overflow-scrolling: none; /* Disable momentum scrolling on iOS */
}

main {
  display: flex;
  width: 100%;
  height: 100%;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  overflow: hidden; /* Prevent scrolling within main */
  touch-action: none; /* Disable touch scrolling behaviors */
}

canvas {
  width: 100%;
  height: 100%;
  display: block; /* Remove any inline spacing */
  touch-action: none; /* Prevent touch scrolling */
}

#stats,
#inspect-organism {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  margin: 0.5rem;
  background-color:hsla(0, 0%, 0%, 0.7);
  width: auto;
  max-height: 90%;
  padding: 1rem;
  border-radius: 4px;
  overflow: auto;
  overscroll-behavior: contain; /* Prevent scroll chaining */
  scrollbar-width: none; /* Firefox */
  touch-action: pan-y; /* Allow vertical scrolling on touch devices */
}
#stats::-webkit-scrollbar,
#inspect-organism::-webkit-scrollbar {
  display: none; /* Safari and Chrome */
}

labels {
  position: fixed;
  bottom: 0.5rem;
  display: flex;
}
labels.left {
  left: 0.5rem;
  gap: 0.5rem;
}
labels.right {
  right: 0.5rem;
  gap: 0; /* No gap - we'll add margin manually when labels are visible */
}

label {
  font-size: 0.8rem;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: default;
  background-color: hsla(0, 0%, 0%, 0.7);
  color: white;
  border: none;
}

@media (max-width: 768px) {
  label {
    font-size: 1rem;
  }
}

labels.right label {
  transition: opacity 0.5s ease, background-color 0.5s ease;
  opacity: 0;
  background-color: transparent;
  width: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
  white-space: nowrap;
}
labels.right label.highlight {
  opacity: 1;
  background-color:hsla(0, 0%, 0%, 0.7);
  width: auto;
  padding: 5px 10px;
  margin-left: 0.5rem;
}
