/* P175 — mobile overlay audit and map-space fixes. */

@media (max-width: 820px) {
  html .leaflet-control-zoom,
  html body .leaflet-top.leaflet-left .leaflet-control-zoom {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  body > .wind-control.ow-p175-mobile-wind-portal {
    position: fixed !important;
    top: calc(62px + env(safe-area-inset-top)) !important;
    right: 8px !important;
    bottom: auto !important;
    left: auto !important;
    z-index: 11950 !important;
    width: min(390px, calc(100vw - 16px)) !important;
    max-width: calc(100vw - 16px) !important;
    max-height: calc(100dvh - var(--mobile-bottom-space, 72px) - 76px) !important;
    overflow: auto !important;
    isolation: isolate;
    contain: paint;
  }

  #ow-race-lite-panel tbody tr:hover td,
  #ow-race-lite-panel tbody tr:focus-within td {
    background: rgba(70, 125, 164, 0.25) !important;
    color: #f3f8fc !important;
  }

  #ow-race-lite-panel tbody tr:hover :is(.ow-sail-name, .ow-same, .ow-muted),
  #ow-race-lite-panel tbody tr:focus-within :is(.ow-sail-name, .ow-same, .ow-muted) {
    color: #f3f8fc !important;
  }

  #ow-race-lite-panel tr.ow-position-row-pinned td,
  #ow-race-lite-panel tr.ow-replay-row-pinned td {
    background: rgba(245, 158, 11, 0.12) !important;
    color: #f8fafc !important;
  }

  .ow-p32-replay-player,
  body.ow-map-fullscreen-v1-active .ow-p32-replay-player {
    bottom: calc(var(--mobile-bottom-space, 72px) + 4px) !important;
  }

  #ow-p175-replay-restore {
    position: fixed;
    left: 50%;
    bottom: calc(var(--mobile-bottom-space, 72px) + 6px);
    z-index: 11940;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 42px;
    padding: 7px 14px;
    border: 1px solid #a9c7d9;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    color: #0b3558;
    box-shadow: 0 8px 24px rgba(11, 45, 79, 0.22);
    font: inherit;
    font-size: 12px;
    cursor: pointer;
    transform: translateX(-50%);
    backdrop-filter: blur(8px);
  }

  #ow-p175-replay-restore[hidden] {
    display: none !important;
  }

  #ow-p175-replay-restore strong {
    white-space: nowrap;
  }
}

@media (min-width: 821px) {
  #ow-p175-replay-restore {
    display: none !important;
  }
}
