/* Teaser loops on the game cards - see selector_teasers.js.
   The box bleeds to the card's edges (the card has 32px/24px padding,
   24px/16px under 600px) and the card's emoji icon sits on its lower edge. */

.game-card.has-teaser {
  padding-top: 0;
  overflow: hidden;
}

.card-teaser {
  position: relative;
  width: calc(100% + 48px);
  margin: 0 -24px 0;
  aspect-ratio: 16 / 9;
  background: #05070c;
  overflow: hidden;
  pointer-events: none;   /* a tap on the preview still opens the game */
  border-bottom: 1px solid var(--border, #2a2f3a);
}

.card-teaser-poster,
.card-teaser-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-teaser-video {
  opacity: 0;
  transition: opacity 0.25s ease;
}

.card-teaser.is-playing .card-teaser-video {
  opacity: 1;
}

.game-card.has-teaser .game-icon {
  position: relative;
  z-index: 1;
  font-size: 2.6rem;
  margin: -1.6rem 0 8px;
  line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.8));
}

@media (max-width: 600px) {
  .card-teaser {
    width: calc(100% + 32px);
    margin: 0 -16px 0;
  }
  .game-card.has-teaser .game-icon {
    font-size: 2.2rem;
  }
}

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