/* =========================================================
   ゆめのおかし工場 — 専用の見た目（ゆめかわ）

   ToC の案D「わいわい屋台」は 黒 2.5px の枠 + 5px ずらした影 で成立している。
   黒枠はふわふわの天敵なので、このゲームの本編エリアだけ別世界にする。
   ヘッダ・フッタ・マーキーは toc.css の共通のまま（サイトから切り離さない）。

   黒を使わない。線と文字はプラムに置き換える。それだけで別世界が立つ。
   ========================================================= */

.fc {
    --f-cream: #fff8f3;
    --f-pink: #ffc8dd;
    --f-mint: #bde0d8;
    --f-lav: #cdb4db;
    --f-sky: #a2d2ff;
    --f-butter: #ffe5a0;
    --f-plum: #6b4e71;
    --f-plum-soft: #9b82a0;

    --f-r: 18px;
    --f-sh: 0 6px 18px rgba(107, 78, 113, .14);

    position: relative;
    color: var(--f-plum);
    font-family: "M PLUS Rounded 1c", system-ui, sans-serif;
    background: linear-gradient(180deg, #f3f8ff 0%, var(--f-cream) 45%, #fff1f6 100%);
    border-radius: 22px;
    padding: 1.4rem 1.1rem 1.8rem;
    overflow: hidden;
}

.fc h2, .fc h3, .fc h4, .fc h5 { font-family: "Kaisei Decol", "M PLUS Rounded 1c", serif; }
.fc b, .fc strong { color: var(--f-plum); }

.fc-btn {
    appearance: none;
    border: 0;
    border-radius: 999px;
    padding: .7rem 1.6rem;
    font: inherit;
    font-weight: 900;
    color: var(--f-plum);
    background: #fff;
    box-shadow: var(--f-sh);
    cursor: pointer;
    transition: transform .16s ease, box-shadow .16s ease;
}
.fc-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(107, 78, 113, .2); }
.fc-btn:focus-visible { outline: 3px solid var(--f-sky); outline-offset: 2px; }
.fc-btn-main { background: var(--f-pink); }
.fc-btn-ship { background: var(--f-butter); padding: .8rem 2.2rem; font-size: 1.05rem; }
.fc-link {
    appearance: none; border: 0; background: none; font: inherit; font-weight: 700;
    color: var(--f-plum-soft); text-decoration: underline; cursor: pointer; padding: .2rem;
}

/* ---------- スタート画面 ---------- */
.fc-start { min-height: 460px; display: grid; place-items: center; text-align: center; }
.fc-start::before {
    content: ""; position: absolute; inset: 0;
    background: url("/assets/img/factory/bg-factory.webp?v=3") center/cover no-repeat;
    opacity: .96;
}
.fc-sky { position: absolute; inset: 0; pointer-events: none; }
.fc-sky img { position: absolute; width: auto; }
.fc-cl { height: 58px; opacity: .85; }
.fc-cl1 { top: 8%;  left: -14%; animation: fc-drift 46s linear infinite; }
.fc-cl2 { top: 26%; left: -22%; height: 42px; animation: fc-drift 62s linear infinite 6s; }
.fc-cl3 { top: 16%; left: -30%; height: 32px; animation: fc-drift 78s linear infinite 14s; }
.fc-st { height: 22px; }
.fc-st1 { top: 14%; left: 18%; animation: fc-twinkle 3.2s ease-in-out infinite; }
.fc-st2 { top: 30%; right: 16%; height: 17px; animation: fc-twinkle 4.1s ease-in-out infinite .6s; }
.fc-st3 { top: 8%;  right: 30%; height: 13px; animation: fc-twinkle 2.7s ease-in-out infinite 1.2s; }
.fc-sm { height: 66px; top: 4%; left: 47%; opacity: .5; animation: fc-rise 7s ease-out infinite; }

@keyframes fc-drift  { from { transform: translateX(0); } to { transform: translateX(150vw); } }
@keyframes fc-twinkle { 0%, 100% { opacity: .35; transform: scale(.88); } 50% { opacity: 1; transform: scale(1.1); } }
@keyframes fc-rise   { 0% { opacity: 0; transform: translateY(14px) scale(.9); }
                       30% { opacity: .55; } 100% { opacity: 0; transform: translateY(-46px) scale(1.2); } }

