/* AIゲームポータル: スマホ縦画面を基準に、幅が広がったら段組みを増やす */
:root {
  --bg: #f5f4ef;
  --surface: #ffffff;
  --text: #1d2125;
  --muted: #59606a;
  --line: #dedbd2;
  --accent: #23614f;
  --accent-text: #ffffff;
  --focus: #1b5fd1;
  --t0: #2f6db5; --t1: #b0472f; --t2: #7a5bb5; --t3: #2c8a7a; --t4: #c2701c;
  --t5: #9a3f72; --t6: #4f7a2a; --t7: #5a5f9a; --t8: #8a6d1f;
  --radius: 14px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --surface: #1f2327;
    --text: #e9e7e3;
    --muted: #a6acb4;
    --line: #343940;
    --accent: #7cc7ae;
    --accent-text: #0f1a16;
    --focus: #8ab4ff;
    --t0: #7fb0ea; --t1: #ec9a86; --t2: #b9a3ec; --t3: #79cfbf; --t4: #f0b26b;
    --t5: #e597c3; --t6: #a6cf7c; --t7: #a9adf0; --t8: #dcc272;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Meiryo", sans-serif;
  font-size: 16px;
  line-height: 1.7;
}
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ヘッダー */
.site-header { padding: 28px 0 12px; }
.site-title { margin: 0; font-size: 1.6rem; line-height: 1.3; letter-spacing: .02em; }
.lead { margin: 6px 0 0; color: var(--muted); font-size: .95rem; }

/* ジャンルの絞り込み（横スクロールのチップ） */
.filter { position: sticky; top: 0; z-index: 2; background: var(--bg); padding: 8px 0; margin: 0 -16px; }
.chips {
  display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px 6px;
  scrollbar-width: thin; -webkit-overflow-scrolling: touch;
}
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: inherit; font-size: .9rem; cursor: pointer;
}
.chip-count { color: var(--muted); font-size: .8rem; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.chip[aria-pressed="true"] .chip-count { color: inherit; opacity: .85; }
.result { margin: 6px 0 10px; color: var(--muted); font-size: .85rem; }

/* カード一覧 */
.cards { list-style: none; margin: 0 0 32px; padding: 0; display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(2, 1fr); gap: 16px; } }
@media (min-width: 980px) { .cards { grid-template-columns: repeat(3, 1fr); } }

.card {
  --hue: var(--t0);
  position: relative; display: flex; flex-direction: column; gap: 8px;
  padding: 16px 16px 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
  border-top: 4px solid var(--hue);
}
.card:hover { border-color: var(--hue); }
.card-title { margin: 0; font-size: 1.15rem; line-height: 1.4; }
.card-desc { margin: 0; color: var(--muted); font-size: .93rem; flex: 1; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  --hue: var(--t0);
  font-size: .75rem; line-height: 1; padding: 5px 8px; border-radius: 6px;
  color: var(--hue); border: 1px solid currentColor;
}
.t0 { --hue: var(--t0); } .t1 { --hue: var(--t1); } .t2 { --hue: var(--t2); }
.t3 { --hue: var(--t3); } .t4 { --hue: var(--t4); } .t5 { --hue: var(--t5); }
.t6 { --hue: var(--t6); } .t7 { --hue: var(--t7); } .t8 { --hue: var(--t8); }

.play {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; min-width: 108px; padding: 8px 20px;
  border-radius: 999px; background: var(--accent); color: var(--accent-text);
  font-weight: 700; text-decoration: none; letter-spacing: .08em;
}
.play:hover { filter: brightness(1.08); }
/* カード全体を押せるようにする */
.card .play::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }

/* フッター */
.site-footer { border-top: 1px solid var(--line); padding: 20px 0 40px; color: var(--muted); font-size: .85rem; }
.site-footer p { margin: 0; }

/* 404 */
.notfound { padding: 48px 16px; }
.notfound h1 { font-size: 1.4rem; margin: 0 0 8px; }
