/* =============================================================================
   Orientation overlay for phones and tablets.

   Shows a floating "please use landscape" prompt when a small screen is in
   portrait orientation.  The prompt is advisory -- browsers cannot truly force
   orientation without fullscreen + Screen Orientation API, which iOS Safari
   does not support.

   Desktop is never affected: the overlay is only rendered on devices whose
   physical screen width is <= 1024 CSS pixels.  We additionally gate on
   `(pointer: coarse)` so that a narrow desktop browser window does not trigger
   the overlay.
   ========================================================================== */

#orientation-overlay {
  display: none;
}

#orientation-overlay.orientation-overlay-dismissed,
.orientation-overlay-close.orientation-overlay-dismissed {
  display: none !important;
}

.orientation-overlay-close {
  display: none;
}

@media (orientation: portrait) and (max-device-width: 1024px) and (pointer: coarse) {
  #orientation-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100vw;
    height: 100vh;
    padding: 56px 72px;
    background: transparent;
    color: #333;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    box-sizing: border-box;
    pointer-events: none;
    overflow: hidden;
    font-size: 150px !important;
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1.05;
    overflow-wrap: normal;
    isolation: isolate;
  }

  #orientation-overlay::before {
    content: "";
    position: absolute;
    top: 15vh;
    left: 50%;
    z-index: -1;
    width: 96vw;
    min-height: 70vh;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.70);
    border-radius: 24px;
    box-shadow:
      0 16px 48px rgba(0,0,0,0.30),
      0 0 0 100vmax #fff;
    box-sizing: border-box;
  }

  .orientation-overlay-close {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9001;
    display: block;
    width: 72px;
    height: 72px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 4px 16px rgba(0,0,0,0.20);
    color: #333;
    cursor: pointer;
    font: 700 48px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    pointer-events: auto;
  }

  .orientation-overlay-close:active {
    transform: scale(0.96);
  }
}
