/* ══════════════════════════════════════════════
   morph-sim.css  ―― モルフシミュレーターの共通スタイル
   種ごとのページ（bearded-dragon / leopard-gecko …）で読み込んで使い回す。
   ※ニシアフ(nishiaf-morph-simulator.html)は従来どおりページ内に同等のCSSを持つ（独立）。
   ══════════════════════════════════════════════ */
nav a.active { background: rgba(255,255,255,0.2); font-weight: bold; }

.tool-heading { background: var(--brown-dark); color: var(--white); padding: 28px 24px; }
.tool-heading-inner { max-width: 1060px; margin: 0 auto; }
.tool-cat { font-size: 0.78rem; font-family: 'Hiragino Kaku Gothic ProN', sans-serif; opacity: 0.75; margin-bottom: 6px; letter-spacing: 0.1em; }
.tool-heading h1 { font-size: clamp(1.2rem, 3vw, 1.7rem); font-family: 'Hiragino Kaku Gothic ProN', sans-serif; font-weight: bold; line-height: 1.4; }
.tool-heading p { font-size: 0.85rem; opacity: 0.82; margin-top: 6px; font-family: 'Hiragino Kaku Gothic ProN', sans-serif; }

.article-meta { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; font-family: 'Hiragino Kaku Gothic ProN', sans-serif; flex-wrap: wrap; }
.article-cat { background: var(--green-pale); color: var(--green-acc); font-size: 0.75rem; padding: 3px 12px; border-radius: 20px; font-weight: bold; }
.article-date { font-size: 0.78rem; color: var(--text-muted); }
.article-lead { background: var(--brown-pale); border-left: 4px solid var(--brown-light); padding: 16px 20px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 0.92rem; line-height: 1.85; margin-bottom: 24px; font-family: 'Hiragino Kaku Gothic ProN', sans-serif; }

