.games-page .wrap {
  padding: 1.25rem;
}

.games-page .games-home {
  width: min(82rem, calc(100vw - 2rem));
  min-height: min(88vh, 60rem);
  justify-items: stretch;
  text-align: left;
  gap: clamp(1.8rem, 3vw, 2.75rem);
  padding: clamp(1.75rem, 4vw, 3rem);
}

.games-hero {
  max-width: 44rem;
  margin: 0 auto;
  display: grid;
  gap: 0.75rem;
  justify-items: center;
  text-align: center;
}

.games-kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.82rem;
  color: rgba(244, 247, 255, 0.72);
}

.games-title {
  max-width: none;
  font-size: clamp(3.25rem, 7vw, 5.85rem);
  text-shadow:
    0 18px 46px rgba(0, 0, 0, 0.48),
    0 0 20px rgba(125, 211, 252, 0.14);
}

.games-intro {
  margin: 0;
  max-width: 38rem;
  color: rgba(244, 247, 255, 0.74);
  font-size: 1.04rem;
  line-height: 1.6;
  text-wrap: balance;
}

.games-grid {
  width: min(76rem, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem;
}

.games-tile {
  --tile-accent: rgba(125, 211, 252, 0.2);
  --tile-gradient:
    linear-gradient(
      135deg,
      rgba(30, 144, 255, 0.18) 0%,
      rgba(106, 90, 205, 0.14) 48%,
      rgba(211, 211, 211, 0.08) 100%
    );
  position: relative;
  overflow: hidden;
  isolation: isolate;
  min-height: 11rem;
  padding: 1.65rem;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0) 42%),
    var(--tile-gradient),
    linear-gradient(180deg, rgba(7, 17, 42, 0.94), rgba(4, 10, 28, 0.96));
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.35rem;
  text-decoration: none;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.games-tile::before {
  content: '';
  position: absolute;
  top: -6rem;
  left: -4rem;
  width: 15rem;
  height: 15rem;
  border-radius: 50%;
  background: radial-gradient(circle, var(--tile-accent) 0%, rgba(255, 255, 255, 0) 72%);
  opacity: 0.95;
  transition:
    transform 180ms ease,
    opacity 180ms ease;
  z-index: -2;
}

.games-tile::after {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0) 48%);
  z-index: -1;
}

.games-tile:hover,
.games-tile:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.22);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0) 42%),
    var(--tile-gradient),
    linear-gradient(180deg, rgba(10, 22, 54, 0.96), rgba(6, 14, 34, 0.98));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  outline: none;
}

.games-tile:hover::before,
.games-tile:focus-visible::before {
  transform: scale(1.08);
  opacity: 1;
}

.games-tile:hover .games-icon-frame,
.games-tile:focus-visible .games-icon-frame {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.22);
}

.games-tile--wide {
  grid-column: span 2;
  min-height: 12.5rem;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: clamp(1.35rem, 3vw, 2.1rem);
}

.games-tile--wide .games-tile-copy {
  max-width: 24rem;
}

.games-icon-frame {
  width: 5.4rem;
  height: 5.4rem;
  flex: 0 0 auto;
  overflow: hidden;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.16);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}

.games-icon-frame--plate {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(228, 235, 244, 0.72));
  border-color: rgba(255, 255, 255, 0.4);
}

.games-tile--wide .games-icon-frame {
  width: 7.4rem;
  height: 7.4rem;
}

.games-icon {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 18px;
}

.games-icon--contain {
  object-fit: contain;
  padding: 0.45rem;
}

.games-icon--cover {
  object-fit: cover;
}

.games-tile-copy {
  display: grid;
  gap: 0.45rem;
}

.game-title {
  font-size: 1.46rem;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.games-tile--wide .game-title {
  font-size: 1.88rem;
}

.game-subtitle {
  max-width: 30ch;
  color: rgba(244, 247, 255, 0.74);
  font-size: 0.97rem;
  line-height: 1.48;
}

.games-tile--connections {
  --tile-accent: rgba(238, 130, 238, 0.28);
  --tile-gradient:
    linear-gradient(
      135deg,
      rgba(255, 99, 71, 0.28) 0%,
      rgba(255, 165, 0, 0.2) 34%,
      rgba(106, 90, 205, 0.26) 100%
    );
}

.games-tile--strands {
  --tile-accent: rgba(30, 144, 255, 0.28);
  --tile-gradient:
    linear-gradient(
      135deg,
      rgba(30, 144, 255, 0.28) 0%,
      rgba(106, 90, 205, 0.22) 60%,
      rgba(211, 211, 211, 0.12) 100%
    );
}

.games-tile--mathdle {
  --tile-accent: rgba(60, 179, 113, 0.26);
  --tile-gradient:
    linear-gradient(
      135deg,
      rgba(60, 179, 113, 0.28) 0%,
      rgba(128, 128, 128, 0.16) 58%,
      rgba(211, 211, 211, 0.12) 100%
    );
}

.games-tile--pi {
  --tile-accent: rgba(255, 165, 0, 0.28);
  --tile-gradient:
    linear-gradient(
      135deg,
      rgba(255, 99, 71, 0.28) 0%,
      rgba(255, 165, 0, 0.2) 38%,
      rgba(30, 144, 255, 0.18) 100%
    );
}

.games-tile--euler {
  --tile-accent: rgba(168, 178, 214, 0.24);
  --tile-gradient:
    linear-gradient(
      135deg,
      rgba(128, 128, 128, 0.24) 0%,
      rgba(106, 90, 205, 0.22) 60%,
      rgba(211, 211, 211, 0.12) 100%
    );
}

.games-tile--scrabble {
  --tile-accent: rgba(255, 165, 0, 0.28);
  --tile-gradient:
    linear-gradient(
      135deg,
      rgba(60, 179, 113, 0.24) 0%,
      rgba(255, 165, 0, 0.2) 58%,
      rgba(211, 211, 211, 0.12) 100%
    );
}

@media (max-width: 980px) {
  .games-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .games-tile--wide {
    grid-column: span 2;
  }
}

@media (max-width: 760px) {
  .games-page .games-home {
    min-height: auto;
    padding: 1.4rem;
  }

  .games-grid {
    grid-template-columns: 1fr;
  }

  .games-tile,
  .games-tile--wide {
    grid-column: auto;
    min-height: 10.5rem;
    flex-direction: column;
    align-items: flex-start;
  }

  .games-tile--wide .games-tile-copy {
    max-width: none;
  }

  .games-tile--wide .games-icon-frame {
    width: 5.4rem;
    height: 5.4rem;
  }

  .games-tile--wide .game-title {
    font-size: 1.52rem;
  }
}

@media (max-width: 520px) {
  .games-page .wrap {
    padding: 0.9rem;
  }

  .games-page .games-home {
    width: calc(100vw - 1rem);
    padding: 1.2rem;
  }

  .games-title {
    font-size: clamp(2.5rem, 11vw, 3.45rem);
  }

  .games-intro {
    font-size: 0.96rem;
  }

  .games-tile {
    padding: 1.3rem;
  }

  .games-icon-frame,
  .games-tile--wide .games-icon-frame {
    width: 4.6rem;
    height: 4.6rem;
  }
}
