/* =============================================================
   ひとやすみゲームズ スタイル
   色を変えたいときは、下の :root の値を変更してください。
   ============================================================= */
:root {
  --color-bg: #fbf8f3;        /* 背景（淡いクリーム） */
  --color-surface: #ffffff;   /* カードの背景 */
  --color-tint: #f3efe7;      /* 交互の帯の背景 */
  --color-text: #2b2a28;      /* 本文 */
  --color-muted: #6a655d;     /* 補足の文字 */
  --color-line: #e4ddd1;      /* 枠線 */
  --color-accent: #2f7d6d;    /* アクセント（落ち着いた緑） */
  --color-accent-dark: #24614f;
  --color-accent-soft: #e3f1ed;
  --color-focus: #d9822b;     /* キーボード操作時の枠 */
  --radius: 14px;
  --shadow: 0 2px 10px rgba(60, 50, 30, 0.08);
  --container: 1040px;
}

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN",
    "Noto Sans JP", "Yu Gothic UI", "Meiryo", sans-serif;
  font-size: 1rem;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

/* キーボード操作時に選択位置をはっきり見せる */
:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: 4px;
}

/* 見出しへジャンプしたとき、固定ヘッダーに隠れないようにする */
[id] {
  scroll-margin-top: 80px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

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

.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 100;
  padding: 8px 16px;
  background: var(--color-surface);
  border: 2px solid var(--color-accent);
  border-radius: 8px;
}

.skip-link:focus {
  top: 12px;
}

/* ---------- ヘッダー ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(251, 248, 243, 0.96);
  border-bottom: 1px solid var(--color-line);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 16px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.site-logo {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: 0.04em;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--color-text);
  font-size: 0.9375rem;
  text-decoration: none;
}

.site-nav a:hover {
  background: var(--color-accent-soft);
}

/* ---------- サイト紹介 ---------- */
.intro {
  padding: 28px 0 8px;
}

.intro__title {
  margin: 0 0 6px;
  font-size: 1.625rem;
  line-height: 1.4;
  letter-spacing: 0.04em;
}

.intro__text {
  margin: 0;
  color: var(--color-muted);
}

/* ---------- セクション共通 ---------- */
.section {
  padding: 32px 0;
}

.section--tinted {
  background: var(--color-tint);
}

.section__title {
  margin: 0 0 16px;
  font-size: 1.375rem;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section__title::before {
  content: "";
  width: 6px;
  height: 1.1em;
  border-radius: 3px;
  background: var(--color-accent);
}

.section__lead {
  margin: -6px 0 16px;
  color: var(--color-muted);
  font-size: 0.9375rem;
}

.notice {
  margin: 0;
  padding: 14px 18px;
  background: var(--color-surface);
  border: 1px dashed var(--color-line);
  border-radius: var(--radius);
  color: var(--color-muted);
}

/* ---------- ゲーム一覧 ---------- */
.game-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

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

/* 画像は16:9で統一。contain なので画像の端が切れません */
.game-card__media {
  aspect-ratio: 16 / 9;
  background: #1b1712;
}

.game-card__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.game-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 18px 20px 20px;
}

.game-card__genre {
  align-self: flex-start;
  margin: 0 0 6px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--color-accent-soft);
  color: var(--color-accent-dark);
  font-size: 0.8125rem;
  font-weight: 700;
}

.game-card__title {
  margin: 0 0 6px;
  font-size: 1.25rem;
  line-height: 1.4;
}

.game-card__text {
  margin: 0 0 16px;
}

.game-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-top: auto;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 140px;
  min-height: 48px;
  padding: 10px 28px;
  border-radius: 999px;
  background: var(--color-accent);
  color: #fff;
  font-weight: 700;
  font-size: 1.0625rem;
  text-decoration: none;
  letter-spacing: 0.1em;
}

.button:hover {
  background: var(--color-accent-dark);
}

