/* ==========================================================================
   graph_2026.css  ── 実績グラフ（.fu-graph / .fu-compare）

   2026-09-06 新規。front-page_1.css のグラフ部分を切り出したものです。
   中身は変えていません（切り出しただけ）。

   【なぜ切り出したか】
   　ショートコード [fu_graph] を固定ページ（LP・実績ページ）でも
   　使うようになったため、front-page_1.css を読まないページでも
   　グラフの見た目が必要になりました。

   【読み込み】
   　header-2026.php の $fu_csss に 'graph_2026' を入れてあります。

   【数字を直すとき】
   　このファイルではなく inc/fu-data.php を直してください。

   ※ 2026-09-13：棒の緑を #00B475（ロレックスグリーンの明るい版）に、
     伸び率の赤を金（--color-fu-gold-ink）に変更しました。
   　 サイト全体を新しい緑に寄せたあと、グラフだけ明るいままで
   　 よいかどうかは、色が確定してから調整します。
   ========================================================================== */

/* ==========================================================================
   2026-08-28：ビフォー／アフター棒グラフ（fu-graph）
   --------------------------------------------------------------------------
   トップページの2つのグラフ（数学偏差値・内申）を、画像とJS生成から
   PHP出力＋CSSに置き換えたものです。

   ・画像を使いません（3d_top-graph01.jpg / -sp.jpg 約730KB が不要に）
   ・PC用とSP用の出し分けも不要（1つで両対応）
   ・数字の修正は front-page.php のデータ配列だけ

   【動き】
   ・「前」のグラフは最初から完成した状態。動きません
   ・「後」のグラフだけが、画面に入ると棒が伸び、数字が出て、気球が上がる
   ・動かす合図は fu-graph-2026.js（is-fu-shown を付けるだけ）

   【色の考え方】
   目標ライン（偏差値60以上／内申4・5）より下はグレー、上は緑。
   足元の札は下が赤、上が青。画像版の配色をそのまま引き継いでいます。
   ========================================================================== */

/* ---- 見出し（既存の .solution h3 / h4 と同じ見た目） ---- */
.fu-graph-title{
  background: var(--fu-brand);
  color: #fff;   /* 2026-09-13：見出しバーはブランドの緑＋白文字 */
  border: 1px solid #333;
  text-align: center;
  color: #fff;
  padding: .3rem;
  margin: 15px 0 10px;
  font-size: 1.05em;
  font-weight: 700;
}
.fu-graph-subtitle{
  border: 1px solid #333;
  padding: .2rem 1rem;
  margin: 0 0 1rem;
  font-size: .95em;
  font-weight: 700;
}

/* ---- 表 ---- */
.fu-graph-tables{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .2rem;
  margin-bottom: 1.6rem;
}
.fu-graph-table{
  border-collapse: collapse;
  width: 100%;
  max-width: 340px;
  margin: 0;
}
.fu-graph-table th,
.fu-graph-table td{
  border: 1px solid #333;
  text-align: center;
  padding: .15rem .4rem;
}
.fu-graph-table thead th{ background: var(--fu-mute); font-weight: 700; }
.fu-graph-table th.green,
/* 2026-09-13：白文字を乗せるので、明るい緑ではなくメインの緑にします
   （#00B475 に白文字だとコントラスト2.7で読みにくいため） */
