/* The games page (directory/index.html), on top of site.css: the featured
   game, the kinds of game, rows and the grid of cards, and the band for
   developers. Redesigned on 2026-10-11. Each card is the game's picture
   (directory/covers), its name, how many can play, and who made it. */

/* --- the top of the page ------------------------------------------------------ */

.hero {
  position: relative;
  overflow: hidden;
  padding: 56px 0 40px;
}

/* Soft lights behind the top of the page: the arcade at night. */
.hero::before {
  content: "";
  position: absolute;
  inset: -40% -10% auto -10%;
  height: 120%;
  background:
    radial-gradient(40% 45% at 18% 30%, rgba(91, 134, 255, 0.28), transparent 70%),
    radial-gradient(35% 40% at 78% 20%, rgba(255, 95, 168, 0.2), transparent 70%),
    radial-gradient(30% 35% at 60% 80%, rgba(155, 107, 255, 0.16), transparent 70%);
  pointer-events: none;
}

.hero-in {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 48px;
  align-items: center;
}

.hero-title {
  font-size: clamp(40px, 5.4vw, 68px);
}

/* The second half of the headline, in the colours of the brand mark. */
.hl {
  background: linear-gradient(92deg, #7c9fff 0%, #b78bff 50%, #ff7fb8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead {
  margin-top: 20px;
  max-width: 540px;
}

.hero-dev {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.hero-dev a {
  color: var(--text);
  font-weight: 700;
  text-decoration-color: rgba(255, 255, 255, 0.35);
  text-underline-offset: 3px;
}

.hero-dev a:hover {
  text-decoration-color: var(--text);
}

/* --- search -------------------------------------------------------------------- */

.search {
  position: relative;
  max-width: 540px;
  margin-top: 28px;
}

.search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 58px;
  padding: 0 56px 0 52px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(19, 25, 50, 0.85);
  color: var(--text);
  font: inherit;
  font-size: 17px;
}

.search-input::placeholder {
  color: #7d86a6;
}

.search-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(91, 134, 255, 0.25);
}

/* The browser's own clear cross would sit next to ours. */
.search-input::-webkit-search-cancel-button {
  display: none;
}

/* "/" jumps to the search: said where the eye is, for a keyboard. */
.search-key {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 26px;
  padding: 2px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  pointer-events: none;
}

.search:focus-within .search-key,
.search-clear:not([hidden]) ~ .search-key {
  display: none;
}

.search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.search-clear:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* --- the featured game ----------------------------------------------------------- */

.spotlight {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: 26px;
  overflow: hidden;
  color: #fff;
  text-decoration: none;
  box-shadow: var(--shadow), 0 0 0 1px var(--line-strong);
  isolation: isolate;
}

.spot-art {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.spot-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms ease;
}

.spotlight:hover .spot-art img,
.spotlight:focus-visible .spot-art img {
  transform: scale(1.04);
}

/* Dark from the bottom, so the words read on any picture. */
.spot-shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(7, 9, 18, 0) 30%, rgba(7, 9, 18, 0.55) 58%, rgba(7, 9, 18, 0.94) 100%);
}

.spot-badge {
  position: absolute;
  top: 18px;
  left: 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(7, 9, 18, 0.62);
  backdrop-filter: blur(6px);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.spot-badge .star {
  color: var(--yellow);
}

.spot-body {
  position: absolute;
  left: 26px;
  right: 26px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.spot-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(30px, 3.4vw, 44px);
  line-height: 1;
  letter-spacing: -0.03em;
}

.spot-blurb {
  max-width: 460px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 16px;
  line-height: 1.45;
}

.spot-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-top: 6px;
}

.spot-meta {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  font-weight: 600;
}

.spot-play {
  pointer-events: none; /* the whole card is the link */
}

/* --- a developer's page ----------------------------------------------------------- */

.dev-head {
  position: relative;
  padding: 48px 0 28px;
  overflow: hidden;
}

.dev-head::before {
  content: "";
  position: absolute;
  inset: -60% -10% auto -10%;
  height: 140%;
  background: radial-gradient(40% 50% at 20% 40%, rgba(91, 134, 255, 0.24), transparent 70%);
  pointer-events: none;
}

.dev-head-in {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 24px;
  align-items: center;
}

.dev-head .eyebrow {
  margin-bottom: 6px;
}

.dev-title {
  font-size: clamp(36px, 5vw, 56px);
  overflow-wrap: anywhere;
}