.fc-start-inner { position: relative; padding: 2rem 1.4rem; border-radius: 26px;
                  background: radial-gradient(ellipse at center,
                      rgba(107, 78, 113, .34) 0%, rgba(107, 78, 113, .16) 55%, rgba(107, 78, 113, 0) 78%); }
.fc-logo {
    margin: 0; font-size: clamp(2rem, 8vw, 3.2rem); line-height: 1.15;
    color: #fff; text-shadow: 0 3px 0 var(--f-lav), 0 8px 20px rgba(107, 78, 113, .35);
}
.fc-sub { margin: .3rem 0 1.6rem; font-weight: 900; color: #fff;
          text-shadow: 0 2px 8px rgba(107, 78, 113, .5); letter-spacing: .1em; }
.fc-start-btns { display: flex; flex-direction: column; gap: .7rem; align-items: center; }
.fc-start-btns .fc-btn { min-width: 220px; }

/* ---------- おかし選び ---------- */
.fc-h { text-align: center; margin: .2rem 0 .2rem; font-size: 1.5rem; }
.fc-note { text-align: center; color: var(--f-plum-soft); font-weight: 700; margin: 0 0 1.2rem; }
.fc-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; }
.fc-card {
    appearance: none; border: 0; cursor: pointer; font: inherit; color: inherit;
    background: #fff; border-radius: var(--f-r); box-shadow: var(--f-sh);
    padding: 1.1rem .9rem 1rem; text-align: center;
    transition: transform .18s ease, box-shadow .18s ease;
}
.fc-card:hover { transform: translateY(-4px); box-shadow: 0 14px 28px rgba(107, 78, 113, .2); }
.fc-card-img { width: auto; height: 108px; object-fit: contain; }
.fc-card h3 { margin: .5rem 0 .6rem; font-size: 1.1rem; }
.fc-card dl { display: grid; grid-template-columns: auto 1fr; gap: .1rem .5rem;
              font-size: .78rem; text-align: left; margin: 0; }
.fc-card dt { color: var(--f-plum-soft); font-weight: 700; }
.fc-card dd { margin: 0; font-weight: 900; }

/* ---------- ノベル ---------- */
/* ノベルを出しているあいだだけ、入れ物に高さを持たせる。
   中身が空のままだと inset:0 の箱がつぶれてしまう。 */
.fc.is-novel { min-height: min(78vh, 620px); min-height: min(78svh, 620px); padding: 0; }

.fc-novel {
    position: absolute; inset: 0; z-index: 30; cursor: pointer;
    border-radius: 22px; overflow: hidden;
    background: linear-gradient(180deg, rgba(205, 180, 219, .35), rgba(255, 248, 243, .92)),
                url("/assets/img/factory/bg-lab.webp?v=3") center/cover no-repeat;
    display: grid; grid-template-rows: 1fr auto; padding: 1rem;
}
.fc-novel-stage { display: grid; place-items: end center; overflow: hidden; }
/* キャラごとの背の高さ。切り抜きは全員 520px に揃えてあるので、
   ここで世界の中での大きさに戻す。並べたときの関係を保つための共通の物差し。
   工場長 1:3.5（いちばん高い）／むっく 1:2.5／きらら 1:2／ぽむ 1:1.5（いちばん低い） */
.fc-ch-manager { --ch: 1.00; }
.fc-ch-kirara  { --ch: 0.72; }
.fc-ch-mukku   { --ch: 0.80; }
.fc-ch-pomu    { --ch: 0.58; }
/* ⚠ ここに .fc-ch { --ch: 1 } を書かないこと。同じ詳細度で後勝ちして、
   上の 4 つを全部 1 に戻してしまう。既定値は var(--ch, 1) の側で持つ。 */

.fc { --portrait-base: min(46vh, 340px); }

/* ⚠ 高さを直接上書きしない。画面幅で変えるときは --portrait-base のほうを変える。
   height を書き直すと var(--ch) の掛け算が落ちて、縮尺が効かなくなる（実際に踏んだ）。 */
.fc-portrait { height: calc(var(--portrait-base) * var(--ch, 1)); width: auto;
               filter: drop-shadow(0 8px 16px rgba(107, 78, 113, .25)); }
