/* 選ぶ楽しさ、絵の見やすさ、顔の安全な表示をまとめる。 */
.story-mode .family-controls{min-height:0;grid-template-rows:minmax(0,1fr)}
.story-mode .parent-card,.story-mode .switch-button{height:auto;min-height:0}
:root{--ink:#183e61;--muted:#5f8095;--teal:#078ec1;--teal-dark:#00668e;--cream:#f3fcff;--line:#b9e2ec}
body{background:radial-gradient(circle at 6% 10%,#fff2a8 0,transparent 38%),radial-gradient(circle at 95% 85%,#ffd7e6 0,transparent 40%),linear-gradient(135deg,#e4fbff,#efffff 50%,#fff4d7)}
.logo{color:#048ca9}.logo-main{text-shadow:0 2px white,2px 3px #c2eaf7}.logo-sub{color:#e67857}.primary{background:linear-gradient(135deg,#08b7b5,#078bcb);box-shadow:0 4px 0 #006a94,inset 0 1px #fff7}.primary:not(:disabled):is(:hover,:focus-visible){background:linear-gradient(135deg,#09c5bc,#099adc);box-shadow:0 4px 0 #006a94,0 0 0 4px #08b9d134}.secondary{border-color:#9ed9e8;background:#ffffffed}.eyebrow{color:#d27e28}.topbar,.game-topbar{background:#ffffff65;border-bottom:1px solid #cde9ed}.growth-stop.active>span{background:linear-gradient(145deg,#00bfb0,#078ed0)}.growth-stop.active{background:#fff5c9;border-radius:12px}.family-stage,.quiz-console,.dialogue-console{border-color:#a5d9ea;box-shadow:0 5px 0 #60a9be20;background:#fffef9}.family-heading{background:linear-gradient(105deg,#e3fbff,#fff2c9);border-bottom:1px solid #d4e9de}.strength-display>strong{color:#ef7e2d}.family-scene{background-color:#c4f0f4}.family-scene:after{display:none!important}.family-portraits{display:flex;align-items:flex-end;justify-content:center;gap:8px;inset:auto 4px 10px;height:auto;z-index:4}
.portrait-card{position:relative;width:var(--portrait-size,29%);height:var(--portrait-size,auto);aspect-ratio:1;flex:0 0 auto;border:3px solid #fff;border-radius:24% 24% 15% 15%;overflow:hidden;background:linear-gradient(145deg,#fff7deeb,#e4f8ffed);box-shadow:0 5px 0 #0c527525,0 0 0 1px #7fb8cf60;transform-origin:50% 95%}
.portrait-card.portrait-papa{background:linear-gradient(140deg,#e1f5ffed,#f0fcffed)}.portrait-card.portrait-mama{background:linear-gradient(140deg,#ffe7e5ed,#fff5efed)}.portrait-card.portrait-child{z-index:1;border-color:#fff4aa;background:linear-gradient(140deg,#fff3c9f0,#fffdf2f0)}
.family-portraits .portrait-card .sprite{position:absolute;top:3%;left:5%!important;bottom:auto!important;width:90%!important;height:90%;aspect-ratio:1;animation:none!important;translate:none!important;transform:none!important;filter:none!important}
.portrait-name{position:absolute;bottom:0;left:0;right:0;z-index:5;text-align:center;background:#fffdf2f7;color:#285a74;font-size:clamp(9px,1vw,12px);font-weight:800;line-height:1.3;padding:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.family-picture .family-portraits{top:auto;bottom:7px;left:4px;right:4px}.title-family .family-portraits{bottom:12%;gap:9px}.portrait-card.active-parent{box-shadow:0 0 0 3px #ffc748,0 6px 0 #e6a52340}.portrait-card.is-resting{filter:saturate(.7);border-style:dashed}.family-picture .personality-label{z-index:6;top:5px;bottom:auto;left:7px;background:#ffffffe6;color:#49718b}.family-speech{z-index:7;border-color:#f5c963;box-shadow:0 3px #e9c85f30}.family-picture .play-reaction.is-correct .portrait-child{animation:portrait-hop .7s .16s cubic-bezier(.2,.8,.3,1)}.family-picture .play-reaction.is-correct .portrait-card.answering-parent{animation:portrait-hop .6s ease-out}.family-picture .play-reaction.is-wrong .portrait-child{animation:portrait-tilt .6s ease-out}.family-picture .switching .portrait-card.active-parent{animation:portrait-hop .5s ease-out}.portrait-card.is-speaking{animation:portrait-tilt .7s ease-out}
@keyframes portrait-hop{0%,100%{transform:none}35%{transform:translateY(-10px) rotate(-3deg)}65%{transform:translateY(-2px) rotate(2deg)}}@keyframes portrait-tilt{0%,100%{transform:none}35%{transform:rotate(-3deg)}70%{transform:rotate(2deg)}}
.story-art-viewport{position:absolute;inset:0;z-index:0;background-repeat:no-repeat;background-color:#d9eff2}.has-story-art .stage-light{background:linear-gradient(transparent 40%,#d3f4fb70 65%,#d3f4fbef 100%);z-index:1}.has-story-art .portrait-card{border-width:2px}.art-zoom{position:absolute;z-index:8;top:7px;right:7px;border-radius:10px;padding:5px 9px;min-height:30px;background:#fffef2ed;color:#245975;font-size:11px;box-shadow:0 2px 0 #407b8c25}.art-zoom:hover{background:#fff4b5}.expanded-story-art{width:100%;aspect-ratio:3/2;background-repeat:no-repeat;border-radius:16px;box-shadow:0 0 0 2px #bfe4ef;margin:10px 0 20px}.modal:has(.expanded-story-art){width:min(980px,100%)}
.story-mode .family-controls{flex-basis:40px;padding:3px 8px}.story-mode .parent-card{min-height:30px;padding:4px 7px}.story-mode .parent-card-bottom,.story-mode .parent-card-note,.story-mode .chapter-progress{display:none}.story-mode .switch-button{min-height:28px;font-size:21px}.story-mode .switch-button small{display:none}.parent-affinity{display:inline-block;font-size:9px;margin-left:5px;color:#ad5184;font-weight:800;white-space:nowrap}
.answer.choice-0{--choice-bg:#ffe2cd;--choice-border:#f1a37c;--choice-shadow:#f1a37c60;--choice-accent:#ef874c}.answer.choice-1{--choice-bg:#d6f3ff;--choice-border:#83c9ea;--choice-shadow:#83c9ea60;--choice-accent:#2a9ccc}.answer.choice-2{--choice-bg:#fff0af;--choice-border:#e9c353;--choice-shadow:#e9c35360;--choice-accent:#cf9f23}.answer.choice-3{--choice-bg:#d7f3d3;--choice-border:#86c87e;--choice-shadow:#86c87e60;--choice-accent:#54aa61}.quiz-coach{background:#e6f5fc}.parent-card.is-active{border-color:#25a6ce;background:#e2f8fc}.mama-card.is-active{border-color:#e78ba5;background:#fff0f4}.life{color:#ef7e75}.genre-label{background:#d6f6f4;color:#087d87}.chapter-dots i.done{background:linear-gradient(90deg,#0dc5b7,#48a7e0)}
.decision-console{display:flex;flex-direction:column}.decision-intro{font-size:16px;font-weight:800;margin:0 0 12px;color:#d47543}.decision-grid{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr 1fr;gap:12px;flex:1;min-height:0}.event-option{min-height:60px;min-width:0;border:2px solid #8bc9e4;border-radius:16px;background:linear-gradient(140deg,#eefbff,#fffef7);box-shadow:0 4px #8bc9e44a;padding:12px;display:flex;flex-direction:column;justify-content:center;align-items:flex-start;gap:8px;text-align:left}.event-option:nth-child(2){border-color:#e5a7be;background:#fff0f5;box-shadow:0 4px #e5a7be40}.event-option:nth-child(3){border-color:#edc672;background:#fff8e7;box-shadow:0 4px #edc67240}.event-option:nth-child(4){border-color:#a2d49a;background:#f0fae9;box-shadow:0 4px #a2d49a40}.event-option:not(:disabled):is(:hover,:focus-visible){transform:translateY(-3px);outline:3px solid #0ca4bd;outline-offset:2px}.event-option strong{font-size:clamp(13px,1.25vw,18px);line-height:1.5}.option-effect{display:flex;flex-direction:column;gap:3px;font-size:12px;line-height:1.35;color:#277e91}.option-effect.negative{color:#ab6558}.event-option small{font-size:10px}.decision-note{flex:0 0 auto;font-size:11px;line-height:1.4;margin:12px 0 0;color:#668397}.event-outcome{flex:1;min-height:0;display:flex;flex-direction:column;justify-content:center;gap:15px;border:2px solid #efcf71;background:linear-gradient(140deg,#fff4c9,#fffdf4);border-radius:20px;padding:24px;overflow:auto}.event-outcome.gentle{background:#fff1ee;border-color:#e2b3a6}.event-outcome .dialogue-text{font-size:calc(21px * var(--font-scale));line-height:1.65}.event-outcome>strong{font-size:15px;color:#be6689}.event-deltas{display:flex;gap:8px;flex-wrap:wrap}.event-deltas>span{background:#fff;border-radius:10px;padding:6px 10px;font-size:14px;font-weight:800;color:#1a8198}.decision-result .dialogue-actions{margin-top:14px}.decision-result .primary{min-width:0;width:100%}
@media(max-width:750px) and (orientation:portrait){.parent-affinity{font-size:8px;margin-left:4px}.portrait-card{border-width:2px}.family-portraits{gap:6px}.art-zoom{min-height:25px;padding:3px 6px;font-size:9px}.story-mode .family-controls{flex-basis:31px;padding:1px 6px 4px}.story-mode .parent-card{min-height:25px;padding:3px 6px}.decision-intro{font-size:13px;margin-bottom:8px}.decision-grid{gap:8px}.event-option{padding:7px;min-height:54px;border-radius:12px;gap:5px}.event-option strong{font-size:12px;line-height:1.4}.option-effect{font-size:10px;gap:1px}.decision-note{font-size:9px;margin-top:8px}.event-outcome{padding:12px;gap:9px}.event-outcome .dialogue-text{font-size:calc(16px * var(--font-scale));line-height:1.55}.event-deltas>span{font-size:11px;padding:4px 6px}.event-outcome>strong{font-size:12px}.decision-result .primary{font-size:11px}.decision-result .dialogue-actions{margin-top:8px}.setting-up .field-caption{margin-bottom:4px}.setting-up .field{margin-bottom:7px}.setting-up .design-chooser{margin-top:6px}}
@media(max-height:650px) and (orientation:portrait){.portrait-name{font-size:9px;line-height:1.2}.parent-affinity{font-size:7px;margin-left:3px}.event-option{padding:5px;gap:3px;min-height:45px}.event-option strong{font-size:11px}.option-effect{font-size:9px}.decision-intro{font-size:11px;margin:0 0 5px}.decision-console h2{margin-bottom:6px}.decision-note{font-size:8px;margin-top:6px}.event-outcome .dialogue-text{font-size:calc(14px * var(--font-scale))}.event-deltas>span{font-size:10px}}
@media(max-height:500px) and (orientation:landscape){.event-option{padding:6px;gap:3px;min-height:45px}.event-option strong{font-size:12px}.option-effect{font-size:10px}.decision-intro{font-size:12px;margin-bottom:6px}.decision-note{font-size:9px;margin-top:6px}.event-outcome{padding:12px;gap:7px}.event-outcome .dialogue-text{font-size:calc(16px * var(--font-scale))}.portrait-name{font-size:9px}.parent-affinity{font-size:8px}}
@media(max-width:750px) and (orientation:portrait){
 .story-mode .game-shell,.story-mode.large-text .game-shell{grid-template-rows:41px minmax(188px,.88fr) minmax(285px,1.12fr) 16px}
 .story-mode .family-controls{flex-basis:36px}
 .decision-console .panel-meta{margin-bottom:8px}.decision-console h2{margin-bottom:7px}
 .story-mode .parent-card-top{gap:2px}.story-mode .parent-card-top>span{font-size:7px}
}
@media(max-width:750px) and (max-height:650px) and (orientation:portrait){
 .story-mode .game-shell,.story-mode.large-text .game-shell{grid-template-rows:30px 184px minmax(0,1fr) 0}
 .story-mode .family-controls{flex-basis:32px}
 .decision-grid{grid-template-rows:repeat(2,minmax(0,1fr))}.decision-console .panel-meta{margin-bottom:5px}
 .decision-console .event-option strong{font-size:12px;line-height:1.35}.decision-console .option-effect{font-size:10px}
}
/* 小さな画面でも結果の解説をできるだけ見せる。 */
@media(max-width:750px) and (max-height:650px) and (orientation:portrait){
 .quiz-console.show-result .console-bottom{flex-basis:124px}
}
@media(max-width:750px) and (max-height:650px) and (orientation:portrait){
 body.playing:not(.story-mode):has(.quiz-console.show-result):not(.large-text) .game-shell{grid-template-rows:30px 164px minmax(0,1fr) 0}
}
@media(max-width:750px) and (max-height:650px) and (orientation:portrait){
 body.playing:not(.story-mode):has(.quiz-console.show-result) .family-heading{flex-basis:26px}
 body.playing:not(.story-mode):has(.quiz-console.show-result) .family-controls{flex-basis:40px;padding:1px 5px 2px}
 body.playing:not(.story-mode):has(.quiz-console.show-result) .parent-card{padding:2px 5px;gap:0}
 body.playing:not(.story-mode):has(.quiz-console.show-result) .chapter-progress{flex-basis:11px;padding-bottom:2px}
 .quiz-console.show-result .answer-text{font-size:calc(13px * var(--font-scale));line-height:1.35}
}
/* 文字拡大時も、親カードが家族の顔を押しつぶさないようにする。 */
@media(max-width:750px) and (max-height:650px) and (orientation:portrait){
 body.large-text.playing:not(.story-mode) .family-controls{flex-basis:42px;min-height:0;grid-template-rows:minmax(0,1fr);padding:1px 5px 2px}
 body.large-text.playing:not(.story-mode) .parent-card,body.large-text.playing:not(.story-mode) .switch-button{min-height:0;padding:2px 5px;gap:0}
 body.large-text.playing:not(.story-mode) .switch-button small{display:none}
 body.large-text.playing:not(.story-mode) .chapter-progress{flex-basis:11px;padding-bottom:2px}
 body.large-text.playing:not(.story-mode) .family-heading{flex-basis:26px}
}
.result-answer{display:none}
@media(max-width:750px) and (max-height:650px) and (orientation:portrait){
 body.large-text.playing:not(.story-mode) .quiz-console:not(.show-result) .quiz-coach{display:none}
 body.large-text.playing:not(.story-mode) .quiz-console:not(.show-result) .console-bottom{flex-basis:42px}
 body.large-text.playing:not(.story-mode) .quiz-console:not(.show-result) .answers{min-height:150px}
 body.large-text.playing:not(.story-mode) .quiz-console.show-result .answers{display:none}
 body.large-text.playing:not(.story-mode) .quiz-console.show-result .result-answer{display:block;margin:0;font-size:calc(13px * var(--font-scale));line-height:1.45;color:#176c69}
 body.large-text.playing:not(.story-mode) .quiz-console.show-result .console-bottom{flex:1;min-height:0}
 body.large-text.playing:not(.story-mode) .quiz-console.show-result .explanation{flex:0 1 auto}
}
/* 小さな画面では、問題と長い選択肢を読む画面を縦に無駄なく使う。 */
@media(max-width:750px) and (max-height:650px) and (orientation:portrait){
 .large-text .modal-backdrop:has(.reader-prompt){padding:6px}
 .large-text .modal:has(.reader-prompt){max-height:calc(100dvh - 12px);padding:8px 12px;border-width:2px}
 .large-text .modal:has(.reader-prompt) .modal-heading{margin-bottom:2px}
 .large-text .modal:has(.reader-prompt) .modal-heading h2{font-size:16px}
 .large-text .modal:has(.reader-prompt) .icon-button{min-width:32px;min-height:32px}
 .large-text .modal .reader-prompt{font-size:calc(16px * var(--font-scale));line-height:1.32;margin:2px 0 4px}
 .large-text .modal .reader-actor{margin-top:0;font-size:11px}
 .large-text .modal .reader-actor .quiet{min-height:30px;padding:2px 7px}
 .large-text .modal:has(.reader-prompt) .answers{margin:4px 0 0;gap:4px}
 .large-text .modal:has(.reader-prompt) .answer{min-height:45px;padding:4px 7px;gap:7px}
 .large-text .modal:has(.reader-prompt) .answer-text{font-size:calc(14px * var(--font-scale));line-height:1.3}
}
@media(max-width:750px) and (max-height:650px) and (orientation:portrait){
 .large-text .modal:has(.reader-prompt) .answer:after{display:none}
}
.question-read.needs-reader{background:#fff0ac;color:#755300;font-weight:800;box-shadow:0 0 0 2px #e8bd43}
/* 成長年齢と総問題数の帯を外し、空いたスペースを家族に回す。 */
.game-shell{grid-template-rows:minmax(0,1fr) 18px}
.game-shell>.family-stage{grid-column:1;grid-row:1}
.game-shell>.quiz-console,.game-shell>.dialogue-console{grid-column:2;grid-row:1}
.game-shell>.game-footer{grid-column:1/3;grid-row:2}
@media(max-width:750px) and (orientation:portrait){
 body.playing .game-shell,body.playing.large-text .game-shell,body.playing.story-mode .game-shell,body.playing.story-mode.large-text .game-shell{grid-template-columns:1fr;grid-template-rows:minmax(205px,.85fr) minmax(290px,1.15fr) 16px}
 .game-shell>.family-stage{grid-column:1;grid-row:1}
 .game-shell>.quiz-console,.game-shell>.dialogue-console{grid-column:1;grid-row:2}
 .game-shell>.game-footer{grid-column:1;grid-row:3}
}
@media(max-width:750px) and (max-height:650px) and (orientation:portrait){
 body.playing .game-shell,body.playing.large-text .game-shell,body.playing.story-mode .game-shell,body.playing.story-mode.large-text .game-shell,body.playing:not(.story-mode):has(.quiz-console.show-result):not(.large-text) .game-shell{grid-template-rows:200px minmax(0,1fr) 0}
 body.playing.story-mode .game-shell,body.playing.story-mode.large-text .game-shell{grid-template-rows:214px minmax(0,1fr) 0}
}
@media(orientation:landscape) and (max-height:560px) and (min-width:600px){
 body.playing .game-shell{grid-template-rows:minmax(0,1fr) 12px}
}
@media(max-width:750px) and (max-height:650px) and (orientation:portrait){
 .large-text .decision-console .event-option strong{font-size:calc(12px * var(--font-scale));line-height:1.3}
}

@media(max-width:300px){.portrait-name{font-size:8px}}
.full-ending-cg .stage-light{display:none}.full-ending-cg .story-art-viewport{background-color:#e5f3f3}.expanded-ending-cg{aspect-ratio:1672/941;background-color:#e5f3f3}
@media(min-width:751px){.playing .outcome-page:has(.full-ending-cg) .outcome-layout{grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr)}}
