/* コメントギルドの案内のページ。木の枠の掲示板の中に、説明のカードを並べる。 */

/* 見出し用の書体：しっぽり明朝 B1（SIL Open Font License 1.1）。このページの見出しで使う文字だけにしぼってある。
   ライセンスは /fonts/OFL.txt。作り方は tools/make-font.js */
@font-face {
  font-family: "CG Mincho";
  src: url("/fonts/cg-mincho-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --page: #eadfc8;      /* 枠の外 */
  --ground: #f4ecdd;    /* 地 */
  --card: #fffdf8;      /* カード */
  --card-line: #d9c9a8; /* カードの枠 */
  --wood: #8a5a2b;
  --wood-dark: #6b4420;
  --wine: #b5472b;      /* 赤れんが（強調。2026-11-23 に、えんじ #7a2e2e から明るくした） */
  --gold: #9a6514;      /* 金（お金の流れ、★） */
  --ink: #2b2420;       /* 文字 */
  --ink-2: #4a3f35;     /* 補足の文字 */
  --ink-3: #6b5b4b;     /* 補足の文字（うすい） */
  --radius: 14px;
  --mincho: "CG Mincho", "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", serif;
}

* { 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;
  padding: 24px 16px 40px;
  background: var(--page);
  color: var(--ink);
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.9;
}

.board {
  max-width: 1080px;
  margin: 0 auto;
  background: var(--ground);
  border: 10px solid var(--wood);
  border-radius: 14px;
  box-shadow: 0 0 0 2px var(--wood-dark), 0 10px 24px rgba(107, 68, 32, 0.22);
  padding: 40px 40px 24px;
}

h1, h2, h3, caption, .catch, .formula, .when, .choice-name, .cta {
  font-family: var(--mincho);
  font-weight: 700;
  line-height: 1.5;
}
h1, h2, h3 { margin: 0; }
p { margin: 0; }

/* 読み上げだけに伝える言葉（画面には出さない） */
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

a { color: var(--wine); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
a:focus-visible { outline: 3px solid var(--wine); outline-offset: 2px; border-radius: 4px; }

/* ── いちばん上 ── */
.hero { text-align: center; }

.badge {
  display: inline-block;
  margin: 0 0 12px;
  padding: 2px 16px;
  border: 2px solid var(--wine);
  border-radius: 999px;
  color: var(--wine);
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.15em;
}

.logo { margin: 0 auto; max-width: 560px; line-height: 0; }
.logo img { display: block; width: 100%; height: auto; }

.domain { color: var(--ink-3); font-size: 0.95rem; letter-spacing: 0.08em; }

.catch {
  margin-top: 20px;
  font-size: 1.5rem;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.lead { max-width: 36em; margin: 16px auto 0; text-align: left; }

/* ── 節 ── */
section { margin-top: 64px; scroll-margin-top: 16px; }

.eyebrow {
  text-align: center;
  color: var(--wine);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
}
.eyebrow::before, .eyebrow::after { content: ""; display: inline-block; width: 28px; height: 2px; margin: 0 12px; background: var(--card-line); vertical-align: middle; }

section > h2, .page-title {
  text-align: center;
  font-size: 1.7rem;
  color: var(--ink);
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.intro { max-width: 40em; margin: 14px auto 0; color: var(--ink-2); }

.card {
  margin-top: 22px;
  padding: 22px 24px;
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: var(--radius);
}
.card p + p { margin-top: 8px; }
.card-title { margin-bottom: 8px; font-size: 1.15rem; color: var(--wine); }
.sub { color: var(--ink-3); font-size: 0.9rem; }

/* ── 節1：3つの箱と、あいだの矢印 ── */
.diagram {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 168px minmax(0, 1fr) 168px minmax(0, 1fr);
  align-items: stretch;
  gap: 10px;
  margin-top: 30px;
}

.role {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 22px 12px;
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: var(--radius);
}
.role h3 { font-size: 1.15rem; color: var(--wine); text-align: center; margin-bottom: 8px; white-space: nowrap; }
.role p { font-size: 0.92rem; line-height: 1.8; color: var(--ink-2); }
.role-sub { display: block; font-size: 0.85em; }

.role.guild {
  background: var(--wine);
  border-color: var(--wine);
  box-shadow: 0 6px 14px rgba(181, 71, 43, 0.28);
}
.role.guild h3, .role.guild p { color: var(--card); }

.flows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}
.flow-item {
  text-align: center;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--ink-2);
}
.flow-item.money { color: var(--ink); font-weight: 700; }

/* 矢印（装飾）。線は ::before、矢じりは ::after。向きは forward＝右（スマホでは下）、back＝左（スマホでは上） */
.arrow {
  --c: var(--ink-2);
  --w: 2px;
  display: block;
  position: relative;
  height: 14px;
  margin-top: 4px;
}
.arrow.gold { --c: var(--gold); --w: 5px; }
.arrow::before {
  content: "";
  position: absolute;
  left: 0;
  right: 9px;
  top: 50%;
  border-top: var(--w) dotted var(--c);
  transform: translateY(-50%);
}
.arrow.gold::before { border-top-style: solid; }
.arrow::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  border-left: 11px solid var(--c);
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  transform: translateY(-50%);
}
.arrow.back { transform: scaleX(-1); }

.legend {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 28px;
  font-size: 0.88rem;
  color: var(--ink-2);
}
.legend li { display: flex; align-items: center; gap: 10px; }
.legend-line { display: inline-block; width: 44px; border-top: 2px dotted var(--ink-2); }
.legend-line.gold { border-top: 5px solid var(--gold); }

.callout {
  max-width: 44em;
  margin: 24px auto 0;
  padding: 18px 22px;
  background: var(--card);
  border: 2px solid var(--wine);
  border-radius: var(--radius);
  text-align: center;
}
.callout strong { color: var(--wine); font-size: 1.08rem; }
.callout p + p { margin-top: 6px; color: var(--ink-2); }

/* ── 節2・節3：手順 ── */
.steps {
  list-style: none;
  margin: 30px 0 0;
  padding: 0;
  display: grid;
  gap: 26px;
}
.steps-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.steps-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 22px; }

