/* 名将と呼ばれた者達 Next Generations サイト共通の見た目（ホーム・説明書 readme/・規約 policy/）
   Bootstrap 5.3.8 の上に重ねる。色はここの変数だけで決める
   ※ Unity の WebGL テンプレート（Assets/WebGLTemplates/MeisyoNX/index.html）は、ここを読まずに同じ色の値をページの中に持つ */
:root {
  --rm-accent: #1e6b52;        /* 目立たせる色（1色だけ） */
  --rm-accent-soft: #e8f2ee;   /* 目立たせる色の薄い版（背景用） */
  --rm-text: #2b2f33;          /* 本文の文字（濃い灰色） */
  --rm-text-sub: #6c757d;      /* 補足の文字 */
  --rm-line: #dee2e6;          /* 区切り線 */
  --rm-bg: #ffffff;            /* 背景 */
  --rm-bg-sub: #f8f9fa;        /* 囲みの背景 */
  --rm-caution: #b45309;       /* 注意枠の線 */
  --rm-caution-soft: #fff7ed;  /* 注意枠の背景 */
  --bs-link-color: var(--rm-accent);
  --bs-link-color-rgb: 30, 107, 82;
  --bs-link-hover-color: #154d3b;
  --bs-link-hover-color-rgb: 21, 77, 59;
}

html { scroll-padding-top: 4.5rem; } /* 固定の上帯に見出しが隠れないように */

body {
  background: var(--rm-bg);
  color: var(--rm-text);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
  line-height: 1.8;
  padding-top: 3.5rem; /* 上帯の高さ */
}

/* ---------- 上の帯 ---------- */
.rm-navbar {
  background: var(--rm-bg);
  border-bottom: 1px solid var(--rm-line);
}
.rm-navbar > .container-fluid { flex-wrap: nowrap; } /* スマホ幅でも上帯を1行に保つ（2行になると下の道しるべが隠れる） */
.rm-navbar .navbar-brand {
  font-size: .9rem;
  font-weight: 700;
  color: var(--rm-text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}
@media (min-width: 576px) {
  .rm-navbar .navbar-brand { font-size: 1rem; }
}
.rm-navbar .navbar-brand small { color: var(--rm-text-sub); font-weight: 400; }

.rm-offcanvas .list-group-item { border-left: 0; border-right: 0; }
.rm-offcanvas .list-group-item.active {
  background: var(--rm-accent-soft);
  color: var(--rm-accent);
  border-color: var(--rm-line);
  font-weight: 700;
}
.rm-chapter-no {
  display: inline-block;
  min-width: 2em;
  color: var(--rm-text-sub);
  font-variant-numeric: tabular-nums;
}

/* ---------- 本文 ---------- */
.rm-main { max-width: 52rem; }

.rm-breadcrumb { font-size: .85rem; margin: 1rem 0 .5rem; }

.rm-chapter-title {
  font-size: 1.5rem;
  font-weight: 700;
  border-left: .3rem solid var(--rm-accent);
  padding-left: .75rem;
  margin: .5rem 0 1.5rem;
}

.rm-main h2 {
  font-size: 1.2rem;
  font-weight: 700;
  border-bottom: 1px solid var(--rm-line);
  padding-bottom: .4rem;
  margin: 2.5rem 0 1rem;
}
/* 小見出し：左に細い線を付けて本文と見分ける（h2 の下線・章見出しの太い左線より控えめ） */
.rm-main h3 {
  font-size: 1.05rem;
  font-weight: 700;
  border-left: .2rem solid var(--rm-accent);
  padding-left: .5rem;
  line-height: 1.4;
  margin: 1.75rem 0 .75rem;
}

/* この章の内容（章内の目次） */
.rm-toc {
  background: var(--rm-bg-sub);
  border: 1px solid var(--rm-line);
  border-radius: .5rem;
  padding: .75rem 1rem;
  margin-bottom: 1.5rem;
}
.rm-toc-title { font-size: .85rem; font-weight: 700; color: var(--rm-text-sub); margin-bottom: .25rem; }
.rm-toc ul { margin: 0; padding-left: 1.2rem; }

/* 準備中の仮文 */
.rm-wip { color: var(--rm-text-sub); }

/* 仮の画像枠（あとで images/ の写真に差し替える） */
.rm-img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 9 / 16;      /* スマホ縦画面の比率 */
  max-width: 18rem;
  margin: 1rem auto;
  border: 2px dashed #adb5bd;
  border-radius: .5rem;
  background: var(--rm-bg-sub);
  color: var(--rm-text-sub);
  font-size: .9rem;
  text-align: center;
  padding: 1rem;
}
.rm-figure { text-align: center; margin: 1rem 0; }
/* 縦長の画面写真は高さで抑える（幅は比率どおりに縮む） */
.rm-figure img { max-height: 26rem; max-width: 100%; width: auto; height: auto; border: 1px solid var(--rm-line); border-radius: .5rem; }
.rm-figure figcaption { font-size: .85rem; color: var(--rm-text-sub); margin-top: .25rem; }

