:root {
  --bg: #11131a;
  --panel: #1c2029;
  --line: #333a48;
  --text: #e8eaf0;
  --muted: #a3aaba;
  --accent: #ffd166;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
  line-height: 1.7;
}

a { color: var(--accent); }

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

header.site { padding-top: 40px; padding-bottom: 24px; }
header.site h1 { margin: 0; font-size: 2rem; line-height: 1.2; }
header.site h1 a { color: inherit; text-decoration: none; }
header.site p { margin: 4px 0 0; color: var(--muted); }

main { flex: 1; padding-bottom: 40px; }

.filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.filter[hidden] { display: none; }
.filter button {
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.filter button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: #11131a; }

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

.game { padding: 12px 12px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.game[hidden] { display: none; }
.game p { margin: 8px 0 0; }
.play { display: block; color: inherit; text-decoration: none; }
.play:hover h2 { color: var(--accent); }
.play img, .placeholder { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 4px; }
.play img { object-fit: cover; }
.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #2a3040;
  color: var(--muted);
  font-size: 3rem;
  font-weight: 700;
}
.game h2 { margin: 12px 0 0; font-size: 1.25rem; }
.genre, .inputs { color: var(--muted); font-size: 0.875rem; }

footer.site { padding-top: 16px; padding-bottom: 32px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.875rem; }
footer.site a { margin-right: 16px; }
footer.site p { margin: 8px 0 0; }

.legal { max-width: 760px; }
.legal h2 { margin-top: 32px; font-size: 1.125rem; }
.legal details { margin-top: 8px; }
.legal summary { cursor: pointer; }
.license {
  margin: 8px 0 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  font-size: 0.8125rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.todo { padding: 2px 6px; border-radius: 4px; background: #5a2a2a; color: #ffd6d6; }