.dev-sub {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.dev-sub a {
  color: var(--text);
  font-weight: 700;
}

.dev-search-slot {
  grid-column: 1 / -1;
}

.dev-search-slot .search {
  margin-top: 18px;
}

.dev-avatar {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--display);
  font-weight: 800;
  font-size: 22px;
}

.dev-avatar-lg {
  width: 96px;
  height: 96px;
  font-size: 44px;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08);
}

/* --- kinds of game ------------------------------------------------------------- */

.catalog {
  padding-top: 8px;
}

/* On a laptop the kinds wrap onto a second line; on a phone they scroll
   sideways in one line (below), as in an app. */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 32px;
  padding: 4px 0;
}

.filters::-webkit-scrollbar {
  display: none;
}

.filter {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-2);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.filter:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.3);
}

.filter[aria-pressed="true"] {
  border-color: transparent;
  background: var(--text);
  color: var(--bg);
}

.filter-count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.filter[aria-pressed="true"] .filter-count {
  color: #4b5270;
}

.filter svg {
  flex: none;
}

/* --- rows and the grid ------------------------------------------------------------ */

.row-section {
  margin-bottom: 44px;
}

.row-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
}

.row-title {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 26px;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.row-count {
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
}

.row-note {
  color: var(--muted);
  font-size: 15px;
}

.row-more {
  margin-left: auto;
  color: var(--text-2);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  background: none;
  border: 0;
  padding: 6px 0;
  cursor: pointer;
  font-family: inherit;
}

.row-more:hover {
  color: var(--text);
  text-decoration: underline;
}

.grid,
.row {
  list-style: none;
  margin: 0;
  padding: 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(218px, 1fr));
  gap: 28px 20px;
}

/* A row scrolls sideways, five cards to a laptop's width. */
.row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 4 * 20px) / 5);
  gap: 20px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  margin: 0 calc(-1 * var(--gutter));
  padding: 4px var(--gutter) 14px;
  scroll-padding: 0 var(--gutter);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.row > li {
  scroll-snap-align: start;
}

/* --- a game's card ---------------------------------------------------------------- */

.gcard {
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius);
}

.gcard:focus-visible {
  outline-offset: 5px;
}

.gcard-art {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--line), 0 10px 30px rgba(0, 0, 0, 0.3);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.gcard:hover .gcard-art,
.gcard:focus-visible .gcard-art {
  transform: translateY(-4px);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5), 0 18px 40px rgba(0, 0, 0, 0.45);
}

.gcard-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 300ms ease;
}

.gcard:hover .gcard-cover {
  transform: scale(1.05);
}

/* A game without a picture: its colour and its first letter, large and faint. */
.gcard-letter {
  position: absolute;
  right: -10px;
  bottom: -46px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 190px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.2);
  pointer-events: none;
}

.gcard-letter-name {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 24px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #fff;
  overflow-wrap: anywhere;
}

