/* =========================================================
   V32 — inline custom player
   Native <video> controls are intentionally never enabled:
   iOS/Android browsers otherwise lift their own player surface
   above the card, hiding the return control and spilling black.
   ========================================================= */

.video-card-ui {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 6px 9px;
  border-radius: 15px;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(7, 9, 9, 0.70);
  border: 1px solid rgba(255, 255, 255, 0.17);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 10px 26px rgba(0, 0, 0, 0.24);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px);
  transition:
    opacity 0.22s ease,
    visibility 0.22s ease,
    transform 0.22s var(--ease);
}

.video-card.is-playing .video-card-ui {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

/* The old floating close control now lives in the bottom player bar. */
.video-card-ui .video-card-close {
  position: static;
  top: auto;
  left: auto;
  flex: 0 0 auto;
  min-height: 26px;
  padding: 0 8px;
  gap: 3px;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.17);
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  font-size: 7.5px;
  line-height: 1;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}

.video-card-ui .video-card-close span {
  font-size: 12px;
}

.video-card-ui .video-card-close:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.34);
}

.video-ui-toggle,
.video-ui-fullscreen {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.9);
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.video-ui-toggle:hover,
.video-ui-fullscreen:hover {
  background: rgba(255, 255, 255, 0.12);
}

.video-ui-toggle:focus-visible,
.video-ui-fullscreen:focus-visible,
.video-ui-track:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.78);
  outline-offset: 2px;
}

.video-ui-icon {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.video-ui-play {
  display: none;
}

.video-ui-pause {
  display: block;
}

.video-card-ui.is-paused .video-ui-pause {
  display: none;
}

.video-card-ui.is-paused .video-ui-play {
  display: block;
}

.video-ui-time {
  flex: 0 0 auto;
  min-width: 58px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 7px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  text-align: center;
  white-space: nowrap;
}

.video-ui-track {
  position: relative;
  flex: 1 1 auto;
  min-width: 32px;
  height: 18px;
  cursor: pointer;
  touch-action: manipulation;
}

.video-ui-track::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-50%);
}

.video-ui-track > span {
  position: relative;
  display: block;
  width: 0;
  height: 2px;
  margin-top: 8px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.88);
}

.video-ui-track > span::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  transform: translateY(-50%);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.18);
}

.video-ui-fullscreen {
  width: 24px;
}

.video-ui-fullscreen .video-ui-icon {
  width: 14px;
  height: 14px;
}

/* Native fullscreen isn't available on iOS Safari; the button falls back
   to webkitEnterFullscreen(). Page fullscreen keeps the custom bar visible. */
.video-card-cover:fullscreen,
.video-card-cover:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  background: #000;
}

.video-card-cover:fullscreen .video-card-media,
.video-card-cover:-webkit-full-screen .video-card-media {
  object-fit: contain;
}

.video-card-cover:fullscreen .video-card-ui,
.video-card-cover:-webkit-full-screen .video-card-ui {
  left: max(20px, env(safe-area-inset-left));
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  max-width: 920px;
  margin: 0 auto;
}

.video-card.is-playing .video-card-media {
  cursor: pointer;
}

@media (max-width: 760px) {
  .video-card-ui {
    left: 9px;
    right: 9px;
    bottom: 9px;
    gap: 6px;
    min-height: 36px;
    padding: 5px 7px;
    border-radius: 13px;
  }

  .video-card-ui .video-card-close {
    min-height: 25px;
    padding: 0 7px;
    font-size: 7px;
  }

  .video-ui-time {
    min-width: 52px;
    font-size: 6.5px;
  }

  .video-ui-toggle,
  .video-ui-fullscreen {
    width: 24px;
    height: 24px;
  }
}

@media (max-width: 380px) {
  .video-card-ui .video-card-close small {
    display: none;
  }

  .video-card-ui .video-card-close span {
    font-size: 14px;
  }

  .video-ui-time {
    min-width: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .video-card-ui {
    transition: none;
  }
}
