/* ── Video player ── */
.video-player {
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid #2a2a2a;
  background: #000;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.video-player__screen.embed-container {
  position: relative;
  aspect-ratio: 16 / 9;
  min-height: 320px;
  background: #000;
}

.embed-container iframe,
.embed-container object,
.embed-container embed {
  width: 100% !important;
  height: 100% !important;
  min-height: 320px;
  border: none;
  display: block;
}

.video-player__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: #141414;
  border-top: 1px solid #2a2a2a;
}

.video-player__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.player-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.player-control__label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #9ca3af;
  white-space: nowrap;
}

.player-control__icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.player-control__select {
  appearance: none;
  background: #1e1e1e url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.6rem center;
  border: 1px solid #2a2a2a;
  border-radius: 0.5rem;
  color: #f3f4f6;
  font-size: 0.8125rem;
  padding: 0.4rem 2rem 0.4rem 0.65rem;
  cursor: pointer;
  min-width: 6.5rem;
  transition: border-color 0.15s;
}

.player-control__select:hover,
.player-control__select:focus {
  border-color: #ef4444;
  outline: none;
}

.player-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #d1d5db;
  background: #1e1e1e;
  border: 1px solid #2a2a2a;
  border-radius: 0.5rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.player-btn:hover:not(.player-btn--disabled):not(.is-disabled) {
  background: #252525;
  border-color: #444;
  color: #fff;
}

.player-btn--accent {
  background: #991b1b;
  border-color: #ef4444;
  color: #fff;
}

.player-btn--accent:hover {
  background: #dc2626;
  border-color: #ef4444;
}

.player-btn--disabled,
.player-btn.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.video-player__note {
  margin: 0;
  padding: 0.5rem 1rem 0.75rem;
  font-size: 0.6875rem;
  color: #6b7280;
  line-height: 1.4;
  background: #141414;
}

.video-player__toast {
  position: absolute;
  bottom: 5.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(0.5rem);
  padding: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.88);
  border: 1px solid #2a2a2a;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  color: #f3f4f6;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 20;
  max-width: 90%;
  text-align: center;
}

.video-player__toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.video-player:fullscreen .video-player__screen {
  min-height: 100vh;
  aspect-ratio: unset;
}

.video-player:fullscreen .video-player__screen iframe {
  min-height: 100vh !important;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.3s ease;
}

img[loading="lazy"].loaded {
  opacity: 1;
}

.no-thumb img { display: none; }

#scroll-sentinel { height: 1px; }

.infinite-loading {
  display: flex;
  justify-content: center;
  padding: 2rem;
}

.infinite-loading::after {
  content: "";
  width: 28px;
  height: 28px;
  border: 2px solid #2a2a2a;
  border-top-color: #ef4444;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #090909; }
::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #444; }

/* ── Category gallery (homepage) ── */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .category-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
  }
}

@media (min-width: 1280px) {
  .category-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.category-card:hover {
  transform: translateY(-2px);
}

.category-badge {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  color: #f3f4f6;
}

.category-name {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.filter-select {
  transition: border-color 0.15s;
}

.filter-select:focus {
  border-color: #ef4444;
}

/* Mobile tag pills below header on small screens */
@media (max-width: 1023px) {
  .mobile-tags {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #2a2a2a;
    -webkit-overflow-scrolling: touch;
  }
  .mobile-tags::-webkit-scrollbar { display: none; }
}