@font-face {
  font-family: "30 Second Life";
  font-style: normal;
  font-weight: 400;
  font-display: fallback;
  src: url(/games/30SecondLife.woff2) format("woff2"),
       url(/games/30SecondLife.ttf) format("truetype");
}

/* Tiles for the /games listing. Each game is a ::: game-tile div whose first
 * paragraph is its image; the featured ones get their own game's colors. */

.game-tile {
  --tile-bg: color-mix(in srgb, var(--tint-background-color) 35%, var(--main-background-color));
  --tile-border: color-mix(in srgb, var(--faint-text-color) 45%, transparent);
  background: var(--tile-bg);
  border: 1px solid var(--tile-border);
  border-radius: 12px;
  overflow: hidden;
  transition: transform .15s, box-shadow .15s;
}

.game-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .18);
}

.game-tile h3 {
  margin: 0 0 .4em;
  font-size: 125%;
}

.game-tile p {
  margin-bottom: .8em;
}

/* The grid of other games */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.game-grid .game-tile {
  display: flex;
  flex-direction: column;
  font-size: 90%;
}

.game-grid .game-tile > * {
  margin-left: 16px;
  margin-right: 16px;
}

.game-grid .game-tile > p:first-child {
  margin: 0 0 14px;
}

article .game-grid .game-tile > p:first-child img {
  display: block;
  width: 100%;
  max-width: none;
  max-height: none;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  margin: 0;
}

/* Pico-8 carts are tall and pixelly: show the whole cart on a dark backdrop */
article .game-grid .game-tile img.cart {
  object-fit: contain;
  background: #1d1d26;
  padding: 12px;
  image-rendering: pixelated;
}

/* Featured games: wide banners in each game's own palette. The whole tile is
 * clickable: the title link's ::before stretches to cover the entire tile. */
.game-tile.featured {
  --arrow-color: #fff;
  --glow: rgba(0, 0, 0, .3);
  position: relative;
  display: flow-root;
  margin-bottom: 20px;
  padding: 20px 56px 20px 20px;
  color: #e6e3f0;
  border: none;
  cursor: pointer;
}

.game-tile.featured a {
  color: #fff !important;
}

.game-tile.featured h3 a::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.game-tile.featured h3 a:hover {
  text-decoration: none;
}

.game-tile.featured h3 a:focus-visible {
  outline: none;
}

.game-tile.featured:has(h3 a:focus-visible) {
  outline: 3px solid var(--arrow-color);
  outline-offset: 3px;
}

.game-tile.featured:hover {
  box-shadow: 0 10px 28px var(--glow);
}

/* A chevron on the right edge that nudges over on hover */
.game-tile.featured::after {
  content: "›";
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 250%;
  line-height: 1;
  color: var(--arrow-color);
  opacity: .5;
  transition: transform .15s, opacity .15s;
}

.game-tile.featured:hover::after {
  opacity: 1;
  transform: translate(5px, -50%);
}

.game-tile.featured > p:first-child {
  float: left;
  margin: 0 20px 0 0;
}

article .game-tile.featured > p:first-child img {
  width: 120px;
  height: 120px;
  max-width: none;
  margin: 0;
  border-radius: 22%;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .4);
}

.game-tile.featured p:last-child {
  margin-bottom: 0;
}

/* On wider screens, keep the icon in its own column so text lines up */
@media screen and (min-width: 701px) {
  .game-tile.featured {
    display: grid;
    grid-template-columns: 120px 1fr;
    column-gap: 20px;
    align-content: start;
  }

  .game-tile.featured > * {
    grid-column: 2;
  }

  .game-tile.featured > p:first-child {
    float: none;
    grid-column: 1;
    grid-row: 1 / span 3;
    margin: 0;
  }
}

.game-tile.triptoy {
  --arrow-color: #f5f06a;
  --glow: rgba(182, 109, 242, .55);
  background: radial-gradient(ellipse at 0% 0%, #3a2470 0%, #1b1530 70%);
  border-top: 5px solid transparent;
  border-image: linear-gradient(90deg, #ff4d6d, #ffb84d, #f5f06a, #5ef08a,
                                #4dc9ff, #7a6bff, #e56bff) 1;
  border-radius: 0;
}

.game-tile.triptoy h3 a {
  font-family: Futura, "Century Gothic", "Avenir Next", "Josefin Sans", sans-serif;
  text-transform: uppercase;
  letter-spacing: .15em;
  font-weight: 300;
}

.game-tile.unshuffle {
  --arrow-color: #ffc94d;
  --glow: rgba(255, 201, 77, .45);
  background: linear-gradient(135deg, #4a6be0 0%, #3d3a8f 50%, #3a1a6a 100%);
}

.game-tile.unshuffle h3 a {
  font-family: "Nunito", "Quicksand", "Varela Round", "Trebuchet MS", sans-serif;
  text-transform: lowercase;
}

.game-tile.thirty-second-life {
  --arrow-color: #f5c400;
  background: #000;
  border: 3px solid #cc9900;
  border-radius: 0;
}

.game-tile.thirty-second-life:hover {
  box-shadow: 6px 6px 0 #cc9900;
}

.game-tile.thirty-second-life::after {
  font-family: "30 Second Life", "Roboto Mono", monospace;
  content: "→";
  font-size: 32px;
  -webkit-font-smoothing: none;
}

/* Pixel font: 8px grid, so stick to multiples of 8px */
.game-tile.thirty-second-life h3 a {
  font-family: "30 Second Life", "Roboto Mono", monospace;
  font-weight: normal;
  font-size: 24px;
  -webkit-font-smoothing: none;
}

@media screen and (max-width: 700px) {
  .game-tile.featured {
    padding: 14px 44px 14px 14px;
  }

  .game-tile.featured::after {
    right: 14px;
  }

  article .game-tile.featured > p:first-child img {
    width: 72px;
    height: 72px;
  }

  .game-tile.featured > p:first-child {
    margin-right: 14px;
  }
}

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