.steps li {
  position: relative;
  padding: 18px 14px 16px;
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: var(--radius);
}
.steps h2, .steps h3 { font-size: 1.02rem; margin: 6px 0 6px; color: var(--ink); }
.steps p { font-size: 0.86rem; line-height: 1.75; color: var(--ink-2); }

.num {
  display: inline-block;
  width: 1.9em;
  height: 1.9em;
  border-radius: 50%;
  background: var(--wine);
  color: var(--card);
  font-weight: 700;
  line-height: 1.9em;
  text-align: center;
}

.steps li.goal { background: var(--wine); border-color: var(--wine); box-shadow: 0 6px 14px rgba(181, 71, 43, 0.28); }
.steps li.goal h2, .steps li.goal h3, .steps li.goal p { color: var(--card); }
.steps li.goal .num { background: var(--card); color: var(--wine); }

/* 手順のあいだの矢じり（装飾） */
.steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -19px;
  border-left: 11px solid var(--ink-3);
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  transform: translateY(-50%);
}
.steps-6 li:not(:last-child)::after { right: -17px; }

/* ── 表 ── */
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; }

table { width: 100%; border-collapse: collapse; }
caption {
  padding-bottom: 10px;
  font-size: 1.15rem;
  color: var(--wine);
  text-align: left;
}
.caption-sub { display: block; font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", "Meiryo", system-ui, sans-serif; font-size: 0.82rem; font-weight: 400; color: var(--ink-3); }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--card-line); text-align: left; font-size: 0.95rem; }
thead th { color: var(--ink-3); font-size: 0.85rem; border-bottom-width: 2px; }
tbody th { font-weight: 700; white-space: nowrap; }
.ranks th, .ranks td { word-break: keep-all; }
.stars td, .stars thead th:last-child { text-align: right; }
.stars td { font-weight: 700; font-variant-numeric: tabular-nums; }
.star { color: var(--gold); letter-spacing: 0.1em; }
.table-note { margin-top: 12px; color: var(--ink-2); font-size: 0.92rem; }

.formula {
  margin: 14px 0 !important;
  padding: 12px 16px;
  border: 2px solid var(--wine);
  border-radius: 10px;
  background: var(--ground);
  color: var(--wine);
  font-size: 1.15rem;
  text-align: center;
}

.caution { margin-top: 20px; color: var(--ink-3); font-size: 0.88rem; line-height: 1.8; }

/* ── ルビ（つくる人＝クリエイター、遊ぶ人＝コメンター） ── */
rt {
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  font-size: 0.42em;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--wine);
}
section > h2 ruby { ruby-position: over; }
section > h2:has(ruby) { line-height: 2; }

