body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    overflow: hidden;
    touch-action: none;
    background-color:black;
}

html, body, canvas {
  touch-action: none;
  overscroll-behavior: contain;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

#glcanvas {
    display: block;
    width: 100%;
    height: 100%;
}
  
#current-time-text {
    position: absolute;
    bottom: 20px;
    left: 20px;
    color: lightgray;
    font-size: 20px;
    font-family: 'Courier New', monospace;
    z-index: 20;  /* Ensure text stays on top */
    pointer-events: auto;
}

#date-picker {
    position: fixed; 
    left: 20px;
    right: 20px;
    bottom: 20px; 
    width: 100vw; 
    opacity: 0; 
    z-index: 10; 
    cursor: pointer;
    pointer-events: auto;
}

#loading-text {
    position: absolute;
    bottom: 120px;
    left: 20px;
    color: darkgoldenrod;
    font-size: 20px;
    font-family: 'Courier New', monospace;
    text-align: left;
    z-index: 10;  /* Ensure text stays on top */
}

#topUI {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    opacity: 0.3;
    transition: opacity 0.2s ease;
    z-index: 10; /* Ensure it’s on top */
    pointer-events: none; /* Allow clicks to pass through when not active */
}

#topUI.is-active {
    opacity: 1;
}

#topButtons {
    position: fixed;
    display: flex;
    padding: 5px;
}

#topButtons > * {
  all: unset;
  display: flex !important;

  /* THIS IS CRITICAL */
  justify-self: stretch;

  align-items: center;
  justify-content: center;
}

/* First visible child → left */
#topButtons > *:first-child {
  justify-content: flex-start;
}

/* Last visible child → right */
#topButtons > *:last-child {
  justify-content: flex-end;
}

#topButtons img {
    /* Force all SVG images to be exactly 50px by 50px */
    width: 30px;
    height: 30px;
    /* Optional: Ensures the SVG scales correctly within the assigned dimensions */
    display: block; 
  max-width: 100%;
  max-height: 100%;
}

#mapToggle {
  position: fixed;
  padding: 10px;
  top: 0;
  left: 0;
  width: 30px;
  height: 30px;
  display: block; 
}

@media (min-aspect-ratio: 1/1) or (orientation: landscape) {
  #topButtons {
      flex-direction: column;
      height: 100%;
      width: 40px;
      top: 0;
      bottom: 0;
      right: 0;
      left: auto;
      justify-content: space-evenly; /* or space-between */
      align-items: center;
  }
}

@media (max-aspect-ratio: 1/1) or (orientation: portrait) {
  #topButtons {
      flex-direction: row;
      height: 40px;
      width: 100%;
      top: 0;
      left: 0;
      right: 0;
      bottom: auto;
      /* Aligns items in the center of the toolbar */
      align-items: center; 
      /* Distributes space evenly between or around buttons (optional, adjust as needed) */
      justify-content: space-around; 
  }
}
