/* Home page: game badges (shaped like Pyrrhia) and About section */
.games {
  padding-bottom: 4rem;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem 2.5rem;
}

.game-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: var(--fg);
  border-radius: var(--radius);
  transition: transform 0.2s ease;
}

.game-badge:hover,
.game-badge:focus-visible {
  transform: translateY(-6px);
}

.game-badge:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 8px;
}

.game-badge-art {
  display: flex;
  align-items: center;
  width: 100%;
  /* Same height for every continent so titles line up across badges. */
  aspect-ratio: 978 / 800;
  margin-bottom: 1.25rem;
  /*
   * Clipped elements cannot carry their own border or glow, so the parent does:
   * four 1.5px offsets draw an even accent rim around any outline, and the
   * last drop-shadow adds the glow. The filter is deliberately not transitioned
   * (re-rasterising five shadows of a clipped image every frame is costly on
   * low-end GPUs); only the badge's transform animates, so hover is a cheap lift.
   */
  filter:
    drop-shadow(1.5px 0 0 var(--accent-dim))
    drop-shadow(-1.5px 0 0 var(--accent-dim))
    drop-shadow(0 1.5px 0 var(--accent-dim))
    drop-shadow(0 -1.5px 0 var(--accent-dim))
    drop-shadow(0 6px 16px rgba(255, 45, 85, 0.18));
}

.game-badge:hover .game-badge-art,
.game-badge:focus-visible .game-badge-art {
  filter:
    drop-shadow(1.5px 0 0 var(--accent))
    drop-shadow(-1.5px 0 0 var(--accent))
    drop-shadow(0 1.5px 0 var(--accent))
    drop-shadow(0 -1.5px 0 var(--accent))
    drop-shadow(0 10px 26px rgba(255, 45, 85, 0.45));
}

/* Every badge image is clipped to a continent outline (see the shapes below). */
.badge-shape {
  flex: none;
  width: 100%;
  background: var(--bg-surface);
}

.badge-shape img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/*
 * Outline of the continent of Pyrrhia (a dragon-shaped landmass), traced from
 * the coastline of the series map. Coordinates are percentages of the box,
 * whose aspect ratio (978 / 800) is the traced shape's bounding box.
 * The Bay of a Thousand Scales is the empty notch east of the Sky Kingdom.
 */
