/* Home games carousel: native scroller, arrows and a calm autoplay, no
   dependencies. Without JS the track stays a swipeable, snapped list of links. */
.arcade-preview.home-games {
  grid-template-columns: minmax(0, 1fr);
  gap: 30px;
}
.home-games-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px 40px;
}
.home-games-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 22px;
}
.home-games-controls:not([hidden]) {
  display: flex;
  gap: 10px;
}
.home-games-arrow {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid #64786f;
  border-radius: 50%;
  background: #191522;
  color: var(--mint);
  cursor: pointer;
}
.home-games-arrow:hover {
  border-color: var(--mint);
}
.home-games-toggle {
  min-width: 48px;
  height: 48px;
  padding: 0 18px;
  border: 1px solid #64786f;
  border-radius: 24px;
  background: #191522;
  color: var(--mint);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.home-games-toggle:hover {
  border-color: var(--mint);
}
.home-games-arrow[aria-disabled='true'] {
  border-color: var(--line);
  color: #8f8496;
  cursor: default;
}
.home-games-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* The track padding keeps focus rings and hover lift inside the scroller. */
.home-games-track {
  --home-games-gap: 18px;
  --home-games-pad: 10px;
  display: flex;
  gap: var(--home-games-gap);
  margin: 0 calc(-1 * var(--home-games-pad));
  padding: var(--home-games-pad);
  list-style: none;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--home-games-pad);
  scrollbar-width: thin;
  scrollbar-color: #64786f transparent;
}
.home-games-item {
  display: flex;
  flex: 0 0 calc((100% - var(--home-games-gap)) / 2);
  min-width: 0;
  scroll-snap-align: start;
}
@media (min-width: 1024px) {
  /* Desktop: exactly three cards in view. */
  .home-games-item {
    flex-basis: calc((100% - 2 * var(--home-games-gap)) / 3);
  }
}
@media (max-width: 760px) {
  .home-games-track {
    --home-games-gap: 14px;
  }
  /* Mobile: one card plus a peek of the next one hints at swiping. */
  .home-games-item {
    flex-basis: 86%;
  }
}

.home-game {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 200px;
  padding: 24px;
  border: 1px solid var(--game-accent);
  border-radius: 14px;
  color: inherit;
  /* Opaque themed fallback: readable where backdrop-filter is unsupported. */
  background: radial-gradient(
    ellipse at 60% 35%,
    var(--game-a),
    var(--game-b) 42%,
    var(--game-c) 80%
  );
  transition:
    border-color 0.2s,
    transform 0.2s;
}
@supports ((backdrop-filter: blur(16px)) or (-webkit-backdrop-filter: blur(16px))) {
  /* Frosted panel: only the backdrop is blurred, never text or icons. */
  .home-game {
    background: radial-gradient(
      ellipse at 60% 35%,
      var(--game-a-frost),
      var(--game-b-frost) 42%,
      var(--game-c-frost) 80%
    );
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
  }
}
.home-game:hover {
  border-color: var(--mint);
}
@media (prefers-reduced-motion: no-preference) {
  .home-game:hover {
    transform: translateY(-3px);
  }
}
body.reduced-motion .home-game:hover {
  transform: none;
}
.home-game:focus-visible,
.home-games-arrow:focus-visible,
.home-games-toggle:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}
.home-game-meta {
  padding-right: 40px;
  color: var(--mint);
  font-size: 10px;
  letter-spacing: 0.15em;
}
.home-game-title {
  display: block;
  margin: 12px 0 10px;
  font:
    700 26px / 1.15 'Space Grotesk',
    sans-serif;
  letter-spacing: -0.02em;
}
.home-games .home-game-description {
  max-width: none;
  margin: 0;
  color: #e2d7e6;
  font-size: 14px;
  line-height: 1.55;
}
.home-game .icon {
  position: absolute;
  top: 22px;
  right: 22px;
}
@media (max-width: 760px) {
  .home-game {
    min-height: 0;
    padding: 20px;
  }
  .home-game-title {
    font-size: 23px;
  }
  .home-game .icon {
    top: 18px;
    right: 18px;
  }
}

/* Per-game themes, matching each game's Arcade card palette. */
.home-game--phishing {
  --game-a: #286271;
  --game-b: #12323c;
  --game-c: #111c2a;
  --game-a-frost: #286271cc;
  --game-b-frost: #12323cdd;
  --game-c-frost: #111c2ae6;
  --game-accent: #648474;
}
.home-game--password {
  --game-a: #773955;
  --game-b: #3d203d;
  --game-c: #251728;
  --game-a-frost: #773955cc;
  --game-b-frost: #3d203ddd;
  --game-c-frost: #251728e6;
  --game-accent: #97657b;
}
.home-game--firewall {
  --game-a: #805825;
  --game-b: #443016;
  --game-c: #231e20;
  --game-a-frost: #805825cc;
  --game-b-frost: #443016dd;
  --game-c-frost: #231e20e6;
  --game-accent: #a99052;
}
.home-game--forensics {
  --game-a: #305e64;
  --game-b: #203b43;
  --game-c: #151f2b;
  --game-a-frost: #305e64cc;
  --game-b-frost: #203b43dd;
  --game-c-frost: #151f2be6;
  --game-accent: #6baab2;
}
.home-game--tracce {
  --game-a: #6d2534;
  --game-b: #321b27;
  --game-c: #15111e;
  --game-a-frost: #6d2534cc;
  --game-b-frost: #321b27dd;
  --game-c-frost: #15111ee6;
  --game-accent: #fb394a;
}
.home-game--reato {
  --game-a: #395a86;
  --game-b: #242a4d;
  --game-c: #181a2b;
  --game-a-frost: #395a86cc;
  --game-b-frost: #242a4ddd;
  --game-c-frost: #181a2be6;
  --game-accent: #829bc4;
}
.home-game--incident-response {
  --game-a: #736045;
  --game-b: #38302c;
  --game-c: #201b29;
  --game-a-frost: #736045cc;
  --game-b-frost: #38302cdd;
  --game-c-frost: #201b29e6;
  --game-accent: #a99168;
}

.home-game--permission-lab {
  --game-a: #5e354d;
  --game-b: #30213c;
  --game-c: #191522;
  --game-a-frost: #5e354dcc;
  --game-b-frost: #30213cdd;
  --game-c-frost: #191522e6;
  --game-accent: #ae7b9e;
}





@media (prefers-reduced-motion: no-preference) {
  .home-games-track {
    scroll-behavior: smooth;
  }
}
body.reduced-motion .home-games-track {
  scroll-behavior: auto;
}

/* With JS the autoplay drifts the track continuously, so mandatory snap would
   fight it: snap is off only in the enhanced section and the script picks the
   scroll behaviour itself. Arrows still land on card edges; wheel and touch
   stay native. */
.home-games[data-home-games-enhanced] .home-games-track {
  scroll-snap-type: none;
  scroll-behavior: auto;
}
