/* Mobile-first interaction layer. All core controls stay large on touch devices. */
:root{--touch-min:48px;--text-readable:16px}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%;scroll-padding-top:16px}
body{overflow-wrap:anywhere}
button,a,input,textarea,summary{-webkit-tap-highlight-color:transparent}
button,.choice,.choice-fieldset label,summary{touch-action:manipulation}
button:active:not(:disabled),.choice-fieldset label:active{transform:scale(.985);filter:brightness(.97)}
button{user-select:none;-webkit-user-select:none}
.btn,.btn.sm,.choice,.top-actions .btn,.question-nav .btn,.next-btn{min-height:48px;font-size:1rem}
.btn.sm{padding:11px 14px}
.brand{min-height:48px}
.strategy summary{display:flex;align-items:center;gap:9px;min-height:52px;cursor:pointer;padding:3px 0}
.choice{min-height:48px;padding:10px 15px;font-size:.94rem}
.answer{display:grid;gap:11px;margin-inline:auto;max-width:440px}
.answer-label,.strategy label{font-size:1rem;font-weight:700;color:#4c4770}
.answer input,.two-inputs input,.step-row input,.strategy textarea{font-size:18px!important;min-height:54px;width:100%;background:#fff;border:2px solid #d6c8ea;border-radius:14px;padding:12px 15px;color:#332951}
.answer #answerInput{font-size:clamp(24px,6vw,32px)!important;text-align:center;letter-spacing:.05em}
.answer input:focus,.step-row input:focus,.strategy textarea:focus{border-color:#7b4ec2;box-shadow:0 0 0 3px #dcd1fc}
.answer .submit-btn,.hint-btn,.next-btn{width:100%;min-height:54px}
.answer input:disabled,.step-row input:disabled,.strategy textarea:disabled{background:#efedf4}
.question-card .math-prompt{font-size:clamp(2.2rem,7vw,3.35rem);line-height:1.24;padding:20px 0 18px;letter-spacing:-.02em;overflow-wrap:normal;word-break:normal}
.question-card .math-prompt.sentence{font-size:clamp(1.32rem,4.2vw,2rem);line-height:1.48;overflow-wrap:anywhere}
.question-nav{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:18px 0}
.next-panel{margin:15px 0}
.question-card .feedback{margin:14px auto 8px;max-width:540px;font-size:1rem}
.helper{margin-top:20px}
.helper h3{font-size:1.05rem}
.helper .hint{padding:14px 16px;margin:11px 0;line-height:1.5}
.strategy-body{padding-top:10px}
.strategy .choices{display:grid;grid-template-columns:1fr 1fr;gap:9px}
.strategy .choices .choice{width:100%}
.strategy textarea{font-size:16px!important;text-align:left;min-height:110px}
.strategy-label{font-weight:700;color:#56456f}
.step-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(90px,120px) minmax(118px,160px);align-items:center;gap:10px;margin-top:13px}
.step-row label{font-weight:730}
.step-row .btn{min-height:48px;padding:10px;font-size:.94rem}
.choice-fieldset label{min-height:54px;gap:14px;font-size:1.02rem;padding:13px 15px}
.choice-fieldset input{width:21px;height:21px;flex:0 0 auto}
.two-inputs{grid-template-columns:1fr 1fr;gap:13px}
.two-inputs label{font-size:.98rem;line-height:1.4}
.progress{height:11px}
.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(min-width:600px) and (max-width:1050px){
 .app-shell{padding-inline:24px}
 .cards{grid-template-columns:repeat(2,minmax(0,1fr))}
 .world{min-height:235px}
 .hero{grid-template-columns:1.7fr 1fr}
 .hero-art{min-height:200px}
 .orb{width:180px}
 .orb span{font-size:5rem}
 .panel{padding:25px}
}
@media(max-width:599px){
 .app-shell{padding:calc(10px + env(safe-area-inset-top,0px)) 14px calc(26px + env(safe-area-inset-bottom,0px));}
 .top{gap:7px;flex-wrap:wrap;padding-bottom:13px}
 .brand{font-size:1.04rem;min-width:0;flex:1}
 .brand-star{width:39px;height:39px;flex:0 0 auto}
 .top-actions{gap:6px;flex-wrap:wrap;justify-content:flex-end}
 .top-actions .tag{display:none}
 .top-actions .btn{padding:9px 11px;min-height:44px;font-size:.88rem}
 .hero{padding:22px 20px;gap:5px;border-radius:23px}
 .hero h1{font-size:clamp(2rem,8vw,2.7rem)}
 .hero p{font-size:1rem;line-height:1.55;margin-top:12px}
 .hero-art{display:none}
 .hero-actions{margin-top:15px}
 .section-title{margin:22px 0 12px}
 .section-title .tag{display:none}
 .section-title h2{font-size:1.36rem}
 .cards{grid-template-columns:1fr;gap:12px}
 .world{min-height:190px;padding:18px}
 .world .glyph{font-size:2rem}
 .world .number{font-size:.82rem}
 .intro{gap:10px}
 .panel{padding:17px;border-radius:19px}
 .station-title{margin:10px 0 10px}
 .station-title h2{font-size:1.28rem}
 .station-title p{font-size:.85rem}
 .question-card{padding:19px 17px}
 .question-card .eyebrow{font-size:.77rem;margin-bottom:10px}
 .question-card .math-prompt{padding:16px 0;font-size:clamp(2.15rem,9.5vw,3rem)}
 .question-card .math-prompt.sentence{font-size:1.28rem}
 .question-nav{gap:9px}
 .question-nav .btn{font-size:.9rem;padding:9px}
 .helper,.strategy{padding:16px;border-radius:17px;margin-top:15px}
 .helper .hint{font-size:1rem}
 .two-inputs{gap:10px}
 .strategy .choices{grid-template-columns:1fr 1fr}
 .step-row{grid-template-columns:1fr 1fr;gap:9px}
 .step-row label{grid-column:1/-1}
 .step-row input{grid-column:1}
 .step-row button{grid-column:2}
 .footer{padding-top:22px}
}
@media(max-width:365px){
 .app-shell{padding-left:10px;padding-right:10px}
 .top-actions .btn{padding-inline:8px}
 .question-nav{grid-template-columns:1fr}
 .strategy .choices{grid-template-columns:1fr}
 .choice-fieldset label{padding:12px}
}
@media(pointer:coarse){
 button,.strategy summary,.choice-fieldset label{min-height:48px}
 .btn:focus-visible,summary:focus-visible{outline-offset:4px}
}
@media(prefers-reduced-motion:reduce){
 button:active:not(:disabled),.choice-fieldset label:active{transform:none}
}

/* Verified by automated mobile Safari contrast audit. */
.strategy summary .note{color:#554568;font-weight:650}

/* Avoid the generic purple button hover overriding secondary/yellow text contrast. */
.btn.sun:hover:enabled{background:#ffd764;color:#503e55}
.btn.secondary:hover:enabled{background:#efe9ff;color:#6543aa}
.btn.ghost:hover:enabled{background:#f2edff;color:#665197}
