:root {
  --page: #f6f3ec;
  --ink: #23201b;
  --ink-soft: #5d574d;
  --line: rgba(35, 32, 27, 0.14);
  --card: #fffdf8;
  --focus: #2f5b6e;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  /* Quit While Afloat's own old-chart colours, for its card. */
  --pirates-sea: #cdd5c0;
  --pirates-ink: #3b2f22;
  --pirates-red: #9c2f22;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #171512;
    --ink: #ece6da;
    --ink-soft: #a9a191;
    --line: rgba(236, 230, 218, 0.16);
    --card: #211e1a;
    --focus: #8cc2d6;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: clamp(2rem, 6vw, 5rem) clamp(1.25rem, 5vw, 3rem) 2rem;
  background: var(--page);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
}

.masthead,
main,
.footer {
  width: 100%;
  max-width: 44rem;
  margin: 0 auto;
}

.masthead h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.25rem, 6vw, 3.25rem);
  font-weight: 400;
  letter-spacing: -0.01em;
}

.masthead p {
  margin: 0.5rem 0 0;
  color: var(--ink-soft);
}

main {
  flex: 1;
  margin-top: clamp(2rem, 5vw, 3rem);
}

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

.game {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem 1.25rem 1.25rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: inherit;
  text-decoration: none;
  transition: border-color 120ms ease;
}

.game:hover {
  border-color: var(--ink-soft);
}

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

.game__mark {
  width: 4rem;
  height: 4rem;
  padding: 0.5rem;
  border-radius: 8px;
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
}

.game__mark .fill {
  stroke: none;
}

.game--pirates .game__mark {
  background: var(--pirates-sea);
  stroke: var(--pirates-ink);
}

.game--pirates .game__mark .fill {
  fill: var(--pirates-ink);
}

.game--pirates .game__mark .fill:last-child {
  fill: var(--pirates-red);
}

.game__body {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.game__title {
  font-family: var(--serif);
  font-size: 1.4rem;
  line-height: 1.2;
}

.game__pitch {
  color: var(--ink-soft);
}

.game__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.game__play {
  padding: 0.45rem 0.9rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
}

.game:hover .game__play {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--page);
}

@media (max-width: 34rem) {
  .game {
    grid-template-columns: auto 1fr;
    align-items: start;
  }

  .game__mark {
    width: 3rem;
    height: 3rem;
    padding: 0.35rem;
  }

  .game__play {
    grid-column: 2;
    justify-self: start;
  }
}

.footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}

.footer a {
  color: var(--ink-soft);
}

.footer a:hover {
  color: var(--ink);
}

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