.pyrrhia-shape {
  aspect-ratio: 978 / 800;
  clip-path: polygon(
    18.2% 0.0%, 19.9% 1.0%, 21.6% 2.8%, 23.3% 4.0%,
    24.6% 2.5%, 25.7% 3.5%, 26.3% 6.2%, 26.9% 10.9%,
    28.6% 12.1%, 29.7% 14.4%, 30.0% 16.5%, 28.9% 18.8%,
    27.9% 21.2%, 27.4% 24.4%, 26.9% 28.7%, 27.1% 32.5%,
    27.9% 36.2%, 28.6% 38.8%, 30.0% 36.9%, 30.6% 35.0%,
    33.0% 32.5%, 35.1% 28.1%, 38.1% 23.8%, 40.7% 21.9%,
    42.7% 21.0%, 43.3% 20.2%, 45.0% 18.1%, 45.5% 16.2%,
    47.9% 15.6%, 49.4% 10.0%, 52.5% 10.0%, 55.5% 9.0%,
    59.6% 7.5%, 62.7% 6.2%, 66.8% 5.6%, 70.9% 5.2%,
    76.0% 6.0%, 81.1% 5.6%, 84.2% 4.6%, 86.5% 3.8%,
    86.4% 5.0%, 85.4% 5.9%, 84.2% 7.1%, 83.6% 8.5%,
    82.1% 10.0%, 80.3% 11.2%, 78.5% 12.2%, 77.2% 13.0%,
    76.3% 14.4%, 76.0% 15.6%, 75.5% 17.5%, 73.9% 20.2%,
    72.1% 23.0%, 70.3% 24.8%, 68.3% 27.8%, 66.4% 30.6%,
    65.7% 34.0%, 65.3% 40.0%, 64.7% 43.2%, 65.3% 45.2%,
    64.7% 46.5%, 65.7% 48.8%, 66.6% 50.6%, 68.0% 52.2%,
    69.6% 53.8%, 70.9% 55.6%, 71.9% 57.5%, 72.4% 59.4%,
    74.4% 60.4%, 77.0% 61.9%, 80.1% 62.7%, 82.6% 63.2%,
    85.2% 62.9%, 88.2% 62.5%, 90.8% 61.9%, 92.5% 60.6%,
    93.4% 59.4%, 93.9% 57.5%, 94.9% 55.6%, 95.4% 53.8%,
    96.4% 51.9%, 97.1% 50.0%, 97.8% 47.5%, 98.2% 45.0%,
    98.3% 41.9%, 97.8% 39.4%, 96.9% 36.9%, 95.7% 34.5%,
    95.6% 34.0%, 96.4% 35.4%, 97.6% 37.5%, 99.0% 41.2%,
    100.0% 45.0%, 100.0% 49.4%, 99.7% 52.5%, 100.0% 55.6%,
    98.5% 57.5%, 97.1% 60.0%, 96.1% 61.9%, 96.1% 65.0%,
    94.4% 67.5%, 93.4% 70.0%, 92.5% 74.4%, 90.3% 77.5%,
    89.8% 80.0%, 88.2% 82.5%, 86.2% 84.4%, 84.2% 87.5%,
    82.1% 88.2%, 81.1% 91.2%, 80.1% 93.8%, 77.0% 96.2%,
    73.9% 98.1%, 71.9% 99.4%, 70.3% 100.0%, 69.8% 97.8%,
    65.7% 94.6%, 62.2% 95.2%, 59.6% 96.5%, 56.7% 95.2%,
    54.7% 93.2%, 53.1% 95.0%, 52.2% 97.5%, 50.9% 98.6%,
    50.2% 96.9%, 50.6% 94.4%, 49.6% 90.6%, 48.4% 88.5%,
    45.3% 87.8%, 42.7% 86.6%, 41.2% 87.1%, 38.1% 88.8%,
    35.1% 89.4%, 33.0% 90.6%, 30.0% 90.9%, 27.4% 89.4%,
    25.1% 88.5%, 25.1% 85.0%, 22.8% 83.4%, 20.2% 83.1%,
    18.2% 84.0%, 16.9% 85.6%, 16.4% 87.5%, 15.3% 90.0%,
    14.8% 91.2%, 13.1% 92.5%, 10.7% 94.0%, 8.2% 95.8%,
    5.9% 95.8%, 7.5% 92.5%, 9.5% 90.6%, 10.2% 87.5%,
    11.0% 85.0%, 12.1% 83.5%, 14.6% 82.5%, 13.6% 80.2%,
    12.1% 78.1%, 11.0% 75.0%, 10.0% 71.2%, 9.0% 68.1%,
    8.5% 64.4%, 7.5% 60.0%, 7.8% 55.6%, 8.5% 52.5%,
    9.5% 48.8%, 10.3% 45.0%, 12.1% 41.2%, 11.0% 38.8%,
    9.3% 36.2%, 9.7% 33.1%, 12.4% 31.2%, 11.6% 29.4%,
    11.1% 25.0%, 4.4% 25.0%, 0.9% 24.5%, 0.0% 21.9%,
    0.3% 19.0%, 3.9% 16.5%, 4.0% 13.8%, 4.4% 10.9%,
    9.5% 8.8%, 9.7% 3.5%, 11.6% 1.9%, 14.8% 1.5%,
    16.5% 0.6%
  );
}

/*
 * Outline of the continent of Pantala (home of the HiveWings), traced from the
 * coastline of the series map and simplified. Percentages of the box, which is
 * deliberately stretched taller than the traced bounding box (1408 / 831) so
 * the badge is as tall as the Pyrrhia ones and shows more of the game.
 * Dragonfly Bay is the large empty notch on the east side, and the long south
 * arm curls around it.
 */
