/* 群 B の共有：コミュニティの部品（ジャンルの行・書きこむ所・投稿の並び・返信）。暗い地と明るい地の両方（tokens の役割の名前だけを使う）。
   P03 メインステージ・P04 プレイ画面の面・P05 エクストラステージ・P06 プロフィールの告知。部品の HTML は src/pages/b/_community.mjs */
@layer page {
  /* ---------- ジャンルの行（role="tablist"） ---------- */
  .cm-bar { display: flex; align-items: center; gap: var(--es-space-21); min-height: 44px; }
  .cm-bar__scroll { display: flex; flex-wrap: wrap; align-items: center; gap: var(--es-space-8); flex: 1 1 auto; min-width: 0; } /* 収まらないときは折り返す（訳が長い言語で、右の列へはみ出さない）。横スクロールにする所は nowrap に戻す */
  .cm-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: var(--es-space-8); flex: 0 1 auto; min-width: 0; } /* タブも折り返す（メインステージの「レビュー」を足して、長い訳の言語で列からはみ出した。WP 2b）。横スクロールの所は nowrap に戻す */
  .cm-tabs .chip { transition: box-shadow var(--es-dur-144) var(--es-ease-out), color var(--es-dur-144) var(--es-ease-out); }
  .cm-bar__extra { display: inline-flex; align-items: center; gap: var(--es-space-8); min-height: 44px; margin-left: auto; flex: 0 0 auto; color: var(--es-accent); font-size: var(--es-text-16); white-space: nowrap; }
  .cm-bar__extra > span { text-decoration: underline; text-underline-offset: 0.25em; text-decoration-thickness: 1px; }
  @media (hover: hover) and (pointer: fine) { .cm-bar__extra:hover > span { text-decoration-thickness: 2px; } }

  /* （17：「この言語だけ」の切り替えは廃止。書きこみは見ている言語へ訳して出す。訳の切り替えは translate.css） */
  .cm-notice { margin-top: var(--es-space-13); }

  /* ---------- 書きこむ所（2.12） ---------- */
  .cm-write { margin-top: var(--es-space-21); scroll-margin-top: calc(var(--hh) + 123px); }
  .cm-gate, .cm-only, .cm-form { background: var(--es-surface); border-radius: var(--es-radius-l); padding: var(--es-space-21); }
  .cm-gate, .cm-only { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; column-gap: var(--es-space-21); row-gap: var(--es-space-13); }
  .cm-gate__t { font-size: var(--es-text-16); line-height: var(--es-lh-16); color: var(--es-text-strong); min-width: 0; flex: 1 1 233px; }
  .cm-write.is-only .cm-gate, .cm-write.is-only .cm-form { display: none; }
  .cm-form { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--es-space-13); align-items: start; }
  .cm-form__me { padding-top: var(--es-space-3); }
  .cm-form__main { min-width: 0; display: flex; flex-direction: column; gap: var(--es-space-13); }
  .cm-in { width: 100%; border: 0; border-bottom: var(--es-line-1) solid var(--es-border); background: transparent; color: var(--es-text-strong); border-radius: 0; padding: var(--es-space-5) 0; }
  .cm-in::placeholder { color: var(--es-text-sub); opacity: 1; }
  .cm-in:focus-visible { outline: none; border-bottom: var(--es-line-2) solid var(--es-accent); padding-bottom: calc(var(--es-space-5) - 1px); }
  .cm-in--title { font-size: var(--es-text-21); line-height: var(--es-lh-21); font-weight: var(--es-fw-bold); }
  .cm-in--body { font-size: var(--es-text-16); line-height: var(--es-lh-16); resize: none; overflow: hidden; min-height: calc(26px * 3 + 10px); }
  .cm-form.is-error .cm-in--body { border-bottom: var(--es-line-2) solid var(--es-text-strong); box-shadow: inset 0 0 0 var(--es-line-2) var(--es-text-strong); padding-left: var(--es-space-8); padding-right: var(--es-space-8); border-radius: var(--es-radius-s); }
  .cm-err { font-size: var(--es-text-13); line-height: var(--es-lh-13); font-weight: var(--es-fw-medium); color: var(--es-text-strong); }
  .cm-form__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; column-gap: var(--es-space-21); row-gap: var(--es-space-8); }
  .cm-to { display: flex; flex-wrap: wrap; gap: var(--es-space-8); min-width: 0; }
  .cm-to__c { cursor: pointer; }
  .cm-to__c input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
  .cm-to__c:has(input:checked) { box-shadow: inset 0 0 0 var(--es-line-2) var(--es-accent); color: var(--es-text-strong); }
  .cm-to__c:has(input:focus-visible) { outline: var(--es-line-2) solid var(--es-focus); outline-offset: 3px; }
  .cm-form__send { display: flex; align-items: center; gap: var(--es-space-13); margin-left: auto; }
  .cm-count { font-size: var(--es-text-13); line-height: var(--es-lh-13); color: var(--es-text-sub); white-space: nowrap; }
  .cm-form__hint { font-size: var(--es-text-13); line-height: var(--es-lh-13); color: var(--es-text-sub); }
  .cm-form__rules .tlink { font-size: var(--es-text-13); min-height: 34px; }

  /* ---------- 投稿の並び ---------- */
  .cm-feed { margin-top: var(--es-space-21); }
  .cm-list { border-top: var(--es-line-1) solid var(--es-rule); }
  .cm-post { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--es-space-13); padding: var(--es-space-21) 0; border-bottom: var(--es-line-1) solid var(--es-rule); animation: cm-in var(--es-dur-144) var(--es-ease-out); }
  .cm-post[data-off], .cm-post[data-page-off], .cm-post[data-hid] { display: none; }
  @keyframes cm-in { from { opacity: 0; } to { opacity: 1; } }
  .cm-post__mark { padding-top: 0; }
  .cm-post__main { min-width: 0; }
  .cm-post__head { display: flex; align-items: flex-start; gap: var(--es-space-8); min-height: 34px; }
  .cm-post__who { display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--es-space-8); row-gap: var(--es-space-3); min-width: 0; flex: 1 1 auto; padding-top: var(--es-space-5); }
  .cm-post__name { font-size: var(--es-text-16); line-height: var(--es-lh-16); font-weight: var(--es-fw-bold); color: var(--es-text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 16em; min-width: 0; }
  a.cm-post__name { text-decoration: none; }
  @media (hover: hover) and (pointer: fine) { a.cm-post__name:hover { text-decoration: underline; text-underline-offset: 0.25em; } }
  .cm-post__time, .cm-post__genre { font-size: var(--es-text-13); line-height: var(--es-lh-13); color: var(--es-text-sub); white-space: nowrap; }
  .cm-feed:not([data-view="all"]) .cm-post__genre { display: none; }
  .cm-pin { display: inline-flex; align-items: center; gap: var(--es-space-5); font-size: var(--es-text-13); line-height: var(--es-lh-13); color: var(--es-text-sub); white-space: nowrap; }
  .tag--promo { box-shadow: inset 0 0 0 var(--es-line-1) var(--es-text-strong); }
  .tag--sys { color: var(--es-text-sub); }
  .cm-post__title { margin-top: var(--es-space-8); font-size: var(--es-text-21); line-height: var(--es-lh-21); }
  /* 投稿の見出しは人が書く文：句読点の塊が長いときは、語（.wd）の切れ目で折り返す（語の途中では折り返さない） */
  .cm-post__title--w .w { display: inline; white-space: normal; }
  /* 閉じた details の中身は、はっきり消す（検査と読み上げで、見えない字を数えないため） */
  .cm-replies:not([open]) > :not(summary) { display: none; }
  .cm-post__text { margin-top: var(--es-space-5); max-width: 42em; font-size: var(--es-text-16); line-height: var(--es-lh-16); color: var(--es-text); overflow-wrap: anywhere; }
  .cm-post__text p + p { margin-top: var(--es-space-8); }
  .cm-post__period { margin-top: var(--es-space-5); font-size: var(--es-text-16); line-height: var(--es-lh-16); color: var(--es-text); }
  .cm-post__link { margin-top: var(--es-space-5); }
  .cm-post__link .tlink { font-size: var(--es-text-16); }
  .cm-post__img { margin-top: var(--es-space-13); max-width: 477px; }
  .cm-post__img img { width: 100%; aspect-ratio: auto; border: var(--es-line-1) solid var(--es-border); }
  .cm-post__game { margin-top: var(--es-space-13); border-top: var(--es-line-1) solid var(--es-rule); border-bottom: var(--es-line-1) solid var(--es-rule); }
  .cm-post__game .rcard { grid-template-columns: 144px minmax(0, 1fr) auto; }
  .cm-post__game .rcard__img { width: 144px; }
  .cm-post__game .rcard__name { font-size: var(--es-text-16); line-height: var(--es-lh-16); }
  .cm-post__game .rcard__line { font-size: var(--es-text-13); line-height: var(--es-lh-13); }

  /* 下の行：返信・いいね（13px・補助の字・間 21） */
  .cm-post__acts { display: flex; gap: var(--es-space-21); margin-top: var(--es-space-5); }
  .cm-act { display: inline-flex; align-items: center; gap: var(--es-space-5); min-height: 44px; font-size: var(--es-text-13); line-height: var(--es-lh-13); color: var(--es-text-sub); }
  .cm-act[aria-pressed="true"] { color: var(--es-accent); font-weight: var(--es-fw-medium); }
  @media (hover: hover) and (pointer: fine) { .cm-act:hover { color: var(--es-text-strong); } .cm-act[aria-pressed="true"]:hover { color: var(--es-accent); } }

  /* 操作の一覧（more） */
  .cm-more { position: relative; flex: 0 0 auto; margin: calc(var(--es-space-5) * -1) calc(var(--es-space-13) * -1) 0 0; }
  .cm-more__btn { color: var(--es-text-sub); }
  .cm-more__list { position: absolute; right: 0; top: 100%; z-index: 20; min-width: 233px; padding: var(--es-space-8); background: var(--es-surface); border: var(--es-line-1) solid var(--es-border); border-radius: var(--es-radius-l); }
  .cm-more__list button { display: flex; align-items: center; width: 100%; min-height: 44px; padding: 0 var(--es-space-13); border-radius: var(--es-radius-m); font-size: var(--es-text-16); text-align: left; color: var(--es-text-strong); white-space: nowrap; }
  @media (hover: hover) and (pointer: fine) { .cm-more__list button:hover { background: color-mix(in srgb, var(--es-text-strong) 10%, transparent); } }
  .cm-note { margin-top: var(--es-space-8); font-size: var(--es-text-13); line-height: var(--es-lh-13); color: var(--es-text-sub); }

  /* 返信：左を 55 下げて並ぶ（390 は 34）。丸は 26 */
  .cm-replies { margin-top: var(--es-space-5); }
  .cm-replies__sum { display: inline-flex; align-items: center; gap: var(--es-space-5); min-height: 44px; cursor: pointer; list-style: none; font-size: var(--es-text-13); line-height: var(--es-lh-13); color: var(--es-accent); }
  .cm-replies__sum::-webkit-details-marker { display: none; }
  .cm-replies__sum > span { text-decoration: underline; text-underline-offset: 0.25em; text-decoration-thickness: 1px; }
  .cm-replies[open] .cm-replies__sum .ico { transform: rotate(180deg); }
  .cm-replies__list { margin-left: var(--es-space-21); }
  .cm-post--reply { padding: var(--es-space-13) 0; border-bottom: 0; border-top: var(--es-line-1) solid var(--es-rule); }
  .cm-post--reply .cm-post__name { font-size: var(--es-text-13); line-height: var(--es-lh-13); }
  .cm-post--reply .cm-post__head { min-height: 26px; }
  .cm-post--reply .cm-post__who { padding-top: var(--es-space-3); }
  .cm-replyform { margin-top: var(--es-space-8); margin-left: var(--es-space-21); display: flex; flex-direction: column; gap: var(--es-space-8); padding: var(--es-space-13); background: var(--es-surface); border-radius: var(--es-radius-l); }
  .cm-replyform .cm-in--body { min-height: calc(26px * 2 + 10px); }
  .cm-replyform__act { display: flex; align-items: center; justify-content: flex-end; gap: var(--es-space-13); }
  @media (min-width: 987px) { .cm-replies__list, .cm-replyform { margin-left: var(--es-space-55); } }

  /* 隠した・何も無い・もっと見る */
  .cm-hidebar { display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--es-space-13); padding: var(--es-space-8) 0; font-size: var(--es-text-13); line-height: var(--es-lh-13); color: var(--es-text-sub); }
  .cm-hidebar .tlink { font-size: var(--es-text-13); }
  .cm-empty { padding: var(--es-space-55) 0; }
  .cm-empty__t { font-size: var(--es-text-26); line-height: var(--es-lh-26); font-weight: var(--es-fw-bold); color: var(--es-text-strong); }
  .cm-empty__s { margin-top: var(--es-space-8); font-size: var(--es-text-16); line-height: var(--es-lh-16); color: var(--es-text); }
  .cm-morewrap { margin-top: var(--es-space-34); display: flex; justify-content: center; }
  .cm-loading { padding: var(--es-space-13) 0; }

  /* ---------- 運営の書きこみ（16 の 2.3）：墨（明るいページ）・消炭（暗いページ）の板に、カラーのしるし・白熱の名前・熾の札 ----------
     板が包むのは、しるし・名前の行・題・本文・添えもの・操作の行だけ。返信の並び・「返信を見る」・返信を書く所は板の外。
     影・ぼかし・グラデーション・縁の線は付けない（8 章） */
  .cm-post--staff { display: block; padding: var(--es-space-13) 0; }
  .cm-post__body { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--es-space-13); padding: var(--es-space-21); border-radius: var(--es-radius-l); background: var(--es-surface); color: var(--es-text); }
  .cm-post__body[data-es-theme="dark"] { background: var(--es-bg); } /* 明るいページ：墨 */
  .cm-post__body :focus-visible { outline-offset: 2px; }
  .cm-post--staff .cm-post__body .cm-post__name { color: var(--es-text-strong); letter-spacing: var(--es-ls-caps); }
  .cm-post--staff > .cm-replies { margin-top: var(--es-space-5); }
  .cm-post--staff > .cm-replyform { margin-top: var(--es-space-8); }
  .mark--staff { width: 34px; height: 34px; }
  .cm-post__nt { display: inline-flex; align-items: center; gap: var(--es-space-8); min-width: 0; max-width: 100%; }
  /* 返信の中の運営：角 8・余白 13 の板。しるしは 34 */
  .cm-post--reply.cm-post--staff { padding: var(--es-space-13) 0; }
  .cm-post--reply > .cm-post__body { padding: var(--es-space-13); border-radius: var(--es-radius-m); }
  .cm-post--reply.cm-post--staff .cm-post__head { min-height: 34px; }
  .cm-post--reply.cm-post--staff .cm-post__who { padding-top: var(--es-space-5); }

  /* 熾の札「運営」（16 の 2.2・G-11）：熾の塗り・完全な丸・線なし・墨の字 13px／700（墨は熾の上で 4.58:1） */
  .tag.tag--staff { background: var(--es-mark); color: var(--es-color-sumi); box-shadow: none; font-weight: var(--es-fw-bold); line-height: 21px; }
  .tag.tag--staff-l { height: 34px; padding: 0 var(--es-space-13); font-size: var(--es-text-16); line-height: 34px; }

  /* 自分の書きこみ（試作）：同じ形 */
  .cm-post--mine .cm-post__acts { display: flex; }

  /* ---------- 小さい版（プレイ画面の面）：丸は 26、本文は 13px／21px ---------- */
  .cm-feed--compact .cm-post { column-gap: var(--es-space-8); padding: var(--es-space-13) 0; }
  .cm-feed--compact .cm-post__name { font-size: var(--es-text-13); line-height: var(--es-lh-13); }
  .cm-feed--compact .cm-post__head { min-height: 26px; }
  .cm-feed--compact .cm-post__who { padding-top: var(--es-space-3); }
  .cm-feed--compact .cm-post__title { font-size: var(--es-text-16); line-height: var(--es-lh-16); margin-top: var(--es-space-5); }
  .cm-feed--compact .cm-post__text, .cm-feed--compact .cm-post__period { font-size: var(--es-text-13); line-height: var(--es-lh-13); }
  .cm-feed--compact .cm-replies__list, .cm-feed--compact .cm-replyform { margin-left: var(--es-space-13); }
  .cm-feed--compact .cm-post__img, .cm-feed--compact .cm-post__game { display: none; }
  .cm-feed--compact .cm-empty { padding: var(--es-space-34) 0; }
  .cm-feed--compact .cm-empty__t { font-size: var(--es-text-16); line-height: var(--es-lh-16); }
  .cm-feed--compact .cm-empty__s { font-size: var(--es-text-13); line-height: var(--es-lh-13); }
  .cm-feed--compact .cm-post--staff { padding: var(--es-space-13) 0; }
  .cm-feed--compact .cm-post__body { column-gap: var(--es-space-8); padding: var(--es-space-13); border-radius: var(--es-radius-m); }
  .cm-feed--compact .cm-post--staff .cm-post__head { min-height: 34px; }
  .cm-feed--compact .cm-post--staff .cm-post__who { padding-top: var(--es-space-5); }
  .cm-write--compact { margin-top: 0; }
  .cm-write--compact .cm-gate, .cm-write--compact .cm-only, .cm-write--compact .cm-form { padding: var(--es-space-13); border-radius: var(--es-radius-m); }
  .cm-write--compact .cm-gate p, .cm-write--compact .cm-gate__t { font-size: var(--es-text-13); line-height: var(--es-lh-13); color: var(--es-text); flex: 1 1 144px; }
  .cm-write--compact .cm-gate .tlink { font-size: var(--es-text-13); }
  .cm-write--compact .cm-in--body { font-size: var(--es-text-13); line-height: var(--es-lh-13); min-height: calc(21px * 2 + 10px); }

  /* ---------- 狭い幅 ---------- */
  @media (max-width: 609px) {
    .cm-replies__list, .cm-replyform { margin-left: var(--es-space-13); }
    .cm-post__game .rcard { grid-template-columns: 89px minmax(0, 1fr); }
    .cm-post__game .rcard__img { width: 89px; }
    .cm-form { grid-template-columns: minmax(0, 1fr); row-gap: var(--es-space-13); }
    .cm-form__me { display: none; }
    .cm-form__send { width: 100%; justify-content: space-between; }
    .cm-form__send .btn { margin-left: auto; }
    .cm-gate .btn { width: 100%; }
    .cm-post__name { max-width: 11em; }
    .cm-post__body { padding: var(--es-space-21) var(--es-space-13); }
    .cm-post--reply > .cm-post__body, .cm-feed--compact .cm-post__body { padding: var(--es-space-13); }
  }
  @media (prefers-reduced-motion: reduce) { .cm-post { animation: none; } }
}
@layer page {
  /* 暗い地の書きこむ所：面（消炭）とメンバーの丸（消炭）が同じ色になるため、丸を墨に */
  [data-es-theme="dark"] .cm-form .mark--member, [data-es-theme="dark"] .cm-replyform .mark--member { background: var(--es-color-sumi); }
}