/* "Play" appears over the picture on hover. */
.gcard-play {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #fff;
  color: #0b0e1a;
  font-size: 14px;
  font-weight: 800;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.gcard:hover .gcard-play,
.gcard:focus-visible .gcard-play {
  opacity: 1;
  transform: none;
}

.pill {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(7, 9, 18, 0.72);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.gcard-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 0 2px;
}

.gcard-title {
  font-weight: 800;
  font-size: 17px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gcard-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.meta-item svg {
  flex: none;
  opacity: 0.85;
}

.gcard-by {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
}

.gcard-by span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-avatar {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

/* "Add your game": for developers, at the end of the games. */
.tile-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  aspect-ratio: 4 / 3;
  padding: 16px;
  border: 2px dashed rgba(255, 255, 255, 0.22);
  border-radius: var(--radius);
  color: var(--text-2);
  text-align: center;
  text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease;
}

.tile-add:hover,
.tile-add:focus-visible {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--text);
}

.tile-add strong {
  color: var(--text);
  font-size: 17px;
}

.tile-add span {
  font-size: 14px;
}

.tile-add svg {
  color: var(--blue-hover);
  margin-bottom: 4px;
}

/* --- developers matching a search -------------------------------------------------- */

.devs-section {
  margin: 0 0 36px;
}

.devs-section .row-title {
  margin-bottom: 14px;
}

.devs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.dev {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 8px 22px 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.dev:hover,
.dev:focus-visible {
  border-color: var(--blue);
}

.dev-name {
  display: block;
  font-weight: 800;
  font-size: 17px;
  line-height: 1.2;
}

.dev-count {
  display: block;
  font-size: 14px;
  color: var(--muted);
}

.empty {
  margin: 8px 0 24px;
  padding: 28px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--text-2);
  text-align: center;
}

.all {
  padding-bottom: 32px;
}

/* --- the band for developers ------------------------------------------------------- */

.dev-cta {
  margin-top: 40px;
}

.dev-cta-in {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
  padding: 48px;
  border-radius: 28px;
  background:
    radial-gradient(60% 90% at 100% 0%, rgba(255, 95, 168, 0.35), transparent 60%),
    radial-gradient(60% 90% at 0% 100%, rgba(91, 134, 255, 0.45), transparent 60%),
    linear-gradient(135deg, #1b2350, #2a1f55);
  box-shadow: 0 0 0 1px var(--line-strong);
}

.dev-cta .eyebrow {
  color: #ffd9ea;
}

.dev-cta .lead {
  margin-top: 14px;
  color: #e3e6f7;
}

.dev-cta-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.dev-cta-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.dev-cta-steps li {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 16px;
  align-items: center;
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(7, 9, 18, 0.35);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.dev-cta-steps .step-n {
  grid-row: 1 / 3;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #1b2350;
  font-family: var(--display);
  font-weight: 800;
  font-size: 20px;
}

.dev-cta-steps b {
  font-size: 18px;
}

.dev-cta-steps span:last-child {
  color: #cfd4ee;
  font-size: 15px;
}

/* --- narrower windows ------------------------------------------------------------- */

@media (max-width: 1100px) {
  .row {
    grid-auto-columns: calc((100% - 3 * 20px) / 4);
  }
}

@media (max-width: 960px) {
  .hero {
    padding: 36px 0 28px;
  }

  .hero-in {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hero-side {
    max-width: 640px;
  }

  .row {
    grid-auto-columns: calc((100% - 2 * 20px) / 3);
  }

  .dev-cta-in {
    grid-template-columns: 1fr;
    padding: 36px 28px;
  }
}

@media (max-width: 640px) {
  .hero {
    padding: 24px 0 20px;
  }

  .hero-title {
    font-size: 38px;
  }

  .hero-lead {
    margin-top: 14px;
  }

  .search {
    margin-top: 20px;
  }

  .search-input {
    height: 52px;
    font-size: 16px;
  }

  .search-key {
    display: none;
  }

  .filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin: 0 calc(-1 * var(--gutter)) 24px;
    padding: 4px var(--gutter) 8px;
    scrollbar-width: none;
  }

  .filter {
    min-height: 40px;
    padding: 0 14px;
    font-size: 14px;
  }

  .spotlight {
    border-radius: 20px;
  }

  .spot-badge {
    top: 12px;
    left: 12px;
    font-size: 12px;
  }

  .spot-body {
    left: 16px;
    right: 16px;
    bottom: 14px;
    gap: 6px;
  }

  /* On a phone the picture is small: the name, who can play, and Play. */
  .spot-blurb {
    display: none;
  }

  .spot-title {
    font-size: 30px;
  }

  .spot-meta {
    font-size: 13px;
  }

  .spot-play {
    min-height: 40px;
    padding: 0 16px;
    font-size: 14px;
  }

  .dev-head {
    padding: 28px 0 16px;
  }

  .dev-avatar-lg {
    width: 64px;
    height: 64px;
    font-size: 30px;
  }

  .row-title {
    font-size: 22px;
  }

  /* The note goes under the title, so a long title keeps one line. */
  .row-head {
    flex-wrap: wrap;
    row-gap: 2px;
  }

  .row-note {
    order: 3;
    flex-basis: 100%;
    font-size: 14px;
  }

  .row {
    grid-auto-columns: 46%;
    gap: 12px;
  }

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

  .gcard {
    gap: 9px;
  }

  .gcard-art,
  .tile-add {
    border-radius: 14px;
  }

  .gcard-title {
    font-size: 16px;
  }

  .gcard-meta,
  .gcard-by {
    font-size: 13px;
  }

  /* No hover on a phone: the picture itself says "tap me". */
  .gcard-play {
    display: none;
  }

  .pill {
    top: 8px;
    left: 8px;
    padding: 4px 9px;
    font-size: 12px;
  }

  .gcard-letter {
    font-size: 130px;
    bottom: -30px;
  }

  .gcard-letter-name {
    font-size: 19px;
    left: 12px;
    bottom: 10px;
  }

  .tile-add strong {
    font-size: 15px;
  }

  .tile-add span {
    font-size: 12px;
  }

  .dev-cta-in {
    padding: 28px 20px;
    border-radius: 22px;
  }

  .dev-cta-buttons .btn {
    flex: 1 1 auto;
  }
}