.toc { background: var(--white); border: 1px solid #e0ceb8; border-radius: var(--radius); padding: 18px 22px; margin-bottom: 28px; }
.toc-title { font-size: 0.88rem; font-weight: bold; font-family: 'Hiragino Kaku Gothic ProN', sans-serif; color: var(--brown-dark); margin-bottom: 10px; }
.toc ol { padding-left: 18px; font-family: 'Hiragino Kaku Gothic ProN', sans-serif; font-size: 0.84rem; }
.toc ol li { margin-bottom: 4px; }
.toc ol a { color: var(--brown-mid); }

.article-body h2 { font-size: 1.2rem; color: var(--white); background: var(--brown-mid); padding: 9px 16px; border-radius: var(--radius-sm); margin: 36px 0 14px; font-family: 'Hiragino Kaku Gothic ProN', sans-serif; }
.article-body h3 { font-size: 1.02rem; color: var(--brown-dark); border-left: 4px solid var(--brown-light); padding-left: 12px; margin: 24px 0 10px; font-family: 'Hiragino Kaku Gothic ProN', sans-serif; }
.article-body p { margin-bottom: 14px; font-size: 0.93rem; }

.point-box { background: var(--green-pale); border-left: 4px solid var(--green-acc); padding: 12px 16px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 18px 0; font-size: 0.87rem; font-family: 'Hiragino Kaku Gothic ProN', sans-serif; line-height: 1.85; }
.warn-box { background: #fff8f0; border-left: 4px solid #d9822b; padding: 12px 16px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 18px 0; font-size: 0.87rem; font-family: 'Hiragino Kaku Gothic ProN', sans-serif; line-height: 1.85; }

.sim-wrap { background: var(--brown-bg); border: 2px solid var(--brown-pale); border-radius: var(--radius); padding: 1.2rem 1rem 1.4rem; margin: 0 0 1.5rem; font-family: 'Hiragino Kaku Gothic ProN', sans-serif; }
.sim-steps { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 1.2rem; }
.sim-step { display: flex; align-items: center; gap: 0.35rem; font-size: 0.8rem; color: var(--text-muted); }
.sim-step-num { width: 24px; height: 24px; border-radius: 50%; background: #ddd; color: #999; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.75rem; flex-shrink: 0; transition: background 0.3s, color 0.3s; }
.sim-step.active .sim-step-num { background: var(--brown-mid); color: white; }
.sim-step.active { color: var(--brown-dark); font-weight: 700; }
.sim-step-arrow { color: #ccc; padding: 0 0.2rem; font-size: 0.8rem; }

.acc-btn { width: 100%; background: #ebf5fb; border: 1.5px solid #aed6f1; border-radius: var(--radius-sm); padding: 0.65rem 0.9rem; text-align: left; font-size: 0.85rem; font-weight: 700; color: #1a5276; cursor: pointer; display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0; font-family: 'Hiragino Kaku Gothic ProN', sans-serif; }
.acc-btn .arr { margin-left: auto; transition: transform 0.25s; font-style: normal; }
.acc-btn.open .arr { transform: rotate(180deg); }
.acc-body { display: none; background: #ebf5fb; border: 1.5px solid #aed6f1; border-top: none; border-radius: 0 0 var(--radius-sm) var(--radius-sm); padding: 0.9rem 1rem 1rem; margin-bottom: 1rem; }
.acc-body.open { display: block; }
.gl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
@media (max-width: 520px) { .gl-grid { grid-template-columns: 1fr; } }
.gl-item { background: white; border-radius: var(--radius-sm); padding: 0.65rem 0.85rem; border-left: 3px solid #2980b9; }
.gl-item h4 { font-size: 0.8rem; font-weight: 700; color: #1a5276; margin-bottom: 0.25rem; }
.gl-item p { font-size: 0.75rem; color: var(--text-muted); line-height: 1.55; }
.gl-item .eg { display: inline-block; margin-top: 0.25rem; background: #eaf2fb; border-radius: 4px; padding: 0.1rem 0.4rem; font-size: 0.7rem; color: #1a5276; }

.parents-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; margin-bottom: 1rem; }
@media (max-width: 560px) { .parents-grid { grid-template-columns: 1fr; } }
.parent-card { background: var(--brown-pale); border-radius: var(--radius); padding: 0.9rem; border: 2px solid transparent; }
.parent-card.pa { border-color: #a0704a; }
.parent-card.pb { border-color: var(--green-acc); }
.parent-lbl { font-weight: 700; font-size: 0.9rem; margin-bottom: 0.7rem; display: flex; align-items: center; gap: 0.45rem; }
.pa .parent-lbl { color: #8B4513; }
.pb .parent-lbl { color: var(--green-acc); }
.badge { display: inline-block; padding: 0.18rem 0.55rem; border-radius: 99px; font-size: 0.7rem; font-weight: 700; color: white; }
.badge-a { background: #a0704a; }
.badge-b { background: var(--green-acc); }

.cat-sec { margin-bottom: 0.15rem; }
.cat-hd { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; padding: 0.35rem 0.5rem; border-radius: var(--radius-sm) var(--radius-sm) 0 0; margin-top: 0.7rem; display: flex; align-items: center; gap: 0.35rem; }
.cat-color .cat-hd { background: #fde8ce; color: #7d4e1a; }
.cat-pattern .cat-hd { background: #e8dff7; color: #4a2080; }
.cat-pigment .cat-hd { background: #d4edda; color: #1a5c30; }
.cat-morphs { border-radius: 0 0 var(--radius-sm) var(--radius-sm); overflow: hidden; border: 1px solid rgba(0,0,0,0.07); }

.morph-row { background: rgba(255,255,255,0.8); padding: 0.4rem 0.5rem; border-bottom: 1px solid rgba(0,0,0,0.05); }
.morph-row:last-child { border-bottom: none; }
.morph-row.is-poly { background: #fef9e7; }
.morph-top { display: flex; align-items: center; gap: 0.35rem; margin-bottom: 0.3rem; }
.morph-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; border: 1px solid rgba(0,0,0,0.15); }
.morph-nm { font-size: 0.8rem; font-weight: 700; flex: 1; }
.type-tag { font-size: 0.57rem; font-weight: 700; padding: 0.08rem 0.3rem; border-radius: 99px; flex-shrink: 0; }
.t-codom { background: #fff3cd; color: #856404; }
.t-rec { background: #d1ecf1; color: #0c5460; }
.t-dom { background: #e2d4f0; color: #5b2d8e; }
.t-poly { background: #fef9e7; color: #7d6608; border: 1px solid #f9ca24; }
.help-btn { background: none; border: 1.5px solid #bbb; color: #999; border-radius: 50%; width: 15px; height: 15px; font-size: 0.6rem; font-weight: 700; cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.help-btn:hover { background: var(--brown-pale); color: var(--brown-dark); border-color: var(--brown-mid); }

.morph-opts { display: flex; gap: 0.25rem; }
.m-opt { flex: 1; }
.m-opt input { display: none; }
.m-opt label { display: block; text-align: center; padding: 0.25rem 0.1rem; font-size: 0.64rem; border: 1.5px solid #ccc; border-radius: var(--radius-sm); cursor: pointer; background: white; color: var(--text-muted); line-height: 1.3; user-select: none; transition: all 0.15s; font-family: 'Hiragino Kaku Gothic ProN', sans-serif; white-space: pre-line; }
.m-opt label:hover { border-color: var(--brown-light); color: var(--brown-dark); }
.m-opt input:checked + label { background: var(--brown-pale); border-color: var(--brown-mid); color: var(--brown-dark); font-weight: 700; }
.m-opt.opt-het input:checked + label { background: #e8f4fd; border-color: #7fb3d3; color: #1a5276; }
.m-opt.opt-visual input:checked + label { background: #fff0e0; border-color: var(--brown-light); }
.m-opt.opt-poly input:checked + label { background: #fef9e7; border-color: #f9ca24; color: #7d6608; }

.calc-wrap { text-align: center; margin: 1.1rem 0 0.4rem; }
.calc-btn { background: linear-gradient(135deg, var(--brown-dark), var(--brown-mid)); color: white; border: none; padding: 0.8rem 2.4rem; font-size: 1rem; font-weight: 700; border-radius: 99px; cursor: pointer; letter-spacing: 0.08em; box-shadow: 0 4px 12px rgba(74,50,24,0.3); transition: transform 0.15s, box-shadow 0.15s; font-family: 'Hiragino Kaku Gothic ProN', sans-serif; }
.calc-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(74,50,24,0.4); }
.reset-lnk { display: block; margin-top: 0.5rem; font-size: 0.78rem; color: var(--text-muted); text-decoration: underline; cursor: pointer; }

#sim-results { display: none; margin-top: 1rem; }
#sim-results.visible { display: block; }
.res-card { background: white; border-radius: var(--radius); padding: 1rem 1.1rem; border: 1px solid #ede0d0; }
.res-title { font-size: 0.85rem; font-weight: 700; color: var(--brown-mid); margin-bottom: 0.8rem; padding-bottom: 0.45rem; border-bottom: 2px solid var(--brown-pale); }
.alert-box { border-radius: var(--radius-sm); padding: 0.55rem 0.85rem; font-size: 0.8rem; margin-bottom: 0.7rem; display: none; gap: 0.45rem; align-items: flex-start; font-family: 'Hiragino Kaku Gothic ProN', sans-serif; }
.alert-box.vis { display: flex; }
.alert-lethal { background: #fff8e1; border: 1.5px solid #f0c36d; color: #7a5c00; }
.alert-poly { background: #fef9e7; border: 1.5px solid #f9ca24; color: #7d6608; }
.res-summary { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 0.8rem; padding-bottom: 0.6rem; border-bottom: 1px solid var(--brown-pale); font-family: 'Hiragino Kaku Gothic ProN', sans-serif; }
.res-summary strong { color: var(--brown-dark); }
.res-item { border-radius: var(--radius-sm); margin-bottom: 0.5rem; background: var(--brown-pale); border-left: 4px solid var(--brown-light); overflow: hidden; }
.res-item:hover { box-shadow: 0 2px 8px rgba(74,50,24,0.1); }
.res-item.lethal { background: #fdf0ee; border-left-color: #c0392b; opacity: 0.88; }
.res-main { display: flex; align-items: center; gap: 0.65rem; padding: 0.55rem 0.8rem; }
.res-prob { font-size: 1rem; font-weight: 700; color: var(--brown-dark); min-width: 3.4rem; text-align: right; flex-shrink: 0; }
.res-item.lethal .res-prob { color: #c0392b; }
.res-bar-wrap { flex: 0 0 60px; height: 6px; background: rgba(0,0,0,0.08); border-radius: 99px; overflow: hidden; }
.res-bar { height: 100%; background: linear-gradient(90deg, var(--brown-light), var(--brown-mid)); border-radius: 99px; }
.res-item.lethal .res-bar { background: linear-gradient(90deg, #e74c3c, #c0392b); }
.res-info { flex: 1; min-width: 0; }
.res-pheno { font-weight: 700; font-size: 0.88rem; display: flex; align-items: center; flex-wrap: wrap; gap: 0.3rem; }
.lethal-badge { background: #c0392b; color: white; font-size: 0.6rem; font-weight: 700; border-radius: 4px; padding: 0.08rem 0.35rem; }
.het-tag { display: inline-block; background: #e8f4fd; border: 1px solid #aed6f1; color: #1a5276; border-radius: 99px; padding: 0.04rem 0.45rem; font-size: 0.67rem; font-weight: 600; margin-top: 0.18rem; margin-right: 0.18rem; }
.res-footer { background: rgba(0,0,0,0.04); padding: 0.35rem 0.8rem; font-size: 0.71rem; color: var(--text-muted); border-top: 1px solid rgba(0,0,0,0.06); font-family: 'Hiragino Kaku Gothic ProN', sans-serif; }

.legend { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-top: 0.7rem; padding-top: 0.7rem; border-top: 1px solid var(--brown-pale); font-size: 0.73rem; font-family: 'Hiragino Kaku Gothic ProN', sans-serif; }
.leg-item { display: flex; align-items: center; gap: 0.3rem; color: var(--text-muted); }
.leg-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }

.tip-ov { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 1000; align-items: center; justify-content: center; padding: 1rem; }
.tip-ov.open { display: flex; }
.tip-box { background: white; border-radius: var(--radius); padding: 1.2rem 1.3rem; max-width: 380px; width: 100%; box-shadow: 0 8px 28px rgba(0,0,0,0.2); position: relative; font-family: 'Hiragino Kaku Gothic ProN', sans-serif; }
.tip-close { position: absolute; top: 0.65rem; right: 0.75rem; background: none; border: none; font-size: 1.1rem; cursor: pointer; color: var(--text-muted); }
.tip-head { display: flex; align-items: center; gap: 0.45rem; margin-bottom: 0.6rem; }
.tip-dot { width: 13px; height: 13px; border-radius: 50%; flex-shrink: 0; border: 1px solid rgba(0,0,0,0.15); }
.tip-box h3 { font-size: 0.95rem; color: var(--brown-dark); }
.tip-box p { font-size: 0.83rem; color: var(--text-main); line-height: 1.65; }
.tip-ex { margin-top: 0.6rem; background: var(--brown-pale); border-radius: var(--radius-sm); padding: 0.5rem 0.7rem; font-size: 0.78rem; color: var(--brown-dark); }
.tip-poly { margin-top: 0.6rem; background: #fef9e7; border: 1px solid #f9ca24; border-radius: var(--radius-sm); padding: 0.45rem 0.65rem; font-size: 0.76rem; color: #7d6608; }

/* ── 2026-09-13 スクロール対策：絞り込み・折りたたみ・固定バー ── */
.morph-filter { width: 100%; box-sizing: border-box; font-size: 0.8rem; padding: 0.45rem 0.6rem; border: 1px solid rgba(0,0,0,0.15); border-radius: var(--radius-sm); background: var(--white); margin-bottom: 0.2rem; }
.morph-filter:focus { outline: 2px solid var(--brown-mid); outline-offset: 1px; }
.cat-hd { cursor: pointer; user-select: none; }
.cat-hd .cat-hd-label { flex: 1; }
.cat-hd .cat-arr { font-size: 0.8rem; opacity: 0.6; transition: transform 0.2s; }
.cat-sec.folded .cat-morphs { display: none; }
.cat-sec.folded .cat-arr { transform: rotate(-90deg); }
#sim-sticky { position: fixed; left: 0; right: 0; bottom: 0; z-index: 900; display: none; align-items: center; gap: 0.6rem; padding: 0.5rem 0.8rem; padding-bottom: calc(0.5rem + env(safe-area-inset-bottom)); background: rgba(255,255,255,0.96); border-top: 2px solid var(--brown-light); box-shadow: 0 -4px 14px rgba(0,0,0,0.08); font-size: 0.74rem; line-height: 1.5; }
#sim-sticky.vis { display: flex; }
#sim-sticky .stk-sum { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
#sim-sticky .stk-sum > div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#sim-sticky .stk-btn { flex-shrink: 0; background: linear-gradient(135deg, var(--brown-dark), var(--brown-mid)); color: #fff; border: none; border-radius: 99px; padding: 0.55rem 1.1rem; font-size: 0.85rem; font-weight: 700; cursor: pointer; }
body.has-sim-sticky { padding-bottom: 4.5rem; }

/* ── 2026-09-13 プルダウンで追加する方式 ── */
.morph-add { margin-bottom: 0.5rem; }
.morph-select { width: 100%; box-sizing: border-box; font-size: 0.85rem; padding: 0.55rem 0.6rem; border: 1.5px solid var(--brown-mid); border-radius: var(--radius-sm); background: var(--white); color: var(--text-main); cursor: pointer; }
.chosen-list { display: flex; flex-direction: column; gap: 0.35rem; }
.chosen-list .morph-row { border-radius: var(--radius-sm); border: 1px solid rgba(0,0,0,0.08); border-left-width: 4px; }
.chosen-list .cat-pigment.morph-row { border-left-color: #7fbf8f; }
.chosen-list .cat-pattern.morph-row { border-left-color: #a48bd0; }
.chosen-list .cat-color.morph-row   { border-left-color: #e0a860; }
.chosen-empty { font-size: 0.78rem; color: var(--text-muted); padding: 0.6rem 0.2rem; }
.rm-btn { margin-left: auto; background: none; border: 1px solid rgba(0,0,0,0.15); color: var(--text-muted); border-radius: 50%; width: 20px; height: 20px; font-size: 0.7rem; line-height: 1; cursor: pointer; flex-shrink: 0; }
.rm-btn:hover { background: #fde8e8; color: #c0392b; border-color: #c0392b; }
.morph-filter, .cat-hd .cat-arr { display: none; }

/* ── 2026-09-14 S09-a 結果を見た目でまとめる ── */
.res-look .res-pheno { font-size: 1rem; }
.het-line { margin-top: 0.3rem; font-size: 0.74rem; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 0.25rem; align-items: center; }
.het-line-lbl { margin-right: 0.15rem; }
.het-line .het-tag { margin: 0; }
.het-none { opacity: 0.7; }
.res-details { margin-top: 0.8rem; border-top: 1px dashed rgba(0,0,0,0.15); padding-top: 0.5rem; }
.res-details > summary { cursor: pointer; font-size: 0.8rem; color: var(--brown-mid); font-weight: 700; padding: 0.35rem 0; list-style: none; }
.res-details > summary::before { content: '▸ '; }
.res-details[open] > summary::before { content: '▾ '; }
.res-details > summary::-webkit-details-marker { display: none; }
.res-details .res-item { font-size: 0.9em; }
