/* One accent colour; light and dark follow the device setting. */
:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --text: #17191f;
  --muted: #5a5f6b;
  --border: #e3e4e8;
  --accent: #3b63d9;
  --accent-text: #ffffff;
  --shadow: 0 1px 2px rgb(16 18 24 / 6%), 0 8px 24px rgb(16 18 24 / 6%);
  --radius: 14px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121419;
    --surface: #1b1e25;
    --text: #eef0f4;
    --muted: #a3a9b6;
    --border: #2c303a;
    --accent: #8aa8ff;
    --accent-text: #0d1220;
    --shadow: none;
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.site-header, main, .site-footer {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

.site-header { padding-top: clamp(48px, 10vw, 112px); padding-bottom: clamp(32px, 6vw, 64px); }

h1 {
  margin: 0;
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h1::after {
  content: "";
  display: block;
  width: 48px;
  height: 4px;
  margin-top: 20px;
  border-radius: 2px;
  background: var(--accent);
}

.tagline { margin: 20px 0 0; max-width: 38rem; color: var(--muted); font-size: 1.125rem; }

main { flex: 1; }

.games {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 24px;
}

.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.thumb {
  display: block;
  aspect-ratio: 40 / 21;
  background: var(--border);
  overflow: hidden;
}

.thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

a.thumb:hover img { transform: scale(1.03); }

.body { display: flex; flex-direction: column; flex: 1; padding: 20px; }

.body h3 { margin: 0; font-size: 1.25rem; line-height: 1.3; }

.body p { margin: 8px 0 20px; color: var(--muted); flex: 1; }

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0; }

.tag {
  padding: 2px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.8125rem;
}

.tag.status { border-color: var(--accent); color: var(--accent); font-weight: 600; }

.play {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 22px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
  text-decoration: none;
}

.play:hover { filter: brightness(1.08); }

.play[aria-disabled="true"] {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--muted);
  cursor: default;
  filter: none;
}

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

.thumb:focus-visible { outline-offset: -3px; }

.message { color: var(--muted); }

.site-footer { padding-top: 64px; padding-bottom: 32px; color: var(--muted); font-size: 0.875rem; }

.site-footer p { margin: 0; }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 480px) {
  .site-header, main, .site-footer { padding-left: 16px; padding-right: 16px; }
  .games { gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .thumb img { transition: none; }
  a.thumb:hover img { transform: none; }
}

/* 404 page */
.not-found { text-align: left; }
.not-found .play { margin-top: 8px; }
