/* レガシー(他人の Scratch 作品の紹介)のページ: トップ・ゲーム一覧・ジャンル・タグ(R2-4c。inc/legacy.php)。
   モック app/docs/review/2026-10-13-{genre-page,list-and-top}/。色は base.css の変数 */

.lg-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; padding-bottom: 48px; }
.lg-main { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 28px; margin-bottom: 48px; }
.lg-layout .lg-main { margin-bottom: 0; }
.lg-lead { max-width: 800px; }
.lg-lead p { margin: 0 0 8px; }
.lg-sec { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.lg-sec > h2, .lg-genre-head h2 { font-size: 24px; line-height: 1.4; margin: 0 0 4px; }
.lg-sub { font-size: 14px; color: var(--sub); margin: 0 0 16px; }
.lg-genre-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.lg-genre-head h2 a { color: var(--text); text-decoration: none; }
.lg-more { font-weight: 700; color: var(--accent); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }

/* ボタン */
.lg-btn { min-height: 48px; display: inline-flex; align-items: center; padding: 0 22px; border-radius: 10px; background: var(--accent); color: #fff; font: inherit; font-weight: 700; border: 0; cursor: pointer; text-decoration: none; }
.lg-btn-sub { background: var(--card); color: var(--text); border: 1px solid var(--line-strong); font-weight: 600; }
.lg-btn-off { background: var(--tag-bg); color: var(--sub); cursor: default; }

/* ジャンル・タグのページの 1 作品(いまの中身のまま) */
.lg-article { border-top: 1px solid var(--line); padding: 24px 0; scroll-margin-top: 16px; }
.lg-sec .lg-article:first-of-type, .lg-main > .lg-sec:first-of-type .lg-article:first-child { border-top: 0; }
.lg-title { font-size: 22px; line-height: 1.4; margin: 0 0 12px; }
.lg-top { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 20px; align-items: start; }
.lg-thumb { width: 100%; height: auto; aspect-ratio: 250 / 190; object-fit: cover; border: 1px solid var(--line); border-radius: 12px; background: var(--tag-bg); display: block; }
.lg-play { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 10px; }
.lg-text { max-width: 800px; overflow-wrap: anywhere; }
.lg-text img, .lg-text iframe, .lg-text video { max-width: 100%; height: auto; }
.lg-text h2 { font-size: 20px; margin: 16px 0 8px; }
.lg-text h3 { font-size: 18px; margin: 14px 0 6px; }
.lg-empty { color: var(--sub); }
.lg-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; padding: 0; }
.lg-tags a { display: inline-flex; min-height: 32px; align-items: center; padding: 0 12px; background: var(--tag-bg); border-radius: 999px; color: var(--text); text-decoration: none; font-size: 14px; }
.lg-info { border-collapse: collapse; margin-top: 14px; font-size: 14px; width: 100%; max-width: 520px; }
.lg-info th, .lg-info td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }
.lg-info th { background: #F7F9FA; width: 7em; font-weight: 600; color: var(--sub); }

/* 右の欄: ジャンルから探す */
.lg-aside { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.lg-aside h2 { font-size: 18px; margin: 0 0 12px; }
.lg-genre-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.lg-genre-list a { display: flex; justify-content: space-between; gap: 8px; min-height: 44px; align-items: center; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); text-decoration: none; }
.lg-genre-list a[aria-current] { border-color: var(--accent); color: var(--accent); }
.lg-genre-list small, .lg-genre-pills small { color: var(--sub); }
.lg-genre-pills { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.lg-genre-pills a { display: inline-flex; gap: 6px; min-height: 44px; align-items: center; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px; color: var(--text); text-decoration: none; background: var(--card); }

/* 小さいカード(ゲーム一覧・トップ) */
.lg-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.lg-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); }
.lg-card-art { width: 100%; height: auto; aspect-ratio: 250 / 190; object-fit: cover; display: block; background: var(--tag-bg); }
.lg-card h3 { font-size: 15px; line-height: 1.5; margin: 8px 12px 10px; }
.lg-card h3 a, .lg-card h3 button { color: var(--text); text-decoration: none; background: none; border: 0; padding: 0; font: inherit; text-align: left; cursor: pointer; }
.lg-badge { display: inline-block; font-size: 12px; font-weight: 700; color: var(--accent); background: var(--accent-tint); border-radius: 999px; padding: 0 8px; margin: 8px 12px; }
.lg-from { display: block; font-size: 12px; color: var(--sub); margin: 6px 12px; }
.lg-blank { display: block; }

