:root {
  --bg: #fafaf9;
  --fg: #1c1917;
  --muted: #57534e;
  --accent: #2563eb;
  --on-accent: #ffffff;
  --card: #ffffff;
  --border: #e7e5e4;
  --max: 44rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111110;
    --fg: #f5f5f4;
    --muted: #a8a29e;
    --accent: #60a5fa;
    --on-accent: #0b1220;
    --card: #1c1b1a;
    --border: #2e2c2a;
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.site-header,
main,
.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1rem;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

.brand {
  color: var(--fg);
  font-weight: 700;
  text-decoration: none;
}

nav {
  display: flex;
  gap: 1.25rem;
}

nav a {
  color: var(--muted);
  text-decoration: none;
}

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

section {
  padding: 2rem 0;
}

.hero {
  padding-top: 4rem;
}

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

h2 {
  font-size: 1.25rem;
  margin: 0 0 1rem;
}

h3 {
  font-size: 1.05rem;
  margin: 0 0 0.25rem;
}

.lede {
  color: var(--muted);
  font-size: 1.2rem;
  margin: 0;
}

.section-head p {
  color: var(--muted);
  margin: -0.5rem 0 1.25rem;
}

.games {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr));
}

.game {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.game:hover,
.game:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 10px 22px -12px rgb(0 0 0 / 0.35);
}

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

.game-thumb {
  position: relative;
  overflow: hidden;
  background: #111;
  aspect-ratio: 16 / 9;
}

.game-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 75%;
  transition: transform 0.4s ease;
}

.game:hover .game-thumb img {
  transform: scale(1.05);
}

.badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: rgb(0 0 0 / 0.65);
  color: #fef3c7;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.game-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.4rem;
  padding: 0.75rem 0.85rem 0.85rem;
}

.game-body h3 {
  font-size: 1.05rem;
  margin: 0;
}

.game-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tags {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.tags li {
  padding: 0 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
}

.play {
  margin-top: auto;
  padding-top: 0.25rem;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.85rem;
}

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

  .game:hover,
  .game:hover .game-thumb img {
    transform: none;
  }
}

.links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  padding-bottom: 2rem;
}
