/* Games: the list (/games), each game's page (/<game>) and the For brands plans */
html {
  background: var(--hero-bg);
}

/* (clear, so the sky behind it shows) */
body {
  background: transparent;
  color: var(--fg);
}

/* the night sky behind the page (sky.js) */
.games__sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.games {
  padding: clamp(120px, 14vw, 200px) var(--gutter) clamp(64px, 8vw, 120px);
}

.games__head {
  display: grid;
  gap: clamp(16px, 1.6vw, 24px);
  margin-bottom: clamp(48px, 6vw, 96px);
}

.games__label,
.game__n {
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.games__title {
  max-width: 11em;
  font-size: clamp(44px, 6.4vw, 120px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}

.games__intro {
  max-width: 34em;
  font-size: clamp(15px, 1.15vw, 20px);
  line-height: 1.4;
  color: var(--muted);
}

.games__list {
  display: grid;
  /* (four to a row: the list will grow) */
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(36px, 3.4vw, 56px) clamp(16px, 1.4vw, 24px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.game a {
  display: grid;
  gap: 16px;
}

.game__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  background: #0b1422;
}

.game__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ease-out);
}

.game__play {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 15px;
  border-radius: 999px;
  /* (dark glass: some of the pictures are bright) */
  background: rgba(4, 8, 15, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-weight: 600;
  font-size: 13px;
  transition: background 0.25s ease;
}

.game__body {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 12px;
  align-items: baseline;
}

.game__name {
  font-size: clamp(20px, 1.5vw, 28px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

/* (the card is narrow: the text runs under the number too) */
.game__meta,
.game__desc {
  grid-column: 1 / -1;
  max-width: 34em;
  font-size: clamp(13px, 0.85vw, 15px);
  line-height: 1.45;
  color: var(--muted);
}

.game__meta {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* (the genre, in the genre's colour: games/build.py) */
.game__meta b {
  font-weight: 500;
  color: var(--accent);
}

/* a short clip over the picture while the card is pointed at (cards.js) */
.game__clip {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.game.is-previewing .game__clip {
  opacity: 1;
}

.game__badge {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--fg);
  color: var(--hero-bg);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@media (hover: hover) and (pointer: fine) {
  .game a:hover .game__media img {
    transform: scale(1.04);
  }

  .game a:hover .game__play {
    background: rgba(4, 8, 15, 0.75);
  }
}

.game a:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 6px;
  border-radius: 12px;
}

.games__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  margin-top: clamp(64px, 8vw, 120px);
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 14px;
  color: var(--muted);
}

.games__foot a:hover {
  color: var(--fg);
}

.games__more {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  padding-bottom: 2px;
  transition: border-color 0.25s ease;
}

.games__more:hover {
  border-color: var(--fg);
}

/* ---------- For brands ---------- */
.brands {
  scroll-margin-top: 48px;
  margin-top: clamp(96px, 12vw, 200px);
  padding-top: clamp(40px, 5vw, 72px);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.brands__head {
  display: grid;
  gap: clamp(16px, 1.6vw, 24px);
  margin-bottom: clamp(40px, 5vw, 72px);
}

.brands__title {
  max-width: 12em;
  font-size: clamp(36px, 4.6vw, 88px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}

.brands__plans {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 1.6vw, 24px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.plan {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: clamp(24px, 2.2vw, 36px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.plan__name {
  font-size: clamp(20px, 1.6vw, 28px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.plan__price {
  font-size: 15px;
  color: var(--fg);
}

.plan__price b {
  font-size: clamp(28px, 2.4vw, 40px);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.plan__desc,
.plan__list {
  font-size: 15px;
  line-height: 1.45;
  color: var(--muted);
}

.plan__list {
  display: grid;
  gap: 6px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.plan__list li::before {
  content: "— ";
}

.plan__time {
  margin-top: auto;
  padding-top: 10px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.brands__steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: clamp(40px, 4vw, 64px) 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.brands__steps li {
  font-size: 15px;
  line-height: 1.4;
  color: var(--muted);
}

.brands__steps b {
  display: block;
  margin-bottom: 4px;
  color: var(--fg);
  font-weight: 600;
}

.brands__steps li::before {
  counter-increment: step;
  content: "0" counter(step);
  display: block;
  margin-bottom: 10px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.brands__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  margin-top: clamp(40px, 4vw, 64px);
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 26px;
  border-radius: 999px;
  background: var(--fg);
  color: var(--hero-bg);
  font-weight: 700;
  font-size: 16px;
  transition: transform 0.25s var(--ease-out), background 0.25s ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button:focus-visible,
.brands__cta a:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 4px;
}

.brands__note {
  font-size: 14px;
  color: var(--muted);
}

.brands__note a {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 1023px) {
  .brands__plans {
    grid-template-columns: 1fr;
  }

  .brands__steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 28px;
  }
}

@media (max-width: 1199px) {
  .games__list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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

/* (phones: still two to a row, each card down to its picture, name and one line) */
@media (max-width: 559px) {
  .games__list {
    gap: 28px 12px;
  }

  .game a {
    gap: 10px;
  }

  .game__n,
  .game__desc,
  .game__play {
    display: none;
  }

  .game__name {
    grid-column: 1 / -1;
    font-size: 17px;
  }

  .game__meta {
    font-size: 10px;
  }

  .game__badge {
    left: 8px;
    top: 8px;
  }
}

/* ---------- For brands: examples and questions ---------- */
.brands__sub {
  margin-bottom: clamp(20px, 2.4vw, 32px);
  font-size: clamp(22px, 1.8vw, 32px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.examples {
  margin-bottom: clamp(48px, 6vw, 96px);
}

.examples__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 1.6vw, 24px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.example {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

/* (the picture fills its side of the card, however tall the words make it) */
.example__media {
  position: relative;
  display: block;
  min-height: 220px;
  background: #0b1422;
}

.example__media img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.example__body {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 10px;
  padding: clamp(20px, 2vw, 32px);
}

.example .games__label {
  font-size: 12px;
  color: var(--accent);
}

.example__name {
  margin: 0;
  font-size: clamp(24px, 2.2vw, 36px);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.example__text {
  font-size: 15px;
  line-height: 1.45;
  color: #d6dbe3;
}

.example__facts {
  display: grid;
  gap: 4px;
  margin: 2px 0 6px;
  padding: 0;
  list-style: none;
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}

.example__facts li::before {
  content: "— ";
}

.faq {
  margin-top: clamp(48px, 5vw, 80px);
}

.faq details {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  font-size: clamp(16px, 1.2vw, 19px);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  flex: none;
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
  color: var(--muted);
}

.faq details[open] summary::after {
  content: "–";
}

.faq summary:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 4px;
}

.faq details p {
  max-width: 44em;
  padding: 0 0 18px;
  font-size: 15px;
  line-height: 1.55;
  color: #d6dbe3;
}

@media (max-width: 1199px) {
  .examples__list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 559px) {
  .example {
    grid-template-columns: 1fr;
  }

  .example__media {
    aspect-ratio: 16 / 9;
  }
}

/* ---------- The list (/games): a short head, the featured game, then every game ---------- */
.games--list {
  padding-top: clamp(96px, 8vw, 128px);
}

.games__head--row {
  grid-template-columns: minmax(0, 1fr) minmax(0, 26em);
  align-items: end;
  gap: 16px clamp(24px, 4vw, 80px);
  margin-bottom: clamp(20px, 2.2vw, 32px);
}

.games__head--row > div {
  display: grid;
  gap: 12px;
  justify-items: start;
}

.games__head--row .games__title {
  max-width: none;
  font-size: clamp(30px, 3.4vw, 60px);
}

.games__head--row .games__intro {
  font-size: 15px;
}

/* the banner: the games take turns on it, each over a silent loop from its trailer (cards.js) */
.spot {
  position: relative;
  display: grid;
  min-height: clamp(420px, 64vh, 700px);
  min-height: clamp(420px, 64svh, 700px);
  overflow: hidden;
  border-radius: 24px;
  background: #000;
  box-shadow: 0 40px 80px -48px rgba(0, 0, 0, 0.8);
}

/* (a hairline of light round the edge, over everything) */
.spot::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

/* (every game in the same place; the one whose turn it is fades in over the last) */
.spot__slide {
  position: relative;
  grid-area: 1 / 1;
  display: flex;
  align-items: flex-end;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.9s ease, visibility 0s 0.9s;
}

.spot__slide.is-on {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.9s ease;
}

.spot__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* dark under the words, a breath of the game's colour in the corner, open over the picture */
.spot__slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(70% 90% at 0% 100%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 70%),
    linear-gradient(to top, rgba(4, 8, 15, 0.94) 0%, rgba(4, 8, 15, 0.5) 38%, rgba(4, 8, 15, 0.08) 68%, rgba(4, 8, 15, 0.38) 100%),
    linear-gradient(to right, rgba(4, 8, 15, 0.62), transparent 58%);
  pointer-events: none;
}

.spot__inner {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: start;
  gap: clamp(10px, 1.1vw, 18px);
  max-width: min(100%, 60em);
  padding: 96px clamp(20px, 3.2vw, 56px) clamp(24px, 3.2vw, 56px);
}

.spot__label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
}

.spot__label::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.spot__name {
  font-size: clamp(52px, 7.6vw, 144px);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.05em;
  text-shadow: 0 2px 40px rgba(0, 0, 0, 0.35);
}

/* (the kanji stay together if the name has to break) */
.spot__name span {
  white-space: nowrap;
}

.spot__pitch {
  max-width: 28em;
  font-size: clamp(16px, 1.45vw, 23px);
  line-height: 1.35;
  color: #e6e9ee;
}

.spot .detail__actions {
  margin-top: clamp(4px, 0.8vw, 12px);
}

.spot a.button--ghost {
  padding: 16px 26px;
}

.spot .button--accent {
  box-shadow: 0 10px 40px -10px var(--accent);
}

/* which of how many */
.spot__count {
  position: absolute;
  z-index: 2;
  left: clamp(20px, 3.2vw, 56px);
  top: clamp(18px, 2.4vw, 36px);
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.6);
}

.spot__count b {
  font-weight: 500;
  color: var(--fg);
}

/* pause / play: two bars, or a triangle once it's paused */
.spot__pause {
  position: absolute;
  z-index: 2;
  right: clamp(20px, 3.2vw, 56px);
  top: clamp(14px, 2vw, 30px);
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: rgba(4, 8, 15, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--fg);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.spot__pause::before {
  content: "";
  width: 10px;
  height: 12px;
  border: 0 solid currentColor;
  border-width: 0 3px;
}

.spot__pause[aria-pressed="true"]::before {
  width: 0;
  height: 0;
  margin-left: 3px;
  border: 6px solid transparent;
  border-left: 10px solid currentColor;
  border-right: 0;
}

.spot__pause:hover {
  border-color: var(--fg);
  background: rgba(4, 8, 15, 0.6);
}

/* whose turn it is: a rail of the games' pictures, the lit one's bar running out */
.spot__nav {
  position: absolute;
  z-index: 2;
  right: clamp(20px, 3.2vw, 56px);
  bottom: clamp(24px, 3.2vw, 56px);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  /* (the more games, the narrower each picture: the rail keeps to its side of the banner) */
  width: min(44%, calc(var(--n, 4) * 146px));
}

.spot__tab {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  max-width: 136px;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: #0b1422;
  color: var(--fg);
  font: 600 12px/1 var(--font);
  text-align: left;
  cursor: pointer;
  opacity: 0.55;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14);
  transition: opacity 0.3s ease, transform 0.4s var(--ease-out), box-shadow 0.3s ease;
}

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

.spot__tab span {
  position: absolute;
  inset: auto 0 0 0;
  padding: 18px 9px 9px;
  background: linear-gradient(to top, rgba(4, 8, 15, 0.9), transparent);
}

.spot__tab:hover {
  opacity: 0.9;
}

.spot__tab[aria-current="true"] {
  opacity: 1;
  transform: translateY(-6px);
  box-shadow: 0 0 0 1.5px var(--accent), 0 14px 30px -12px var(--accent);
}

.spot__tab i {
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
}

.spot__tab i::after {
  content: "";
  display: block;
  height: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
}

/* (a turn lasts as long as the bar takes to fill: cards.js moves on when it ends) */
.spot__tab[aria-current="true"] i::after {
  animation: spot-run 8s linear forwards;
}

.spot.is-held .spot__tab i::after,
.spot.is-away .spot__tab i::after,
.spot.is-paused .spot__tab i::after {
  animation-play-state: paused;
}

@keyframes spot-run {
  to {
    transform: scaleX(1);
  }
}

.spot__tab:focus-visible,
.spot__pause:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
}

/* a game's turn: its picture eases back from a little close, its words come up one by one */
@media (prefers-reduced-motion: no-preference) {
  .spot__slide.is-on .spot__video {
    animation: spot-zoom 9s cubic-bezier(0.2, 0.6, 0.2, 1) both;
  }

  .spot__slide.is-on .spot__inner > * {
    animation: spot-rise 0.8s var(--ease-out) both;
  }

  .spot__slide.is-on .spot__inner > :nth-child(2) { animation-delay: 0.07s; }
  .spot__slide.is-on .spot__inner > :nth-child(3) { animation-delay: 0.14s; }
  .spot__slide.is-on .spot__inner > :nth-child(4) { animation-delay: 0.21s; }

  @keyframes spot-zoom {
    from {
      transform: scale(1.08);
    }
  }

  @keyframes spot-rise {
    from {
      opacity: 0;
      transform: translate3d(0, 18px, 0);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .spot__slide,
  .spot__slide.is-on,
  .spot__tab {
    transition: none;
  }

  .spot__tab[aria-current="true"] i::after {
    animation: none;
    transform: scaleX(1);
  }

  .spot__pause {
    display: none;
  }
}

/* (narrower: the rail runs along the bottom, under the words) */
@media (max-width: 1199px) {
  .spot__inner {
    padding-bottom: calc(clamp(20px, 3.2vw, 56px) + clamp(58px, 9vw, 96px) + 22px);
  }

  .spot__nav {
    left: clamp(20px, 3.2vw, 56px);
    bottom: clamp(20px, 3.2vw, 56px);
    justify-content: flex-start;
    width: auto;
  }

  .spot__tab {
    flex: 1 1 0;
    width: auto;
    max-width: 150px;
  }

  .spot__tab[aria-current="true"] {
    transform: translateY(-4px);
  }
}

.games__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin: clamp(48px, 5vw, 80px) 0 clamp(20px, 2.4vw, 32px);
}

/* the game last played on this device (cards.js) */
.resume {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  transition: border-color 0.2s ease;
}

.resume[hidden] {
  display: none;
}

.resume::before {
  content: "";
  border: 5px solid transparent;
  border-left: 8px solid currentColor;
  border-right: 0;
}

.resume:hover,
.resume:focus-visible {
  border-color: var(--fg);
}

/* genre chips (there once the list is long enough: games/build.py) */
.filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}

.filter button {
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 600 13px/1 var(--font);
  cursor: pointer;
}

.filter button:hover {
  color: var(--fg);
}

.filter button[aria-pressed="true"] {
  border-color: var(--accent, var(--fg));
  color: var(--fg);
}

@media (max-width: 767px) {
  .games__head--row {
    grid-template-columns: 1fr;
  }

  .spot {
    min-height: 68svh;
    border-radius: 18px;
  }

  .spot__name {
    font-size: 46px;
  }

  .spot .button {
    padding: 14px 20px;
    font-size: 15px;
  }

  .spot__nav {
    gap: 8px;
  }

  .spot__tab {
    border-radius: 8px;
  }

  /* (too small to read: the picture says which) */
  .spot__tab span {
    display: none;
  }
}

/* (land one after another as the page opens) */
@media (prefers-reduced-motion: no-preference) {
  .games__head > *,
  .game {
    animation: rise 0.9s var(--ease-out) both;
  }

  .games__head > :nth-child(2) { animation-delay: 0.06s; }
  .games__head > :nth-child(3) { animation-delay: 0.12s; }
  .games__head > :nth-child(4) { animation-delay: 0.16s; }
  .game:nth-child(1) { animation-delay: 0.2s; }
  .game:nth-child(2) { animation-delay: 0.28s; }
  .game:nth-child(3) { animation-delay: 0.36s; }
  .game:nth-child(4) { animation-delay: 0.44s; }
  .game:nth-child(5) { animation-delay: 0.52s; }

  @keyframes rise {
    from {
      opacity: 0;
      transform: translate3d(0, 32px, 0);
    }
  }
}

/* ---------- A game's own page (/<game>/, games/build.py) ---------- */
.detail__back {
  display: inline-flex;
  gap: 8px;
  margin-bottom: clamp(28px, 3vw, 48px);
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  transition: color 0.25s ease;
}

.detail__back:hover {
  color: var(--fg);
}

.detail__head {
  display: grid;
  gap: clamp(16px, 1.6vw, 24px);
}

.detail__title {
  font-size: clamp(48px, 7.2vw, 136px);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.045em;
}

.detail__title span {
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0;
}

.detail__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
  margin-top: 8px;
}

.detail__link {
  font-weight: 600;
  font-size: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  padding-bottom: 2px;
  transition: border-color 0.25s ease;
}

.detail__link:hover {
  border-color: var(--fg);
}

.detail__note {
  max-width: 40em;
  padding: 12px 16px;
  border: 1px solid rgba(255, 200, 120, 0.35);
  border-radius: 12px;
  background: rgba(255, 200, 120, 0.06);
  font-size: 14px;
  line-height: 1.45;
  color: #f3dcb8;
}

.facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px 24px;
  margin: clamp(16px, 2vw, 32px) 0 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.facts dt {
  margin-bottom: 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.facts dd {
  margin: 0;
  font-size: 15px;
  line-height: 1.4;
}

.detail__section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 16px clamp(24px, 4vw, 80px);
  margin-top: clamp(56px, 7vw, 112px);
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.detail__h {
  font-size: clamp(22px, 1.8vw, 32px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.detail__prose {
  display: grid;
  gap: 16px;
  max-width: 40em;
  font-size: clamp(16px, 1.2vw, 20px);
  line-height: 1.5;
  color: #d6dbe3;
}

.detail__small {
  margin-top: 16px;
  max-width: 40em;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

.controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 32px;
  margin: 0;
}

.controls__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.controls dt {
  font-size: 15px;
  color: #d6dbe3;
}

.controls dd {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  margin: 0;
}

kbd {
  min-width: 28px;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  line-height: 1.3;
  text-align: center;
  color: var(--fg);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gallery a {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border-radius: 10px;
  background: #0b1422;
}

.gallery img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ease-out);
}

.gallery a:hover img {
  transform: scale(1.04);
}

.detail__brand {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 20px 32px;
  margin-top: clamp(56px, 7vw, 112px);
  padding: clamp(24px, 3vw, 40px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.detail__brand p {
  max-width: 36em;
  font-size: clamp(15px, 1.15vw, 19px);
  line-height: 1.45;
  color: var(--muted);
}

.detail__brand b {
  display: block;
  margin-bottom: 4px;
  color: var(--fg);
  font-size: clamp(18px, 1.5vw, 24px);
}

.detail__pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: clamp(40px, 5vw, 72px);
}

.detail__pager a {
  display: grid;
  gap: 4px;
  font-size: clamp(20px, 1.8vw, 30px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.detail__pager a:last-child {
  text-align: right;
}

.detail__pager span {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.detail__more {
  margin-top: clamp(56px, 7vw, 112px);
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.detail__more .detail__h {
  margin-bottom: clamp(24px, 3vw, 40px);
}

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

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

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

@media (max-width: 559px) {
  .gallery {
    grid-template-columns: 1fr;
  }

  .detail__play {
    padding: 12px 20px;
    font-size: 15px;
  }
}

/* ---------- A game's hero (games/detail.js) ---------- */
.ghero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: min(92vh, 980px);
  min-height: min(92svh, 980px);
  overflow: hidden;
  background: #000;
}

.ghero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* (dark enough under the words, open above them) */
.ghero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, var(--hero-bg) 0%, rgba(4, 8, 15, 0.85) 22%, rgba(4, 8, 15, 0.25) 60%, rgba(4, 8, 15, 0.45) 100%),
    linear-gradient(to right, rgba(4, 8, 15, 0.6), transparent 60%);
  pointer-events: none;
}

.ghero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  gap: clamp(14px, 1.4vw, 22px);
  width: 100%;
  padding: 120px var(--gutter) clamp(40px, 5vw, 72px);
}

.ghero__inner .detail__back {
  justify-self: start;
  margin-bottom: auto;
}

.ghero__pitch {
  max-width: 30em;
  font-size: clamp(17px, 1.5vw, 24px);
  line-height: 1.35;
  color: #e6e9ee;
}

.has-game .games__label {
  color: var(--accent);
}

.button svg {
  flex: none;
}

.button--accent {
  background: var(--accent);
  color: #05070c;
}

.button--ghost {
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(4, 8, 15, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--fg);
  font: inherit;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
}

.button--ghost:hover {
  border-color: var(--fg);
}

/* before you play: this visitor's device and connection */
.check {
  display: grid;
  gap: 6px;
  justify-items: start;
  max-width: 40em;
  padding: 12px 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 12px;
  background: rgba(4, 8, 15, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 14px;
  line-height: 1.45;
  color: #e6e9ee;
}

.check[hidden] {
  display: none;
}

.check__send {
  margin-top: 4px;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #05070c;
  font: 700 14px/1 var(--font);
  cursor: pointer;
}

.detail {
  padding-top: clamp(32px, 4vw, 56px);
}

.detail .facts {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.detail .detail__note {
  margin-top: 24px;
}

/* ---------- Highlights ---------- */
.features {
  margin-top: clamp(56px, 7vw, 112px);
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.features .detail__h {
  margin-bottom: clamp(24px, 3vw, 40px);
}

.features__list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(16px, 1.6vw, 24px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.feature__media {
  overflow: hidden;
  aspect-ratio: 16 / 10;
  margin-bottom: 14px;
  border-radius: 12px;
  background: #0b1422;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.feature__media video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feature__title {
  margin-bottom: 6px;
  font-size: clamp(17px, 1.3vw, 21px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.feature__title::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin: 0 10px 2px 0;
  border-radius: 50%;
  background: var(--accent);
}

.feature__text {
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}

/* ---------- The full trailer ---------- */
.watch {
  width: min(1280px, 92vw);
  max-width: none;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}

.watch::backdrop {
  background: rgba(2, 4, 8, 0.88);
  backdrop-filter: blur(6px);
}

.watch__video {
  display: block;
  width: 100%;
  height: auto;
  max-height: 86vh;
  border-radius: 12px;
  background: #000;
}

.watch__close {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: var(--fg);
  font: 400 28px/1 var(--font);
  cursor: pointer;
}

.watch__close:hover,
.watch__close:focus-visible {
  background: rgba(255, 255, 255, 0.24);
}

/* ---------- Play, always in reach ---------- */
.playbar {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 8px 8px 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(4, 8, 15, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  font-weight: 700;
  font-size: 15px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 24px);
  transition: opacity 0.35s ease, transform 0.5s var(--ease-out);
}

.playbar.is-shown {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.playbar img {
  width: 64px;
  height: 40px;
  border-radius: 999px;
  object-fit: cover;
}

.playbar .button {
  padding: 12px 20px;
  font-size: 15px;
}

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

@media (max-width: 559px) {
  .features__list {
    grid-template-columns: 1fr;
  }

  .ghero {
    min-height: 88svh;
  }

  .detail__actions .button {
    padding: 14px 20px;
    font-size: 15px;
  }

  .playbar {
    left: 16px;
    right: 16px;
    justify-content: space-between;
    transform: translate(0, 24px);
  }

  .playbar.is-shown {
    transform: none;
  }
}

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

/* ---------- Start somewhere (a world, a mood) ---------- */
.quick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #d6dbe3;
}

.quick b {
  margin-right: 4px;
  font-weight: 600;
  color: var(--muted);
}

.quick a {
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(4, 8, 15, 0.4);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.quick a:hover,
.quick a:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.quick span {
  font-size: 13px;
  color: var(--muted);
}

/* ---------- How to play: tabs ---------- */
.tabs__list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.tabs__tab {
  padding: 9px 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 600 14px/1 var(--font);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.tabs__tab:hover {
  color: var(--fg);
}

.tabs__tab[aria-selected="true"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--fg);
}

.tabs__tab:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 2px;
}

.controls__how {
  font-size: 14px;
  color: var(--muted);
  text-align: right;
}

/* the little keyboard: the keys this game uses are lit */
.kb {
  display: grid;
  gap: 5px;
  width: max-content;
  max-width: 100%;
  margin-bottom: 20px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.kb__row {
  display: flex;
  gap: 5px;
}

.kb__row--2 {
  padding-left: 18px;
}

.kb__row--3 {
  padding-left: 0;
}

.kb__row--4 {
  justify-content: center;
}

.kb__key {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom-width: 2px;
  border-radius: 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.3);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.kb__key--wide {
  width: auto;
  min-width: 46px;
  padding: 0 8px;
}

.kb__row--4 .kb__key {
  min-width: 200px;
}

.kb__key.is-used {
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  color: var(--fg);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.kb__key.is-lit {
  background: var(--accent);
  color: #05070c;
  transform: translateY(1px);
}

.needs {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.needs h3 {
  margin-bottom: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.needs ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
  font-size: 15px;
  line-height: 1.45;
  color: #d6dbe3;
}

/* ---------- How it's made ---------- */
.making {
  margin: 0 0 24px;
}

.making__box {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  background: #000;
}

.making__box video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.trailer-btn {
  position: absolute;
  left: 50%;
  top: 50%;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border: 0;
  border-radius: 999px;
  background: rgba(4, 8, 15, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--fg);
  font: 600 15px/1 var(--font);
  cursor: pointer;
  transform: translate(-50%, -50%);
}

.trailer-btn:hover {
  background: rgba(4, 8, 15, 0.85);
}

.trailer-btn[hidden] {
  display: none;
}

.stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.stack li {
  padding: 5px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 999px;
  font-size: 13px;
  color: #d6dbe3;
}

/* ---------- What's new ---------- */
.updates {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.updates li {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.updates time {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
  line-height: 1.9;
  color: var(--accent);
}

.updates p {
  font-size: 15px;
  line-height: 1.5;
  color: #d6dbe3;
}

/* (on the list: each update names its game, in the game's colour) */
.updates a {
  margin-right: 8px;
  font-weight: 700;
  color: var(--fg);
}

.updates a:hover {
  color: var(--accent);
}

.detail__credits {
  margin-top: 0;
}

/* ---------- Share ---------- */
.share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-top: clamp(32px, 4vw, 56px);
  font-size: 14px;
  color: var(--muted);
}

.share span {
  margin-right: 6px;
}

.share a,
.share button {
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: transparent;
  color: var(--fg);
  font: 600 14px/1 var(--font);
  cursor: pointer;
}

.share a:hover,
.share button:hover {
  border-color: var(--accent);
}

/* ---------- The gallery, one at a time ---------- */
.gallery a {
  cursor: zoom-in;
}

.lightbox {
  width: min(1280px, 92vw);
  max-width: none;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}

.lightbox::backdrop {
  background: rgba(2, 4, 8, 0.92);
}

.lightbox figure {
  margin: 0;
}

.lightbox img {
  display: block;
  width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 10px;
}

.lightbox figcaption {
  margin-top: 12px;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  width: 48px;
  height: 48px;
  margin-top: -40px;
  border: 0;
  border-radius: 50%;
  background: rgba(4, 8, 15, 0.6);
  color: var(--fg);
  font: 400 30px/1 var(--font);
  cursor: pointer;
}

.lightbox__nav--prev {
  left: 12px;
}

.lightbox__nav--next {
  right: 12px;
}

.lightbox__nav:hover {
  background: rgba(4, 8, 15, 0.9);
}

/* ---------- Into the game ---------- */
.enter {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  padding: clamp(24px, 4vw, 56px) var(--gutter);
  background: #000 center / cover no-repeat;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.enter::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(4, 8, 15, 0.85), transparent 50%);
}

.enter p {
  position: relative;
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg);
}

.enter.is-on {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 559px) {
  .kb {
    display: none;
  }

  .updates li {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .controls__how {
    max-width: 55%;
  }
}
