    /* Reset and basic styles */
    body,
    html {
      margin: 0;
      padding: 0;
      overflow: hidden;
      width: 100%;
      height: 100%;
      background-color: black;
      font-family: var(--font-family);
      text-rendering: optimizeLegibility;
    }


    #app {
      position: relative;
      width: 100%;
      height: 100%;
      overflow: hidden;
    }

    /* Base video: always full width, vertically centered, behind everything */
    #base-video {
      position: absolute;
      left: 0;
      top: 50%;
      transform: translateY(-50%);
      width: 100%;
      height: auto;
      z-index: 1;
      display: none;
    }

    /* Overlay video: placed on top of the base video */
    #video-overlay {
      position: absolute;
      left: 0;
      top: 50%;
      transform: translateY(-50%);
      width: 100%;
      height: auto;
      z-index: 21;
      display: none;
      opacity: 0;
    }

    @keyframes buttonEntryAnimation {
      from {
        opacity: 0;
        transform: translateY(20px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    @keyframes buttonExitAnimation {
      from {
        opacity: 1;
        transform: translateY(0);
      }
      to {
        opacity: 0;
        transform: translateY(20px);
      }
    }


    /* If the window's aspect ratio is less than 16:9 (tall/narrow) */
@media (max-aspect-ratio: 16/9) {
  #scene-container,
  .popup-page-wrapper {
    width: 100%;
    height: auto;
  }
}

/* If the window's aspect ratio is greater than 16:9 (wide/short) */
@media (min-aspect-ratio: 16/9) {
  #scene-container,
  .popup-page-wrapper {
    width: auto;
    height: 100%;
  }
}

.spinner {
  width: 48px;
  height: 48px;
  border: 5px solid #FFF;
  border-bottom-color: transparent;
  border-radius: 50%;
  display: inline-block;
  box-sizing: border-box;
  animation: rotation 1s linear infinite;
  }

  @keyframes rotation {
  0% {
      transform: rotate(0deg);
  }
  100% {
      transform: rotate(360deg);
  }
  } 

  #loading-spinner {
    position: fixed;
    top:0;
    left:0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
  }



  #screensaver-video {
    position: absolute;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000; /* Increased z-index to be higher than popups */
    opacity: 0;
    display: none;
    transition: opacity 1s ease-in-out;
  }
  
  /* Portrait Mode Overlay */
  #portrait-mode-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    z-index: 9999; /* Ensure it's on top of everything */
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    flex-direction: column;
  }

  #portrait-mode-overlay img {
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  /* Only show the overlay when in portrait mode on mobile/tablet devices */
  @media screen and (max-width: 1024px) and (orientation: portrait) {
    #portrait-mode-overlay {
      display: flex;
    }
  }
  

  #language-selector {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 1000;
    display: none;
    gap: 5px;
    background: rgba(0, 0, 0, 0.3);
    padding: 5px;
    border-radius: 20px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.lang-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    text-transform: uppercase;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.5);
    color: black;
}

.lang-btn.active {
    background: rgba(255, 255, 255, 0.8);
    color: black;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

/* Adjust for RTL languages */
html[dir="rtl"] #language-selector {
    left: 15px;
    right: auto;
}
