:root{--stage-ink:#254b60;--stage-pink:#d59aa3;--stage-gold:#d6b366;--stage-mint:#e5f3ef}
.undiscovered-art{aspect-ratio:20/11;min-height:150px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:18px;text-align:center;border:1px dashed #aacbd2;border-radius:18px 18px 0 0;background:linear-gradient(120deg,#edf7f5,#faf5e9)}.undiscovered-art>span{font-size:38px;line-height:1.2;color:#59788a}.book-card .undiscovered-art p{margin:0;font-size:14px}
*{box-sizing:border-box}body{margin:0;background:#fffcf5;color:var(--stage-ink);font-family:system-ui,"Yu Gothic",sans-serif;font-size:16px;line-height:1.85}main{max-width:1056px;margin:auto;padding:22px 22px 38px}h1,h2,h3,p{margin-top:0}h1{font-size:clamp(28px,5vw,44px);line-height:1.5;letter-spacing:.06em}h1 small{display:block;font-size:.46em;letter-spacing:.04em}h2{font-size:clamp(20px,3vw,27px);line-height:1.65}h3{font-size:19px}rt{font-size:.52em;letter-spacing:0;font-weight:400}button,a{touch-action:manipulation}button{font:inherit;line-height:1.7;color:inherit;min-height:48px;border:1px solid #aacbd2;border-radius:16px;background:white;padding:12px 20px;cursor:pointer}button:disabled{opacity:.52;cursor:default}button:focus-visible,a:focus-visible,input:focus-visible,summary:focus-visible{outline:3px solid #b17b16;outline-offset:4px}button:hover:enabled{background:#eef7f8}.primary{background:#007ded;color:white;border-color:#007ded;font-weight:700;box-shadow:inset 0 2px 2px #ffffff70}.primary:hover:enabled{background:#006ddd}.draft-note,.eyebrow,.muted{font-size:13px;color:#59788a}.eyebrow{letter-spacing:.12em}.hero{display:grid;grid-template-columns:1.05fr 1fr;gap:24px;align-items:center;padding:32px;border-radius:28px;background:linear-gradient(120deg,#e2f4fb,#eaf7ed);margin-bottom:24px}.hero-art{position:relative;border:10px solid #fff9eb;border-radius:18px;box-shadow:0 10px 0 #adc8c43b;overflow:hidden}.hero-art img{display:block;width:100%;height:auto}.tag{display:inline-block;border:1px solid #b6ced1;border-radius:20px;padding:2px 12px;background:#ffffffa8;font-size:13px}.panel{border:1px solid #c7dce0;border-radius:24px;background:white;padding:26px;margin:20px 0;box-shadow:0 5px 18px #28495c06}.course-buttons{display:flex;gap:12px;margin:12px 0 20px}.course-buttons button{flex:1;text-align:left}.course-buttons button[aria-pressed=true]{border:2px solid #007ded;background:#edf8ff;padding:11px 19px}.course-buttons small{display:block;font-size:13px;margin-top:6px}.actions{display:flex;gap:12px;flex-wrap:wrap}.actions button{flex:1}.topbar{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:18px}.topbar p{margin:0;font-size:14px}.progress{display:flex;gap:7px;margin:12px 0}.progress span{height:5px;background:#e6eaea;flex:1;border-radius:5px}.progress .current{background:#76bfc2}.scene{margin:0 auto 14px;max-width:600px}.scene img{display:block;width:100%;height:auto;max-height:280px;object-fit:contain;border-radius:18px;background:#fcf7eb}.scene figcaption{padding:9px 12px;background:#faf5eb;border-radius:0 0 14px 14px;font-size:15px;font-weight:600;line-height:1.9}.scene-label,.story-label{display:block;font-size:13px;font-weight:600;color:#59788a;margin:0 0 6px}.story-label{max-width:760px;margin:16px auto 0}.story-label+.story{margin-top:6px}.story{max-width:760px;margin:16px auto;font-size:17px}.dialogue{background:#fff7df;border-left:4px solid #d3b360;border-radius:12px;padding:14px 18px;font-weight:600}.choices{display:grid;gap:12px}.choice{width:100%;text-align:left;display:flex;gap:12px;align-items:center;font-weight:600}.choice .letter{flex:none;width:28px;height:28px;line-height:28px;border-radius:50%;text-align:center;background:#edf2f3;font-size:14px}.scene-choices{grid-template-columns:repeat(3,minmax(0,1fr));align-items:stretch}.scene-choices .choice{display:block;padding:12px;font-weight:400}.scene-choices img{display:block;width:100%;height:auto;border-radius:12px;margin:8px 0}.scene-choices .option-text{display:block;font-size:15px;line-height:1.9}.reveal{margin-top:18px;font-size:14px}.feedback{padding:22px;background:#edf8f1;border:1px solid #a5cfc0;border-radius:18px;margin:18px 0}.hint{background:#fff7e7;border-color:#e4ca93}.feedback h3{margin-bottom:10px}.feedback dl{margin:12px 0 0}.feedback dt{font-size:13px;color:#597a7c;margin-top:14px}.feedback dd{margin:5px 0;font-size:17px}.feedback .word{font-size:25px;font-weight:700}.reading{display:block;font-size:13px;font-weight:400}.next{width:100%;margin-top:12px}.score{font-size:22px}.score strong{font-size:46px}.word-list{list-style:none;padding:0}.word-list li{padding:12px 0;border-bottom:1px solid #e0ecec}.word-list .mark{font-size:13px;display:block;color:#527078}.book-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.book-card{border:1px solid #cee0e1;border-radius:20px;padding:18px;min-width:0}.book-card h3{font-size:21px;line-height:1.85;margin-bottom:12px}.book-card .scene figcaption{font-size:13px}.book-card p{font-size:15px}.book-card .reading{margin-top:4px}.review-link{min-height:44px;margin-top:8px;padding:8px 12px}.preference{display:flex;gap:8px;align-items:center;margin-top:28px;font-size:14px;min-height:44px}.preference input{width:21px;height:21px}footer{display:flex;flex-wrap:wrap;justify-content:center;gap:18px;padding:25px 20px 44px;font-size:13px}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}.skip-link{position:absolute;left:-9999px}.skip-link:focus{left:10px;top:10px;z-index:99999;background:white;padding:10px}.scene-change img{animation:scene-enter .7s ease-out 1}@keyframes scene-enter{from{opacity:.45;transform:translateY(5px)}to{opacity:1;transform:none}}body.motion-reduced .scene-change img{animation:none}#save-status:not(:empty){padding:14px;border:1px solid #d4b570;border-radius:12px;background:#fff9ea;font-size:14px}[data-focus],#scene-focus,[data-feedback]{scroll-margin-top:90px}[tabindex="-1"]:focus:not(:focus-visible){outline:none}
@media(max-width:767px){main{padding:16px 14px 30px}.hero{padding:24px;grid-template-columns:1fr;gap:12px}.hero-art{max-width:310px;justify-self:center}.panel{padding:18px}.book-grid{grid-template-columns:1fr}.scene-choices{grid-template-columns:1fr}.scene-choices .choice{display:grid;grid-template-columns:28px minmax(0,1fr);column-gap:9px}.scene-choices img{grid-column:2;max-width:330px;justify-self:center}.scene-choices .option-text{grid-column:2}.scene img{max-height:225px}.actions button{flex-basis:45%}.story{font-size:16px}.feedback{padding:17px}.hero p{margin-bottom:12px}}
@media(max-width:370px){main{padding-inline:10px}.panel{padding:14px}.course-buttons{gap:8px}.course-buttons button{padding:10px!important}.hero{padding:20px}.topbar button{padding:8px 12px}.book-card{padding:14px}.feedback .word{font-size:22px}.actions{display:grid;grid-template-columns:1fr}.scene figcaption{font-size:14px}.choice{padding:12px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;scroll-behavior:auto!important;transition:none!important}}

/* Keep the next action in reach while leaving explanations and observations scrollable. */
@media(max-width:700px),(max-height:500px) and (max-width:1000px){
  #game-root:has([data-action="next"]){padding-bottom:calc(84px + env(safe-area-inset-bottom,0px))}
  #game-root :is([data-action="next"]){position:fixed;z-index:20;left:max(12px,env(safe-area-inset-left,0px));right:max(12px,env(safe-area-inset-right,0px));bottom:calc(10px + env(safe-area-inset-bottom,0px));width:auto;margin:0;min-height:52px;box-shadow:0 0 0 6px #fffdf7,0 -4px 18px #073e7d24}
}
