/* ===== モノノカタリ ゲームコレクション 共通スタイル ===== */
:root {
  --bg: #f6f5fb;
  --card: #ffffff;
  --ink: #2b2440;
  --sub: #6b6580;
  --line: #e6e2f0;
  --accent: #ff6b4a;
  --accent-dark: #e4502f;
  --violet: #6a5ae0;
  --chip: #efecfa;
  --radius: 14px;
  --shadow: 0 2px 6px rgba(43, 36, 64, .06), 0 8px 24px rgba(43, 36, 64, .06);
  --max: 1180px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
  line-height: 1.75;
  font-size: 16px;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--violet); }
a:hover { color: var(--accent-dark); }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: #fff; padding: 8px; z-index: 10; }

/* ---- ヘッダー・フッター ---- */
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 18px; letter-spacing: .02em; }
.logo-mark { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--violet), var(--accent)); color: #fff; display: grid; place-items: center; font-size: 18px; }
.logo small { display: block; font-size: 11px; font-weight: 600; color: var(--sub); line-height: 1.2; }
.logo span { line-height: 1.2; }
.site-nav { display: flex; gap: 4px; }
.site-nav a { white-space: nowrap; color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 600; padding: 8px 10px; border-radius: 8px; }
.site-nav a:hover { background: var(--chip); }
.site-footer { margin-top: 64px; background: #fff; border-top: 1px solid var(--line); padding: 28px 0 36px; font-size: 14px; color: var(--sub); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 10px; }
.site-footer a { color: var(--sub); }

/* ---- 見出し・本文 ---- */
main { display: block; padding-top: 24px; }
h1 { font-size: clamp(22px, 3.2vw, 30px); line-height: 1.35; margin: 8px 0 12px; }
h2 { font-size: 21px; margin: 40px 0 14px; padding-left: 12px; border-left: 5px solid var(--accent); line-height: 1.4; }
h3 { font-size: 17px; margin: 24px 0 8px; }
.lead { color: var(--sub); margin: 0 0 20px; }
.breadcrumb { font-size: 13px; color: var(--sub); margin: 0 0 4px; }
.breadcrumb a { color: var(--sub); }
.prose { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px clamp(18px, 4vw, 36px); }
.prose p { margin: 0 0 1em; }
.prose h2:first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: 4px 0; }

