  /* Main content */
    #mainContent {
      display: flex;
      justify-content: center;
      align-items: center;
      min-height: 100vh;
    }
    #openOverlayBtn {
      padding: 1em 2em;
      font-size: 1rem;
      cursor: pointer;
    }

    /* Fullscreen overlay */
    #videoOverlay {
      position: fixed;
      top: 0;
      left: 0;
      width: 100vw;
      height: 100vh;
      display: none; /* hidden initially */
      justify-content: center;
      align-items: center;
      background: rgba(0, 0, 0, 0.95);
      z-index: 9999;
    }
    /* Show overlay when .active is added */
    #videoOverlay.active {
      display: flex;
    }

    /* Close button */
    #closeBtn {
      position: absolute;
      top: 10px;
      right: 10px;
      z-index: 10000;
      background: #fff;
      border: none;
      font-size: 1rem;
      padding: 0.5em 1em;
      cursor: pointer;
    }

    /* Video container that fills overlay and has black background for letterboxing */
    .video-container {
      position: relative;
      width: 100%;
      height: 100%;
      background: #000;
      overflow: hidden; /* hide any overflow if we rotate */
    }

    /* Center video absolutely, using object-fit: contain to show entire video */
    .video-container video {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 100%;
      height: 100%;
      object-fit: contain;
      transform-origin: center center;
    }

    /*
      If orientation lock fails (common on iOS) or device is in portrait,
      we "fake" landscape by rotating the video 90deg.
      The key addition is setting width/height to 100vh / 100vw,
      ensuring it fits fully on iOS Safari without cropping.
    */
    .video-container.rotate video {
      transform: translate(-50%, -50%) rotate(90deg);
      width: 100vh;
      height: 100vw;
      object-fit: contain;
    }