/* Shared preschool interaction polish, after platform safe-area rules. */
:root {--farm-scene:url('assets/farm/world-map.webp');}
:root,body.farm-world,.farm-backdrop,.farm-trail {background-image:var(--farm-scene);}
html[data-subject="math"] {--farm-scene:url('assets/farm/math-world.webp');--farm-canvas:#79ba9e;}
body.farm-world[data-subject="math"] .garden-map.choices,body.farm-world[data-subject="math"] .farm-trail {background-color:#79ba9e;}
.brand-name {line-height:1.15;}
@media(max-width:700px){.brand-name{max-width:115px;font-size:.9rem;text-align:left;}}
@media(max-width:350px){.brand-name{max-width:100px;font-size:.82rem;}}
.spelling-result,.reading-practice {margin:16px auto 0;padding:14px;border:1px solid #b4cc8f;border-radius:16px;background:#eef5dc;}
.spelling-caption,.reading-practice h2 {margin:0 0 8px;color:#416d32;font-weight:900;font-size:1rem;}
.spelling-line {display:flex;flex-direction:column;gap:4px;margin:8px 0;line-height:1.6;}
.spelling-line strong,.reading-target {font-size:1.25rem;color:#65472f;}
.spelling-line span {font-size:.95rem;color:#526840;}
.spelling-replay,.reading-actions button {min-height:44px;padding:8px 12px;border:1px solid #a7be83;border-radius:12px;background:#fff8e7;color:#486c34;font-weight:850;}
.reading-actions {display:flex;flex-wrap:wrap;justify-content:center;gap:8px;}
.reading-practice p {margin:8px 0;}.reading-status {font-size:.8rem;color:#63704f;}
.reading-record[aria-pressed="true"] {background:#fff0cd;border-color:#b18a42;}
.reading-actions button:disabled {opacity:.55;}
.farm-world .panel[data-presentation="success"] .celebration-mark,.farm-world .panel[data-presentation="finish"] .celebration-mark {width:78px;height:78px;border:4px solid #9cc56e;background:#e9f8c9;box-shadow:0 0 0 8px #a4ce6720;}
.panel[data-presentation="success"] .celebration-mark::after,.panel[data-presentation="finish"] .celebration-mark::after {width:39px;height:39px;}
.feedback[data-kind="retry"] {padding:10px 12px;border:2px solid #dab96f;border-radius:14px;background:#fff1ce;color:#795c2e;font-weight:850;}
.feedback[data-kind="retry"]::before {content:'↻';display:inline-block;margin-right:7px;font-size:1.4rem;vertical-align:middle;}

.farm-world .game:not([data-subject="math"]) .panel[data-presentation="success"]>.prompt {display:none;}
.spelling-result {padding:10px 12px;margin-top:12px;}
.spelling-caption {font-size:.88rem;margin-bottom:3px;}
.spelling-line {margin:4px 0;gap:2px;}
.reading-practice {margin-top:8px;padding:8px 0 0;border:0;border-top:1px solid #cbdcab;border-radius:0;background:transparent;}
.reading-practice .reading-target {font-size:1rem;font-weight:850;}
.reading-status {font-size:.75rem;}

/* A reference card looks different from an answer; the first action needs no Start screen. */
.farm-world .sample .reference-model {border:1px dashed #b6ac8b;background:#f4eedf;box-shadow:none;color:#776c53;cursor:default;}
.farm-world .game[data-onboarding="true"] .choices {position:relative;border:2px dashed #b7cf9b;border-radius:20px;padding:12px 8px;margin-bottom:24px;}
.farm-world .game[data-onboarding="true"] .choices>.choice {border-width:3px;border-color:#7ba761;box-shadow:0 5px 0 #a7bd87;}
.choices[data-touch-guide="true"]::after {content:'';position:absolute;width:38px;height:38px;right:2px;bottom:-23px;background:url('assets/icons/tap-hand.svg') center/contain no-repeat;pointer-events:none;animation:show-tap 850ms ease-in-out 2;}
.farm-world .panel[data-presentation="success"] .actions {margin:8px auto 18px;}
.farm-world .next-play {min-height:62px;min-width:220px;display:inline-flex;justify-content:center;align-items:center;gap:12px;font-size:1.2rem;border:3px solid #fff5db;outline:3px solid #8ab263;animation:next-invite 900ms ease-in-out 2;}
.next-play>.icon {width:28px;height:28px;filter:brightness(0) invert(1);}
@keyframes show-tap {50%{transform:translateY(-6px) scale(1.08);}}
@keyframes next-invite {50%{box-shadow:0 0 0 7px #83ae5440;}}
@media(prefers-reduced-motion:reduce){.choices[data-touch-guide="true"]::after,.farm-world .next-play {animation:none;}}

.farm-world .game[data-onboarding="true"][data-type="match"] .choices {flex-wrap:nowrap;gap:10px;}
.farm-world .game[data-onboarding="true"][data-type="match"] .choices>.choice {width:calc((100% - 20px)/3);min-width:44px;min-height:88px;padding:8px 4px;font-size:2rem;}
@media(max-width:700px){
 .farm-world .game[data-onboarding="true"] .meadow {height:58px;}
 .farm-world .game[data-onboarding="true"] .rabbit {width:58px;height:65px;}
 .farm-world .game[data-onboarding="true"] .flower {transform:scale(.29);}
 .farm-world .game[data-onboarding="true"] .panel>.prompt {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;}
 .farm-world .game[data-onboarding="true"] .panel[data-presentation="success"] .celebration-mark {width:56px;height:56px;margin:10px auto;}
 .farm-world .game[data-onboarding="true"] .panel[data-presentation="success"] h1 {font-size:1.5rem;margin-block:6px;}
}


/* Clear action hierarchy and attempt feedback, without an extra confirmation step. */
.farm-world #lesson-home{background:#e7f2d0;border-color:#adc586;color:#466b32;}
.farm-world #lesson-reset{background:#fff9e8;box-shadow:none;font-weight:750;color:#79664e;}
.farm-world .game button:focus-visible,.lesson-navigation button:focus-visible,.math-sections button:focus-visible{outline:3px solid #397b69;outline-offset:3px;}
.farm-world .panel-top{flex-wrap:wrap;row-gap:9px;}
.farm-world .step{line-height:1.5;}
.step[data-mode="practice"]::after{content:' · Tự thử';color:#397660;}
.farm-world .feedback:not(:empty){margin:0 auto 14px;text-align:left;font-size:.94rem;line-height:1.5;}
.feedback[data-kind="practice"]{display:flex;align-items:center;gap:10px;padding:10px 12px;border:2px solid #a6cabb;background:#e6f3e9;color:#365f4a;border-radius:14px;}
.feedback[data-kind="practice"]::before{content:'';flex:0 0 24px;width:24px;height:24px;background:currentColor;mask:url('assets/icons/plant.svg') center/contain no-repeat;}
.farm-world .panel .choices:has(>.choice:disabled){cursor:default;}
.reading-record::before{content:'';display:inline-block;vertical-align:middle;width:20px;height:20px;margin-right:7px;background:currentColor;mask:url('assets/icons/microphone.svg') center/contain no-repeat;}
.reading-record[aria-pressed="true"]::before{width:13px;height:13px;border-radius:3px;background:currentColor;mask:none;}
@media(max-width:700px) and (min-height:600px){
 .farm-world .game[data-subject="math"][data-stage="question"] .meadow{height:64px;}
 .farm-world .game[data-subject="math"][data-stage="question"] .rabbit{width:64px;height:72px;}
 .farm-world .game[data-subject="math"][data-stage="question"] .flower{transform:scale(.32);}
 .farm-world .game[data-subject="math"][data-stage="question"] .panel{padding:18px 16px;}
 .farm-world .game[data-subject="math"][data-stage="question"] .panel-top~h1{font-size:1.5rem;line-height:1.25;}
 .farm-world .game[data-subject="math"][data-stage="question"] .listening-tools:has(button:not([hidden])){margin-bottom:12px;}
}
