.home-games { --card-gap: 16px; }

.home-games-panel {
  position: relative;
}

.home-section-heading {
  min-height: 44px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.home-section-heading h2 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #f2f4f6;
  font-size: clamp(1.1rem, 2.2vw, 1.5rem);
  font-weight: 700;
  line-height: 1.35;
}

.home-heading-icon { width: 24px; height: 28px; flex: 0 0 auto; }
.home-heading-icon img { display: block; width: 100%; height: 100%; object-fit: contain; }

.home-section-actions,
.home-carousel-controls { display: flex; align-items: center; gap: 10px; }
.home-section-actions { gap: 22px; flex-shrink: 0; }
.home-carousel-controls[hidden], .home-carousel-pages[hidden] { display: none; }

.home-view-all {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #ff424a;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  transition: color 0.18s ease;
}

.home-view-all:hover { color: #ff858b; }
.home-view-all svg, .home-carousel-arrow svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home-carousel-arrow {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #e1e6eb;
  background: #0e1216;
  border: 1px solid #30373f;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.home-carousel-arrow:hover:not(:disabled) { color: #ff686f; border-color: #b53a40; }
.home-carousel-arrow:disabled { opacity: 0.35; cursor: default; }

.home-game-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 3 * var(--card-gap)) / 4);
  gap: var(--card-gap);
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: #494e54 #121519;
  border-radius: 11px;
}

.home-games-panel.is-enhanced .home-game-track { scrollbar-width: none; }
.home-games-panel.is-enhanced .home-game-track::-webkit-scrollbar { display: none; }

.home-game-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--card-gap);
}

.home-game-card {
  position: relative;
  min-width: 0;
  background: #121519;
  border: 1px solid #2b3239;
  border-radius: 11px;
  scroll-snap-align: start;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.home-game-link { display: flex; height: 100%; flex-direction: column; border-radius: inherit; }
.home-game-card:focus-within { border-color: #f15b62; }
.home-game-link:focus-visible { outline-offset: -3px !important; }

.home-game-artwork {
  position: relative;
  aspect-ratio: 16 / 9;
  flex-shrink: 0;
  overflow: hidden;
  background: #1c2229;
  border-radius: 10px 10px 0 0;
}

.home-game-artwork img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.home-game-artwork img[hidden] { display: none; }
.home-game-fallback { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: linear-gradient(135deg, #222936, #15191f); color: #7f8999; }
.home-game-fallback svg { width: 38px; height: 38px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.home-game-fallback span { font-size: .65rem; letter-spacing: .16em; font-weight: 600; }

.home-game-discount {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 8px;
  color: #fff;
  background: #bd1821;
  border: 1px solid #e74349;
  border-radius: 5px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.5;
}

.home-game-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
}

.home-game-info h3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin: 0;
  color: #f4f5f6;
  font-size: 0.94rem;
  font-weight: 650;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.home-game-meta {
  margin-top: auto;
  padding-top: 5px;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.home-game-platform { margin: 0; flex-shrink: 0; color: #a7afb8; font-size: 0.75rem; }

.home-game-price {
  margin-left: auto;
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-variant-numeric: tabular-nums;
}

.home-game-price del { color: #949da6; font-size: 0.8rem; white-space: nowrap; }
.home-game-price strong { color: #ff3d47; font-size: 1.03rem; font-weight: 750; white-space: nowrap; }
.home-game-price strong.is-free { color: #49df97; }
.home-game-price strong.is-reference { color: #d5dbe3; }
.home-game-price strong.is-unavailable { color: #a7afb8; font-size: .85rem; }
.home-game-price-label { color: #a7afb8; font-size: .7rem; }
.home-games-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 180px; padding: 28px 20px; border: 1px solid #2b3239; border-radius: 11px; background: #121519; text-align: center; }
.home-games-empty p { margin: 0; max-width: 480px; color: #a7afb8; font-size: .9rem; line-height: 1.7; }
.home-games-empty a { display: inline-flex; align-items: center; min-height: 44px; color: #f49aa3; text-decoration: underline; text-underline-offset: 4px; }

.home-load-failure { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-block: 32px; padding: 32px 20px; border: 1px solid #2b3239; border-radius: 12px; background: #121519; text-align: center; overflow-wrap: anywhere; }
.home-load-failure > svg { width: 32px; height: 32px; color: #f45248; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.home-load-failure h2 { margin: 0; font-size: 1.25rem; line-height: 1.4; }
.home-load-failure p { max-width: 38ch; margin: 0; color: #a7afb8; font-size: .9rem; }
.home-load-failure .home-retry { min-height: 44px; margin-top: 4px; padding: 10px 24px; font-size: .9rem; text-transform: none; }

.home-carousel-pages { display: flex; justify-content: center; flex-wrap: wrap; margin: 10px 0 -10px; }
.home-carousel-page {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}
.home-carousel-page::before { content: ""; width: 7px; height: 7px; border-radius: 8px; background: #66717d; }
.home-carousel-page[aria-current="true"]::before { width: 20px; background: #ff3641; }
.home-carousel-page:hover::before { background: #ff7f87; }
.home-games :is(a, button, [tabindex]):focus-visible { outline: 2px solid #ff6b73; outline-offset: 3px; }

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .home-game-card:hover { background: #171b20; border-color: #964149; }
  .home-game-card:hover img { transform: scale(1.025); }
}

@media (max-width: 1023px) {
  .home-game-track { grid-auto-columns: calc((100% - var(--card-gap)) / 2); }
  .home-game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .home-games { --card-gap: 12px; }
  .home-section-heading { margin-bottom: 12px; gap: 8px; }
  .home-section-heading h2 { gap: 7px; font-size: 1rem; }
  .home-heading-icon { width: 19px; height: 23px; }
  .home-carousel-controls { display: none; }
  .home-view-all { gap: 4px; font-size: 0.72rem; }
  .home-view-all svg { width: 16px; height: 16px; }
  .home-game-track { grid-auto-columns: 88%; }
  .home-game-grid { grid-template-columns: minmax(0, 1fr); }
  .home-game-discount { top: 8px; left: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .home-games *, .home-games *::before { transition: none; }
}