/* 押すと拡大（readme.js がボタンで包む） */
.rm-zoom-btn { padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: .5rem; }
.rm-zoom-btn:focus-visible { outline: 3px solid var(--rm-accent); outline-offset: 2px; }
.rm-zoom-modal .modal-dialog { width: fit-content; max-width: 95vw; margin-left: auto; margin-right: auto; }
.rm-zoom-modal .modal-content { background: transparent; border: 0; }
.rm-zoom-modal .modal-body { position: relative; padding: 0; text-align: center; }
.rm-zoom-modal img { max-width: 100%; max-height: 90vh; width: auto; height: auto; border-radius: .5rem; cursor: zoom-out; }
.rm-zoom-modal .btn-close { position: absolute; top: .5rem; right: .5rem; background-color: rgba(0, 0, 0, .5); border-radius: 50%; padding: .6rem; opacity: 1; }

/* ヒント枠・注意枠 */
.rm-note {
  border-left: .3rem solid var(--rm-accent);
  background: var(--rm-accent-soft);
  border-radius: .25rem;
  padding: .75rem 1rem;
  margin: 1rem 0;
}
.rm-note-caution { border-left-color: var(--rm-caution); background: var(--rm-caution-soft); }
.rm-note-title { font-weight: 700; margin-bottom: .25rem; }

/* 表はスマホで横に流れるよう .table-responsive で包む */
.rm-main .table { font-size: .95rem; }

/* ---------- 目次（トップ） ---------- */
.rm-card {
  height: 100%;
  border: 1px solid var(--rm-line);
  border-radius: .5rem;
  transition: border-color .15s, box-shadow .15s;
}
.rm-card:hover, .rm-card:focus-within { border-color: var(--rm-accent); box-shadow: 0 .125rem .5rem rgba(0, 0, 0, .06); }
.rm-card a { color: var(--rm-text); text-decoration: none; }
.rm-card .rm-card-no { color: var(--rm-accent); font-weight: 700; font-size: .85rem; }
.rm-card .rm-card-title { font-weight: 700; margin: .1rem 0 .25rem; }
.rm-card .rm-card-desc { color: var(--rm-text-sub); font-size: .85rem; margin: 0; line-height: 1.6; }

/* ---------- 前後の章・下の帯 ---------- */
.rm-pager { display: flex; justify-content: space-between; gap: .5rem; margin: 3rem 0 1.5rem; }
.rm-pager a { flex: 1 1 0; min-width: 0; font-size: .9rem; }
.rm-pager .rm-pager-next { text-align: right; }
.rm-pager small { display: block; color: var(--rm-text-sub); }