/* ── 「あなたはどっちのタイプですか？」と、2つの大きなボタン ── */
.choose { margin-top: 44px; text-align: center; }
.question { font-size: 1.45rem; color: var(--ink); }
.choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  max-width: 720px;
  margin: 22px auto 0;
}
.choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 150px;
  padding: 26px 16px 20px;
  border: 3px solid var(--wine);
  border-radius: var(--radius);
  background: var(--wine);
  color: var(--card);
  text-decoration: none;
  box-shadow: 0 6px 0 #7d2f1b, 0 12px 18px rgba(181, 71, 43, 0.25);
}
.choice-name { font-size: 2.1rem; line-height: 2; }
.choice rt { color: var(--card); font-size: 0.4em; }
.choice-sub { font-size: 0.92rem; line-height: 1.6; }
.choice:hover { background: var(--card); color: var(--wine); }
.choice:hover rt { color: var(--wine); }
.choice:active { transform: translateY(3px); box-shadow: 0 3px 0 #7d2f1b; }
.choice:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

/* ── 説明のページ（クリエイター向け・コメンター向け） ── */
.subhead { text-align: center; }
.sublogo { display: inline-block; width: min(280px, 70%); line-height: 0; border-radius: 8px; }
.sublogo img { display: block; width: 100%; height: auto; }
.subpage > section:first-child { margin-top: 28px; }

.enjoy { margin-top: 48px; text-align: center; }
.cta {
  display: inline-block;
  padding: 18px 44px;
  border: 3px solid var(--wine);
  border-radius: 999px;
  background: var(--wine);
  color: var(--card);
  font-size: 1.4rem;
  text-decoration: none;
  box-shadow: 0 6px 0 #7d2f1b, 0 12px 18px rgba(181, 71, 43, 0.25);
}
.cta:hover { background: var(--card); color: var(--wine); }
.cta:active { transform: translateY(3px); box-shadow: 0 3px 0 #7d2f1b; }
.cta:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.enjoy-note { margin-top: 16px; color: var(--ink-3); font-size: 0.88rem; }

.pagelinks {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 20px;
  margin-top: 40px;
  font-size: 0.95rem;
}

/* ── 公開予定・運営者 ── */
.plan { text-align: center; }
.when { margin-top: 12px; font-size: 1.5rem; color: var(--wine); }
.small { margin-top: 6px; color: var(--ink-3); font-size: 0.9rem; }

.about { margin: 18px auto 0; max-width: 34em; border-top: 1px solid var(--card-line); }
.about div {
  display: grid;
  grid-template-columns: 8.5em 1fr;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--card-line);
}
.about dt { color: var(--ink-3); font-weight: 700; }
.about dd { margin: 0; overflow-wrap: anywhere; }

footer {
  margin-top: 48px;
  padding-top: 14px;
  border-top: 2px solid var(--card-line);
  text-align: center;
  color: var(--ink-3);
  font-size: 0.85rem;
}

/* ── 少しせまい画面：手順を3列にする（横1列だと、見出しが折り返す幅） ── */
@media (max-width: 1139px) {
  .steps-5, .steps-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; }
  .steps-6 li:not(:last-child)::after { right: -19px; }
  .steps li:nth-child(3n)::after { display: none; }
}