.fu-graph-table thead th.green{ background-color: var(--color-fu-green-deep); color: #fff; }

/* 表のあいだの矢印（SPは下向き。PCで右向きに変わります） */
.fu-graph-tablearrow{
  width: 0; height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 16px solid #1F3B99;
  margin: .3rem 0;
}

/* ---- グラフ全体 ---- */
.fu-graph-charts{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
}
/* 気球が上へ出るぶんの逃げ。気球を使う面だけ余白を取ります */
.fu-graph--balloon .fu-graph-charts{ padding-top: 48px; }  /* 気球は未使用（'badge' => 'circle'） */

.fu-graph-arrow{
  width: 0; height: 0;
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-top: 22px solid #1F3B99;
  margin: .2rem 0;
}

.fu-graph-chart{
  margin: 0;
  flex: 1 1 0;
  min-width: 0;
  width: 100%;
  position: relative;
  --fu-d: 5px;      /* 3Dの奥行き。PCでは8pxになります */
  --fu-barw: 60%;   /* 棒の太さ（1列に対する割合） */
}

.fu-graph-plot{
  display: flex;
  gap: 4px;
  height: 210px;
  position: relative;
  padding-top: 22px;
}
.fu-graph-unit{ position: absolute; top: 2px; left: 0; font-size: 11px; color: var(--fu-ground-quiet); }
.fu-graph-yaxis{
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  width: 20px;
  font-size: 10px;
  color: var(--fu-ground-quiet);
  line-height: 1;
  flex: 0 0 auto;
}
.fu-graph-area{
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  border-left: 1px solid #999;
  border-bottom: 1px solid #999;
}
.fu-graph-grid{
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: space-between;
}
.fu-graph-grid i{ display: block; height: 1px; background: var(--fu-card-2); }
.fu-graph-cols{ position: absolute; inset: 0; display: flex; align-items: flex-end; }
.fu-graph-col{
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}
.fu-graph-track{
  position: relative;
  width: 100%;
  flex: 1 1 auto;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

/* 棒の上に出る人数。棒の高さ＋3Dの奥行きぶん上に置きます */
.fu-graph-val{
  position: absolute;
  left: 0; right: 0;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--fu-ground-ink);
  white-space: nowrap;
  opacity: 0;
  transition: opacity .35s .9s;
  bottom: calc(var(--fu-h) + var(--fu-d) + 3px);
}
.fu-graph-val i{ font-style: normal; font-size: .85em; font-weight: 500; }

/* ---- 棒（3D風） ---- */
.fu-graph-bar{
  width: var(--fu-barw);
  height: 0;
  position: relative;
  transition: height 1.1s cubic-bezier(.22,.9,.3,1);
  background: linear-gradient(90deg,#8A9096,#A6ACB2 55%,#7C8288);
}
.fu-graph-col.is-fu-hi .fu-graph-bar{
  background: linear-gradient(90deg,#54A82B,#78C94F 55%,#4E9E27);
}
/* 上面と側面を skew で作ります。奥行きは --fu-d 1つで管理 */
.fu-graph-bar::before{
  content: "";
  position: absolute;
  left: 0;
  top: calc(var(--fu-d) * -1);
  width: 100%;
  height: var(--fu-d);
  background: var(--fu-mute);
  color: var(--fu-ground-quiet);   /* 2026-09-13 追加：地と文字を必ず対で決める */
  transform: skewX(-45deg);
  transform-origin: bottom left;
}
.fu-graph-bar::after{
  content: "";
  position: absolute;
  right: calc(var(--fu-d) * -1);
  top: 0;
  width: var(--fu-d);
  height: 100%;
  background: var(--fu-mute);
  color: var(--fu-ground-quiet);   /* 2026-09-13 追加：地と文字を必ず対で決める */
  transform: skewY(-45deg);
  transform-origin: top left;
}
.fu-graph-col.is-fu-hi .fu-graph-bar::before{ background: var(--fu-brand); }
.fu-graph-col.is-fu-hi .fu-graph-bar::after{ background: var(--fu-brand); }

/* ---- 動き ----
   「前」は最初から完成した状態。動くのは「後」だけです。
   比較の基準が先に立っていて、そこから伸びるほうが変化として読めます。 */
.fu-graph-chart--before .fu-graph-bar{ height: var(--fu-h); transition: none; }
.fu-graph-chart--before .fu-graph-val{ opacity: 1; transition: none; }
.fu-graph-chart--before .fu-graph-badge{ transform: none; opacity: 1; transition: none; }

.fu-graph-chart--after.is-fu-shown .fu-graph-bar{ height: var(--fu-h); }
.fu-graph-chart--after.is-fu-shown .fu-graph-val{ opacity: 1; }

/* ---- 階級の札 ---- */
.fu-graph-xlab{
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: var(--color-fu-green-deep);
  border-radius: 3px;
  margin-top: 3px;
  line-height: 1.5;
  white-space: nowrap;
  text-align: center;
}
.fu-graph-col.is-fu-hi .fu-graph-xlab{ background: var(--fu-brand); }
/* 偏差値グラフ：階級名が長いので横いっぱいの札に */
.fu-graph--pill .fu-graph-xlab{ width: 100%; padding: 1px 0; }
/* 内申グラフ：1〜5の数字なので正方形の札に（画像版と同じ） */
.fu-graph--square .fu-graph-xlab{
  width: 22px; height: 22px; line-height: 22px;
  border-radius: 3px; font-size: 13px;
}

/* ---- 気球 ----
   下からふわりと上がってきて、4と5の棒の中間の上で止まります。
   止まったあとも静かに揺れ続けます（気球が固定されていると不自然なため）。
   横位置を % にしてあるので、画面幅が変わっても棒との位置関係を保ちます。 */
.fu-graph-badge{
  position: absolute;
  z-index: 3;
}
.fu-graph-badge--balloon{
  top: -46px;
  right: 7%;
  width: 86px;
  transform-origin: bottom center;
  transform: translateY(150px);
  opacity: 0;
  transition: transform 1.8s .5s cubic-bezier(.22,.72,.28,1), opacity .6s .5s;
}
.fu-graph-chart--after.is-fu-shown .fu-graph-badge--balloon{
  transform: translateY(0);
  opacity: 1;
  animation: fu-graph-float 4.5s ease-in-out 2.4s infinite;
}
@keyframes fu-graph-float{
  0%, 100% { transform: translateY(0)    rotate(0deg); }
  50%      { transform: translateY(-7px) rotate(-1.2deg); }
}
.fu-graph-balloon{
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.18));
}

/* ============================================================
   丸バッジ
   ・偏差値グラフで使っています
   ・内申グラフを気球ではなく円にしたい場合は、front-page.php の
     'badge' => 'balloon' を 'circle' に変えるだけです。
     そのときは .fu-graph--balloon の padding-top（気球の逃げ）が
     効かなくなりますが、円は上にはみ出さないので問題ありません
   ============================================================ */
.fu-graph-badge--circle{
  top: -6px;
  right: 20px;   /* 2026-09-05：右端いっぱいから少し内側へ */
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  line-height: 1.1;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
  transform: scale(.4);
  opacity: 0;
  transition: transform .55s 1.5s cubic-bezier(.2,1.4,.4,1), opacity .4s 1.5s;
}
.fu-graph-chart--after.is-fu-shown .fu-graph-badge--circle{ transform: scale(1); opacity: 1; }
/* 2026-09-05：バッジの色を入れ替えました。
   左（入会前）＝グレー：まだ成果が出ていない状態。棒のグレーと合わせています
   右（入会後）＝ゴールド：成果が出たことを示す
   以前は 左=ゴールド／右=緑 でした。 */
.fu-graph-chart--before .fu-graph-badge--circle{
  background: var(--fu-mute);
  color: var(--fu-ground-quiet);   /* 2026-09-13 追加：地と文字を必ず対で決める */
  background-image: radial-gradient(circle at 34% 28%, rgba(255,255,255,.35), rgba(255,255,255,0) 60%);
}
.fu-graph-chart--after .fu-graph-badge--circle{
  background: var(--fu-gold);
  color: var(--fu-brand-dark);   /* 2026-09-13 追加：地と文字を必ず対で決める */
  background-image: radial-gradient(circle at 34% 28%, rgba(255,255,255,.35), rgba(255,255,255,0) 60%);
}
/* 2026-09-05：バッジ内の「内申4・5」「56人」が小さすぎたため大きくしました
   （9.5px → 13px／PCは14px）。あわせてバッジ自体も
   88px → 96px（PCは104px → 112px）に広げています。
   ％の数字はそのままです。 */
.fu-graph-badge--circle .fu-graph-badge-t{ font-size: 13px; font-weight: 700; }
.fu-graph-badge--circle strong{ font-size: 26px; font-weight: 900; letter-spacing: -.02em; }
.fu-graph-badge--circle strong i{ font-style: normal; font-size: 13px; font-weight: 700; margin-left: 1px; }
.fu-graph-badge--circle .fu-graph-badge-n{ font-size: 13px; font-weight: 600; opacity: .95; }

/* ---- キャプション ---- */
.fu-graph-chart figcaption{
  margin-top: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.fu-graph-captext{ text-align: center; }
.fu-graph-pill{
  display: inline-block;
  color: var(--fu-ground-ink);
  font-weight: 700;
  border-radius: 4px;
  padding: .15rem 1.4rem;
  font-size: .95em;
}
/* 2026-09-05：バッジをグレーにしたので、下の「入会前」の札も
   グレーに揃えました。ゴールドに戻す場合は #C08A2E に。 */
.fu-graph-chart--before .fu-graph-pill{ background: var(--fu-mute); }
/* 2026-09-13：白文字を乗せるので濃い緑に（明るい緑だとコントラスト2.7） */
.fu-graph-chart--after  .fu-graph-pill{ background: var(--fu-brand); color: #fff; }
.fu-graph-cap{ display: block; font-weight: 700; margin-top: .25rem; font-size: .95em; }

/* ---- 吹き出し（入試で使用する） ---- */
.fu-graph-bubble{
  position: relative;
  flex: 0 0 auto;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: var(--fu-brand);
  color: #ffffff;   /* 2026-09-13 追加：地と文字を必ず対で決める */
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.25;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.fu-graph-bubble::after{
  content: "";
  position: absolute;
  right: -6px;
  top: 52%;
  width: 0; height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 10px solid #1F3B99;
}

/* ---- 結果テキスト ----
   幅を固定していないので、文字がはみ出しません。
   （旧版は幅の指定があり、2文字はみ出していました） */
.fu-graph-result{
  margin-top: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.fu-graph-result p{
  margin: 0;
  border: 1px solid #333;
  border-radius: 4px;
  padding: .4rem .7rem;
  font-size: .95em;
  font-weight: 700;
  background: var(--fu-card);
  color: var(--fu-ground-ink);   /* 2026-09-13 追加：地と文字を必ず対で決める */
}
.fu-graph-down{ color: var(--fu-ground-quiet); }
.fu-graph-up{ color: var(--color-fu-gold-ink); }

/* ==========================================================================
   PC（768px〜）：表とグラフを左右に並べ、矢印を横向きに
   ========================================================================== */
@media screen and (min-width: 768px){
  .fu-graph-tables{ flex-direction: row; align-items: stretch; justify-content: center; gap: 1rem; }
  .fu-graph-table{ max-width: 300px; }
  .fu-graph-tablearrow{
    align-self: center;
    border: 0;
    width: 0; height: 0;
    border-top: 14px solid transparent;
    border-bottom: 14px solid transparent;
    border-left: 18px solid #1F3B99;
    margin: 0;
  }
  .fu-graph-charts{ flex-direction: row; align-items: center; gap: 1rem; }
  .fu-graph--balloon .fu-graph-charts{ padding-top: 62px; }
  .fu-graph-arrow{
    flex: 0 0 auto;
    border: 0;
    width: 0; height: 0;
    border-top: 18px solid transparent;
    border-bottom: 18px solid transparent;
    border-left: 24px solid #1F3B99;
    margin: 0 0 2rem;
  }
  .fu-graph-chart{ --fu-d: 8px; --fu-barw: 56%; }
  .fu-graph-plot{ height: 250px; }
  .fu-graph-yaxis{ width: 24px; font-size: 11px; }
  .fu-graph-val{ font-size: 11px; }
  .fu-graph-xlab{ font-size: 11px; }
  .fu-graph--square .fu-graph-xlab{ font-size: 13px; }
  .fu-graph-badge--circle{ width: 112px; height: 112px; top: -10px; }
  .fu-graph-badge--circle strong{ font-size: 31px; }
  .fu-graph-badge--circle .fu-graph-badge-t{ font-size: 14px; }
  .fu-graph-badge--circle .fu-graph-badge-n{ font-size: 14px; }
  .fu-graph-badge--balloon{ width: 104px; top: -60px; right: 7%; }
  .fu-graph-result{ flex-direction: row; }
  .fu-graph-result p{ flex: 1 1 0; }
}

/* 動きを減らす設定の端末では、揺れも浮上も止めて完成形を出します */
@media (prefers-reduced-motion: reduce){
  .fu-graph-bar,
  .fu-graph-val,
  .fu-graph-badge{ transition: none !important; }
  .fu-graph-badge--balloon{ transform: none; opacity: 1; }
  .fu-graph-chart--after.is-fu-shown .fu-graph-badge--balloon{ transform: none; animation: none; }
}

/* ==========================================================================
   2026-08-29：日本語の折り返し（見出しの「1文字だけ残る」対策）
   --------------------------------------------------------------------------
   【なぜ clamp では直らないか】
   clamp() が決めるのは文字の大きさだけです。どこで折り返すかは
   「文字数 × 文字サイズ ÷ 箱の幅」で決まるため、少し小さくしても
   幅が変われば別の場所でまた1文字余ります。
   下限に張り付いたあとは、そもそも縮みません。

   【この2行がやること】
   text-wrap: balance
     各行がだいたい同じ長さになるよう、折り返し位置を選び直します。
     行数は変わりませんが、最後に1文字だけ残るのがなくなります。
     Chrome 130+／Safari 17.5+／Firefox 121+

   word-break: auto-phrase
     日本語を単語ではなく文節で切ります。
     「小山台を目指す塾な／ら」ではなく「小山台を目指す／塾なら」。
     Chrome 119+／Edge 119+。SafariとFirefoxは未対応ですが、
     対応していないブラウザは無視するだけなので壊れません。

   【付ける範囲】
   見出し・帯・キャプションなど短い文だけ。本文の段落には付けません。
   長い文章に balance を使うと、かえって行がガタつきます。

   【うまくいかない1行が出たら】
   auto-phrase は機械学習で文節を判定するので、まれに意図しない位置で
   切れます。その1行だけ <wbr> で切ってよい位置を指定できます。
   ========================================================================== */

.fu-graph-title,
.fu-graph-subtitle,
.fu-graph-cap,
.fu-graph-pill,
.fu-graph-bubble,
.fu-graph-result p,
.fu-graph-table th,
.solution h3,
.solution h4,
.solution .bg-green-line,
.solution .solutionList li .after,
.solution .junior-table-wrapper .left p span {
  text-wrap: balance;
  word-break: auto-phrase;
}

/* ==========================================================================
   2026-09-05 追記：グラフが1本だけのとき（小学部の内申）

   .fu-graph-tables と .fu-graph-charts は、上下に積む作りです。
   2本立て（中学部）はそれで自然ですが、1本立て（小学部）は
   表もグラフも1つずつなので、PCでは横に並べたほうが収まります。

   ・スマホ（〜767px）：表が上、グラフが下（今までどおりの縦並び）
   ・PC（768px〜）    ：表が左、グラフが右

   セクションをグリッドにして、見出しと結論だけ全幅に伸ばしています。
   既存の2本立てのグラフには影響しません。
   ========================================================================== */
/* ==========================================================================
   2026-09-05：バッジと棒の重なりを解消

   棒の一番高いところに人数（29人・32人など）が入るため、
   バッジを棒の上に重ねると数字が隠れます。実測すると
   ①の「32人」②の「29人」③の「20人」が隠れていました。

   ・入会後（金）… 棒より上に逃がします。結果として
     入会前（銀）より高い位置になり、成果が上がったことが
     位置でも分かるようになります
   ・入会前（銀）… 棒が低いので、そのままの高さで問題ありません
   ・小学部（1本立て）… グラフが低く上に逃がしきれないため、
     内申1・2の空いている左側へ置きます
   ========================================================================== */
.fu-graph-charts{ padding-top: 42px; }
.fu-graph-chart--after .fu-graph-badge--circle{ top: -42px; }

.fu-graph--single .fu-graph-charts{ padding-top: 0; }
.fu-graph--single .fu-graph-badge--circle{ top: -10px; right: auto; left: 34px; }

@media (min-width: 768px){
  .fu-graph--single{
    display: grid;
    grid-template-columns: minmax(240px, 320px) 1fr;
    column-gap: 2rem;
    align-items: center;
  }
  /* 見出し・小見出し・結論は横いっぱいに */
  .fu-graph--single .fu-graph-title,
  .fu-graph--single .fu-graph-subtitle,
  .fu-graph--single .fu-graph-result{ grid-column: 1 / -1; }

  .fu-graph--single .fu-graph-tables{
    grid-column: 1;
    margin-bottom: 0;   /* 縦並び用の下余白は横並びでは不要 */
  }
  .fu-graph--single .fu-graph-charts{ grid-column: 2; justify-content: center; }

  /* 横に並べると、表（6行・約240px）に対してグラフだけが
     大きく見えます。高さと幅を抑えて、左右の背丈をそろえます。
     2本立てのグラフ（height:250px）はそのままです。 */
  .fu-graph--single .fu-graph-chart{ flex: 0 1 520px; max-width: 520px; }
  .fu-graph--single .fu-graph-plot{ height: 195px; }

  .fu-graph-charts{ padding-top: 50px; }
  .fu-graph-chart--after .fu-graph-badge--circle{ top: -50px; }
  .fu-graph--single .fu-graph-charts{ padding-top: 0; }
  .fu-graph--single .fu-graph-badge--circle{ top: -10px; right: auto; left: 70px; }
}

/* ==========================================================================
   2026-09-05 追記：小見出しの中に入れる注記
   1本立てのグラフでは、グラフ下のキャプションをやめて、
   この形で小見出しの枠に入れています。
   ========================================================================== */
.fu-graph-subnote{
  display: block;
  margin-top: .15rem;
  font-size: .88em;
  font-weight: 700;
  color: var(--fu-ground-brand);
}
/* 2026-09-05：PCでも1行に収まらず、（中1　6月以前まで）の途中で
   折り返していたため、常に改行して2行目に置くことにしました。 */

/* ==========================================================================
   2026-09-05 追記：数字が行頭に落ちるのを防ぐ

   日本語はどこでも折り返せるため、「入会時」で改行して
   次の行が「79人から…」で始まる、という見え方になりがちです。

   ・.fu-nb  … その中では折り返さない（数字と単位を引き離さない）
   ・.fu-br-pc … PCでだけ効く強制改行。スマホでは無効になるので、
                 幅が狭いときに変な位置で切れる心配がありません
   ========================================================================== */
.fu-nb{ white-space: nowrap; }
br.fu-br-pc{ display: none; }
@media (min-width: 768px){
  br.fu-br-pc{ display: inline; }
}


/* ==========================================================================
   2026-09-05 追記：横棒の比較グラフ（.fu-compare）

   小学部LPの主役です。小学生には「入会前の内申」が存在しないため、
   前後の対比（.fu-graph）では「フレンズアップだから伸びた」ことを
   示せません。そこで、よそと並べて比べる形を別に作りました。

       都内公立中学の平均 13.4%  →  中学から入会 32%  →  小学部から入会 38%

   ・棒の長さはPHPが style="--fu-w:○%" で入れています
   ・JSは使っていません。CSSのアニメーションだけで伸びます
   ・見出し・表の見た目は、上の .fu-graph に合わせてあります
   ・数字を直すのは inc/fu-data.php です
   ========================================================================== */
.fu-compare{
  margin: 15px 0 0;
}

/* 見出し（.fu-graph-title と同じ見た目） */
.fu-compare-title{
  background: var(--fu-brand);
  color: #fff;   /* 2026-09-13：見出しバーはブランドの緑＋白文字 */
  border: 1px solid #333;
  text-align: center;
  color: #fff;
  padding: .3rem;
  margin: 15px 0 10px;
  font-size: 1.05em;
  font-weight: 700;
}
.fu-compare-subtitle{
  border: 1px solid #333;
  padding: .2rem 1rem;
  margin: 0 0 1rem;
  font-size: .95em;
  font-weight: 700;
}

/* ---- 大きな数字 ---- */
.fu-compare-hero{
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .1rem .6rem;
  margin: 0 0 1.1rem;
}
.fu-compare-hero strong{
  font-size: clamp(2.6rem, 9vw, 3.4rem);
  line-height: 1;
  font-weight: 900;
  color: var(--fu-ground-brand);
}
.fu-compare-hero strong i{
  font-style: normal;
  font-size: .42em;
  font-weight: 700;
  margin-left: .1em;
}
.fu-compare-hero span{
  font-size: clamp(.9rem, 3.4vw, 1rem);
  font-weight: 700;
  color: var(--fu-ground-ink);
}

/* ---- 棒 ---- */
.fu-compare-bars{ margin: 0; }

.fu-compare-row{
  display: grid;
  grid-template-columns: 1fr;
  gap: .15rem;
  margin: 0 0 .8rem;
}
.fu-compare-name{
  font-size: clamp(.82rem, 3.2vw, .9rem);
  line-height: 1.35;
  color: var(--fu-ground-ink);
}
.fu-compare-row.is-fu-hi .fu-compare-name{ font-weight: 700; color: var(--fu-ground-brand); }

.fu-compare-track{
  position: relative;
  height: 32px;
  background: var(--fu-mute);
  color: var(--fu-ground-quiet);   /* 2026-09-13 追加：地と文字を必ず対で決める */
  border-radius: 3px;
}
/* 2026-09-13 深夜：棒が「全部同じ長さ」に見えていたのを直しました
   ------------------------------------------------------------------
   9/13の色の統一のときに、受け皿（track）と棒（fill）を
   どちらも --fu-mute にしてしまいました。
   同じ色なので、比較対象の2本（13.4% と 32%）が受け皿に溶けて、
   3本とも受け皿いっぱいに見えていました。

   受け皿は薄く、棒は濃く。これが元の形です。
   （元は棒 #9AA0A6 に白文字でしたが、コントラストが2.28しか
     なかったので、棒を濃くして白文字が読めるようにしています） */
.fu-compare-fill{
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: var(--fu-w);
  background: var(--fu-bar-quiet);
  color: #fff;
  border-radius: 0 3px 3px 0;
}
.fu-compare-row.is-fu-hi .fu-compare-fill{
  background: var(--color-fu-green-bright);
  color: var(--fu-brand-dark);   /* 明るい緑の上は濃い緑の文字 */
}

/* 値は棒の中。棒の長さを変えても位置がずれません */
.fu-compare-val{
  position: absolute;
  top: 50%; right: 10px;
  transform: translateY(-50%);
  font-size: clamp(.84rem, 3.2vw, .92rem);
  font-weight: 700;
  color: inherit;          /* 棒の色に合わせて上で決めています */
  white-space: nowrap;
}

/* 画面に入ったとき、左から伸びます（JS不要） */
@media (prefers-reduced-motion: no-preference){
  .fu-compare-fill{
    animation: fuCompareGrow .9s cubic-bezier(.22,.9,.3,1) both;
    animation-delay: var(--fu-d, 0s);
  }
  @keyframes fuCompareGrow{
    from{ width: 0; }
    to  { width: var(--fu-w); }
  }
}
/* 2026-10-16 画面に入るまで待つ（fu-graph-2026.js が .fu-compare--wait を付けます）
   JSが動かないときは、これまでどおりすぐ伸びます */
@media (prefers-reduced-motion: no-preference){
  .fu-compare--wait .fu-compare-fill{ animation-play-state: paused; }
  .fu-compare--wait.is-fu-shown .fu-compare-fill{ animation-play-state: running; }
  .fu-compare--wait .fu-compare-hero strong{
    display: inline-block;
    opacity: 0;
    transform: translateY(8px) scale(.9);
    transition: opacity .5s ease .9s, transform .6s cubic-bezier(.2,1.4,.4,1) .9s;
  }
  .fu-compare--wait.is-fu-shown .fu-compare-hero strong{ opacity: 1; transform: none; }
}

/* ---- 凡例 ---- */
.fu-compare-legend{
  display: flex;
  flex-wrap: wrap;
  gap: .2rem 1.2rem;
  margin: .9rem 0 0;
  font-size: .8rem;
  color: var(--fu-ground-quiet);
}
.fu-compare-legend__item{ display: flex; align-items: center; }
.fu-compare-legend__item::before{
  content: "";
  width: 12px; height: 12px;
  border-radius: 3px;
  background: var(--fu-bar-quiet);
  color: var(--fu-ground-quiet);   /* 2026-09-13 追加：地と文字を必ず対で決める */
  margin-right: .4em;
}
.fu-compare-legend__item.is-fu-hi::before{ background: var(--color-fu-green-bright); }

/* ---- 表（.fu-graph-table と同じ見た目） ---- */
.fu-compare-table{
  border-collapse: collapse;
  width: 100%;
  max-width: 420px;
  /* 2026-09-13 深夜：PCで左に寄っていたのでセンターにしました。
     幅の上限が420pxなので、800pxの中で左端に貼り付いて
     右に大きな空きができていました。 */
  margin: 1.1rem auto 0;
  font-size: .9em;
}
.fu-compare-table th,
.fu-compare-table td{
  border: 1px solid #333;
  text-align: center;
  padding: .15rem .5rem;
}
.fu-compare-table thead th{ background: var(--fu-mute); font-weight: 700; }
.fu-compare-table tbody th{ font-weight: 400; text-align: left; }
.fu-compare-table tr.is-fu-hi th,
.fu-compare-table tr.is-fu-hi td{ background: var(--fu-card-2); font-weight: 700; }

.fu-compare-foot{
  margin: .8rem 0 0;
  font-size: .78rem;
  line-height: 1.7;
  color: var(--fu-ground-quiet);
}

/* PCでは、名前を棒の左に置いて読みやすくします */
@media (min-width: 768px){
  .fu-compare-row{
    grid-template-columns: 13em 1fr;
    gap: 0 1rem;
    align-items: center;
  }
  .fu-compare-name{ text-align: right; }
  .fu-compare-track{ height: 34px; }
}


/* ==========================================================================
   2026-10-25 豆柴くん（「後」のグラフ）
   ・棒が伸びきって、グラフが画面にしっかり入ったら、豆柴くんが左の棒から順に
     棒の上をピョンピョン渡る。いちばん高い棒でひと休みして、右へ降りて走り去る
   ・絵は小学部の階段と同じスプライト（10コマ横並び）
   ・「視差効果を減らす」設定では出さない（JS側）
   ========================================================================== */
.fu-graph-dog{
  position: absolute; left: 0; top: 0; z-index: 6;   /* 偏差値・内申の丸いバッジより手前 */
  width: 40px; height: 30px;
  background: url(../img/2026/shogaku/mameshiba-run.webp) no-repeat 0 0 / 1000% 100%;
  transform-origin: 50% 90%;
  opacity: 0; pointer-events: none; will-change: transform, opacity;
}
@media (min-width: 768px){ .fu-graph-dog{ width: 48px; height: 36px; } }
body[data-fu-theme="dark"] .fu-graph-dog{ filter: drop-shadow(0 0 1px rgba(255,255,255,.55)) drop-shadow(0 0 3px rgba(255,255,255,.25)); }
