/* ============================================================================
   Popular Games (home) — premium polish. Loaded LAST so it wins the cascade.
   Pure CSS: no markup/build changes. Covers header pill, game cards, artwork
   gloss, play chip, price pill, HOT badge, empty state and loading shimmer.
   ========================================================================== */

/* ---------- Section header ---------- */
.home-featured .section-head h2 { gap: calc(1.6 * var(--reference-unit)); }
.home-featured .popular-icon { filter: drop-shadow(0 1px 1px #0b10361f); }
.home-featured .view-all-btn {
  display: inline-flex; align-items: center; gap: 3px;
  min-height: 30px; padding: 0 9px 0 13px; border-radius: 999px;
  background: linear-gradient(120deg, #e7f8f2, #eaf3fe);
  box-shadow: inset 0 0 0 1px #cfe9e0, 0 1px 2px #1639550a;
  color: #00806a; font-size: 12px; font-weight: 700; letter-spacing: -.1px;
}
.home-featured .view-all-btn svg { width: 12px; height: 12px; }
.home-featured .view-all-btn:active { transform: scale(.96); }

/* ---------- Grid ---------- */
.home-featured .featured-games {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.home-featured .game-cover { aspect-ratio: 1.5; }
.home-featured .featured-game > b {
  min-height: 42px;
  font-size: 13px;
  padding: 9px 10px 11px;
}

/* ---------- Card ---------- */
.home-featured .featured-game {
  position: relative;
  border: 1px solid #e2ebf3;
  border-radius: calc(4.2 * var(--reference-unit));
  background: linear-gradient(180deg, #ffffff, #f6f9fc);
  box-shadow: 0 3px 12px #1639550e, 0 1px 2px #1639550a;
  overflow: hidden;
  transition: transform 160ms var(--ui-ease), box-shadow 160ms var(--ui-ease), border-color 160ms var(--ui-ease);
  animation: fg-card-in 360ms var(--ui-ease) backwards;
}
.home-featured .featured-game:nth-child(2) { animation-delay: 55ms; }
.home-featured .featured-game:nth-child(3) { animation-delay: 110ms; }
.home-featured .featured-game:nth-child(4) { animation-delay: 165ms; }
@keyframes fg-card-in { from { opacity: 0; transform: translateY(9px) scale(.985); } }

/* Colored top accent, unique per card */
.home-featured .featured-game::before {
  content: ''; position: absolute; z-index: 3; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #00d9ae, #35c3ff);
}
.home-featured .featured-game:nth-child(2)::before { background: linear-gradient(90deg, #ffb14d, #ff6d4d); }
.home-featured .featured-game:nth-child(3)::before { background: linear-gradient(90deg, #b57bff, #6a8dff); }
.home-featured .featured-game:nth-child(4)::before { background: linear-gradient(90deg, #4be08a, #00b8d9); }

/* First card = highlighted "hot" pick */
.home-featured .featured-game:first-child {
  background: linear-gradient(180deg, #fffdf4, #fff7e4);
  border-color: #ffdf9e;
  box-shadow: 0 3px 14px #f5a62326, 0 1px 2px #b068080f;
}
.home-featured .featured-game:first-child::before { background: linear-gradient(90deg, #ffc94d, #ff7d3b); }
.home-featured .featured-game:first-child::after {
  content: 'HOT';
  position: absolute; z-index: 4; top: 7px; left: 7px;
  padding: 2.5px 7px; border-radius: 999px;
  background: linear-gradient(120deg, #ff9d2e, #ff4d3d);
  box-shadow: 0 2px 7px #ff5a2e59, inset 0 0 0 1px #ffffff59;
  color: #fff; font-size: 8px; font-weight: 800; letter-spacing: .5px; line-height: 1;
}

@media (hover: hover) and (pointer: fine) {
  .home-featured .featured-game:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 26px #1639551e, 0 2px 6px #1639550e;
  }
}

/* ---------- Cover / artwork ---------- */
.home-featured .game-cover { border-radius: 0; overflow: hidden; }

/* Frosted play chip in the middle of the cover (triangle drawn via SVG data-URI) */
.home-featured .game-cover::before {
  content: ''; position: absolute; z-index: 3; left: 50%; top: 50%;
  width: 26px; height: 26px; transform: translate(-50%, -50%);
  border-radius: 50%;
  background-color: #ffffffe6;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M3.4 2.1 8.1 5 3.4 7.9Z' fill='%23079277'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 54% 50%; background-size: 11px 11px;
  box-shadow: 0 2px 10px #0b103645, inset 0 0 0 1px #ffffffd9;
}

/* Gloss over artwork for depth (artwork + fallback both fill the cover) */
.home-featured .popular-art::after,
.home-featured .game-fallback::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, #ffffff33, #ffffff00 32%, #0b103650 100%);
}

/* ---------- Price pill ---------- */
.home-featured .game-price {
  left: 4px; right: auto; bottom: 4px;
  display: inline-flex; align-items: center; gap: 3.5px;
  padding: 3px 7px 3px 4.5px; border-radius: 999px;
  background: #0c1230b8;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  box-shadow: inset 0 0 0 1px #ffffff33;
  color: #fff; font-size: 9px; font-weight: 700; line-height: 1; letter-spacing: .1px;
}
.home-featured .game-price::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #ffe9a8, #ffc233 55%, #e08e00);
  box-shadow: 0 0 0 1.5px #ffffff45;
}

/* ---------- Title ---------- */
.home-featured .featured-game > b {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  min-height: calc(6 * var(--reference-unit));
  padding: calc(1.5 * var(--reference-unit)) calc(1 * var(--reference-unit)) calc(1.1 * var(--reference-unit));
  font-size: clamp(10.5px, calc(2.75 * var(--reference-unit)), 12.5px);
  font-weight: 650; line-height: 1.25; letter-spacing: calc(-.08 * var(--reference-unit));
  color: #17223b;
}

/* ---------- Loading placeholder (shimmer) ---------- */
.home-featured .home-games-placeholder {
  grid-column: 1 / -1;
  min-height: 96px; border: 0; border-radius: calc(4.2 * var(--reference-unit));
  background: linear-gradient(100deg, #edf3f9 40%, #f8fbfd 50%, #edf3f9 60%);
  background-size: 200% 100%;
  animation: fg-shimmer 1.15s linear infinite;
  color: #7c8ea6; font-size: 12px;
}
.home-featured .home-games-placeholder .earn-art { width: 40px; height: 37px; opacity: .75; }
@keyframes fg-shimmer { to { background-position: -200% 0; } }

/* ---------- Empty state ---------- */
.home-featured .games-empty-link {
  position: relative; overflow: hidden;
  grid-column: 1 / -1;
  min-height: 0; padding: 16px 18px; gap: 13px;
  border: 1.5px dashed #b9dfd0;
  border-radius: calc(4.2 * var(--reference-unit));
  background:
    radial-gradient(circle at 92% 14%, #7ee7c44d, transparent 42%),
    radial-gradient(circle at 4% 96%, #ffd9a640, transparent 40%),
    linear-gradient(120deg, #f1fbf7, #eef5fe 60%, #f6f1fe);
  box-shadow: 0 3px 12px #1639550a;
  text-align: left;
}
.home-featured .games-empty-link .earn-art { width: 48px; height: 44px; }
.home-featured .games-empty-link b {
  display: block; font-size: 14px; font-weight: 700; letter-spacing: -.3px; color: #17223b;
}
.home-featured .games-empty-link small {
  display: block; margin-top: 3px; font-size: 11.5px; line-height: 1.45; color: #5d7189;
}
.home-featured .games-empty-link > svg {
  flex-shrink: 0; width: 30px; height: 30px; padding: 8px; box-sizing: border-box;
  border-radius: 50%; background: #00a5812e; color: #00806a;
}
.home-featured .games-empty-link:active { transform: scale(.985); }

/* ---------- Larger screens ---------- */
@media (min-width: 600px) {
  .home-featured .featured-game > b { min-height: 44px; font-size: 13px; padding: 9px 10px 10px; }
  .home-featured .game-cover::before { width: 30px; height: 30px; background-size: 13px 13px; }
}
@media (min-width: 760px) {
  .home-featured .featured-games { gap: 14px; }
  .home-featured .game-cover { aspect-ratio: 1.85; }
  .home-featured .game-cover::before { width: 34px; height: 34px; background-size: 14px 14px; }
  .home-featured .game-price { font-size: 11px; padding: 4px 9px 4px 6px; gap: 5px; bottom: 7px; left: 7px; }
  .home-featured .game-price::before { width: 9px; height: 9px; }
  .home-featured .featured-game:first-child::after { font-size: 9px; top: 10px; left: 10px; padding: 3px 8px; }
  .home-featured .home-games-placeholder, .home-featured .games-empty-link { min-height: 118px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .home-featured .featured-game,
  .home-featured .home-games-placeholder,
  .home-featured .games-empty-link { animation: none; transition: none; }
}