/* トップの見出し */
.lg-hero { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 24px; align-items: center; }
.lg-hero img { width: 100%; height: auto; }
.lg-hero h1 { font-size: 30px; line-height: 1.35; margin: 0; }
.lg-hero-name { display: block; font-size: 16px; color: var(--accent); font-weight: 800; }

/* サイトの中で遊ぶ画面: 全画面。PC は左にゲーム・右の欄(広告・作者の表示)、狭い画面は縦に並べる
   (古いテーマ masalachai assets/scss/partials/modal/_modal.scss と同じ形。DECISIONS 2026-10-13) */
.lg-dialog { border: 0; border-radius: 0; padding: 0; margin: 0; width: 100%; height: 100%; max-width: none; max-height: none; background: var(--card); color: var(--text); }
.lg-dialog[open] {
  display: grid; grid-template-columns: minmax(0, 1fr) 340px; grid-template-rows: auto auto minmax(0, 1fr);
  grid-template-areas: "frame head" "frame ad" "frame credit";
}
.lg-dialog::backdrop { background: rgb(20 32 43 / 60%); }
html:has(.lg-dialog[open]) { overflow: hidden; }
.lg-frame { grid-area: frame; min-height: 0; border: 3px solid var(--accent); background: #fff; }
.lg-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.lg-dialog-head { grid-area: head; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; }
.lg-dialog-title { margin: 0; font-weight: 700; font-size: 18px; line-height: 1.4; }
.lg-close { flex: none; }
.lg-ad { grid-area: ad; margin: 0 20px 16px; min-height: 250px; background: var(--tag-bg); }
.lg-credit { grid-area: credit; align-self: start; margin: 0 20px; font-size: 14px; display: grid; gap: 4px; }
.lg-credit div { display: flex; gap: 8px; }
.lg-credit dt { flex: none; width: 6em; color: var(--sub); }
.lg-credit dd { margin: 0; overflow-wrap: anywhere; }
.lg-credit-note { grid-area: credit; align-self: end; margin: 0 20px 16px; font-size: 12px; color: var(--sub); }

@media (max-width: 899px) {
  .lg-dialog[open] {
    grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto auto auto;
    grid-template-areas: "head" "frame" "credit" "note" "ad"; overflow-y: auto;
  }
  .lg-frame { aspect-ratio: 4 / 3; }
  .lg-credit { margin-top: 12px; }
  .lg-credit-note { grid-area: note; margin-top: 8px; }
  .lg-ad { margin-top: 4px; }
}

@media (max-width: 1100px) {
  .lg-layout { grid-template-columns: 1fr; }
  .lg-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 759px) {
  .lg-main { padding: 18px; }
  .lg-top { grid-template-columns: 1fr; }
  .lg-thumb { max-width: 320px; }
  .lg-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lg-hero { grid-template-columns: 72px minmax(0, 1fr); gap: 14px; }
  .lg-hero h1 { font-size: 22px; }
}

/* ジャンルのページのハブ(R2-5 d1。モック app/docs/review/2026-10-13-genre-hub/)。遊ぶ画面・節は base.css の game-card・pair・card を使う */
.lg-hub { margin-top: 20px; }
.lg-hub > h2 { font-size: 24px; line-height: 1.4; margin: 0 0 4px; }
.lg-hub .game-card { margin: 0; }
.lg-hub-more { margin-top: 28px; padding-top: 4px; border-top: 1px solid var(--line); }
