:root {
  --nvp-bg: #fff;
  --nvp-surface: #f7f7f7;
  --nvp-text: #171717;
  --nvp-muted: #737373;
  --nvp-accent: #111;
  --nvp-border: #e5e5e5;
}

.nvp-app {
  background: var(--nvp-bg);
  color: var(--nvp-text);
  min-height: 70vh;
  width: 100%;
}

.nvp-toolbar {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: center;
  padding: 16px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--nvp-border);
}

.nvp-order {
  border: 1px solid var(--nvp-border);
  background: #fff;
  color: var(--nvp-text);
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  min-height: 42px;
  padding: 0 18px;
}

.nvp-order.is-active {
  background: var(--nvp-accent);
  border-color: var(--nvp-accent);
  color: #fff;
}

.nvp-feed {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 0 auto;
  max-width: 1760px;
  padding: 22px clamp(16px, 3vw, 48px) 56px;
}

.nvp-card {
  border: 1px solid var(--nvp-border);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
  cursor: pointer;
  min-width: 0;
  overflow: hidden;
  position: relative;
  background: var(--nvp-surface);
  aspect-ratio: 9 / 16;
}

.nvp-card__media,
.nvp-card video,
.nvp-card__thumb {
  height: 100%;
  width: 100%;
}

.nvp-card__media {
  position: relative;
}

.nvp-card__thumb {
  display: block;
  object-fit: cover;
}

.nvp-card video {
  inset: 0;
  display: block;
  opacity: 0;
  object-fit: cover;
  position: absolute;
  transition: opacity .16s ease;
}

.nvp-card:hover video {
  opacity: 1;
}

.nvp-card__overlay {
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .76));
  bottom: 0;
  display: none;
  left: 0;
  padding: 42px 12px 12px;
  position: absolute;
  right: 0;
}

.nvp-card__overlay:empty {
  display: none;
}

.nvp-card__overlay h3 {
  color: var(--nvp-text);
  font-size: 15px;
  line-height: 1.25;
  margin: 0 0 4px;
  overflow-wrap: anywhere;
}

.nvp-card__overlay span {
  color: var(--nvp-muted);
  font-size: 12px;
  display: none;
}

.nvp-card__play {
  align-items: center;
  background: rgba(0, 0, 0, .58);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 999px;
  color: #fff;
  display: flex;
  height: 42px;
  justify-content: center;
  left: 50%;
  opacity: 0;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  transition: opacity .18s ease;
  width: 42px;
}

.nvp-card:hover .nvp-card__play {
  opacity: 1;
}

.nvp-modal {
  background: rgba(0, 0, 0, .92);
  inset: 0;
  position: fixed;
  z-index: 99999;
}

.nvp-modal__video {
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.nvp-modal__close {
  background: rgba(255, 255, 255, .14);
  border: 0;
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  font-size: 28px;
  height: 46px;
  line-height: 1;
  position: absolute;
  right: 18px;
  top: 18px;
  width: 46px;
  z-index: 2;
}

.nvp-modal__nav {
  align-items: center;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  display: flex;
  font-size: 48px;
  height: 58px;
  justify-content: center;
  line-height: 1;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 58px;
  z-index: 2;
}

.nvp-modal__nav--prev {
  left: 20px;
}

.nvp-modal__nav--next {
  right: 20px;
}

.nvp-sentinel {
  min-height: 2px;
}

@media (max-width: 767px) {
  :root {
    --nvp-bg: #000;
    --nvp-surface: #000;
    --nvp-text: #fff;
    --nvp-muted: #ddd;
    --nvp-accent: #fff;
    --nvp-border: rgba(255, 255, 255, .14);
  }

  .nvp-app {
    height: 100svh;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
  }

  .nvp-toolbar {
    background: linear-gradient(180deg, rgba(0, 0, 0, .75), transparent);
    border-bottom: 0;
    justify-content: flex-start;
    overflow-x: auto;
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
  }

  .nvp-order {
    background: rgba(0, 0, 0, .42);
    border-color: rgba(255, 255, 255, .28);
    color: #fff;
  }

  .nvp-order.is-active {
    background: #fff;
    border-color: #fff;
    color: #000;
  }

  .nvp-feed {
    display: block;
    padding: 0;
  }

  .nvp-card {
    aspect-ratio: auto;
    border-radius: 0;
    border: 0;
    height: 100svh;
    scroll-snap-align: start;
  }

  .nvp-card video {
    background: #000;
    object-fit: contain;
    opacity: 1;
    position: static;
  }

  .nvp-card__thumb {
    display: none;
  }

  .nvp-card__overlay {
    padding: 80px 18px 80px;
  }

  .nvp-card__overlay h3 {
    font-size: 18px;
    max-width: calc(100vw - 88px);
  }

  .nvp-card__play {
    bottom: 92px;
    left: auto;
    opacity: 1;
    right: 18px;
    top: auto;
    transform: none;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .nvp-feed {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) and (max-width: 1279px) {
  .nvp-feed {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) and (max-width: 1535px) {
  .nvp-feed {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (orientation: landscape) and (max-width: 900px) {
  .nvp-app {
    height: auto;
    min-height: 100svh;
    overflow-y: visible;
  }

  .nvp-feed {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-top: 74px;
  }

  .nvp-card {
    aspect-ratio: 9 / 16;
    height: auto;
  }
}

@media (max-width: 767px) {
  .nvp-modal__nav {
    display: none;
  }
}