.text-link {
  display: inline-block;
  padding: 6px 0;
  font-weight: 700;
}

/* 掲載が1作品のときは、PCで横長のカードにして寂しく見えないようにする */
@media (min-width: 760px) {
  .game-list--single {
    grid-template-columns: 1fr;
  }

  .game-list--single .game-card {
    flex-direction: row;
  }

  .game-list--single .game-card__media {
    flex: 0 0 55%;
  }

  .game-list--single .game-card__body {
    justify-content: center;
    padding: 28px 32px;
  }

  .game-list--single .game-card__actions {
    margin-top: 8px;
  }
}

/* ---------- 遊び方 ---------- */
.howto-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.howto-card {
  padding: 18px 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
}

.howto-card__title {
  margin: 0 0 8px;
  font-size: 1.125rem;
  line-height: 1.4;
}

.howto-card__list {
  margin: 0 0 8px;
  padding-left: 1.4em;
}

.howto-card__list li + li {
  margin-top: 4px;
}

.howto-card__play {
  margin: 0;
}

/* ---------- 更新履歴 ---------- */
.update-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--color-line);
}

.update-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 0 20px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--color-line);
}

.update-list time {
  color: var(--color-muted);
  font-variant-numeric: tabular-nums;
  min-width: 7em;
}

/* ---------- プライバシーポリシーなどの文章ページ ---------- */
.prose {
  max-width: 760px;
}

.page-title {
  margin: 0 0 20px;
  font-size: 1.625rem;
  line-height: 1.4;
}

.prose h2 {
  margin: 32px 0 8px;
  font-size: 1.1875rem;
  line-height: 1.5;
}

.prose ul {
  padding-left: 1.4em;
}

.effective-date {
  margin-top: 32px;
  color: var(--color-muted);
}

.back-link {
  margin-top: 32px;
}

/* ---------- フッター ---------- */
.site-footer {
  padding: 24px 0;
  border-top: 1px solid var(--color-line);
  font-size: 0.9375rem;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
}

.site-footer__links {
  display: flex;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer__copy {
  margin: 0;
  color: var(--color-muted);
}

/* ---------- PC ---------- */
@media (min-width: 760px) {
  .intro {
    padding: 44px 0 12px;
  }

  .intro__title {
    font-size: 2rem;
  }

  .section {
    padding: 48px 0;
  }

  .section__title {
    font-size: 1.5rem;
  }
}

/* ---------- トップの紹介画像（site.heroImage を設定したとき） ----------
   images/ogp.png（1200×630）のうち、アイコンとサイト名の部分
   （横200〜1000px・縦120〜420px）だけを切り出してロゴとして表示します。
   画像の背景色はページの背景色と同じなので、枠を付けずになじませています。
   別の画像に差し替えた場合は、下の数値（比率・位置）を調整してください。 */
.intro__inner:has(.intro__title--image) {
  text-align: center;
}

.intro__title--image {
  margin: 0 auto 4px;
  max-width: 400px;
}

/* 中央揃えの紹介文を、文節の区切りで自然に改行する（対応ブラウザのみ） */
.intro__inner:has(.intro__title--image) .intro__text {
  word-break: auto-phrase;
  text-wrap: balance;
}

.intro__logo {
  display: block;
  aspect-ratio: 800 / 300;   /* 切り出す範囲の 横:縦 */
  overflow: hidden;
}

.intro__logo img {
  width: 150%;               /* 1200 ÷ 800 */
  max-width: none;
  margin-left: -25%;         /* 200 ÷ 800 */
  margin-top: -15%;          /* 120 ÷ 800 */
}

/* ---------- 404ページ ---------- */
.not-found {
  text-align: center;
  padding: 24px 20px 40px;
}

.not-found__code {
  margin: 0;
  font-size: 4rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-accent);
  letter-spacing: 0.08em;
}

.not-found__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 24px;
  margin-top: 28px;
}
