/* Games page. Like the vocabulary page: one rounded card, square rules that
   turn white, bold uppercase interface text, and no accent colour. */
.games-page {
  --background: #000;
  --card: #101010;
  --foreground: #fff;
  --muted: #9a9a9a;
  --rule: #3a3a3a;

  margin: 0;
  padding: 14px;
  background: var(--background);
  color: var(--foreground);
  font-family: "Inter", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color-scheme: dark;
}

.games-page *,
.games-page *::before,
.games-page *::after {
  box-sizing: border-box;
}

.games-page a {
  color: inherit;
  text-decoration: none;
}

.games-page a:focus-visible,
.menu-page a:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
}

/* The page sits inside one rounded card */
.games-card {
  min-height: calc(100dvh - 28px);
  padding: 30px 40px 48px;
  border-radius: 30px;
  background: var(--card);
}

.games-page .site-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin: 0 0 34px;
  font-size: clamp(0.75rem, 3.4vw, 3.25rem);
}

.games-page .site-header h1 {
  margin: clamp(36px, 8vh, 96px) 0 0;
  font-family: inherit;
  font-size: 2em;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.045em;
  text-transform: uppercase;
}

.games-page .home-link {
  flex-shrink: 0;
  color: var(--foreground);
  font-family: inherit;
  font-size: 1em;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

/* Equal 16:9 covers, side by side */
.games-shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 300px));
  gap: 30px 20px;
}

.game-card {
  min-width: 0;
}

.game-tile {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  isolation: isolate;
  border: 2px solid var(--rule);
  background: #191919;
  transition: border-color 0.2s ease;
}

.game-tile-art,
.game-tile-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.game-tile-art {
  object-fit: cover;
  transition: transform 500ms ease;
}

.game-tile-shade {
  background: linear-gradient(0deg, rgb(0 0 0 / 85%), transparent 66%);
}

.game-tile-bottom {
  position: absolute;
  right: 14px;
  bottom: 14px;
  left: 14px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
}

.game-tile h2 {
  margin: 0;
  font-size: 2.1rem;
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 0.88;
  text-transform: uppercase;
}

/* A square play button, ruled white and filling on hover */
.game-tile-play {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 2px solid #fff;
  background: rgb(0 0 0 / 50%);
  color: #fff;
  transition: background 0.2s ease, color 0.2s ease;
}

.game-tile-play svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.game-tile:hover,
.game-tile:focus-visible {
  border-color: #fff;
}

.game-tile:hover .game-tile-art,
.game-tile:focus-visible .game-tile-art {
  transform: scale(1.03);
}

.game-tile:hover .game-tile-play,
.game-tile:focus-visible .game-tile-play {
  background: #fff;
  color: #000;
}

.game-details {
  padding-top: 14px;
}

.game-details p {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1.5;
  text-transform: uppercase;
}

.game-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 8px 0 0;
  padding: 0;
  color: var(--muted);
  list-style: none;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1.5;
  text-transform: uppercase;
}

.game-facts li {
  position: relative;
  white-space: nowrap;
}

.game-facts li + li::before {
  position: absolute;
  left: -12px;
  color: #555;
  content: "/";
}

/* Keep all four menu destinations visible on small and short screens. */
.menu-page .bottom-left-nav {
  left: clamp(20px, 4vw, 40px);
  bottom: max(24px, env(safe-area-inset-bottom));
}

.menu-page .bottom-left-nav .big-title {
  font-size: min(clamp(2.1rem, 10vw, 8rem), 17vh);
}

@media (max-width: 860px) {
  .games-page {
    padding: 10px;
  }

  .games-card {
    min-height: calc(100dvh - 20px);
    padding: 22px 20px 40px;
    border-radius: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .games-page *,
  .menu-page .big-title {
    animation: none !important;
    transition: none !important;
  }
}
