/* Front media protect + mobile viewing. Independent of style.css rewrites. */

img, video, audio, picture, canvas {
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

video::-webkit-media-controls-overflow-button,
video::-internal-media-controls-download-button {
  display: none !important;
}

.media-viewer-image-shell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 100%;
}
.media-protect-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  background: transparent;
  touch-action: pan-y pinch-zoom;
}
.paid-media-grid button img {
  pointer-events: none;
  -webkit-user-drag: none;
}
.paid-content-item {
  min-height: 48px;
}

@media (max-width: 767px) {
  .simple-modal {
    align-items: flex-end;
    padding: 0;
  }
  .simple-modal-box {
    max-width: 100%;
    max-height: min(94dvh, 94vh);
    border-radius: 18px 18px 0 0;
    display: flex;
    flex-direction: column;
  }
  .simple-modal-head {
    flex: 0 0 auto;
    height: 52px;
    padding: 0 14px 0 max(14px, env(safe-area-inset-left));
  }
  .simple-modal-head button {
    min-width: 44px;
    min-height: 44px;
  }
  .simple-modal-content {
    flex: 1 1 auto;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 16px max(18px, env(safe-area-inset-bottom));
    line-height: 1.65;
  }

  .paid-content-item {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 12px 10px;
  }
  .paid-content-item b,
  .paid-content-item p {
    overflow-wrap: anywhere;
  }
  .paid-content-item strong {
    white-space: normal;
    text-align: right;
    max-width: 88px;
  }

  .paid-media-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }
  .paid-media-grid button {
    aspect-ratio: 3 / 4;
    min-height: 44px;
    border-radius: 14px;
  }
  .paid-media-grid button > span,
  .paid-video-open > span {
    font-size: 12px;
    padding: 8px 10px;
  }
  .paid-video-card {
    min-height: 180px;
  }
  .paid-video-list video {
    max-height: 52vh;
    width: 100%;
    border-radius: 14px;
  }
  .paid-voice-controls {
    grid-template-columns: 48px minmax(0, 1fr) !important;
    gap: 8px;
  }
  .paid-voice-toggle {
    min-width: 44px;
    min-height: 44px;
  }

  .media-viewer {
    padding: max(6px, env(safe-area-inset-top)) 8px max(8px, env(safe-area-inset-bottom));
  }
  .media-viewer-toolbar {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    gap: 6px;
    min-height: 48px;
  }
  .media-viewer-mode {
    display: none;
  }
  .media-viewer-back,
  .media-viewer-close {
    min-width: 44px;
    min-height: 44px;
    padding: 0;
  }
  .media-viewer-stage {
    touch-action: pan-y pinch-zoom;
  }
  .media-viewer-stage img,
  .media-viewer-stage video {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    border-radius: 0;
    box-shadow: none;
  }
  .media-viewer-video-shell,
  .media-viewer-video-shell video {
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: contain;
    background: #111;
  }
  .media-viewer.natural-media .media-viewer-stage {
    -webkit-overflow-scrolling: touch;
  }
  .media-viewer.natural-media .media-viewer-image-shell {
    display: block;
    max-width: none;
    max-height: none;
  }
  .media-viewer.natural-media .media-protect-layer {
    touch-action: pan-x pan-y;
  }
  .media-viewer-nav {
    grid-template-columns: 1fr auto 1fr;
    gap: 8px;
    padding-top: 8px;
  }
  .media-viewer-nav button {
    min-height: 44px;
    font-size: 14px;
    padding: 0 10px;
  }
  .media-viewer-hint {
    font-size: 11px;
    padding: 6px 4px 0;
  }
}

@media (max-width: 380px) {
  .paid-content-item {
    grid-template-columns: 40px minmax(0, 1fr);
  }
  .paid-content-item strong {
    grid-column: 2;
    justify-self: start;
    max-width: none;
    text-align: left;
    margin-top: 2px;
  }
  .media-viewer-toolbar strong {
    font-size: 13px;
  }
}


.paid-video-card { position: relative; }
.paid-video-poster {
  display: block;
  width: 100%;
  min-height: 180px;
  max-height: 52vh;
  object-fit: cover;
  pointer-events: none;
  background: #1a1220;
}