.pantala-shape {
  aspect-ratio: 978 / 800;
  clip-path: polygon(
    99.9% 7.1%, 98.3% 4.2%, 88.1% 3.4%, 86.6% 0.6%,
    81.7% 0.5%, 79.0% 2.0%, 75.8% 0.1%, 72.1% 0.0%,
    69.7% 1.9%, 72.4% 1.1%, 73.9% 2.9%, 74.8% 1.9%,
    75.8% 4.5%, 68.4% 8.0%, 64.7% 12.0%, 60.2% 12.0%,
    58.1% 13.4%, 51.1% 12.8%, 45.4% 9.4%, 40.4% 9.5%,
    40.1% 8.8%, 40.7% 7.7%, 43.3% 7.2%, 41.4% 3.3%,
    36.2% 3.7%, 35.0% 2.4%, 32.8% 3.3%, 31.0% 2.2%,
    26.1% 3.4%, 22.2% 2.4%, 16.3% 3.6%, 13.5% 3.0%,
    8.9% 6.6%, 4.7% 7.6%, 2.6% 9.6%, 1.1% 12.8%,
    1.5% 14.5%, 1.6% 12.9%, 3.6% 10.7%, 6.2% 12.2%,
    6.9% 15.1%, 2.3% 21.2%, 2.3% 24.8%, 0.0% 30.2%,
    1.1% 31.4%, 0.7% 33.5%, 1.1% 33.9%, 2.3% 31.1%,
    4.5% 29.9%, 4.6% 28.2%, 5.6% 28.8%, 6.1% 27.3%,
    7.2% 29.0%, 8.0% 27.6%, 8.9% 28.2%, 9.0% 27.0%,
    11.7% 26.6%, 13.3% 25.1%, 16.4% 25.4%, 18.4% 24.3%,
    18.9% 25.5%, 15.1% 27.2%, 12.2% 30.7%, 7.8% 34.0%,
    5.0% 42.5%, 3.8% 44.1%, 2.3% 53.9%, 4.1% 56.7%,
    4.7% 55.5%, 3.5% 54.2%, 5.2% 50.7%, 6.3% 49.8%,
    6.0% 51.6%, 6.8% 51.6%, 8.2% 48.0%, 12.0% 45.4%,
    19.8% 44.5%, 18.9% 43.4%, 19.1% 42.5%, 20.8% 44.1%,
    24.0% 44.3%, 24.8% 46.0%, 21.9% 46.1%, 24.2% 50.0%,
    25.2% 50.0%, 26.3% 54.1%, 21.9% 59.5%, 22.0% 61.1%,
    20.8% 61.9%, 20.1% 66.0%, 21.3% 71.1%, 21.7% 68.2%,
    22.7% 67.6%, 23.4% 68.6%, 23.8% 67.5%, 22.7% 65.7%,
    23.0% 64.6%, 24.1% 64.3%, 24.7% 65.9%, 26.4% 66.6%,
    25.9% 58.2%, 26.9% 56.9%, 27.1% 53.9%, 28.7% 53.5%,
    27.3% 58.8%, 27.8% 61.0%, 27.2% 63.9%, 28.1% 65.7%,
    28.1% 70.1%, 29.7% 73.5%, 29.0% 74.9%, 27.7% 71.8%,
    26.7% 71.7%, 26.7% 67.8%, 24.2% 73.1%, 23.8% 79.2%,
    25.7% 84.6%, 26.4% 84.5%, 26.6% 81.3%, 27.8% 81.7%,
    28.5% 79.2%, 29.1% 84.3%, 33.3% 89.2%, 35.5% 87.2%,
    38.6% 91.0%, 40.9% 91.6%, 45.3% 90.7%, 47.2% 87.6%,
    48.5% 87.2%, 49.2% 89.3%, 47.8% 89.8%, 49.5% 90.6%,
    53.1% 96.4%, 55.3% 96.7%, 54.4% 95.2%, 54.9% 94.2%,
    58.4% 98.4%, 59.9% 98.0%, 62.1% 100.0%, 63.6% 98.9%,
    64.8% 99.9%, 67.7% 98.2%, 68.9% 96.1%, 70.5% 95.9%,
    71.1% 94.7%, 70.1% 94.0%, 71.4% 92.9%, 72.3% 93.1%,
    72.3% 94.9%, 72.9% 95.5%, 74.1% 94.6%, 75.8% 95.4%,
    79.2% 94.8%, 82.0% 92.7%, 80.6% 91.7%, 81.0% 90.6%,
    83.4% 90.5%, 83.8% 91.2%, 83.1% 92.4%, 84.2% 92.3%,
    85.1% 90.8%, 88.8% 89.2%, 90.3% 87.0%, 87.9% 87.5%,
    87.5% 89.4%, 86.3% 88.7%, 88.1% 84.9%, 91.0% 84.7%,
    91.1% 86.4%, 92.0% 85.7%, 93.2% 82.3%, 91.2% 82.8%,
    91.6% 80.2%, 95.4% 78.2%, 94.9% 80.0%, 95.7% 79.4%,
    98.6% 73.5%, 98.5% 72.5%, 96.9% 75.5%, 96.2% 73.9%,
    97.9% 66.6%, 99.1% 64.7%, 99.4% 61.9%, 98.8% 60.5%,
    98.8% 62.5%, 97.2% 63.7%, 94.0% 57.8%, 95.0% 62.0%,
    94.2% 63.7%, 94.7% 65.7%, 95.5% 63.1%, 96.0% 63.6%,
    94.8% 68.9%, 94.0% 69.3%, 93.8% 68.0%, 92.7% 69.4%,
    90.0% 70.1%, 89.9% 71.7%, 88.3% 73.5%, 88.2% 74.9%,
    83.2% 77.3%, 82.4% 76.4%, 78.5% 77.0%, 77.3% 76.1%,
    76.8% 77.3%, 74.8% 77.5%, 72.1% 74.3%, 69.1% 73.7%,
    67.6% 71.4%, 67.7% 65.3%, 69.2% 61.0%, 68.7% 58.8%,
    70.1% 56.9%, 72.1% 59.5%, 71.9% 62.8%, 73.3% 66.6%,
    75.6% 65.3%, 77.5% 67.7%, 79.2% 68.1%, 79.0% 66.9%,
    79.7% 66.4%, 81.2% 67.8%, 81.1% 65.2%, 83.1% 64.9%,
    81.4% 62.2%, 82.7% 61.1%, 83.7% 62.7%, 84.1% 61.9%,
    83.2% 59.8%, 81.7% 59.3%, 80.2% 60.4%, 79.3% 62.5%,
    74.8% 62.3%, 74.1% 60.0%, 75.0% 58.0%, 75.5% 53.0%,
    74.7% 46.5%, 71.0% 46.4%, 67.4% 48.0%, 66.7% 38.8%,
    68.7% 37.7%, 69.2% 38.8%, 68.2% 39.6%, 69.1% 39.9%,
    76.8% 33.5%, 82.1% 35.9%, 82.2% 38.1%, 81.1% 40.5%,
    82.4% 40.2%, 83.1% 38.0%, 84.5% 36.6%, 84.6% 34.2%,
    86.6% 34.5%, 83.2% 32.2%, 80.7% 32.7%, 80.7% 31.7%,
    82.4% 31.0%, 81.7% 30.0%, 70.6% 31.8%, 70.1% 30.8%,
    72.3% 27.6%, 76.5% 24.7%, 79.2% 24.5%, 79.3% 22.5%,
    80.5% 21.9%, 80.3% 20.5%, 83.3% 18.9%, 86.1% 20.7%,
    89.8% 18.9%, 92.7% 20.0%, 93.7% 19.4%, 93.7% 21.1%,
    92.8% 21.8%, 95.3% 21.3%, 97.9% 16.9%, 93.7% 14.5%,
    92.5% 12.4%, 93.6% 11.6%, 94.5% 12.7%, 95.0% 11.1%,
    95.9% 11.0%, 96.1% 13.6%, 97.5% 12.0%, 99.2% 13.0%,
    99.9% 10.7%
  );
}

.game-badge-title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}

.game-badge-desc {
  color: var(--fg-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 300px;
}

/* About */
.about {
  max-width: 640px;
  margin: 0 auto;
  padding: 3rem 0 1rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.about h2 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.about p {
  color: var(--fg-muted);
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

.about .about-note {
  font-size: 0.85rem;
}

@media (max-width: 860px) {
  .games-grid {
    grid-template-columns: 1fr;
    max-width: 440px;
    margin: 0 auto;
    gap: 2.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .game-badge {
    transition: none;
  }

  .game-badge:hover,
  .game-badge:focus-visible {
    transform: none;
  }
}