/* ---- トップ ---- */
.hero { background: linear-gradient(120deg, #fff 0%, #fff5ef 55%, #f0edff 100%); border-radius: 20px; padding: 26px clamp(18px, 4vw, 36px); box-shadow: var(--shadow); margin-bottom: 26px; }
.hero h1 { margin-top: 0; }
.hero p { margin: 0; color: var(--sub); }

.tag-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; padding: 0; list-style: none; }
.tag-filter button, .tag {
  font: inherit; font-size: 13px; font-weight: 600; border: 0; cursor: pointer;
  background: var(--chip); color: var(--violet); border-radius: 999px; padding: 5px 13px; line-height: 1.5;
}
.tag-filter button[aria-pressed="true"] { background: var(--violet); color: #fff; }
.tag { cursor: default; font-size: 12px; padding: 2px 10px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }

.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; margin: 0; padding: 0; list-style: none; }
.game-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; transition: transform .15s ease, box-shadow .15s ease; }
.game-card:hover { transform: translateY(-3px); box-shadow: 0 4px 10px rgba(43, 36, 64, .08), 0 14px 32px rgba(43, 36, 64, .12); }
.game-card a { color: inherit; text-decoration: none; display: block; height: 100%; }
.game-card .thumb { aspect-ratio: 16 / 9; background: #ddd8ec; overflow: hidden; }
.game-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.game-card:hover .thumb img { transform: scale(1.04); }
.game-card .body { padding: 12px 14px 16px; }
.game-card h3 { margin: 0 0 4px; font-size: 16px; line-height: 1.4; }
.game-card p { margin: 0 0 10px; font-size: 13px; color: var(--sub); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.game-card[hidden] { display: none; }
.grid-empty { color: var(--sub); }

/* ---- 広告枠（ゲーム画面とは重ねない。「広告」と明記する） ---- */
.ad-box { margin: 0; }
.ad-box[hidden] { display: none; }
.ad-label { display: block; font-size: 11px; color: var(--sub); letter-spacing: .1em; margin-bottom: 4px; text-align: center; }
.ad-box .ad-inner { min-height: 250px; display: flex; align-items: center; justify-content: center; }
.ad-box.is-dev .ad-inner { border: 2px dashed #c9c2de; border-radius: 10px; color: #9a93b3; font-size: 13px; background: #fbfaff; text-align: center; padding: 12px; }
.ad-box ins.adsbygoogle { display: block; width: 100%; }
.ad-list { margin: 36px auto 0; max-width: 970px; }
.ad-list .ad-inner { min-height: 100px; }

/* ---- ゲームページ ---- */
/* 広い画面：左の広告 ｜ 真ん中にゲーム ｜ 右の広告。
   Google のゲーム向けのルールに合わせ、広告とゲーム画面のあいだは 150px 以上あける */
.wrap.wide { max-width: 1440px; }
.game-head { grid-area: head; margin-bottom: -14px; }
.game-layout {
  display: grid; gap: 28px;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "head" "play" "howto" "adl" "about";
  align-items: start;
}
.g-play { grid-area: play; }
.g-howto { grid-area: howto; }
.g-about { grid-area: about; }
.g-ad-left { grid-area: adl; }
.g-ad-right { grid-area: adr; display: none !important; } /* せまい画面では右の広告は出さない */
@media (min-width: 1200px) {
  .game-layout {
    grid-template-columns: 160px minmax(0, 1fr) 160px;
    grid-template-areas: "adl head adr" "adl play adr" "adl howto adr" "adl about adr";
    column-gap: 150px; row-gap: 28px;
  }
  .g-ad-right { display: block !important; }
  .g-ad-right[hidden] { display: none !important; }
  .g-ad { position: sticky; top: 76px; }
  .g-ad .ad-inner { min-height: 600px; }
}
@media (min-width: 1700px) {
  .wrap.wide { max-width: 1680px; }
  .game-layout { grid-template-columns: 300px minmax(0, 1fr) 300px; }
}

.game-frame {
  position: relative; background: #1a1530; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  width: 100%; aspect-ratio: 16 / 9; margin: 0 auto;
}
.game-frame.portrait { aspect-ratio: 9 / 16; width: auto; height: min(82vh, 860px); max-width: 100%; }
.game-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: #000; }
.play-cover { position: absolute; inset: 0; border: 0; padding: 0; margin: 0; cursor: pointer; background: #1a1530; color: #fff; font: inherit; }
.play-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .9; }
.portrait .play-cover img { object-fit: contain; }
.portrait .play-cover .play-btn { top: 78%; }
.play-cover .play-btn {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: var(--accent); color: #fff; font-weight: 800; font-size: 22px; padding: 14px 34px; border-radius: 999px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .35); white-space: nowrap; transition: transform .15s ease, background .15s ease;
}
.play-cover:hover .play-btn, .play-cover:focus-visible .play-btn { background: var(--accent-dark); transform: translate(-50%, -50%) scale(1.05); }
.game-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.btn { font: inherit; font-weight: 700; font-size: 14px; border: 0; border-radius: 10px; padding: 9px 16px; cursor: pointer; background: var(--ink); color: #fff; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { background: #443a63; color: #fff; }
.btn.light { background: var(--chip); color: var(--violet); }
.game-tools .hint { font-size: 13px; color: var(--sub); }
.notice { margin-top: 14px; background: #fff8e6; border: 1px solid #f3dc9c; border-radius: 10px; padding: 12px 14px; font-size: 14px; }

/* 全画面（ブラウザの全画面が使えないとき＝iPhone などは、画面いっぱいに広げる） */
.game-frame:fullscreen { border-radius: 0; width: 100%; height: 100%; aspect-ratio: auto; }
.game-frame.pseudo-fs { position: fixed; inset: 0; z-index: 1000; width: 100vw; height: 100vh; height: 100dvh; max-width: none; aspect-ratio: auto; border-radius: 0; }
.fs-close { display: none; position: absolute; right: 10px; top: 10px; z-index: 2; background: rgba(0, 0, 0, .6); color: #fff; border: 0; border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 14px; cursor: pointer; }
.game-frame.pseudo-fs .fs-close { display: block; }
body.no-scroll { overflow: hidden; }

.controls-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.controls-table th, .controls-table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.controls-table th { width: 42%; font-weight: 700; color: var(--ink); background: #faf9fd; }
.credits { font-size: 13px; color: var(--sub); }

.related { margin-top: 48px; }

/* ---- スマホ ---- */
@media (max-width: 640px) {
  body { font-size: 15px; }
  .site-header .wrap { height: 54px; }
  .logo { font-size: 14px; }
  .site-nav .nav-home { display: none; }
  .logo small { display: none; }
  .site-nav a { font-size: 13px; padding: 6px 7px; }
  .game-frame, .game-frame.portrait { width: 100%; height: auto; aspect-ratio: auto; height: calc(100svh - 150px); min-height: 420px; }
  .game-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
  .prose { padding: 18px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