/* ── 図は、箱の中の文が窮屈になる幅（1000px 未満）から、縦に並べて、矢印も下向き・上向きにする ── */
@media (max-width: 999px) {
  .board { padding: 32px 24px 20px; }
  .diagram { grid-template-columns: 1fr; gap: 12px; }
  .role-sub { display: inline; }
  /* 3本の矢印を、横に並べる（2026-11-23。縦に3つ重ねると、1本の長い矢印に見えて分かりにくいため）。
     それぞれ、矢印を左、言葉を右に置く。言葉は、決めた切れ目（<wbr>）で折り返す */
  .flows {
    flex-direction: row;
    justify-content: center;
    align-items: stretch;
    gap: 8px 28px;
    padding: 2px 4px;
  }
  .flow-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    min-width: 0;
    text-align: left;
    font-size: 0.88rem;
    word-break: keep-all;
  }
  .flow-item .arrow { order: -1; flex: none; align-self: stretch; width: 14px; height: auto; min-height: 52px; margin: 0; }
  .arrow::before {
    left: 50%;
    right: auto;
    top: 0;
    bottom: 9px;
    border-top: 0;
    border-left: var(--w) dotted var(--c);
    transform: translateX(-50%);
  }
  .arrow.gold::before { border-left-style: solid; }
  .arrow::after {
    right: auto;
    left: 50%;
    top: auto;
    bottom: 0;
    border-top: 11px solid var(--c);
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 0;
    transform: translateX(-50%);
  }
  .arrow.back { transform: scaleY(-1); }
}

/* ── スマホ（幅 700px 未満。600px 未満をふくむ）：手順も縦に並べて、矢印も下向きにする ── */
@media (max-width: 699px) {
  body { padding: 12px 10px 28px; font-size: 15.5px; }
  .board { border-width: 7px; padding: 28px 16px 18px; }
  .catch { font-size: 1.2rem; }
  section > h2, .page-title { font-size: 1.4rem; }
  section { margin-top: 52px; }
  .when { font-size: 1.3rem; }
  .about div { grid-template-columns: 1fr; gap: 0; }
  .choices { grid-template-columns: 1fr; gap: 20px; max-width: 360px; }
  .choice { min-height: 124px; padding: 20px 14px 16px; }
  .choice-name { font-size: 1.8rem; }
  .question { font-size: 1.2rem; }
  .cta { padding: 16px 28px; font-size: 1.2rem; }
  .pagelinks { flex-direction: column; align-items: center; }
  .card { padding: 18px 16px; }
  .pair { grid-template-columns: 1fr; gap: 0; }
  .flows { gap: 8px 14px; padding: 2px 0; }
  .flow-item { gap: 6px; font-size: 0.82rem; }

  .steps-5, .steps-6 { grid-template-columns: 1fr; gap: 30px; }
  .steps li { padding: 16px 16px 14px; }
  .steps p { font-size: 0.92rem; }
  .steps li:not(:last-child)::after,
  .steps-6 li:not(:last-child)::after,
  .steps li:nth-child(3n):not(:last-child)::after {
    display: block;
    top: auto;
    right: auto;
    left: 50%;
    bottom: -23px;
    border-top: 11px solid var(--ink-3);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 0;
    transform: translateX(-50%);
  }

  th, td { padding: 8px 5px; font-size: 0.84rem; }
  .role-sub { display: inline; }
  thead th { font-size: 0.78rem; }
}

/* ── とても小さいスマホ（幅 360px 未満）：表の文字とすきまを、少しつめる ── */
@media (max-width: 359px) {
  .ranks th, .ranks td { padding: 7px 3px; font-size: 0.76rem; }
  .ranks tbody th { white-space: normal; }
  .flows { gap: 8px 8px; }
  .flow-item { gap: 5px; font-size: 0.78rem; }
}