.fc-novel-box {
    position: relative; background: #fff; border-radius: var(--f-r);
    box-shadow: var(--f-sh); padding: 1rem 1.1rem 1.3rem; min-height: 5.2rem;
}
.fc-speaker { margin: 0 0 .3rem; font-weight: 900; color: var(--f-lav); font-size: .9rem; }
.fc-line { margin: 0; font-size: 1.05rem; font-weight: 700; line-height: 1.7; }
.fc-next { position: absolute; right: .9rem; bottom: .5rem; font-size: .7rem;
           color: var(--f-plum-soft); animation: fc-twinkle 1.6s ease-in-out infinite; }
.fc-skip {
    position: absolute; top: .8rem; right: .8rem; appearance: none; border: 0; cursor: pointer;
    font: inherit; font-weight: 900; color: var(--f-plum); background: rgba(255, 255, 255, .9);
    border-radius: 999px; padding: .4rem 1.1rem; box-shadow: var(--f-sh);
}

/* ---------- 開発画面 ---------- */
.fc-dev { background: linear-gradient(180deg, #f6fbff, var(--f-cream)); }
.fc-head { display: flex; flex-wrap: wrap; gap: .4rem 1rem; justify-content: space-between;
           align-items: baseline; margin-bottom: .8rem; }
.fc-order { margin: 0; font-weight: 900; font-size: 1.05rem; }
.fc-order b { color: var(--f-lav); font-size: 1.2em; }
.fc-order small { display: block; font-size: .72rem; color: var(--f-plum-soft); font-weight: 700; }
.fc-counts { margin: 0; font-weight: 700; color: var(--f-plum-soft); }
.fc-counts b { color: var(--f-plum); font-size: 1.15em; }

.fc-tabs { display: flex; gap: .4rem; margin-bottom: .5rem; flex-wrap: wrap; }
.fc-tab {
    appearance: none; border: 0; cursor: pointer; font: inherit; font-weight: 900;
    color: var(--f-plum-soft); background: #fff; border-radius: 999px;
    padding: .45rem 1.1rem; box-shadow: var(--f-sh); font-size: .85rem;
}
.fc-tab.is-on { background: var(--f-lav); color: #fff; }

.fc-panels { position: relative; display: grid; grid-template-columns: 1.3fr 1fr; gap: .7rem;
             align-items: start; }
/* 1 カラムに落とすのは 560px 未満だけ。560〜720 で 1 カラムにすると
   グラフが幅いっぱいに広がって高さが 394px まで膨らみ、
   デスクトップより背が高くなる逆転が起きる（実測で確認）。 */
@media (max-width: 559px) { .fc-panels { grid-template-columns: 1fr; } }
@media (min-width: 560px) and (max-width: 720px) { .fc-panels { grid-template-columns: 1.15fr 1fr; } }
.fc-plot, .fc-report { background: #fff; border-radius: var(--f-r); box-shadow: var(--f-sh); padding: .8rem; }
.fc-empty { margin: 0; padding: 2.4rem .6rem; text-align: center; color: var(--f-plum-soft); font-weight: 700; }
.fc-chart svg { width: 100%; height: auto; display: block; }
/* グラフだけは正確に。光らせない・ぼかさない */
.fc-chart .grid-line { stroke: #efe6f2; stroke-width: 1; }
.fc-chart .axis-line { stroke: #c9b6d0; stroke-width: 1.5; }
.fc-chart .zero-line { stroke: #b9a3c1; stroke-width: 1.5; stroke-dasharray: 4 3; }
.fc-chart .axis-label { fill: var(--f-plum-soft); font-size: 11px; font-weight: 700; }
.fc-chart .wave-path { fill: none; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }

/* ---------- エフェクト（試作完成 / 測定 / 味見） ---------- */
.fc-fx {
    position: absolute; inset: 0; z-index: 40; display: grid; place-items: center;
    border-radius: 22px; overflow: hidden;
    background: linear-gradient(180deg, rgba(205, 180, 219, .30), rgba(255, 248, 243, .95)),
                url("/assets/img/factory/bg-lab.webp?v=3") center/cover no-repeat;
}
.fc-fx-body { position: relative; width: min(420px, 82%); height: 300px; display: grid; place-items: center; }
.fc-fx-sweet { height: 120px; width: auto; }
.fc-fx-say { position: absolute; bottom: 0; margin: 0; font-weight: 900; font-size: 1.1rem;
             color: var(--f-plum); text-shadow: 0 2px 10px rgba(255, 255, 255, .9); }

/* 試作完成: 材料が中央へ寄り、重なった瞬間にお菓子になる */
.fc-fx-make .fc-fx-ing {
    position: absolute; height: auto;
    animation: fx-gather var(--fx-dur) cubic-bezier(.4, 0, .3, 1) both;
}
.fc-fx-make .i0 { top: 4%;  left: 6%; }
.fc-fx-make .i1 { top: 30%; right: 4%; animation-delay: calc(var(--fx-dur) * .06); }
.fc-fx-make .i2 { bottom: 16%; left: 14%; animation-delay: calc(var(--fx-dur) * .12); }
@keyframes fx-gather {
    0%   { opacity: 0; transform: translate(0, 0) scale(.7); }
    18%  { opacity: 1; transform: translate(0, 0) scale(1); }
    62%  { opacity: 1; }
    100% { opacity: 0; transform: translate(var(--gx, 0), var(--gy, 0)) scale(.25); }
}
.fc-fx-make .i0 { --gx: 120px; --gy: 96px; }
.fc-fx-make .i1 { --gx: -128px; --gy: 52px; }
.fc-fx-make .i2 { --gx: 96px; --gy: -78px; }

/* 試作完成: お菓子が現れて、きらめきが散る */
.fc-fx-make .fc-fx-sweet { animation: fx-pop var(--fx-dur) cubic-bezier(.2, 1.6, .4, 1) both;
                           animation-delay: calc(var(--fx-dur) * .55); }
.fc-fx-make img[class^="s"] { position: absolute; width: auto; height: 30px;
    animation: fx-burst var(--fx-dur) ease-out both; }
.fc-fx-make .s1 { top: 14%; left: 16%; } .fc-fx-make .s2 { top: 22%; right: 14%; --d: .08; }
.fc-fx-make .s3 { bottom: 26%; left: 24%; --d: .16; } .fc-fx-make .s4 { bottom: 22%; right: 22%; --d: .12; }
@keyframes fx-pop { 0% { opacity: 0; transform: scale(.3) translateY(24px); }
                    60% { opacity: 1; transform: scale(1.12) translateY(-6px); }
                    100% { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes fx-burst { 0% { opacity: 0; transform: scale(.2); }
                      45% { opacity: 1; transform: scale(1.2); }
                      100% { opacity: 0; transform: scale(1.05) translateY(-18px); } }

/* 測定: 上から感圧軸が下りてきて、試料を押す */
.fc-fx-measure .fc-fx-sweet { animation: fx-squash var(--fx-dur) ease-in-out both; transform-origin: 50% 100%; }
.fc-fx-plunger { position: absolute; top: 6%; width: 74px; height: 120px; border-radius: 0 0 14px 14px;
    background: linear-gradient(180deg, var(--f-lav), #b79ec7);
    box-shadow: 0 6px 14px rgba(107, 78, 113, .22);
    animation: fx-press var(--fx-dur) ease-in-out both; }
.fc-fx-stage { position: absolute; bottom: 20%; width: 190px; height: 18px; border-radius: 999px;
    background: var(--f-mint); box-shadow: 0 4px 10px rgba(107, 78, 113, .16); }
@keyframes fx-press { 0% { transform: translateY(-60px); } 45% { transform: translateY(54px); }
                      70% { transform: translateY(54px); } 100% { transform: translateY(-30px); } }
@keyframes fx-squash { 0%, 30% { transform: scaleY(1) scaleX(1); }
                       55%, 70% { transform: scaleY(.66) scaleX(1.16); }
                       100% { transform: scaleY(1) scaleX(1); } }

/* 味見: 試作品がキャラに吸い込まれていく */
.fc-fx-taste .fc-fx-face { position: absolute; right: 6%; bottom: 8%; height: calc(var(--fxface-base, 215px) * var(--ch, 1)); width: auto;
    animation: fx-bob var(--fx-dur) ease-in-out both; }
.fc-fx-taste .fc-fx-sweet { position: absolute; left: 12%; bottom: 34%;
    animation: fx-suck var(--fx-dur) cubic-bezier(.5, 0, .85, .4) both; }
@keyframes fx-suck { 0% { opacity: 1; transform: translate(0, 0) scale(1) rotate(0deg); }
                     70% { opacity: 1; }
                     100% { opacity: 0; transform: translate(190px, 26px) scale(.18) rotate(220deg); } }
@keyframes fx-bob { 0%, 60% { transform: translateY(0) scale(1); }
                    80% { transform: translateY(-10px) scale(1.06); }
                    100% { transform: translateY(0) scale(1); } }

/* ---------- 手順の表示 ---------- */
.fc-steps { display: flex; gap: .4rem; list-style: none; margin: 0 0 .5rem; padding: 0; }
.fc-steps li { font-size: .74rem; font-weight: 900; color: var(--f-plum-soft);
               background: #fff; border-radius: 999px; padding: .3rem .9rem; box-shadow: var(--f-sh); }
.fc-steps li.is-on { background: var(--f-lav); color: #fff; }
.fc-lead { margin: 0 0 .8rem; font-weight: 700; color: var(--f-plum-soft); }
.fc-btn small { display: block; font-size: .68rem; font-weight: 700; color: var(--f-plum-soft); }
.fc-btn:disabled { opacity: .45; cursor: default; transform: none; color: var(--f-plum); }

.fc-report h4 { margin: 0 0 .1rem; font-size: .95rem; }
.fc-report h4 span { color: var(--f-plum-soft); font-size: .85em; }
.fc-rep-mix { margin: 0 0 .6rem; font-size: .72rem; color: var(--f-plum-soft); font-weight: 700; }
.fc-rep-block { margin-bottom: .5rem; }
.fc-rep-block h5 { margin: 0 0 .15rem; font-size: .76rem; color: var(--f-lav); }
.fc-report table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.fc-report th { text-align: left; font-weight: 700; color: var(--f-plum-soft); padding: .12rem 0; }
.fc-report td { text-align: right; font-weight: 900; padding: .12rem 0; font-variant-numeric: tabular-nums; }
.fc-report td small { font-size: .72em; color: var(--f-plum-soft); margin-left: .15em; font-weight: 700; }
.fc-report td i { font-style: normal; font-size: .72rem; }
.fc-report td i.up { color: #d1668a; } .fc-report td i.dn { color: #5a8fb8; }
.fc-report td i.eq { color: var(--f-plum-soft); }
.fc-hint { margin: .5rem 0 0; padding: .5rem .6rem; border-radius: 12px; background: var(--f-butter);
           font-size: .8rem; font-weight: 700; line-height: 1.5; }

.fc-wow { position: absolute; inset: 0; pointer-events: none; }
/* width を書かないと、HTML の width 属性（191px など）がそのまま効いて
   横に 6 倍ほど伸びる。高さだけ指定する画像には必ず width: auto を添える。 */
.fc-wow img { position: absolute; width: auto; height: 34px; animation: fc-pop 1.3s ease-out forwards; }
.fc-wow .a { top: 10%; left: 12%; } .fc-wow .b { top: 22%; right: 16%; animation-delay: .1s; }
.fc-wow .c { bottom: 18%; left: 26%; animation-delay: .2s; }
.fc-wow .d { bottom: 12%; right: 24%; animation-delay: .15s; }
@keyframes fc-pop { 0% { opacity: 0; transform: scale(.4) translateY(10px); }
                    35% { opacity: 1; transform: scale(1.15) translateY(-6px); }
                    100% { opacity: 0; transform: scale(1) translateY(-26px); } }

.fc-hist-wrap { text-align: right; margin: .4rem 0 .6rem; }

/* 「見るだけ」のリンクを 1 行に並べる。ボタン列の下に置くので、
   押すものと見るものが上下で分かれる。 */
.fc-subs {
    display: flex; flex-wrap: wrap; justify-content: center;
    gap: .2rem .35rem; margin: .5rem 0 0;
}
.fc-subs .fc-link { font-size: .88rem; }
/* 2 本目の前に中黒を置いて、別々の操作だと分かるようにする */
.fc-subs .fc-link + .fc-link::before {
    content: "・"; margin-right: .35rem;
    color: var(--f-plum-soft); text-decoration: none; display: inline-block;
}

/* ---------- 配合バー ---------- */
.fc-mix { background: #fff; border-radius: var(--f-r); box-shadow: var(--f-sh); padding: .9rem; }
.fc-bar { display: flex; height: 54px; border-radius: 14px; overflow: hidden; }
.fc-seg { display: grid; place-content: center; font-size: .74rem; font-weight: 900;
          color: var(--f-plum); transition: width .18s ease; overflow: hidden; white-space: nowrap; }
.fc-seg b { display: block; font-size: 1.15rem; }
.fc-seg0 { background: var(--f-pink); }
.fc-seg1 { background: var(--f-mint); }
.fc-seg2 { background: var(--f-lav); }
.fc-bar-ctl { display: grid; gap: .3rem; margin-top: .6rem; }
.fc-bar-ctl label, .fc-proc { display: grid; grid-template-columns: 7.5em 1fr auto; gap: .5rem;
                              align-items: center; font-size: .8rem; font-weight: 700; }
.fc-proc { margin-top: .6rem; }
/* range の既定トラックは濃いグレー。黒を使わない方針に合わないので自前で描く。 */
.fc input[type="range"] {
    width: 100%; appearance: none; background: none; height: 22px; cursor: pointer;
}
.fc input[type="range"]::-webkit-slider-runnable-track {
    height: 10px; border-radius: 999px; background: #f2ecf5;
}
.fc input[type="range"]::-moz-range-track {
    height: 10px; border-radius: 999px; background: #f2ecf5;
}
.fc input[type="range"]::-webkit-slider-thumb {
    appearance: none; width: 22px; height: 22px; margin-top: -6px;
    border-radius: 50%; background: var(--f-lav); border: 3px solid #fff;
    box-shadow: 0 2px 6px rgba(107, 78, 113, .3);
}
.fc input[type="range"]::-moz-range-thumb {
    width: 22px; height: 22px; border-radius: 50%; background: var(--f-lav);
    border: 3px solid #fff; box-shadow: 0 2px 6px rgba(107, 78, 113, .3);
}
.fc input[type="range"]:focus-visible { outline: 3px solid var(--f-sky); outline-offset: 2px; }

.fc-actions { display: flex; gap: .6rem; justify-content: center; margin: .6rem 0 .2rem;
              flex-wrap: wrap; align-items: center; }
.fc-ship { text-align: center; margin-top: .5rem; }

/* 味見の画面。喜んでいるか渋っているかで、幕の色をすこし変える。 */
.fc-novel.is-good { background: linear-gradient(180deg, rgba(189, 224, 216, .5), rgba(255, 248, 243, .94)),
                    url("/assets/img/factory/bg-lab.webp?v=3") center/cover no-repeat; }
.fc-novel.is-bad  { background: linear-gradient(180deg, rgba(255, 200, 221, .5), rgba(255, 248, 243, .94)),
                    url("/assets/img/factory/bg-lab.webp?v=3") center/cover no-repeat; }

/* ---------- 市場・結果 ---------- */
.fc-market { padding-top: 0; }
.fc-market-bg { position: absolute; inset: 0 0 auto; height: 220px; overflow: hidden; }
.fc-market-bg img { width: 100%; height: 100%; object-fit: cover; }
.fc-market-bg::after { content: ""; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(255, 248, 243, 0) 40%, var(--f-cream) 100%); }
.fc-result { position: relative; padding-top: 150px; }
.fc-res-ttl { margin: 0; text-align: center; font-weight: 900; color: var(--f-lav); letter-spacing: .1em; }
.fc-res-big { margin: 0 0 1rem; text-align: center; font-size: clamp(2.6rem, 11vw, 4.2rem);
              font-weight: 900; line-height: 1; }
.fc-res-big small { font-size: .28em; margin-left: .2em; color: var(--f-plum-soft); }
.fc-segs { display: grid; gap: .7rem; }
.fc-seg-res { background: #fff; border-radius: var(--f-r); box-shadow: var(--f-sh); padding: .8rem .9rem; }
.fc-seg-res.is-main { outline: 3px solid var(--f-butter); }
.fc-seg-head { display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; margin-bottom: .5rem; }
.fc { --face-base: 74px; }
.fc-seg-face { height: calc(var(--face-base) * var(--ch, 1)); width: auto; }
.fc-seg-head b { font-size: 1.05rem; }
.fc-seg-head em { font-style: normal; font-size: .68rem; font-weight: 900; color: #b08a2e;
                  background: var(--f-butter); border-radius: 999px; padding: .1rem .6rem; margin-left: .4rem; }
.fc-seg-head span { display: block; font-size: .8rem; font-weight: 700; color: var(--f-plum-soft); }
.fc-pass { margin-left: auto; font-size: .74rem; font-weight: 900; border-radius: 999px;
           padding: .25rem .8rem; background: #fdf3f6; color: #b5566f; }
.fc-pass.ok { background: #eefaf3; color: #2f7d58; }

.fc-band { display: grid; grid-template-columns: 6.5em 1fr 2.4em; gap: .5rem; align-items: center;
           font-size: .76rem; font-weight: 700; margin: .18rem 0; }
.fc-band-track { position: relative; height: 12px; border-radius: 999px; background: #f2ecf5;
                 overflow: hidden; }   /* 帯が軸の外へ伸びてもカードから出さない */
.fc-band-track i { position: absolute; top: 0; height: 100%; border-radius: 999px; background: var(--f-mint); }
.fc-band-track u { position: absolute; top: -3px; width: 4px; height: 18px; border-radius: 2px;
                   background: var(--f-plum); transform: translateX(-2px); }
.fc-band.is-ng .fc-band-v { color: #b5566f; }
.fc-band.is-ok .fc-band-v { color: #2f7d58; }
.fc-band-v { text-align: right; }
.fc-kuchikomi { margin: .5rem 0 0; font-size: .85rem; font-weight: 700; }
.fc-again { display: flex; gap: .7rem; justify-content: center; flex-wrap: wrap; margin-top: 1.2rem; }
.fc-again .fc-btn { text-decoration: none; display: inline-block; }

/* ---------- モーダル ---------- */
.fc-modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center;
            background: rgba(107, 78, 113, .38); padding: 1rem; }
.fc-modal-box { background: #fff; border-radius: 22px; padding: 1.4rem 1.2rem; max-width: 560px;
                width: 100%; max-height: 84vh; max-height: 84dvh; overflow: auto; box-shadow: 0 20px 50px rgba(107, 78, 113, .3);
                color: var(--f-plum); font-family: "M PLUS Rounded 1c", system-ui, sans-serif; }
.fc-modal-box h3 { margin: 0 0 .8rem; font-size: 1.25rem; }
.fc-how { margin: 0 0 1rem; padding-left: 1.2rem; display: grid; gap: .6rem; }
.fc-how b { display: block; }
.fc-how span { font-size: .85rem; font-weight: 700; color: var(--f-plum-soft); }
.fc-how em { font-style: normal; color: var(--f-plum); }
.fc-terms summary { cursor: pointer; font-weight: 900; }
.fc-terms dl { display: grid; grid-template-columns: 7em 1fr; gap: .2rem .6rem; font-size: .82rem; margin: .6rem 0 0; }
.fc-terms dt { font-weight: 900; color: var(--f-plum-soft); }
.fc-terms dd { margin: 0; }
.fc-hist-scroll { overflow: auto; max-height: 50vh; }
.fc-hist { width: 100%; border-collapse: collapse; font-size: .76rem; white-space: nowrap; }
.fc-hist th, .fc-hist td { padding: .25rem .4rem; text-align: right; border-bottom: 1px solid #f1eaf4; }
.fc-hist th { color: var(--f-plum-soft); position: sticky; top: 0; background: #fff; }
.fc-modal-box .fc-btn { display: block; margin: 1.2rem auto 0; }

/* S7 量産ボタンは 620px 以上ではボタン列の中に入れる（JS が移す）。
   独立した段をやめると 1 行ぶん（約 47px）減る。
   620px 未満では 3 つ目が折り返して逆に増えるので、そこでは元の段のまま。 */
.fc-actions .fc-btn-ship { margin: 0; }

/* ---------- せまい画面 ---------- */
@media (max-width: 720px) {
    .fc { padding: 1rem .7rem 1.4rem; }
    .fc { --portrait-base: min(34vh, 250px); }
    .fc-bar-ctl label, .fc-proc { grid-template-columns: 6em 1fr auto; font-size: .75rem; }
    .fc-band { grid-template-columns: 5.5em 1fr 2.2em; font-size: .7rem; }
    .fc { --face-base: 58px; --fxface-base: 160px; }
}

/* ---------- スマホ ----------
   グラフとレポートが縦に積まれるぶん（541px）が効いてくる。
   文字は縮めない（レポートの単位が既に 9.2px あり、これ以上は読めない）。
   縮めるのは余白・行間・箱の内側と、役割が重なっている要素。 */
@media (max-width: 619px) {
    /* 手順の帯はタブと役割が重なる。測る画面では出さない */
    .fc-screen-result .fc-steps { display: none; }

    /* タブは折り返すと 2 行（85px）になる。1 行のまま横へ流す */
    .fc-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
    .fc-tabs::-webkit-scrollbar { display: none; }
    .fc-tab { white-space: nowrap; flex: 0 0 auto; }

    .fc-head { font-size: .84rem; }
    .fc-panels { gap: .45rem; }
    .fc-plot, .fc-report { padding: .55rem; }
    .fc-report h4 { font-size: .9rem; }
    .fc-rep-mix { font-size: .72rem; line-height: 1.5; margin: .1rem 0 .4rem; }
    .fc-rep-block { margin-bottom: .3rem; }
    .fc-report th, .fc-report td { padding: .06rem 0; }

    /* ボタンはタップ領域（44px 以上）を保ったまま詰める */
    .fc-actions { gap: .45rem; margin: .5rem 0 .2rem; }
    .fc-actions .fc-btn { padding: .6rem 1rem; font-size: .92rem; }
    .fc-actions .fc-btn small { display: block; font-size: .68rem; margin-top: -.1rem; }
    .fc-ship { margin-top: .3rem; }
    .fc-ship .fc-btn { padding: .55rem 1.2rem; }
}

/* ---------- 動きを減らす設定 ---------- */
@media (prefers-reduced-motion: reduce) {
    .fc *, .fc *::before, .fc *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* ---------- シェア ----------
   .sh の見た目は games.css にしかなく、このページは読まないので
   アイコンが原寸で出ていた。ゆめかわの地に合わせて置き直す。 */
.fc .share { margin: 1.2rem auto .4rem; max-width: 26rem; text-align: center; }
.fc .share-label { font-size: .76rem; font-weight: 900; color: var(--f-plum-soft); margin: 0 0 .55rem; }
.fc .share-btns { display: flex; gap: 9px; justify-content: center; flex-wrap: wrap; }
.fc .sh {
    font: inherit; font-weight: 900; font-size: .84rem; cursor: pointer;
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .5rem 1.05rem; border: 0; border-radius: 999px;
    background: #fff; color: var(--f-plum); text-decoration: none;
    box-shadow: var(--f-sh);
    transition: transform .14s ease, box-shadow .14s ease;
}
.fc .sh:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(107, 78, 113, .2); }
.fc .sh svg { width: 17px; height: 17px; flex: none; }
.fc .sh-x { background: var(--f-plum); color: #fff; }
.fc .sh-line { background: #06c755; color: #fff; }
.fc .sh-ig { background: linear-gradient(45deg, #f9ce34, #ee2a7b 48%, #6228d7); color: #fff; }
.fc .sh-sheet { background: #ffe680; color: var(--f-plum); }
.fc .sh[hidden] { display: none; }
.fc .share-card { margin: 0 auto .8rem; max-width: 20rem; }
.fc .share-card img {
    display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630;
    border-radius: 14px; box-shadow: var(--f-sh);
}
.fc .share-card figcaption { margin-top: .35rem; font-size: .7rem; font-weight: 700; color: var(--f-plum-soft); }
.fc .share-note {
    margin: .7rem 0 0; font-size: .78rem; font-weight: 700; color: var(--f-plum);
    background: #fff; border-radius: 14px; box-shadow: var(--f-sh);
    padding: .5rem .8rem; word-break: break-all;
}
.fc-unmeasured {
    margin: .4rem 0 0; font-size: .72rem; font-weight: 700; color: var(--f-plum-soft);
    background: #f7f2fa; border-radius: 10px; padding: .35rem .6rem;
}
