/**
 * <game-card> styles
 * Clean, semantic CSS using Y888 design tokens
 * Pixel-matched to reference (y888.com)
 *
 * Card specs (from reference):
 * - Width: 2.1rem (--card-benchmark)
 * - Aspect ratio: 1 : 1.33
 * - Border radius: benchmark * 0.125 = 0.2625rem
 * - Grid gap: 0.3rem
 */

/* Card container */
.game-card {
  position: relative;
  width: var(--y888-card-width, 2.1rem);
  aspect-ratio: 1 / 1.33;
  border-radius: calc(var(--y888-card-width, 2.1rem) * 0.125);
  overflow: hidden;
  cursor: pointer;
  background-color: var(--y888-bg-card);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  /* Reference: NO hover lift/transform on cards */
  -webkit-tap-highlight-color: transparent;
}

/* Reference: no hover/active transform on game cards */

/* Game art image layer */
.game-card__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* HOT badge (top-left) */
.game-card__badge {
  position: absolute;
  top: 0;
  left: 0;
  width: calc(var(--y888-card-width, 2.1rem) * 0.319);
  height: calc(var(--y888-card-width, 2.1rem) * 0.25857);
  z-index: 2;
  pointer-events: none;
}

.game-card__badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Provider logo chip (top-center-right area, baked into art) */
/* Note: provider logos are part of the game art image itself */

/* Favorite star button (top-right) */
.game-card__favorite {
  position: absolute;
  top: var(--y888-space-xs);
  right: var(--y888-space-xs);
  width: 0.34rem;
  height: 0.34rem;
  z-index: 3;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  opacity: 0.9;
  transition: opacity var(--y888-transition-fast), transform var(--y888-transition-fast);
}

.game-card__favorite:hover {
  opacity: 1;
  transform: scale(1.1);
}

.game-card__favorite img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.game-card__favorite--active {
  opacity: 1;
}

/* Loading skeleton state */
.game-card--loading {
  background: linear-gradient(
    90deg,
    var(--y888-bg-card) 25%,
    #2a2a2a 50%,
    var(--y888-bg-card) 75%
  );
  background-size: 200% 100%;
  animation: game-card-shimmer 1.5s infinite;
}

@keyframes game-card-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* NOTE: .game-grid page-layout rules were removed from this component file.
   They lived here from the homepage integration but leaked into subgame.html,
   where they overrode the original flex layout (._list-ordinary-layout).
   Homepage grid rules now live only in css/rewrite/games.css (index.html).
   Component CSS must style only the <game-card> element itself. */

/* Responsive: card width scales with container */
@media (max-width: 750px) {
  .game-card {
    --y888-card-width: calc((100vw - 0.6rem - 0.4rem) / 3);
  }
}
