@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Noto+Sans+Thai+Looped:wght@400;500;600;700&display=swap');
:root{--paper:#faf7ed;--ink:#364333;--green:#526f43;--line:#e1e5d6;--muted:#677460}*{box-sizing:border-box}body{margin:0;color:var(--ink);background:var(--paper);font-family:'DM Sans','Noto Sans Thai Looped',system-ui,sans-serif}button{font:inherit;cursor:pointer;border:0;color:inherit;touch-action:manipulation;min-height:48px;transition:transform .15s,background .15s}button:active{transform:scale(.97)}button:focus-visible,a:focus-visible{outline:4px solid #a28ac2;outline-offset:4px}button[hidden]{display:none}header{max-width:1100px;margin:auto;height:88px;padding:16px 28px;display:flex;align-items:center;justify-content:space-between;gap:14px}.home-button{background:white;border:1px solid var(--line);padding:10px 16px;border-radius:18px;font-weight:600}.home-button span{font-size:25px;vertical-align:middle;margin-right:3px}.brand{display:flex;align-items:center;gap:4px}.brand svg{width:47px;height:47px}.brand strong{font-size:24px;letter-spacing:-1px}.brand strong span{color:#8ba668}.top-actions{display:flex;gap:8px}.top-actions button{background:transparent;font-size:14px;padding:8px 12px;border-radius:14px}.top-actions button:first-child{background:#ecebdf}.top-actions button:last-child{color:#7a8170}main{max-width:980px;padding:10px 28px 30px;margin:auto}.lesson-top{display:flex;align-items:center;justify-content:space-between;padding:5px 7px 18px;font-size:15px;color:var(--muted)}.step-dots{display:flex;gap:8px}.step-dots i{height:9px;width:25px;border-radius:6px;background:#dde2cf}.step-dots .filled{background:#93a970}.lesson-card{background:#fffefa;border:1px solid var(--line);border-radius:30px;padding:24px 32px 0;box-shadow:0 6px 0 #e7ead9}.step-title{display:flex;align-items:center;gap:12px}.number{display:grid;place-items:center;width:42px;height:42px;background:#e7edcb;border-radius:50%;font-size:20px;font-weight:700}.step-title h1{font-size:30px;letter-spacing:-.8px;margin:0;font-weight:600;flex:1}.hint-button{background:#f3e8ce;border-radius:16px;padding:8px 17px;font-weight:600;font-size:16px}.coach{display:flex;align-items:center;background:#f0f3e4;border-radius:18px;margin:20px 0;min-height:69px;padding:5px 10px 5px 6px;gap:7px;transition:box-shadow .2s}.coach-face{flex-shrink:0;width:54px;height:54px}.coach-face svg{width:100%;height:100%}.coach p{font-size:19px;line-height:1.5;margin:8px 0;flex:1;font-weight:500}.coach>button{width:48px;height:48px;border-radius:50%;background:#fffefa;font-size:25px;flex-shrink:0}.hint-glow{box-shadow:0 0 0 4px #d7b566!important}.learn-area{display:grid;grid-template-columns:1.08fr 1fr;gap:32px;align-items:stretch}.picture-card{background:#f2eddb;min-height:310px;border-radius:24px;padding:7px 15px 18px;display:flex;flex-direction:column;align-items:center;justify-content:center;overflow:hidden}.picture-card svg{width:265px;max-width:100%;height:220px}.picture-name{font-size:35px;line-height:1.6}.translation{font-size:19px;color:#738064;line-height:1.5}.letter-card{text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center}.huge-letter{font-size:150px;line-height:1.22;color:var(--green);font-weight:500}.letter-name{font-size:26px;margin:0 0 17px}.listen{display:flex;justify-content:center;align-items:center;gap:13px;min-height:66px;min-width:215px;border-radius:20px;background:var(--green);color:white;font-weight:600;font-size:25px;box-shadow:0 4px 0 #3e5833}.text-button{background:none;font-size:15px;color:#647958;padding:10px}.tiny-note{text-align:center;color:#818a76;font-size:12px;margin:17px 0}.bottom-bar{border-top:1px solid var(--line);padding:18px 0;display:flex;justify-content:space-between;align-items:center;gap:12px}.quiet{background:transparent;font-size:16px;color:#6e7b63;padding:10px 5px}.next{background:#e5bc6b;color:#4b422d;border-radius:17px;padding:14px 25px;font-size:20px;font-weight:700;min-height:58px;box-shadow:0 4px 0 #cba35a}.voice-state{display:flex;flex-direction:column;align-items:center;justify-content:center;max-width:200px;text-align:center}.voice-state small{font-size:11px;color:#6b765e}.stop{background:none;color:#6d775e;font-size:12px;min-height:30px}.write-area{display:grid;grid-template-columns:190px minmax(0,1fr);gap:24px;margin:18px 0 22px}.demo-box{background:#f2f4e9;border-radius:20px;text-align:center;padding:15px}.demo-top{display:flex;align-items:center;justify-content:space-between;font-size:17px;font-weight:600}.demo-top button{font-size:26px;background:white;border-radius:50%;width:44px;min-height:44px}.demo-canvas{margin:14px auto 7px;width:125px;height:150px;background:white;border-radius:13px;display:block}.demo-buttons{display:flex;gap:7px;justify-content:center}.demo-buttons button{background:white;border:1px solid var(--line);border-radius:12px;padding:6px 12px;font-size:15px;min-height:42px}.demo-box p{font-size:15px;color:var(--muted);line-height:1.6;margin:12px 0 0}.stages{display:flex;gap:8px;margin-bottom:11px}.stages button{flex:1;background:#f0f1e9;border-radius:12px;font-size:15px;padding:8px 5px;min-height:48px}.stages .selected{background:#e4eccc;color:var(--green);font-weight:700;box-shadow:inset 0 0 0 2px #b7c790}.pad-wrap{position:relative;aspect-ratio:1.55;border:2px solid #dfe4d2;border-radius:18px;overflow:hidden}.pad-wrap canvas{display:block;width:100%;height:100%;touch-action:none}.pad-label{position:absolute;bottom:8px;left:14px;color:#7f8a72;pointer-events:none;font-size:13px}.pad-tools{display:flex;justify-content:flex-end;gap:8px;margin-top:10px}.pad-tools button{background:#f0f1e8;border-radius:12px;padding:7px 13px;font-size:14px}.quiz-area{text-align:center}.quiz-picture{margin:-12px auto 0;display:flex;align-items:center;justify-content:center;flex-direction:column}.quiz-picture svg{width:230px;height:165px}.quiz-picture span{font-size:21px}.small-listen{background:#eef2df;border-radius:13px;color:var(--green);padding:8px 18px;margin:10px 0;font-size:16px}.answers{display:flex;justify-content:center;gap:24px;margin:9px 0}.answers button{height:105px;width:114px;border:2px solid #e0e6d4;background:white;border-radius:22px;font-size:58px;box-shadow:0 4px 0 #e2e8d7}.answers .correct{background:#e4edc7;border-color:#90a66d}.answers .try-again{background:#faead1}.answers .hint-answer{border-color:#caac5b;box-shadow:0 0 0 4px #eee0ad}.feedback{min-height:32px;font-size:19px;margin:18px 0;color:var(--green)}.home-card{text-align:center;padding:12px 0 20px}.home-sprout svg{height:95px;width:95px}.home-card h1,.finish-card h1{font-size:32px;font-weight:600;margin:12px 0}.home-card>p,.finish-card p{font-size:18px;color:var(--muted);line-height:1.6}.chapters{display:grid;grid-template-columns:1fr 1fr;gap:20px;margin-top:30px}.chapters>button{display:flex;flex-direction:column;align-items:flex-start;text-align:left;background:var(--chapter-color);padding:24px;border-radius:24px;min-height:210px}.chapter-count{font-size:13px;opacity:.7}.chapters strong{font-size:21px;margin-top:8px}.chapter-letters{font-size:35px;letter-spacing:8px;margin:12px 0}.chapters small{font-size:14px;width:100%;opacity:.75}.chapters small span{float:right;font-size:22px}.alphabet-grid{display:grid;grid-template-columns:repeat(8,1fr);gap:12px;margin-top:30px}.alphabet-grid button{font-size:35px;background:#edf1dd;border-radius:17px;padding:12px 5px}.alphabet-grid small{display:block;font-size:11px;color:#6c795d}.finish-card{text-align:center;padding:55px 0}.big-star{font-size:95px;color:#e3b35c;line-height:1.2}.celebration-letters{display:flex;justify-content:center;gap:15px;margin:25px}.celebration-letters span{font-size:44px;padding:10px 24px;background:#e6edcf;border-radius:20px}.finish-card .next{margin-top:20px}#toast{position:fixed;bottom:20px;left:50%;transform:translateX(-50%) translateY(15px);opacity:0;pointer-events:none;background:#405436;color:white;padding:14px 22px;border-radius:15px;max-width:90%;transition:.2s;z-index:20}#toast.show{opacity:1;transform:translateX(-50%)}dialog{border:1px solid var(--line);background:#fffefa;color:var(--ink);border-radius:25px;padding:26px;max-width:620px;width:90%;max-height:88vh;overflow:auto}dialog::backdrop{background:#2e392966}.dialog-head{display:flex;align-items:center;justify-content:space-between}.dialog-head h2{margin:0;font-size:25px}.dialog-head button{font-size:30px;width:48px;background:#f0f2e5;border-radius:50%}dialog h3{margin:25px 0 8px;font-size:18px}dialog p{font-size:15px;line-height:1.8;color:#69775e}dialog a{color:var(--green)}.dialog-button{background:#eaf0da;border-radius:13px;padding:13px 20px;font-size:16px;text-align:left}
@media(max-width:800px){header{padding:13px 22px;height:80px}.brand strong{font-size:21px}.brand svg{width:38px;height:38px}main{padding:8px 22px 25px}.lesson-card{padding:22px 23px 0}.step-title h1{font-size:27px}.coach p{font-size:18px}.learn-area{gap:20px}.picture-card{min-height:290px}.picture-card svg{height:190px}.huge-letter{font-size:132px}.listen{min-width:180px}.write-area{grid-template-columns:155px minmax(0,1fr);gap:16px}.demo-box{padding:12px}.demo-canvas{width:106px;height:130px}.demo-box p{font-size:13px}.demo-top{font-size:15px}.stages button{font-size:13px}.pad-wrap{aspect-ratio:1.15}.alphabet-grid{grid-template-columns:repeat(6,1fr)}}
@media(max-width:560px){header{padding:10px 15px;height:74px;gap:5px}.home-button{font-size:0;padding:5px;width:46px;height:46px;min-height:46px}.home-button span{font-size:27px;margin:0}.brand svg{width:33px}.brand strong{font-size:20px}.top-actions{gap:0}.top-actions button{font-size:12px;padding:8px 10px}.top-actions button:last-child{padding-right:0}main{padding:6px 13px 25px}.lesson-top{font-size:13px;padding-bottom:12px}.step-dots i{width:18px;height:7px}.lesson-card{padding:17px 15px 0;border-radius:24px}.step-title{gap:9px}.number{width:34px;height:34px;font-size:17px}.step-title h1{font-size:23px}.hint-button{font-size:14px;padding:7px 12px;min-height:43px}.coach{margin:15px 0;min-height:66px;padding:5px}.coach-face{width:41px;height:41px}.coach p{font-size:16px;line-height:1.5}.coach>button{width:43px;height:43px;min-height:43px;font-size:21px}.learn-area{grid-template-columns:1fr 1fr;gap:10px}.picture-card{min-height:254px;border-radius:19px;padding:7px 6px 17px}.picture-card svg{height:145px;width:100%}.picture-name{font-size:30px}.translation{font-size:14px}.huge-letter{font-size:109px}.letter-name{font-size:21px;margin-bottom:14px}.listen{font-size:20px;min-width:0;width:100%;min-height:58px;border-radius:17px;gap:9px}.text-button{font-size:12px;min-height:45px}.tiny-note{font-size:10px;line-height:1.5}.bottom-bar{gap:7px;padding:15px 0}.quiet{font-size:14px}.next{padding:12px 16px;font-size:17px;min-height:53px;border-radius:15px}.voice-state{max-width:90px}.voice-state small{font-size:10px}.stop{font-size:10px}.write-area{grid-template-columns:1fr;margin:10px 0 18px;gap:14px}.demo-box{display:grid;grid-template-columns:90px 1fr;gap:0 16px;padding:10px 15px;text-align:left}.demo-top{grid-column:2;grid-row:1;font-size:17px;justify-content:flex-start;gap:15px}.demo-canvas{grid-column:1;grid-row:1/4;margin:0;width:86px;height:104px}.demo-buttons{grid-column:2;justify-content:flex-start;align-self:start}.demo-box p{display:none}.demo-top button{min-height:40px;height:40px;width:40px}.demo-buttons button{min-height:40px;font-size:13px}.stages button{font-size:14px}.pad-wrap{aspect-ratio:1.3}.pad-tools button{font-size:13px;min-height:46px}.pad-label{font-size:11px}.answers{gap:15px}.answers button{height:91px;width:87px;font-size:48px}.quiz-picture svg{height:150px}.feedback{font-size:17px}.home-card h1,.finish-card h1{font-size:27px}.home-card>p,.finish-card p{font-size:16px}.chapters{gap:12px;margin-top:24px}.chapters>button{padding:17px;min-height:196px;border-radius:20px}.chapters strong{font-size:17px}.chapter-letters{font-size:27px;letter-spacing:3px}.chapter-count{font-size:12px}.chapters small{font-size:12px}.alphabet-grid{grid-template-columns:repeat(4,1fr);gap:10px}.celebration-letters{gap:8px;margin:25px 0}.celebration-letters span{padding:10px 18px;font-size:38px}.finish-card{padding-top:35px}}
@media(prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
.home-button{min-height:58px;font-size:19px;padding:10px 20px}.parents-button{background:transparent;color:#7a8170;font-size:14px;padding:8px 12px;border-radius:14px}
.coach>.hint-button{width:auto;height:auto;min-height:62px;border-radius:18px;padding:8px 18px;font-size:20px;font-weight:700;background:#f3e8ce;display:flex;align-items:center;gap:6px;box-shadow:0 3px 0 #e2d1a8}.coach>.hint-button span{font-size:24px}
.back{background:#eef1e4;color:#56664b;border-radius:18px;padding:12px 22px;font-size:20px;font-weight:600;min-height:64px;box-shadow:0 4px 0 #dfe4d0}.next{min-height:64px;font-size:22px;padding:14px 30px}
.listen{min-height:80px;min-width:240px;font-size:29px;border-radius:24px}.picture-card{position:relative}
.replay{display:block;width:100%;margin-top:10px;background:white;border:2px solid var(--line);border-radius:16px;font-size:18px;font-weight:600;min-height:58px}.demo-canvas{cursor:pointer;width:150px;height:180px}
.stages button{min-height:58px;font-size:17px;border-radius:15px}.pad-tools{gap:12px}.pad-tools button{min-height:60px;padding:10px 24px;font-size:19px;font-weight:600;border-radius:16px}
.small-listen{min-height:62px;padding:10px 28px;font-size:21px;font-weight:600;border-radius:18px;box-shadow:0 3px 0 #dbe3c6}
.answers{gap:28px}.answers button{height:124px;width:132px;font-size:68px;border-width:3px;border-radius:26px;transition:transform .2s,opacity .35s,filter .35s,background .2s}
/* voice loading: a bar fills inside the tapped button; extra taps are ignored until the sound plays */
.is-loading{position:relative;overflow:hidden;animation:breathe 1.1s ease-in-out infinite}
.is-loading::after{content:'';position:absolute;left:12%;right:12%;bottom:5px;height:8px;border-radius:8px;background:linear-gradient(90deg,#f6c453 calc(var(--p,0)*100%),rgba(255,255,255,.75) 0);box-shadow:inset 0 0 0 2px rgba(60,70,50,.18);transition:background .15s}
.is-playing{animation:playing 1s ease-in-out infinite}
@keyframes breathe{50%{transform:scale(.97);filter:brightness(1.06)}}
@keyframes playing{0%,100%{box-shadow:0 0 0 0 rgba(166,190,113,.7)}50%{box-shadow:0 0 0 12px rgba(166,190,113,0)}}
/* letter game rewards */
.answers .pop{animation:pop .6s cubic-bezier(.3,1.6,.5,1);background:#e4edc7;border-color:#90a66d;box-shadow:0 0 0 6px #cfe0a6}
.answers .try-again{animation:shake .5s;background:#fde3c8;border-color:#e6a774}
.answers .used{opacity:.32;filter:grayscale(1);transform:scale(.88);box-shadow:none}
.answers .fade-out{opacity:.25;transform:scale(.85);transition-delay:.25s}
.answers .hint-answer{animation:glow 1.1s ease-in-out infinite}
.quiz-picture.dance svg{animation:dance .9s ease-in-out 2}.coach-face.jump{animation:jump .6s ease-out 2}
.next.ready{animation:ready 1.2s ease-in-out infinite}
.cheer-banner{position:fixed;white-space:nowrap;left:50%;top:38%;z-index:30;display:flex;align-items:center;gap:12px;padding:22px 40px;font-size:46px;font-weight:700;color:#4e6a3e;background:#fffdf2;border:4px solid #e5c56f;border-radius:32px;box-shadow:0 10px 0 #e5c56f,0 20px 50px rgba(60,70,40,.25);transform:translate(-50%,-50%);pointer-events:none;animation:banner 1.7s ease-out forwards}
.confetti{position:fixed;z-index:31;font-size:28px;pointer-events:none;transform:translate(-50%,-50%);animation:fly 1.2s cubic-bezier(.2,.7,.4,1) forwards}
.try-bubble{position:fixed;z-index:30;padding:10px 20px;font-size:24px;font-weight:700;color:#8a5a2b;background:#fff3dd;border:3px solid #eec48e;border-radius:22px;white-space:nowrap;pointer-events:none;transform:translate(-50%,-115%);animation:bubble 1.3s ease-out forwards}
@keyframes pop{0%{transform:scale(1)}40%{transform:scale(1.28) rotate(-6deg)}70%{transform:scale(.95) rotate(3deg)}100%{transform:scale(1.08)}}
@keyframes shake{0%,100%{transform:translateX(0)}20%{transform:translateX(-12px) rotate(-4deg)}40%{transform:translateX(10px) rotate(3deg)}60%{transform:translateX(-7px)}80%{transform:translateX(5px)}}
@keyframes glow{0%,100%{box-shadow:0 0 0 4px #eee0ad;transform:scale(1)}50%{box-shadow:0 0 0 12px #f3dc8f;transform:scale(1.07)}}
@keyframes dance{25%{transform:rotate(-6deg) translateY(-8px)}50%{transform:rotate(0) translateY(0)}75%{transform:rotate(6deg) translateY(-8px)}}
@keyframes jump{40%{transform:translateY(-14px) scale(1.12)}}
@keyframes ready{50%{transform:scale(1.07);box-shadow:0 4px 0 #cba35a,0 0 0 8px rgba(229,188,107,.35)}}
@keyframes banner{0%{transform:translate(-50%,-50%) scale(.2);opacity:0}18%{transform:translate(-50%,-50%) scale(1.15);opacity:1}30%{transform:translate(-50%,-50%) scale(1)}80%{opacity:1}100%{transform:translate(-50%,-62%) scale(1);opacity:0}}
@keyframes fly{0%{transform:translate(-50%,-50%) scale(.4);opacity:1}100%{transform:translate(calc(-50% + var(--x)),calc(-50% + var(--y))) rotate(var(--r)) scale(1.1);opacity:0}}
@keyframes bubble{0%{transform:translate(-50%,-80%) scale(.4);opacity:0}20%{transform:translate(-50%,-115%) scale(1.1);opacity:1}30%,45%{transform:translate(-50%,-115%) rotate(-4deg)}38%{transform:translate(-50%,-115%) rotate(4deg)}75%{opacity:1}100%{transform:translate(-50%,-150%);opacity:0}}
.pad-tools .icon-tool{width:72px;height:72px;min-height:72px;padding:0;display:grid;place-items:center;border-radius:20px;background:#f0f1e8;box-shadow:0 4px 0 #dfe2d4}.icon-tool svg{width:40px;height:40px;fill:none;stroke:#56664b;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}.dialog-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:18px}
@media(max-width:560px){.home-button{width:56px;height:56px;min-height:56px;font-size:0;padding:5px}.coach>.hint-button{min-height:56px;padding:6px 12px;font-size:17px}.back{font-size:16px;padding:10px 14px;min-height:58px}.next{font-size:18px;min-height:58px;padding:12px 18px}.listen{min-height:66px;font-size:22px;min-width:0}.replay{font-size:16px;min-height:52px;grid-column:2}.pad-tools{justify-content:flex-end}.pad-tools .icon-tool{width:64px;height:64px;min-height:64px}.small-listen{font-size:18px}.answers{gap:14px}.answers button{height:100px;width:100px;font-size:56px}.cheer-banner{font-size:34px;padding:16px 26px}.try-bubble{font-size:20px}}
@media(max-width:800px){.demo-canvas{width:120px;height:144px}}
@media(max-width:560px){.demo-canvas{width:86px;height:104px}}
/* adventure map: one island per chapter, grey until its four letters are done */
body{overflow-x:hidden}.map-screen{text-align:center;padding:0 0 12px}.map-screen h1{font-size:28px;font-weight:700;margin:0 0 2px}.map-screen>p{color:var(--muted);font-size:17px;margin:0 0 12px}.map-screen>.swipe-hint{font-size:15px;margin:4px 0 0}
/* the map is wider than the screen and scrolls sideways; its height fits an iPad held in landscape */
.map-scroll{width:100vw;margin-left:calc(50% - 50vw);overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain;scroll-snap-type:x proximity;scrollbar-width:none;padding:2px 0 6px}.map-scroll::-webkit-scrollbar{display:none}
.map{--h:clamp(360px,calc(100vh - 250px),780px);--h:clamp(360px,calc(100dvh - 250px),780px);--col:calc(var(--h) * .5);position:relative;height:var(--h);width:calc(var(--col) * (var(--cols) + .4));margin:0 24px;border-radius:34px;overflow:hidden;background:linear-gradient(90deg,#cdeef5,#9fd7e6 30%,#86c9dc 70%,#9fd7e6);box-shadow:inset 0 0 0 5px #eaf7fa,0 6px 0 #d4e8ee}
.wave{position:absolute;width:44px;height:12px;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 12'%3E%3Cpath d='M2 8q5-6 10 0t10 0 10 0 10 0' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' opacity='.7'/%3E%3C/svg%3E") center/contain no-repeat;animation:isle-drift 6s ease-in-out infinite}
.wave:nth-child(2n){animation-delay:-3s}
.map-path{position:absolute;inset:0;width:100%;height:100%;fill:none;pointer-events:none}
.map-path path{stroke:white;stroke-width:3;stroke-dasharray:2 9;stroke-linecap:round;vector-effect:non-scaling-stroke;opacity:.9}.map-path path.done{stroke:#ffcf4d;stroke-width:6;stroke-dasharray:none}
.island{position:absolute;width:calc(var(--h) * .54);scroll-snap-align:center;transform:translate(-50%,-50%);background:none;padding:0;display:flex;flex-direction:column;align-items:center;gap:3px;min-height:0}
.island:active{transform:translate(-50%,-50%) scale(.97)}
.island-pic{position:relative;display:block;width:100%}
.island-art{display:block;width:100%;height:auto;filter:grayscale(1) brightness(.86) contrast(.9);animation:isle-bob 5s ease-in-out infinite}
.island:nth-of-type(2n) .island-art{animation-delay:-2.5s}
.island .alive-only{opacity:0}.island.alive .alive-only{opacity:1}.island.alive .wither-only{display:none}.island.alive .island-art{filter:none}
.island-name small{display:inline-grid;place-items:center;width:24px;height:24px;margin-right:7px;border-radius:50%;background:#e5a64a;color:white;font-size:13px;vertical-align:1px}.island-name{background:#fffdf5;border-radius:14px;padding:5px 14px;font-weight:700;font-size:17px;box-shadow:0 3px 0 rgba(40,70,80,.12);white-space:nowrap}
.island-stars{color:#f0b93f;font-size:20px;letter-spacing:2px;line-height:1;text-shadow:0 1px 0 white}
.island.locked .island-art{opacity:.6;filter:grayscale(1) brightness(.95) blur(.6px)}.island.locked .island-name{opacity:.75}
.fog{position:absolute;inset:18% 22% 22%;display:grid;place-items:center;font-size:36px;border-radius:50%;background:radial-gradient(#ffffffd9 30%,#ffffff00 70%)}
.island.current .island-pic::before{content:'';position:absolute;inset:8% 4% 2%;border-radius:50%;background:radial-gradient(#fff6c8,#fff6c800 68%);animation:isle-glow 2s ease-in-out infinite}
.here{position:absolute;left:50%;top:-8%;display:flex;flex-direction:column;align-items:center;pointer-events:none;animation:isle-here 1.3s ease-in-out infinite}
.here svg{width:46px;height:46px;filter:drop-shadow(0 2px 0 white)}.here b{background:#e5a64a;color:white;border-radius:12px;padding:3px 12px;font-size:15px;box-shadow:0 3px 0 #c98a35}
.island.nope{animation:isle-nope .45s}
.island .enter{display:none}.island.ready .enter{display:block;position:absolute;left:50%;top:42%;padding:9px 18px;border-radius:18px;background:#e5a64a;color:white;font-size:19px;font-weight:700;white-space:nowrap;box-shadow:0 4px 0 #c98a35;animation:isle-enter 1.2s ease-in-out infinite}
@keyframes isle-enter{0%,100%{transform:translate(-50%,-50%) scale(1)}50%{transform:translate(-50%,-50%) scale(1.08)}}
/* idle life: rain on grey islands; sun, birds, animals and lights on living ones */
.rain path{stroke-dasharray:5 7;animation:isle-rain .7s linear infinite}
.island.alive .rays{transform-box:fill-box;transform-origin:center;animation:isle-spin 14s linear infinite}
.island.alive .bird{animation:isle-birds 8s ease-in-out infinite}
.island.alive .flag{transform-box:fill-box;transform-origin:left center;animation:isle-flag 1.2s ease-in-out infinite}
.island.alive .hop{transform-box:fill-box;transform-origin:center bottom;animation:isle-hop 1.8s ease-in-out infinite}
.island.alive .swing{transform-box:fill-box;transform-origin:top center;animation:isle-swing 2.4s ease-in-out infinite}
.island.alive .fish{transform-box:fill-box;transform-origin:center;animation:isle-fish 3.2s ease-in-out infinite}
.island.alive .spray{animation:isle-spray 1.6s ease-out infinite}
.island.alive .window{animation:isle-twinkle 3s ease-in-out infinite}
.island.alive .bell{transform-box:fill-box;transform-origin:top center;animation:isle-swing 1.6s ease-in-out infinite}
.island.alive .ding{animation:isle-twinkle 1.6s ease-in-out infinite}
.island.alive .lantern{transform-box:fill-box;transform-origin:top center;animation:isle-swing 3s ease-in-out infinite}
.island.alive .bees{animation:isle-bees 4s ease-in-out infinite}
.island.alive .beam{transform-box:fill-box;transform-origin:left center;animation:isle-beam 3s ease-in-out infinite}
.island.alive .ship{animation:isle-ship 3.5s ease-in-out infinite}
.island.alive .kite{transform-box:fill-box;transform-origin:bottom center;animation:isle-kite 4s ease-in-out infinite}
@keyframes isle-bees{0%,100%{transform:translate(0,0)}25%{transform:translate(-10px,-6px)}50%{transform:translate(-4px,6px)}75%{transform:translate(8px,-2px)}}
@keyframes isle-beam{0%,100%{opacity:.35;transform:scaleX(.8)}50%{opacity:.85;transform:scaleX(1.1)}}
@keyframes isle-ship{50%{transform:translateY(-3px) rotate(-1.5deg)}}
@keyframes isle-kite{0%,100%{transform:rotate(-4deg)}50%{transform:rotate(5deg) translateY(-4px)}}
/* revival, about 7.5 seconds, so a child can watch it happen: the rain cloud drifts off (0.5s), cracks and bare branches
   fade one by one (1s), a magic ring spreads (1.4s), colour washes out from the centre over the grey island (1.8-5.8s),
   leaves, flowers and animals grow back one at a time (2.6-6.4s), then the island sparkles. JS sets the per-piece delays. */
.island.reviving .island-art{animation:none;filter:grayscale(1) brightness(.86) contrast(.9)}
.island.reviving .island-art.wash{position:absolute;left:0;top:0;filter:none;clip-path:circle(0% at 50% 66%);animation:isle-wash 4s 1.8s linear both}
.island.reviving .wither-only{display:inline;transform-box:fill-box;transform-origin:center bottom;animation:isle-wilt-away 1s ease-in both}
.island.reviving .rain-cloud{animation:isle-cloud-off 1.8s .5s ease-in both}
.island.reviving .pop{transform-box:fill-box;transform-origin:center bottom;animation:isle-grow .9s cubic-bezier(.3,1.5,.5,1) both}
.island.reviving .alive-only:not(.pop){animation:isle-fade-in 1s 5.4s ease-out both}
.island.reviving .island-pic::after{content:'';position:absolute;left:50%;top:60%;width:16%;aspect-ratio:1;border-radius:50%;border:6px solid #ffe28a;box-shadow:0 0 18px #fff3b0;transform:translate(-50%,-50%);animation:isle-ring 1.6s 1.4s ease-out both}
.island.reviving .island-pic::before{content:'';position:absolute;inset:6% 0 0;border-radius:50%;background:radial-gradient(#fff6c8cc,#fff6c800 65%);animation:isle-bloom 4.2s 1.8s ease-in-out both}
.island.reviving.ready .enter{display:none}
.revive-spark{position:absolute;color:#ffd45c;text-shadow:0 0 8px #fff3b0;font-size:clamp(14px,calc(var(--h) * .045),30px);pointer-events:none;animation:isle-spark 1.3s ease-in-out both}
@keyframes isle-wash{from{clip-path:circle(0% at 50% 66%)}to{clip-path:circle(75% at 50% 66%)}}
@keyframes isle-wilt-away{0%{opacity:1;transform:none}100%{opacity:0;transform:translateY(6px) scale(.6)}}
@keyframes isle-cloud-off{0%{opacity:1;transform:none}30%{opacity:1;transform:translate(-6px,2px)}100%{opacity:0;transform:translate(70px,-34px) scale(.8)}}
@keyframes isle-grow{0%{opacity:0;transform:translateY(8px) scale(0)}70%{opacity:1;transform:translateY(0) scale(1.15)}100%{opacity:1;transform:none}}
@keyframes isle-fade-in{from{opacity:0}to{opacity:1}}
@keyframes isle-bloom{0%,100%{opacity:0}40%,70%{opacity:1}}
@keyframes isle-spark{0%{opacity:0;transform:scale(.2) rotate(0)}50%{opacity:1;transform:scale(1.2) rotate(90deg)}100%{opacity:0;transform:scale(.4) rotate(180deg)}}
@keyframes isle-bob{50%{transform:translateY(-6px)}}
@keyframes isle-drift{50%{transform:translateX(10px)}}
@keyframes isle-glow{50%{opacity:.4}}
@keyframes isle-here{0%,100%{transform:translate(-50%,0)}50%{transform:translate(-50%,-10px)}}
@keyframes isle-nope{20%{transform:translate(calc(-50% - 10px),-50%)}40%{transform:translate(calc(-50% + 8px),-50%)}60%{transform:translate(calc(-50% - 6px),-50%)}80%{transform:translate(calc(-50% + 4px),-50%)}}
@keyframes isle-rain{to{stroke-dashoffset:-12}}
@keyframes isle-spin{to{transform:rotate(360deg)}}
@keyframes isle-birds{0%,100%{transform:translate(0,0)}50%{transform:translate(26px,-8px)}}
@keyframes isle-flag{50%{transform:skewY(8deg) scaleX(.9)}}
@keyframes isle-hop{0%,60%,100%{transform:translateY(0)}75%{transform:translateY(-8px)}}
@keyframes isle-swing{0%,100%{transform:rotate(-10deg)}50%{transform:rotate(10deg)}}
@keyframes isle-fish{0%,55%,100%{transform:translate(0,8px) rotate(0);opacity:0}65%{opacity:1}75%{transform:translate(8px,-16px) rotate(-30deg);opacity:1}90%{transform:translate(16px,4px) rotate(40deg);opacity:0}}
@keyframes isle-spray{0%{transform:translateY(4px);opacity:0}40%{opacity:1}100%{transform:translateY(-8px);opacity:0}}
@keyframes isle-twinkle{50%{opacity:.55}}
@keyframes isle-ring{0%{opacity:1;transform:translate(-50%,-50%) scale(.2)}100%{opacity:0;transform:translate(-50%,-50%) scale(7)}}
@media(max-width:700px){.map-screen h1{font-size:24px}.map-screen>p{font-size:15px}.island-name{font-size:15px}.here svg{width:38px;height:38px}}
@media(prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
/* A little reveal ritual: lift, turn, then settle as the sound begins. */
.letter-card{gap:20px;min-width:0}.flip-scene{position:relative;display:block;width:min(100%,245px);height:250px;padding:0;border:0;background:none;perspective:1100px;border-radius:28px;isolation:isolate;-webkit-tap-highlight-color:transparent}.flip-scene:active{transform:none}.flip-lift,.flip-inner{display:block;position:relative;width:100%;height:100%;transform-style:preserve-3d}.flip-inner{transition:transform .9s cubic-bezier(.22,.75,.25,1);transform:rotateY(0)}.flip-scene.revealed .flip-inner{transform:rotateY(180deg)}.card-face{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;flex-direction:column;border-radius:27px;backface-visibility:hidden;-webkit-backface-visibility:hidden;overflow:hidden;border:2px solid #d3ddba;box-shadow:0 7px 0 #c6d1ae,0 13px 22px #526f4312}.card-cover{background:radial-gradient(circle at 20% 20%,#edf2d8 0 3px,transparent 4px) 0 0/27px 27px,#e2eacb;transform:rotateY(0);color:#526f43}.card-stitch{position:absolute;inset:10px;border:2px dashed #b9c99b;border-radius:19px;opacity:.75}.cover-sprout{position:absolute;top:15px;width:63px;height:63px}.cover-sprout svg{width:100%;height:100%}.mystery-mark{font-size:94px;line-height:1;font-weight:600;margin-top:23px;color:#6c8650;text-shadow:0 3px 0 #f8faed}.cover-sound{position:absolute;bottom:22px;width:56px;height:40px;display:grid;place-items:center;background:#fff9e5;border-radius:50%;box-shadow:0 3px 0 #cfdbaf}.cover-sound svg{width:34px;height:27px}.card-letter{background:radial-gradient(ellipse at 50% 30%,#fffefa,#f4f3df);transform:rotateY(180deg)}.card-letter .huge-letter{font-size:128px;line-height:1.3;margin-top:8px}.card-letter .letter-name{font-size:25px;margin:0 10px 15px}.letter-sun{position:absolute;right:17px;top:12px;color:#d8af54;font-size:29px}.card-wait{position:absolute;bottom:25px;display:flex;gap:7px;opacity:0}.card-wait i{width:9px;height:9px;background:#6a8450;border-radius:50%}.waiting:not(.revealed) .cover-sound{opacity:0}.waiting:not(.revealed) .card-wait{opacity:1}.waiting .card-wait i{animation:seed-wait .85s ease-in-out infinite}.waiting .card-wait i:nth-child(2){animation-delay:.14s}.waiting .card-wait i:nth-child(3){animation-delay:.28s}.waiting:not(.revealed) .cover-sprout{animation:seed-sway 1.8s ease-in-out infinite}.just-revealed .flip-lift{animation:card-lift .95s ease-in-out both}.reveal-spark{position:absolute;pointer-events:none;opacity:0;font-size:32px;color:#dab356}.spark-one{top:5px;left:-14px;--turn:-18deg}.spark-two{top:35px;right:-13px;--turn:22deg;font-size:39px}.spark-three{bottom:22px;right:-11px;--turn:12deg;font-size:25px}.just-revealed .reveal-spark{animation:reveal-glint .7s .45s ease-out both}.just-revealed .spark-two{animation-delay:.6s}.just-revealed .spark-three{animation-delay:.72s}
@keyframes seed-wait{0%,70%,100%{transform:translateY(0);opacity:.45}35%{transform:translateY(-7px);opacity:1}}
@keyframes seed-sway{50%{transform:rotate(7deg) translateY(-3px)}}
@keyframes card-lift{0%,100%{transform:translateY(0) scale(1)}45%{transform:translateY(-10px) scale(1.035)}75%{transform:translateY(-3px) scale(1.015)}}
@keyframes reveal-glint{0%{opacity:0;transform:scale(.25) rotate(0)}40%{opacity:1;transform:scale(1.15) rotate(var(--turn))}100%{opacity:0;transform:translateY(-12px) scale(.7) rotate(var(--turn))}}
/* Pictures explain the three writing modes; accessible names remain for screen readers. */
.stages{gap:12px;margin-bottom:16px}.stages button{position:relative;display:grid;place-items:center;min-width:0;min-height:112px;padding:5px 8px;border:2px solid transparent;border-radius:21px;background:#f0f1e8;box-shadow:0 4px 0 #e0e4d5;transition:background .2s,border-color .2s,transform .2s}.stages button>svg{display:block;width:110px;max-width:100%;height:96px;overflow:visible}.stages button.selected{background:#e8efda;border-color:#91a773;box-shadow:0 4px 0 #b7c895}.mode-check{position:absolute;right:6px;top:6px;width:24px;height:24px;border-radius:50%;background:#607e49;display:grid;place-items:center;opacity:0;transform:scale(.5)}.mode-check svg{width:19px;height:19px;fill:none;stroke:#fffefa;stroke-width:2.8;stroke-linecap:round;stroke-linejoin:round}.selected .mode-check{opacity:1;transform:scale(1);animation:mode-check-in .35s ease-out}.selected .mode-pencil{animation:pencil-draw .65s ease-in-out}.selected .mode-ink{stroke-dasharray:100;animation:ink-in .7s ease-out}
@keyframes mode-check-in{0%{transform:scale(.4)}65%{transform:scale(1.15)}100%{transform:scale(1)}}
@keyframes pencil-draw{0%,100%{transform:translate(0,0)}45%{transform:translate(-5px,5px)}}
@keyframes ink-in{from{stroke-dashoffset:100}to{stroke-dashoffset:0}}
@media(max-width:800px){.flip-scene{height:230px;max-width:220px}.card-letter .huge-letter{font-size:114px}.stages{gap:8px}.stages button{min-height:100px;padding:4px}.stages button>svg{height:85px}}
@media(max-width:560px){.letter-card{gap:17px}.flip-scene{height:205px;max-width:195px}.card-face{border-radius:21px}.card-stitch{inset:8px;border-radius:14px}.cover-sprout{width:49px;height:49px;top:12px}.mystery-mark{font-size:77px;margin-top:15px}.cover-sound{bottom:18px}.card-letter .huge-letter{font-size:100px}.card-letter .letter-name{font-size:19px;margin:0 4px 10px}.letter-sun{font-size:22px;right:12px}.stages{gap:9px}.stages button{min-height:96px;border-radius:17px}.stages button>svg{height:82px}.mode-check{width:21px;height:21px;right:4px;top:4px}.spark-one{left:-9px}.spark-two{right:-8px}.reveal-spark{font-size:25px}}
@media(prefers-reduced-motion:reduce){.flip-inner{transition:none}.just-revealed .reveal-spark{display:none}.waiting .card-wait i{opacity:1}.selected .mode-ink{stroke-dashoffset:0}}
/* Matching cards stay covered until the question's audio actually starts. */
.answers .answer-choice{position:relative;perspective:800px;border:0;background:transparent;box-shadow:none;isolation:isolate;padding:0;height:140px;width:132px;border-radius:25px;-webkit-tap-highlight-color:transparent}.answer-turn{position:absolute;inset:0;display:block;transform-style:preserve-3d;transition:transform .78s cubic-bezier(.22,.75,.25,1);transition-delay:var(--card-delay)}.cards-revealed .answer-turn{transform:rotateY(180deg)}.answer-face{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;border-radius:24px;backface-visibility:hidden;-webkit-backface-visibility:hidden;border:2px solid #d6dfc4;box-shadow:0 5px 0 #cdd7bb;overflow:hidden}.answer-cover{flex-direction:column;background:radial-gradient(circle,#eef3de 0 2px,transparent 3px) 0 0/20px 20px,#e1eacb;color:#6b8451;transform:rotateY(0)}.answer-cover::before{content:'';position:absolute;inset:7px;border:1.5px dashed #b7c99a;border-radius:17px}.answer-sprout{height:42px;width:42px;margin-top:-4px}.answer-sprout svg{height:100%;width:100%}.answer-question{font-size:48px;font-weight:600;line-height:1.05}.answer-front{background:#fffefa;transform:rotateY(180deg);color:var(--green);font-size:68px}.answer-dots{position:absolute;bottom:12px;display:flex;gap:5px;opacity:0}.answer-dots i{width:5px;height:5px;border-radius:50%;background:#6a8450}.cards-waiting .answer-dots{opacity:1}.cards-waiting .answer-dots i{animation:seed-wait .85s ease-in-out infinite}.cards-waiting .answer-dots i:nth-child(2){animation-delay:.14s}.cards-waiting .answer-dots i:nth-child(3){animation-delay:.28s}.cards-waiting .answer-sprout{animation:seed-sway 1.8s ease-in-out infinite;animation-delay:var(--card-delay)}.answers .correct .answer-front{background:#e4edc7;border-color:#90a66d}.answers .try-again .answer-front{background:#fde3c8;border-color:#e6a774}.answers .answer-choice.correct,.answers .answer-choice.try-again{background:transparent}.answers:not(.cards-revealed) .answer-choice:active{transform:translateY(2px)}
@media(max-width:560px){.answers .answer-choice{height:116px;width:min(100px,28vw);border-radius:21px}.answer-face{border-radius:20px}.answer-front{font-size:56px}.answer-sprout{height:34px;width:34px}.answer-question{font-size:40px}.answer-dots{bottom:10px}}
@media(prefers-reduced-motion:reduce){.answer-turn{transition:none}.cards-waiting .answer-dots i{opacity:1}}
/* iPad held sideways (every model from mini 1133x744 to Pro 13" 1376x1032, with or without Safari's toolbars; phones sideways are
   too short for this and scroll instead, see the end of this file):
   each lesson screen fits one view with no scrolling. Title and coach share a row, and the content area stretches to the height left. */
@media(orientation:landscape) and (min-width:900px) and (min-height:600px){
 header{height:66px;padding:8px 28px}.home-button{min-height:52px;padding:6px 18px}.brand svg{width:40px;height:40px}
 main{max-width:1180px;padding-top:2px;padding-bottom:8px}
 .map{--h:clamp(360px,calc(100vh - 205px),780px);--h:clamp(360px,calc(100dvh - 205px),780px)}
 .lesson-top{padding:0 7px 6px;font-size:14px}
 .lesson-card{display:grid;grid-template-columns:auto minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto auto;gap:10px 18px;height:calc(100vh - 110px);height:calc(100dvh - 110px);padding:12px 26px 0}
 .lesson-card>.step-title{grid-column:1;grid-row:1}.step-title h1{font-size:26px;white-space:nowrap}
 .lesson-card>.coach{grid-column:2;grid-row:1;margin:0;min-height:62px}
 .lesson-card>.learn-area,.lesson-card>.write-area,.lesson-card>.quiz-area{grid-column:1/-1;grid-row:2;min-height:0;height:100%;margin:0}
 .lesson-card>.tiny-note{grid-column:1/-1;grid-row:3;margin:-4px 0 0}
 .lesson-card>.bottom-bar{grid-column:1/-1;grid-row:4;padding:0 0 10px;border-top:0}
 .learn-area{gap:24px}
 .picture-card{min-height:0;height:100%;padding:8px 12px 12px}.picture-card svg{flex:1 1 0;min-height:0;height:auto;width:100%}
 .picture-name{font-size:clamp(24px,4.5vh,35px);line-height:1.35}
 .letter-card{height:100%;min-height:0;gap:clamp(10px,2vh,20px)}
 .flip-scene{flex:1 1 0;min-height:0;height:auto;max-height:260px;width:auto;max-width:100%;aspect-ratio:245/250}
 .card-letter .huge-letter{font-size:clamp(68px,14vh,128px)}
 .listen{flex:none;min-height:clamp(58px,9vh,80px)}
 .write-area{grid-template-columns:clamp(150px,17vw,210px) minmax(0,1fr);gap:20px}
 .demo-box{display:flex;flex-direction:column;align-items:center;min-height:0;padding:12px}.demo-box p{display:none}
 .demo-canvas{flex:1 1 0;min-height:0;width:100%;height:auto;object-fit:contain;margin:8px 0}
 .replay{flex:none}
 .writing{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto minmax(0,1fr);gap:10px 12px;min-height:0}
 .stages{grid-column:1;grid-row:1;margin:0}.stages button{min-height:66px}.stages button>svg{height:50px}
 .pad-tools{grid-column:2;grid-row:1;margin:0;align-self:center}.pad-tools .icon-tool{width:64px;height:64px;min-height:64px}
 .pad-wrap{grid-column:1/-1;grid-row:2;aspect-ratio:auto;min-height:0}
 .quiz-area{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.25fr);grid-template-rows:minmax(0,1fr) auto;column-gap:24px;align-items:center}
 .quiz-picture{grid-column:1;grid-row:1;margin:0;min-height:0;height:100%}.quiz-picture svg{flex:1 1 0;min-height:0;height:auto;width:100%}
 .small-listen{grid-column:1;grid-row:2;justify-self:center;margin:6px 0}
 .answers{grid-column:2;grid-row:1;margin:0}.feedback{grid-column:2;grid-row:2;margin:6px 0}
 .answers .answer-choice{height:clamp(100px,22vh,160px);width:clamp(92px,20vh,148px)}.answer-front{font-size:clamp(52px,11vh,84px)}
 /* speaking practice gets its own row under the picture and letter card, which give up the height it needs */
 .lesson-card{grid-template-rows:auto minmax(0,1fr) auto auto auto}
 .lesson-card>.speech-practice{grid-column:1/-1;grid-row:3;margin:0;min-height:0;padding:8px 18px;gap:16px}
 .lesson-card>.tiny-note{grid-row:4}.lesson-card>.bottom-bar{grid-row:5}
 .speech-practice .speak-button{width:64px;height:64px;min-width:64px}
 /* the Home Screen invitation floats between Back and Next instead of pushing the lesson down; on the map, the map makes room */
 body:has(.lesson-card) .install-banner{position:fixed;left:50%;bottom:12px;transform:translateX(-50%);z-index:40;width:min(540px,calc(100vw - 480px));margin:0;box-shadow:0 10px 28px rgba(60,70,40,.2)}
 body:has(.map) .install-banner{margin:0 auto 8px;padding:8px 14px}
 body:has(.install-banner) .map{--h:clamp(330px,calc(100vh - 290px),780px);--h:clamp(330px,calc(100dvh - 290px),780px)}
}
/* Speaking practice: one large picture control, with a calm, visible recording state. */
.speech-practice{display:flex;align-items:center;gap:20px;background:#edf2e1;border:1px solid #dbe4c9;border-radius:23px;padding:16px 22px;margin:20px 0 8px;position:relative;min-height:120px}.speak-button{width:82px;height:82px;min-width:82px;border-radius:50%;background:#fffefa;color:#587846;box-shadow:0 5px 0 #cddbbb;display:grid;place-items:center}.speak-button svg{width:47px;height:47px;fill:currentColor}.speech-copy{flex:1;min-width:0}.speech-copy strong{font-size:20px}.speech-copy strong span{margin-left:8px;font-size:26px}.speech-copy p{font-size:17px;line-height:1.5;margin:5px 0}.speech-copy small{color:#677460;word-break:break-word}.speech-cancel{background:transparent;text-decoration:underline;border-radius:10px;font-size:14px;padding:8px}.record-stop{height:26px;width:26px;border-radius:7px;background:currentColor}.speech-practice[data-phase=recording]{background:#fff1e6;border-color:#efd0b5}.speech-practice[data-phase=recording] .speak-button{background:#df8b65;color:white;box-shadow:0 0 0 8px #f5d9c8;animation:mic-breathe 1.5s ease-in-out infinite}.speech-practice[data-phase=thinking] .speak-button{opacity:.7;animation:mic-breathe 2s infinite}.speech-practice[data-phase=match]{background:#e8f1d5}.speech-practice[data-phase=match] .speak-button{background:#e5b957;color:white;font-size:46px}.voice-ripples{display:none;height:20px;align-items:center;gap:5px;margin-top:7px}.voice-ripples i{width:5px;height:9px;border-radius:5px;background:#c77e58;animation:voice-bounce .8s ease-in-out infinite alternate}.voice-ripples i:nth-child(2n){animation-delay:.2s}.voice-ripples i:nth-child(3){animation-delay:.4s}.speech-practice[data-phase=recording] .voice-ripples{display:flex}.model-mascot{background:#eaf0da;width:90px;height:90px;padding:20px;border-radius:50%;margin:20px auto}.model-mascot svg{width:100%;height:100%;fill:#587846;color:#587846}#model-message{padding:14px;border-radius:14px;background:#f0f2e5}#prepare-model{width:100%;text-align:center}#prepare-model:disabled{opacity:.7}.dialog-actions{display:flex;flex-wrap:wrap;gap:10px;margin:15px 0}
.install-banner{max-width:924px;margin:0 auto 12px;padding:12px 16px;border:1px solid #e5d9bd;background:#f5ecd8;border-radius:20px;display:flex;align-items:center;gap:13px}.install-banner img{border-radius:15px}.install-banner>div{flex:1}.install-banner strong{font-size:15px;display:block}.install-banner span{font-size:13px;color:#6c765e;display:block;margin-top:4px}.install-open{background:#fffefa;font-size:14px;border-radius:12px;padding:10px 18px;white-space:nowrap}.install-dismiss{font-size:25px;background:transparent;min-width:44px}.install-icon{display:block;margin:24px auto 12px;border-radius:23px;box-shadow:0 4px 0 #dce4c8}.install-steps{list-style:none;padding:0;display:grid;gap:12px}.install-steps li{display:flex;align-items:center;gap:14px;background:#f0f2e5;border-radius:16px;padding:16px;font-size:17px;line-height:1.55}.install-steps b{display:grid;place-items:center;background:white;width:30px;min-width:30px;height:30px;border-radius:50%;font-size:17px}.install-steps svg{width:36px;min-width:36px;height:36px;stroke:#657f54;stroke-width:3;fill:none;stroke-linecap:round;stroke-linejoin:round}.install-steps .menu-dots{font-size:35px;min-width:36px;text-align:center}.install-guide .guide-done,.install-now{width:100%;text-align:center}.install-footnote{font-size:13px!important}.install-guide p{line-height:1.7}.install-banner+main{padding-top:0}
@keyframes mic-breathe{50%{transform:scale(1.06)}}@keyframes voice-bounce{to{height:20px}}
@media(max-width:980px){.install-banner{margin-left:22px;margin-right:22px}}
@media(max-width:560px){.speech-practice{padding:14px;gap:13px;flex-wrap:wrap;border-radius:20px}.speak-button{width:66px;min-width:66px;height:66px}.speak-button svg{width:38px;height:38px}.speech-copy strong{font-size:18px}.speech-copy p{font-size:15px}.speech-copy strong span{font-size:24px}.speech-cancel{position:absolute;right:4px;top:-42px}.install-banner{margin:0 13px 12px;padding:10px;gap:9px;flex-wrap:wrap}.install-banner img{width:42px;height:42px}.install-banner>div{min-width:180px}.install-banner strong{font-size:13px}.install-banner span{font-size:12px}.install-open{margin-left:51px;min-height:44px}.install-dismiss{margin-left:auto}.install-steps li{padding:12px;gap:10px;font-size:15px}}
@media(prefers-reduced-motion:reduce){.speak-button,.voice-ripples i{animation:none!important}}
/* Member account: Google's button on the map, the member's picture once signed in. */
.header-actions{display:flex;align-items:center;gap:8px}.google-slot{min-height:44px;display:flex;align-items:center}.google-slot:empty{min-width:0}
.account-chip{display:flex;align-items:center;gap:8px;background:white;border:1px solid var(--line);border-radius:999px;padding:4px 14px 4px 4px;min-height:48px;font-weight:600;font-size:15px}.account-chip img,.account-initial{width:38px;height:38px;border-radius:50%;object-fit:cover;flex-shrink:0}.account-initial{display:grid;place-items:center;background:#e4eccc;color:var(--green);font-size:18px}
#google-dialog{margin:4px 0 6px}
@media(max-width:560px){.account-chip{padding:4px}.account-name{display:none}}
/* Sign-in page: the only screen before a grown-up signs in. */
.login-main{min-height:100vh;min-height:100dvh;display:flex;align-items:center;justify-content:center;padding:24px 16px}
.login-screen{width:100%;max-width:480px;display:flex;flex-direction:column;align-items:center;gap:14px}
.login-lang{display:flex;gap:4px;background:#ecebdf;border-radius:999px;padding:4px;align-self:flex-end}.login-lang button{min-height:40px;padding:6px 16px;border-radius:999px;background:transparent;font-size:15px;color:var(--muted)}.login-lang .selected{background:white;color:var(--ink);font-weight:700;box-shadow:0 1px 3px #0001}
.login-card{width:100%;background:#fffefa;border:1px solid var(--line);border-radius:30px;padding:30px 28px 24px;text-align:center;box-shadow:0 6px 0 #e7ead9}
.login-sprout svg{width:96px;height:96px}.login-card h1{font-size:36px;letter-spacing:-1.5px;margin:2px 0 6px}.login-card h1 span{color:#8ba668}
.login-lead{font-size:19px;font-weight:600;margin:0 0 8px}.login-who{font-size:15px;line-height:1.6;color:var(--muted);margin:0 0 20px}
.login-buttons{display:flex;flex-direction:column;align-items:center;gap:12px;min-height:96px}.login-wait{color:var(--muted);font-size:15px}
.line-login{display:inline-flex;align-items:center;gap:10px;background:#06C755;color:white;text-decoration:none;font-weight:700;font-size:16px;height:44px;padding:0 22px 0 10px;border-radius:999px;min-width:240px;justify-content:center}.line-login:hover{background:#05b34c}.line-login:active{background:#048b3b}.line-login svg{width:30px;height:30px}
.login-legal{font-size:13px;line-height:1.6;color:#818a76;margin:20px 0 0}.login-legal a{color:var(--green)}
.made-by{font-size:14px!important}
/* Word friends: three everyday words after the matching game. */
.word-friends{text-align:center;display:flex;flex-direction:column;justify-content:center;min-height:0}
.word-friends h2{font-size:24px;margin:0 0 4px}.word-friends h2 span{color:var(--green);font-size:32px}
.twin-note{font-size:15px;color:var(--muted);margin:0 0 6px}
.word-cards{display:flex;justify-content:center;gap:18px;margin:10px 0 6px}
.word-card{position:relative;flex:1;max-width:220px;display:flex;flex-direction:column;align-items:center;gap:2px;background:#fffefa;border:2px solid #dfe6cf;border-radius:24px;padding:12px 10px 14px;box-shadow:0 5px 0 #dfe6cf;animation:word-in .6s cubic-bezier(.3,1.5,.5,1) both;animation-delay:var(--card-delay)}
.word-card:active{transform:scale(.97)}.word-card.is-playing{border-color:#93a970;box-shadow:0 5px 0 #b7c790,0 0 0 4px #e4eccc}
.word-kind{font-size:12px;font-weight:700;color:#7d8a6c;background:#eef2df;border-radius:999px;padding:2px 10px}
.word-emoji{font-size:58px;line-height:1.25}
.word-th{font-size:34px;line-height:1.5;font-weight:500}.word-th b{color:#d0663f;font-weight:700}
.word-mean{font-size:16px;color:var(--muted)}
.word-sound{position:absolute;top:8px;right:12px;color:var(--green);font-size:17px}
@keyframes word-in{from{opacity:0;transform:translateY(16px) scale(.85)}to{opacity:1;transform:none}}
@media(orientation:landscape) and (min-width:900px) and (min-height:600px){.word-cards{margin:6px 0;gap:24px}.word-card{max-width:270px;padding:16px 12px 18px}.word-emoji{font-size:clamp(48px,11vh,88px)}.word-th{font-size:clamp(28px,5.6vh,44px)}.word-mean{font-size:18px}.word-friends h2{font-size:26px}}
/* Thai Sprout is played with the device held sideways; upright phones and tablets get a turn-me screen. */
#rotate{display:none}
@media(orientation:portrait) and (pointer:coarse){html:not(.on-login) #rotate{display:flex;position:fixed;inset:0;z-index:1000;flex-direction:column;align-items:center;justify-content:center;gap:16px;padding:24px 16px;background:var(--paper);text-align:center}}
#rotate svg{width:150px;height:150px}#rotate .rotate-device{transform-origin:60px 60px;animation:rotate-hint 2.6s ease-in-out infinite}
#rotate h2{font-size:26px;margin:0}#rotate p{font-size:17px;color:var(--muted);margin:0;max-width:340px;line-height:1.6}
html[lang="zh-Hant"] #rotate [lang="en"],html:not([lang="zh-Hant"]) #rotate [lang="zh-Hant"]{display:none}
@keyframes rotate-hint{0%,25%{transform:rotate(0)}55%,85%{transform:rotate(-90deg)}100%{transform:rotate(0)}}
@media(orientation:landscape) and (min-width:900px) and (min-height:600px){.lesson-card>.word-friends{grid-column:1/-1;grid-row:2;min-height:0;height:100%;margin:0}}
.word-card.heard{border-color:#9bb877;box-shadow:0 5px 0 #c5d6a6}.word-card.heard .word-sound{color:white;background:#7fa25c;border-radius:50%;width:24px;height:24px;display:grid;place-items:center;font-size:14px;top:6px;right:8px}
.word-card.nudge{animation:word-nudge .5s ease-in-out}
@keyframes word-nudge{20%{transform:translateX(-7px) rotate(-2deg)}40%{transform:translateX(6px) rotate(2deg)}60%{transform:translateX(-4px)}80%{transform:translateX(3px)}}
.words-count{font-size:17px;font-weight:600;color:var(--green);margin:6px 0 0}
.next.locked{opacity:.45;filter:grayscale(.7);box-shadow:none}
/* ===================================================================================================================
   Thai Sprout design system: paper and Korean sticker style (drafts in midjourney/, rules in docs/design/ui-system.md).
   Everything visual below maps onto a few tokens and eight component families; add new UI by reusing them, not by new colours.
   Textures (paper, grain, kraft, sea, dots) are images from docs/design/codex-backgrounds.md; until html.ui-art is set they are
   'none' and the CSS-drawn fallbacks underneath show instead.
   =================================================================================================================== */
:root{
 /* colour */
 --paper:#faf5e6;--cream:#fffaf0;--kraft:#f6eedb;--ink:#364333;--ink-soft:#6b6a52;--muted:#77745c;
 --leaf:#7cb35a;--leaf-deep:#5b8d3f;--honey:#f0c763;--honey-light:#f8dc85;--honey-deep:#c9953a;--coral:#e0704a;--sky:#a9dbe7;
 --pastel-green:#b9d993;--pastel-yellow:#f5d06e;--pastel-teal:#95cfca;--pastel-pink:#f6c1b8;--pastel-lilac:#d6c8ee;
 /* the sticker edge, depth and corners */
 --edge:#fff;--edge-w:4px;
 --shadow-pill:0 4px 0 #eadfc4,0 9px 18px rgba(140,110,50,.13);
 --shadow-sheet:0 8px 0 #ece1c5,0 20px 34px rgba(140,110,50,.14);
 --shadow-tile:0 6px 0 rgba(120,100,50,.13),0 14px 22px rgba(120,100,50,.14);
 --shadow-inset:inset 0 2px 6px rgba(120,100,50,.1);
 --r-pill:999px;--r-sheet:36px;--r-tile:26px;--r-panel:24px;
 --outline-text:3px 0 #fff,-3px 0 #fff,0 3px #fff,0 -3px #fff,2px 2px #fff,-2px 2px #fff,2px -2px #fff,-2px -2px #fff,0 7px 9px rgba(70,50,15,.2);
 --outline-pic:drop-shadow(2.5px 0 0 #fff) drop-shadow(-2.5px 0 0 #fff) drop-shadow(0 2.5px 0 #fff) drop-shadow(0 -2.5px 0 #fff) drop-shadow(0 5px 5px rgba(70,50,15,.2));
 /* textures (images arrive from Codex) */
 --tex-paper:none;--tex-grain:none;--tex-kraft:none;--tex-sea:none;--tex-dots:none;
 /* CSS fallbacks */
 --fallback-grain:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .42 0 0 0 0 .34 0 0 0 0 .2 0 0 0 .08 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
 --fallback-waves:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='120'%3E%3Cg fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' opacity='.55'%3E%3Cpath d='M10 30q15-10 30 0t30 0 30 0'/%3E%3Cpath d='M150 86q14-9 28 0t28 0 28 0'/%3E%3Cpath d='M120 18q8-5 16 0'/%3E%3C/g%3E%3C/svg%3E");
 --fallback-dots:radial-gradient(circle,rgba(255,255,255,.55) 0 2.5px,transparent 3.5px);
}
html.ui-art{--tex-paper:url("assets/ui/paper.webp");--tex-grain:url("assets/ui/grain.webp");--tex-kraft:url("assets/ui/kraft.webp");--tex-sea:url("assets/ui/sea.webp");--tex-dots:url("assets/ui/dots.webp")}
svg.defs{position:absolute;width:0;height:0;overflow:hidden}

/* 1. page: warm paper */
body{background-color:var(--paper);background-image:var(--tex-paper),var(--fallback-grain);background-size:512px,180px}

/* 2. sheet: the big cream surfaces that hold a screen */
.lesson-card,.login-card,dialog,.install-banner,.cheer-banner{background:var(--tex-grain),var(--cream);background-size:512px;border:6px solid var(--edge);border-radius:var(--r-sheet);box-shadow:var(--shadow-sheet);color:var(--ink)}
dialog{border-radius:32px}dialog::backdrop{background:rgba(70,60,30,.35);backdrop-filter:blur(2px)}
dialog h3{color:var(--ink)}dialog p{color:var(--ink-soft)}
.install-banner{border-radius:var(--r-pill);border-width:4px}

/* 3. panel: a recessed kraft area inside a sheet (demo, writing pad, picture, speaking) */
.demo-box,.pad-wrap,.picture-card,.speech-practice{background:var(--tex-kraft),var(--kraft);background-size:512px;border:var(--edge-w) solid var(--edge);border-radius:var(--r-panel);box-shadow:var(--shadow-inset),0 3px 0 #ece1c5}
.pad-wrap{background:#fffdf8}
.demo-canvas{border-radius:16px;box-shadow:0 0 0 3px #fff,0 3px 0 #e8dcc0}

/* 4. sticker tile: pastel card with a thick white die-cut edge */
.word-card,.alphabet-grid button,.celebration-letters span,.stages button,.card-face,.answers .answer-face{border:var(--edge-w) solid var(--edge);border-radius:var(--r-tile);box-shadow:var(--shadow-tile)}
.word-card{border-width:7px;border-radius:28px;outline:2px solid rgba(255,255,255,.65);outline-offset:-15px;padding:16px 12px 18px}
.word-card:nth-child(3n+1),.alphabet-grid button:nth-child(5n+1),.celebration-letters span:nth-child(4n+1){background:var(--tex-grain),var(--pastel-green)}
.word-card:nth-child(3n+2),.alphabet-grid button:nth-child(5n+2),.celebration-letters span:nth-child(4n+2){background:var(--tex-grain),var(--pastel-yellow)}
.word-card:nth-child(3n+3),.alphabet-grid button:nth-child(5n+3),.celebration-letters span:nth-child(4n+3){background:var(--tex-grain),var(--pastel-teal)}
.alphabet-grid button:nth-child(5n+4),.celebration-letters span:nth-child(4n+4){background:var(--tex-grain),var(--pastel-pink)}
.alphabet-grid button:nth-child(5n+5){background:var(--tex-grain),var(--pastel-lilac)}
.word-card,.alphabet-grid button,.celebration-letters span{background-size:512px}
.alphabet-grid button,.celebration-letters span{color:var(--ink);text-shadow:var(--outline-text)}
.alphabet-grid small{color:var(--ink-soft);text-shadow:none;font-weight:600}
.celebration-letters span{border-radius:22px}
/* flip letter card and game cards: dotted pastel back, cream face */
.card-cover,.answer-cover{background:var(--tex-dots),var(--fallback-dots) 0 0/22px 22px,var(--pastel-green);color:var(--leaf-deep)}
.card-stitch{border:2px dashed rgba(255,255,255,.85)}
.card-letter,.answer-front{background:var(--tex-grain),var(--cream);background-size:512px}
.cover-sound{background:#fff;box-shadow:var(--shadow-pill)}
.answers .correct .answer-front{background:var(--pastel-green);border-color:var(--edge)}
.answers .try-again .answer-front{background:var(--pastel-pink);border-color:var(--edge)}
.answers .hint-answer .answer-face{box-shadow:var(--shadow-tile),0 0 0 6px #ffe39a}
/* writing-mode buttons: pastel tiles; the chosen one turns green with the same gold check badge as heard word cards */
.stages button{background:var(--tex-grain),#fff;background-size:512px}
.stages .selected{background:var(--tex-grain),var(--pastel-green);box-shadow:var(--shadow-tile);color:var(--ink)}
.mode-check,.word-card.heard .word-sound{background:linear-gradient(var(--honey-light),#e9b54c);border:3px solid #fff;box-shadow:0 3px 0 var(--honey-deep)}
.mode-check{width:30px;height:30px;right:4px;top:4px}

/* 5. buttons: three puffy pills (primary honey, secondary white, action green), round icons, quiet links */
.next,.install-now,.guide-done{background:linear-gradient(var(--honey-light),var(--honey) 55%,#e7b24c);color:#5a3f12;border:4px solid var(--edge);border-radius:var(--r-pill);box-shadow:inset 0 3px 0 rgba(255,255,255,.55),0 5px 0 var(--honey-deep),0 12px 18px rgba(170,120,40,.25);font-weight:700}
.next.ready{animation:none}
.home-button,.parents-button,.account-chip,.back,.replay,.small-listen,.dialog-button,.install-open,.hint-button{background:#fff;border:3px solid var(--edge);border-radius:var(--r-pill);box-shadow:var(--shadow-pill);color:var(--ink);font-weight:600}
.hint-button{background:#fff3cf}
.dialog-button{text-align:center;padding:12px 22px}
.listen{background:linear-gradient(#93c46d,#6fa24f);color:#fff;border:4px solid var(--edge);border-radius:var(--r-pill);box-shadow:inset 0 3px 0 rgba(255,255,255,.35),0 5px 0 #4f7d36,0 12px 18px rgba(60,100,40,.22)}
.icon-tool,.pad-tools .icon-tool,.dialog-head button,.install-dismiss,.speak-button{background:#fff;border:3px solid var(--edge);border-radius:50%;box-shadow:var(--shadow-pill);color:var(--leaf-deep)}
.pad-tools .icon-tool{border-radius:22px}
.icon-tool svg{stroke:var(--ink-soft)}
.text-button,.quiet,.speech-cancel{background:none;color:var(--leaf-deep);text-decoration:underline;text-underline-offset:3px;font-weight:600}
.next.locked{opacity:.45;filter:grayscale(.7);box-shadow:none}

/* 6. chips, toggles and progress */
.login-lang{background:#fff;border:3px solid var(--edge);box-shadow:var(--shadow-pill)}
.login-lang .selected{background:linear-gradient(var(--honey-light),var(--honey));color:#5a3f12;box-shadow:inset 0 2px 0 rgba(255,255,255,.5)}
.account-initial{background:linear-gradient(var(--honey-light),var(--honey));color:#5a3f12}
.step-dots i,.words-progress i{height:11px;border-radius:var(--r-pill);background:#ebe3cb;box-shadow:inset 0 2px 0 rgba(0,0,0,.05)}
.step-dots .filled,.words-progress i.on{background:linear-gradient(90deg,#f3c95e,#ea9a45)}
.words-progress{display:flex;gap:6px;width:min(280px,60%);margin:10px auto 0}.words-progress i{flex:1;height:12px;transition:background .3s}
.number{background:radial-gradient(circle at 35% 30%,#fffbe9,#f6dd9c);color:#7a561a;border:3px solid var(--edge);box-shadow:0 3px 0 #e6cf95,0 6px 10px rgba(150,110,40,.18)}

/* 7. speech bubbles and feedback: white or tinted stickers */
.coach{background:#fff;border:3px solid var(--edge);border-radius:var(--r-pill);box-shadow:var(--shadow-pill);padding-left:10px}
.coach-face svg,.brand svg{overflow:visible}
#toast{background:var(--ink);color:#fff;border:4px solid var(--edge);border-radius:var(--r-pill);box-shadow:var(--shadow-sheet);font-weight:600}
.cheer-banner{color:var(--leaf-deep);border-radius:var(--r-pill);text-shadow:var(--outline-text)}
.try-bubble{background:var(--pastel-pink);color:#7a3d26;border:4px solid var(--edge);border-radius:var(--r-pill);box-shadow:var(--shadow-pill)}
.hint-glow{box-shadow:var(--shadow-pill),0 0 0 6px #ffe39a!important}
.here b{position:relative;background:var(--leaf);color:#fff;border:3px solid var(--edge);border-radius:16px;padding:3px 14px;font-size:16px;box-shadow:0 3px 0 var(--leaf-deep),0 6px 10px rgba(50,90,30,.2)}
.here b::after{content:'';position:absolute;left:50%;top:-9px;transform:translateX(-50%);border:6px solid transparent;border-bottom-color:#fff}
.here{top:-14%}.here svg{width:58px;height:58px;filter:none}
.island .enter,.island.ready .enter{background:linear-gradient(var(--honey-light),var(--honey));color:#5a3f12;border:3px solid var(--edge);box-shadow:0 4px 0 var(--honey-deep)}

/* 8. the sea map */
.map{background:var(--tex-sea) 0 0/1024px 512px,var(--fallback-waves) 0 0/260px 120px,linear-gradient(180deg,#b9e3ec,#9dd3e2 55%,#a9dbe7);border:6px solid var(--edge);box-shadow:0 8px 0 #d3e6ea,0 18px 30px rgba(60,110,130,.15)}
.map-path path{stroke-width:5;stroke-dasharray:.1 12;opacity:1}
.island-art .water{display:none}
.island-art .sun circle,.island-art .rain-cloud>path{stroke:#fff;stroke-width:5;paint-order:stroke}
.island-name{background:#fff;border:3px solid var(--edge);border-radius:var(--r-pill);box-shadow:var(--shadow-pill)}
.island-name small{background:linear-gradient(#f6cf6f,#e3a94a);box-shadow:inset 0 2px 0 rgba(255,255,255,.5)}
.island-stars{background:#fff;border-radius:var(--r-pill);padding:3px 10px 4px;box-shadow:0 3px 0 rgba(60,110,130,.15);font-size:17px}
.fog{background:radial-gradient(#ffffffee 32%,#ffffff00 70%)}.fog svg{width:46px;height:50px}

/* screen specifics: sign-in stickers */
.login-main{position:relative;overflow:hidden}
.login-stickers{position:fixed;inset:0;pointer-events:none;z-index:0}
.ls{position:absolute;font-size:clamp(40px,7vh,72px);font-weight:800;line-height:1;text-shadow:var(--outline-text);animation:sticker-float 6s ease-in-out infinite}
.ls-star,.ls-apple,.ls-leaf{text-shadow:none;filter:var(--outline-pic);font-size:clamp(30px,5vh,48px)}
.ls-k{left:8%;top:16%;color:var(--leaf);rotate:-10deg}.ls-kh{left:12%;top:62%;color:var(--coral);animation-delay:-2s}.ls-kho{right:10%;top:20%;color:#d6a23e;animation-delay:-4s}.ls-ng{right:14%;top:68%;color:#5aa8bd;animation-delay:-1s}
.ls-star{right:22%;top:9%}.ls-apple{left:22%;top:84%;animation-delay:-3s}.ls-leaf{right:6%;top:46%;animation-delay:-5s}
.ls-isle{left:4%;top:38%;width:clamp(110px,16vh,170px);animation-delay:-2.5s}.ls-isle svg{width:100%;height:auto;display:block}
.ls-isle .island-art{filter:none;animation:none}.ls-isle .alive-only{opacity:1}.ls-isle .wither-only{display:none}
@keyframes sticker-float{50%{translate:0 -8px}}
.login-screen{position:relative;z-index:1}
/* the stickers sit inside the sign-in screen, so the card and language switch must stack above them */
.login-lang,.login-card{position:relative;z-index:1}
/* held upright the card fills the middle, so the stickers move to the top and bottom edges */
@media(orientation:portrait){
 .ls-k{left:6%;top:4%}.ls-leaf{left:30%;right:auto;top:6%}.ls-star{right:30%;top:3%}.ls-kho{right:6%;top:5%}
 .ls-kh{left:6%;top:auto;bottom:5%}.ls-apple{left:30%;top:auto;bottom:3%}.ls-ng{right:32%;top:auto;bottom:6%}
 .ls-isle{left:auto;right:4%;top:auto;bottom:2%;width:clamp(90px,11vh,140px)}
}
.login-card{border-radius:38px}
.login-sprout svg{width:132px;height:132px;overflow:visible;animation:isle-bob 4s ease-in-out infinite}
.login-card h1{font-size:40px}
.google-pill{background:#fff;border:3px solid var(--edge);border-radius:var(--r-pill);padding:6px 8px;box-shadow:var(--shadow-pill);min-width:252px;display:flex;justify-content:center}
.line-login{height:54px;min-width:252px;background:linear-gradient(#2fd46f,#06C755 55%,#05b34c);border:4px solid var(--edge);box-shadow:inset 0 3px 0 rgba(255,255,255,.35),0 5px 0 #04913d,0 12px 18px rgba(6,150,70,.22);font-size:17px}

/* screen specifics: word cards */
.word-card.heard{border-color:#fffdf6}
.word-card.is-playing{box-shadow:var(--shadow-tile),0 0 0 6px #ffe9a6}
.word-kind{background:#fff;color:var(--ink-soft);padding:3px 12px;box-shadow:0 2px 0 rgba(0,0,0,.06)}
.word-pic{position:relative;display:grid;place-items:center;width:clamp(78px,15vh,124px);aspect-ratio:1}
.word-pic img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}
.word-pic.has-art .word-emoji,.word-pic.art-loading .word-emoji{visibility:hidden}
.word-emoji{filter:var(--outline-pic)}
.word-th{color:var(--ink);text-shadow:var(--outline-text)}.word-th b{color:var(--coral)}
.word-mean{background:rgba(255,255,255,.85);color:var(--ink-soft);border-radius:var(--r-pill);padding:2px 14px;font-weight:600}
.word-sound{top:auto;bottom:10px;right:10px;width:30px;height:30px;display:grid;place-items:center;border-radius:50%;background:rgba(255,255,255,.85);color:var(--leaf-deep);font-size:15px}
.word-card.heard .word-sound{top:auto;bottom:8px;right:8px;width:34px;height:34px;color:#fff;font-size:17px}
.words-count{margin-top:6px}
.huge-letter{color:var(--leaf-deep);text-shadow:var(--outline-text)}
#rotate{background:var(--paper)}
@media(prefers-reduced-motion:reduce){.ls,.login-sprout svg{animation:none}}
.finish-card{background:var(--tex-grain),var(--cream);background-size:512px;border:6px solid var(--edge);border-radius:var(--r-sheet);box-shadow:var(--shadow-sheet);padding:44px 24px;margin-top:10px}
.big-star{color:var(--honey);text-shadow:var(--outline-text)}
.letter-pic{position:relative;display:grid;place-items:center}.letter-pic img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}.letter-pic.has-art>svg,.letter-pic.art-loading>svg{visibility:hidden}
.picture-card .letter-pic{width:min(92%,380px);aspect-ratio:768/640;height:auto;max-height:62%}.quiz-picture .letter-pic{width:clamp(200px,24vw,300px);aspect-ratio:768/640;height:auto}
.island-art .resident{filter:drop-shadow(0 3px 2px rgba(45,85,98,.25))}
.island.alive:not(.reviving) .resident{animation:resident-bob 3.2s ease-in-out infinite;transform-box:fill-box;transform-origin:center bottom}.island.alive .resident:nth-of-type(2n){animation-delay:-1.6s}
@keyframes resident-bob{50%{transform:translateY(-3px)}}

/* sign-in: a small tag over the button this device used last time */
.login-option{position:relative;display:flex;justify-content:center}
.last-used{position:absolute;top:-11px;right:-6px;z-index:1;background:linear-gradient(var(--honey-light),var(--honey));color:#5a3f12;border:2px solid var(--edge);border-radius:999px;padding:1px 9px;font-size:12px;font-weight:700;line-height:1.5;box-shadow:var(--shadow-pill);pointer-events:none}
/* a phone held sideways is normally scaled down as a whole (see the viewport script in index.html); if a browser ignores that,
   the header, Home Screen invitation and map shrink and the lessons scroll instead of squeezing into one view */
@media(orientation:landscape) and (max-height:599px){
 header{height:54px;padding:4px 16px;gap:8px}.home-button{min-height:44px;height:44px;padding:4px 14px}.brand svg{width:32px;height:32px}.brand strong{font-size:19px}
 .account-chip,.parents-button{min-height:44px;height:44px}
 main{padding-top:4px;padding-bottom:12px}
 .install-banner{padding:4px 10px;gap:10px;margin-bottom:6px}.install-banner img{width:36px;height:36px}.install-banner span{display:none}.install-open{min-height:40px;padding:6px 14px}.install-dismiss{min-height:40px}
 .map-screen{padding-bottom:4px}.map-screen h1{display:none}.map-screen>p{font-size:14px;margin:0 0 6px}.map-screen>.swipe-hint{display:none}
 /* below about 260px the island names overlap, so a very short screen scrolls a little instead */
 .map{--h:clamp(260px,calc(100vh - 92px),780px);--h:clamp(260px,calc(100dvh - 92px),780px)}
 body:has(.install-banner) .map{--h:clamp(260px,calc(100vh - 92px),780px);--h:clamp(260px,calc(100dvh - 92px),780px)}
}
/* the phone note shown after sign-in */
.device-tip{max-width:420px;text-align:center}.device-tip-sprout .mascot{width:76px;height:76px}
.device-tip h3{font-size:21px;line-height:1.4;margin:6px 0 8px}.device-tip p{font-size:16px;line-height:1.6;margin:0 0 18px}
@media(max-height:599px){.device-tip{padding:14px 22px}.device-tip-sprout .mascot{width:46px;height:46px}.device-tip h3{font-size:19px;margin:0 0 4px}.device-tip p{font-size:15px;margin:0 0 10px}}
