/* The Games page uses the V4 type, color, and spacing tokens. */
.primary-nav a[aria-current="page"] {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: .33em;
}

.games-hero {
  display: grid;
  grid-template-columns: minmax(0, .84fr) minmax(0, 1.16fr);
  align-items: center;
  gap: clamp(30px, 4vw, 66px);
  padding-block: clamp(52px, 6.4vw, 96px) clamp(54px, 6.5vw, 100px);
}

.games-hero h1 {
  font-size: clamp(57px, 6.4vw, 94px);
  margin-block: 14px 20px;
}

.games-hero h1 > :is(span, em) { display: block; }
.games-hero h1 em { color: var(--accent); font-weight: 450; }
[dir="rtl"] .games-hero h1 { line-height: 1.17; }
[dir="rtl"] .games-hero h1 em { font-style: normal; }
.games-lede { color: var(--muted); font-size: clamp(16px, 1.45vw, 19px); max-width: 43ch; }
.games-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-block-start: 24px; }
.games-actions .primary-button, .games-section-heading .primary-button, .games-numblocks .primary-button { flex: none; }

.games-hero-art, .games-numblocks-art { margin: 0; min-width: 0; }
.games-scene {
  position: relative;
  aspect-ratio: 16 / 9;
  isolation: isolate;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--panel);
}
.games-hero .games-scene { aspect-ratio: 5 / 4; }
.games-scene picture, .games-scene picture img { position: absolute; inset: 0; width: 100%; height: 100%; }
.games-scene picture img { object-fit: cover; }
.games-scene--sky picture img { object-position: 50% 46%; }
.games-scene--sea picture img { object-position: 53% 60%; }
.games-scene--forest picture img { object-position: 48% 53%; }
.games-scene .games-scene-character {
  position: absolute;
  left: 50%;
  bottom: 6%;
  translate: -50% 0;
  width: auto;
  height: 74%;
  max-width: 67%;
  object-fit: contain;
  object-position: center bottom;
}
.games-scene--sea .games-scene-character { height: 63%; }
.games-hero .games-scene-character { height: 75%; bottom: 5%; }
.games-hero-caption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px; margin-block-start: 9px; }
.games-hero-caption > :first-child { color: var(--ink); font-weight: 650; }

.games-catcher { border-block-start: 1px solid var(--line); }
.games-section-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-block-end: 36px; }
.games-section-heading h2, .games-numblocks h2 { font-size: clamp(42px, 4.5vw, 67px); overflow-wrap: anywhere; }
.games-section-heading h2 { max-width: 17ch; margin-block: 9px 14px; }
.games-catcher .games-section-heading { margin-block-end: 28px; }
.games-worlds {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px 22px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.games-world-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  column-gap: 14px;
  margin-block-start: 12px;
  padding-inline: 1px;
}
.games-world-character { color: var(--accent); font-weight: 650; font-size: 14px; }
.games-world-description { grid-column: 1 / -1; color: var(--muted); margin-block-start: 5px; }
.games-worlds-caption { border-block-start: 1px solid var(--line); margin-block-start: 24px; padding-block-start: 11px; }

.games-numblocks-layout {
  display: grid;
  grid-template-columns: minmax(0, .86fr) minmax(0, 1.14fr);
  align-items: center;
  gap: clamp(26px, 4vw, 62px);
}
.games-numblocks h2 { max-width: 15ch; }
.games-numblocks-art picture { display: block; }
.games-numblocks-art img { width: 100%; aspect-ratio: 16 / 9; object-fit: contain; border-radius: var(--radius); background: var(--panel); }
.games-numblocks-art figcaption { margin-block-start: 9px; }
.games-modes { margin-block: 20px 22px; max-width: 36ch; }
.games-modes > div { padding-block: 11px; border-block-start: 1px solid var(--line); }
.games-modes > div:last-child { border-block-end: 1px solid var(--line); }
.games-modes dt { font-weight: 650; }
.games-modes dd { margin: 3px 0 0; color: var(--muted); line-height: 1.5; }

.games-page a[href^="#"]:focus-visible { outline-offset: 5px; }
.games-page .card-links .guide-link { width: fit-content; }
.games-page .section:focus-visible { outline-offset: -5px; }

@media (max-width: 850px) {
  .games-hero { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .games-hero .games-scene { aspect-ratio: 16 / 10; }
  .games-section-heading { align-items: start; flex-direction: column; gap: 18px; }
  .games-numblocks-layout { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 650px) {
  .games-hero { padding-block: 28px 44px; }
  .games-hero h1 { font-size: clamp(50px, 14.5vw, 75px); margin-block: 11px 14px; }
  .games-hero-copy { min-width: 0; }
  .games-actions { gap: 7px 15px; margin-block-start: 18px; }
  .games-hero .games-scene { aspect-ratio: 1; }
  .games-scene { aspect-ratio: 1; }
  .games-worlds { grid-template-columns: minmax(0, 1fr); gap: 25px; }
  .games-world-copy { margin-block-start: 9px; }
  .games-world-description { font-size: 15px; }
  .games-numblocks-art img { aspect-ratio: 1; }
}

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