.btn-rm-outline {
  --bs-btn-color: var(--rm-accent);
  --bs-btn-border-color: var(--rm-line);
  --bs-btn-hover-color: var(--rm-accent);
  --bs-btn-hover-bg: var(--rm-accent-soft);
  --bs-btn-hover-border-color: var(--rm-accent);
  --bs-btn-active-color: var(--rm-accent);
  --bs-btn-active-bg: var(--rm-accent-soft);
  --bs-btn-active-border-color: var(--rm-accent);
}

.rm-footer {
  border-top: 1px solid var(--rm-line);
  color: var(--rm-text-sub);
  font-size: .8rem;
  text-align: center;
  padding: 1.25rem 1rem 2rem;
}

/* 先頭へ戻る */
.rm-to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 1px solid var(--rm-line);
  background: var(--rm-bg);
  color: var(--rm-accent);
  font-size: 1.2rem;
  line-height: 1;
  box-shadow: 0 .125rem .5rem rgba(0, 0, 0, .1);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s, visibility .2s;
  z-index: 1020;
}
.rm-to-top.show { opacity: 1; visibility: visible; }

/* ---------- 規約・各種表示だけの部品 ---------- */
/* 【要記入】（公開前に埋める所。見落とさないよう注意の色で囲む。埋めたら span ごと消す） */
.pl-fill { background: var(--rm-caution-soft); border: 1px dashed var(--rm-caution); border-radius: .25rem; padding: 0 .25rem; }
/* 特定商取引法などの「項目｜内容」の表（項目の列を細くする） */
.pl-table th { width: 30%; background: var(--rm-bg-sub); font-weight: 700; }
@media (max-width: 575.98px) { .pl-table th { width: 38%; } }
/* 規約の条文（第1条など）の番号付きの段落 */
.pl-main ol.pl-article > li { margin-bottom: .5rem; }
.pl-date { color: var(--rm-text-sub); font-size: .9rem; margin-top: 2rem; }

/* ---------- ホーム（index.html）・近日公開（game.html）・404 だけの部品 ---------- */
.hm-hero { text-align: center; padding: 2.5rem 0 1.5rem; }
.hm-title { font-size: 1.6rem; font-weight: 700; line-height: 1.4; margin: 0; }
@media (min-width: 576px) { .hm-title { font-size: 2rem; } }
.hm-title-en { display: block; font-size: .85rem; font-weight: 400; color: var(--rm-text-sub); margin-top: .25rem; }
.hm-sub { font-size: 1.05rem; color: var(--rm-accent); font-weight: 700; margin: 1rem 0 0; }

/* 遊ぶボタン（ブラウザ／Google Play／App Store）。幅が足りないと折り返して縦に並ぶ */
.hm-play { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; margin: 1.75rem 0 .5rem; }
.hm-play .btn { min-width: 12rem; font-weight: 700; }
.btn-rm-accent {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--rm-accent);
  --bs-btn-border-color: var(--rm-accent);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #154d3b;
  --bs-btn-hover-border-color: #154d3b;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #154d3b;
  --bs-btn-active-border-color: #154d3b;
}
/* 近日公開（押せない）。span で置き、見た目だけボタンにそろえる */
.hm-soon {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 12rem;
  padding: .375rem .75rem;
  border: 1px dashed #adb5bd;
  border-radius: var(--bs-border-radius);
  color: var(--rm-text-sub);
  line-height: 1.4;
}
.hm-soon small { font-size: .75rem; }
/* ストアのページへのボタン（押せる）。近日公開の枠と同じ 2 段にする */
.hm-store {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.4;
}
.hm-store small { font-size: .75rem; font-weight: 400; }

/* 近日公開・404 の案内 */
.hm-notice { text-align: center; padding: 3rem 0; }
.hm-notice p { color: var(--rm-text-sub); }

/* 下の帯の小さいリンク並び */
.hm-links { list-style: none; padding: 0; margin: 0 0 .5rem; display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem 1rem; }
.hm-links a { color: var(--rm-text-sub); }
.hm-links a:hover { color: var(--rm-accent); }
