.grid {
  display: grid;
grid-template-columns: repeat(3, 1fr);

  /* grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); */
  gap: 2.4rem;
  padding: 0 2rem 2rem 2rem;
  flex-grow: 1;
  margin: 0 auto;
  max-width: 1200px;
}

.thumb {
  position: relative;
  cursor: pointer;
  border: none;
  /* border-radius: 0.5rem; */
  overflow: hidden;
  /* box-shadow: 0 0 8px #f00, 0 0 20px #900 inset; */
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: thumbfade 0.6s ease-in-out;
    box-shadow: -1px 0px 18px 0px rgba(255, 255, 255, 0.3);
}

@keyframes thumbfade {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.thumb:hover {
  transform: scale(1.05) translateY(-4px);
  box-shadow: 0 0 12px var(--base-red), 0 0 30px var(--base-red) inset;
}

.thumb img {
  width: 100%;
  display: block;
  transition: transform 0.4s ease, filter 0.4s ease;
}

.thumb:hover img {
  transform: scale(1.05);
  filter: brightness(1.1) contrast(1.2);
}

/* Optional: Play icon overlay */
.thumb::after {
  content: "▶";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3rem;
  color: rgba(255, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.thumb:hover::after {
  opacity: 1;
}

/* Modal system */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.95);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.modal.open {
  opacity: 1;
  pointer-events: all;
}

.modal::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(45deg, transparent, transparent 4px, rgba(255, 0, 0, 0.2) 5px);
  pointer-events: none;
  z-index: 0;
  animation: scan 2s linear infinite;
}

@keyframes scan {
  0% { background-position: 0 0; }
  100% { background-position: 100px 100px; }
}

.video-container {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background: #000;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  background: #000;
  z-index: 2;
  transform: translateX(100%);
  transition: transform 0.6s ease;
}

#videoMetadata {
  flex: 0 0 auto;
  background: rgba(17, 17, 17, 0.7);
  color: var(--base-red);
  border-top: 1px solid var(--base-red);
  box-shadow: 0 0 10px var(--base-red);
  display: flex;
  flex-direction: column;
  user-select: none;
  max-height: 35vh;
  overflow-y: auto;
}

#videoMetadataTop {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--base-red);
}

#videoMetadataTop h2 {
  margin: 0;
  font-size: 1.8rem;
  text-shadow: 0 0 8px var(--base-red);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#videoMetadataBottom {
  display: flex;
  align-items: stretch;
  padding: 0 1rem;
  gap: 1rem;
  background: #111;
  border-top: 1px solid var(--base-red);
}

#videoMetadataBottom button.nav-btn {
  flex: none;
  width: 3.5rem;
  font-size: 1.8rem;
  background: transparent;
  color: var(--base-red);
  border: 1px solid var(--base-red);
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.3s ease;
  user-select: none;
  box-shadow: 0 0 8px var(--base-red) inset;
}

#videoMetadataBottom button.nav-btn:hover {
  color: var(--base-white);
  background: var(--base-red);
  text-shadow: 0 0 10px var(--base-white);
  box-shadow: 0 0 15px var(--base-red) inset;
}

#videoMetadataInfo {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: var(--base-red);
  font-size: 1rem;
  user-select: text;
  padding: 0 0.5rem;
  overflow: hidden;
}

#videoMetadataInfo p {
  margin: 0;
  line-height: 1.2em;
  text-shadow: 0 0 3px #900;
}

.close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 2rem;
  color: var(--base-red);
  cursor: pointer;
  z-index: 1001;
  user-select: none;
  transition: color 0.3s ease;
}

.close-btn:hover {
  color: var(--base-white);
  text-shadow: 0 0 12px var(--base-red);
}


.skeleton {
  position: relative;
  border-radius: 0.5rem;
  overflow: hidden;
  background: linear-gradient(90deg, #1a1a1a 25%, #333 50%, #1a1a1a 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite linear;
  aspect-ratio: 4 / 3;
  /* box-shadow: 0 0 8px rgba(255, 0, 0, 0.4), inset 0 0 16px rgba(255, 0, 0, 0.3); */
  transition: transform 0.3s ease;
}


@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.hover-info {
  position: absolute;
  pointer-events: none;
  background-color: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 0.5rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  z-index: 1000;
  max-width: 240px;
  font-family: 'Michroma', sans-serif;
  transition: opacity 0.3s;
}
