/* Homepage: the list of games, one slim row each so all of them fit on one screen.
   Colours, font and the wordmark come from base.css. */

.home-top {
  padding: 18px 24px 14px;
}

.home-main {
  max-width: 640px;
  margin: 0 auto;
  padding: 28px 24px 48px;
}

.intro {
  margin-bottom: 24px;
  animation: rise 0.5s var(--ease) both;
}

.intro h1 {
  margin: 0 0 8px;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.intro p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

/* Game rows: preview, name and one line, then Play */

.games {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.games li {
  display: flex;
  animation: rise 0.5s var(--ease) both;
}

.games li:nth-child(2) { animation-delay: 60ms; }
.games li:nth-child(3) { animation-delay: 120ms; }
.games li:nth-child(n + 4) { animation-delay: 180ms; }

.game {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  flex: 1;
  padding: 10px 14px 10px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: transform 0.2s var(--ease), border-color 0.2s;
}

a.game:hover {
  border-color: var(--muted);
  transform: translateY(-2px);
}

a.game:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.game-art {
  position: relative;
  display: block;
  width: 80px;
  height: 80px;
  overflow: hidden;
  border-radius: 10px;
  background: var(--bg);
}

.game-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.game-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.game-line {
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-play {
  padding: 8px 16px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.game-soon {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-align: right;
  text-transform: uppercase;
}

.game.is-soon .game-art { opacity: 0.55; }
.game.is-soon .game-name { color: var(--muted); }

/* Match the Color Grading preview: the same photo, the right half graded, split on a diagonal */

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

.art-match .graded {
  clip-path: polygon(62% 0, 100% 0, 100% 100%, 38% 100%);
  filter: sepia(0.35) saturate(1.5) hue-rotate(-12deg) contrast(1.12) brightness(1.03);
}

/* Match Pixel Colors preview: four swatches */

.art-pixels {
  display: grid;
  grid-template-columns: repeat(2, 26px);
  gap: 6px;
  place-content: center;
}

.art-pixels span {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  background: var(--c);
}

@media (max-width: 820px) {
  .home-top { padding: 12px 16px 10px; }
  .home-main { padding: 16px 16px 32px; }
  .intro { margin-bottom: 18px; }
  .intro h1 { font-size: 26px; }
  .intro p { font-size: 15px; }
  .games { gap: 8px; }
  .game { gap: 12px; padding: 8px 12px 8px 8px; }
  .game-art { width: 64px; height: 64px; }
  .game-name { font-size: 16px; }
  .game-line { font-size: 13px; }
  .game-play { padding: 7px 14px; }
  .art-pixels { grid-template-columns: repeat(2, 21px); gap: 5px; }
  .art-pixels span { width: 21px; height: 21px; }
}

@media (prefers-reduced-motion: reduce) {
  .intro, .games li { animation: none; }
  .game { transition: none; }
}
