/* "Game" template (custom-game.hbs): the game in a cabinet, then the page's
   own content, with download cards (.game-downloads) for the computer versions. */

.game-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 2.5rem;
}

.game-head {
  width: 100%;
  max-width: 680px;
  margin-bottom: 1.5rem;
  text-align: center;
}

.game-back {
  display: inline-block;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text-acc);
  text-decoration: none;
}

.game-back:hover { color: var(--color-primary); }

.game-title {
  margin: 0;
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1.1;
}

.game-tagline {
  margin: 0.5rem 0 0;
  font-size: 1.15rem;
  color: var(--color-text-acc);
}

/* the cabinet around the game; PICO-8 draws in steps of 128px on big
   screens, so the screen inside is 512px at most (520 with its border) */
.game-cabinet {
  width: 100%;
  max-width: 556px;
  padding: 18px;
  background: #1d2b53;
  border-radius: 24px;
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.35), 0 12px 30px rgba(0, 0, 0, 0.3);
}

.game-screen {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #000;
  border: 4px solid #000;
  border-radius: 8px;
  box-sizing: border-box;
}

.game-screen iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.game-content {
  width: 100%;
  max-width: 680px;
  margin-top: 2rem;
}

/* downloads: <div class="game-downloads"> with one .game-dl card per version */
.game-downloads {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  width: 100%;
  margin: 2rem 0;
}

.game-downloads h2 {
  grid-column: 1 / -1;
  margin: 0;
}

.game-dl {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem 1.25rem 1.25rem;
  text-align: center;
  background: var(--color-bg-acc);
  border: 2px solid var(--color-border);
  border-radius: 20px;
}

.game-dl img {
  width: 128px;
  height: auto;
  margin: 0 0 1rem;
  image-rendering: pixelated;
  transform: rotate(-3deg);
  transition: transform 0.2s ease;
}

.game-dl:nth-child(odd) img { transform: rotate(3deg); }
.game-dl:hover img { transform: rotate(0) scale(1.05); }

.game-dl h3 {
  margin: 0;
  font-size: 1.35rem;
}

.game-dl p {
  flex: 1; /* buttons line up across cards */
  margin: 0.35rem 0 1rem;
  font-size: 0.95rem;
  color: var(--color-text-acc);
}

.content .game-dl .game-dl-main {
  display: none; /* game.js shows it once it knows the computer */
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.4rem;
  font-weight: 700;
  line-height: 1.2;
  color: #1d2b53 !important; /* the theme's link color would win otherwise */
  text-decoration: none;
  background: var(--color-primary);
  border: 0;
  border-radius: 999px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.content .game-dl .game-dl-main:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.game-dl-main svg { width: 1.1em; height: 1.1em; flex: none; }

.content .game-dl.is-ready .game-dl-main { display: inline-flex; }

.game-dl-all {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 0.9rem;
  margin-top: 0.9rem;
  font-size: 0.9rem;
}

.game-dl-all a { color: var(--color-text-acc); }
.game-dl-all a:hover { color: var(--color-primary); }

.game-dl-note {
  width: 100%;
  margin: 0;
  font-size: 0.85rem;
  color: var(--color-text-acc);
  text-align: center;
  grid-column: 1 / -1;
}

/* "Games" template (custom-games.hbs): a shelf of cartridges, then every
   game playable in its own section */
.games-hub + .games-hub { padding-top: 0; }

.games-hub-intro { margin-top: 0; text-align: center; }

.games-shelf {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
  width: 100%;
  margin: 0.5rem 0 1rem;
}

.games-shelf-cart {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: 120px;
  font-weight: 700;
  color: var(--color-text);
  text-align: center;
  text-decoration: none;
}

.games-shelf-cart img {
  width: 96px;
  height: auto;
  image-rendering: pixelated;
  transform: rotate(-3deg);
  transition: transform 0.2s ease;
}

.games-shelf-cart:nth-child(even) img { transform: rotate(3deg); }
.games-shelf-cart:hover img { transform: rotate(0) translateY(-4px) scale(1.05); }
.games-shelf-cart:hover { color: var(--color-primary); }

.games-hub-game {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 3rem 0 1rem;
  border-top: 2px dashed var(--color-border);
  scroll-margin-top: 1rem;
}

.games-hub-game:first-of-type { border-top: 0; }

.games-hub-game .game-title { font-size: clamp(1.75rem, 5vw, 2.5rem); }
.games-hub-game .game-title a { color: inherit; text-decoration: none; }
.games-hub-game .game-title a:hover { color: var(--color-primary); }

.games-hub-more { text-align: center; font-weight: 600; }
