:root{--night:#071b3b;--sky:#123c70;--blue:#78c9f2;--cloud:#f9fdff;--green:#7ccc79;--gold:#ffd85a;--ink:#092448}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;font-family:"Trebuchet MS",Verdana,sans-serif;background:radial-gradient(circle at top,#214f83 0,#07162f 58%,#030b19 100%);color:white}
button{font:inherit}
.shell{min-height:100vh;display:grid;place-items:center;padding:18px}
.game-card{width:min(980px,100%);background:#f7fbff;border:3px solid rgba(255,255,255,.65);border-radius:28px;overflow:hidden;box-shadow:0 22px 70px rgba(0,0,0,.42)}
.game-header{display:flex;justify-content:space-between;align-items:center;padding:16px 22px 12px;color:var(--ink);background:linear-gradient(90deg,#fff,#eaf6ff)}
.eyebrow{margin:0;color:#2f865e;font-size:.78rem;font-weight:900;letter-spacing:.12em;text-transform:uppercase}
h1{margin:3px 0 0;font-size:clamp(1.25rem,3vw,2.1rem);line-height:1.05}
.icon-button{width:44px;height:44px;border-radius:50%;border:2px solid #c7dcf2;color:var(--ink);background:white;font-size:1.4rem;font-weight:900;cursor:pointer}
.progress-panel{display:grid;grid-template-columns:auto 1fr auto;gap:14px;align-items:center;padding:10px 22px;color:var(--ink);background:#e8f4ff;border-top:1px solid #d4e8fa}
.progress-item{display:flex;gap:8px;align-items:baseline;font-size:.88rem;font-weight:800}.progress-item strong{font-size:1.05rem}.progress-item.gold{color:#7a5400}
.progress-track{height:13px;border-radius:20px;background:#c9def1;overflow:hidden}.progress-track span{display:block;width:0;height:100%;background:linear-gradient(90deg,#68c87b,#f7d557);transition:width .35s}
.game{position:relative;height:min(66vh,610px);min-height:460px;overflow:hidden;isolation:isolate;background:linear-gradient(rgba(5,20,50,.16),rgba(3,19,31,.14)),url("assets/moonlit-forest-clean.png") center/cover;outline:none;touch-action:none}
.game:focus-visible{box-shadow:inset 0 0 0 4px var(--gold)}
.stars{position:absolute;inset:0;background-image:radial-gradient(circle,#fff 0 1px,transparent 1.8px);background-size:54px 49px;opacity:.35}
.roro{position:absolute;left:7%;top:50%;width:168px;height:134px;z-index:5;transform:translateY(-50%);filter:drop-shadow(0 8px 8px rgba(0,12,30,.65));transition:top .25s cubic-bezier(.2,.8,.3,1)}
.roro img{width:100%;height:100%;object-fit:contain}
.roro.flying{animation:bob .75s ease-in-out infinite alternate}
@keyframes bob{to{transform:translateY(-55%) rotate(2deg)}}
.collectible{position:absolute;right:-230px;top:50%;z-index:4;animation:travel 12.5s linear forwards;will-change:transform}
.collectible.cloud{width:180px;min-height:68px;padding:13px 16px;display:grid;place-items:center;text-align:center;color:#16365b;background:var(--cloud);border:4px solid #85d2f5;border-radius:50% 48% 46% 52%;font-weight:900;font-size:1rem;line-height:1.15;filter:drop-shadow(0 7px 0 rgba(26,89,134,.25));isolation:isolate}
.collectible.cloud::before,.collectible.cloud::after{content:"";position:absolute;z-index:-1;background:var(--cloud);border:4px solid #85d2f5;border-bottom:0}
.collectible.cloud::before{width:64px;height:39px;left:24px;top:-21px;border-radius:60px 60px 0 0;transform:rotate(-5deg)}
.collectible.cloud::after{width:75px;height:47px;right:21px;top:-27px;border-radius:70px 70px 0 0;transform:rotate(5deg)}
.collectible.gold-nugget{width:78px;height:72px;display:grid;place-items:center;color:#ffd54a;background:transparent;border:0;font-family:Arial,sans-serif;font-size:4.5rem;line-height:1;font-weight:900;-webkit-text-stroke:3px #fff0a0;filter:drop-shadow(0 0 13px #ffd943) drop-shadow(0 7px 0 #a8710b)}
@keyframes travel{to{transform:translateX(-1250px)}}
.message{position:absolute;z-index:8;left:50%;top:18%;transform:translate(-50%,-50%) scale(.8);margin:0;padding:12px 20px;border-radius:24px;background:#fff;color:var(--ink);font-size:1.15rem;font-weight:900;opacity:0;pointer-events:none;box-shadow:0 8px 22px rgba(0,0,0,.22)}
.message.show{animation:pop 1.1s ease}
.message.show.finale{left:50%;top:var(--final-top,25%);width:min(460px,calc(100% - 260px));padding:20px 26px;border:4px solid #85d2f5;border-radius:28px;font-size:clamp(1.25rem,4vw,2rem);line-height:1.25;animation:finalMessage 5.65s ease forwards}
.message.show.finale::before{content:"";position:absolute;left:-27px;bottom:18px;width:0;height:0;border-top:17px solid transparent;border-bottom:17px solid transparent;border-right:27px solid #85d2f5}
.message.show.finale::after{content:"";position:absolute;left:-19px;bottom:23px;width:0;height:0;border-top:12px solid transparent;border-bottom:12px solid transparent;border-right:20px solid #fff}
@keyframes pop{20%,70%{opacity:1;transform:translate(-50%,-50%) scale(1)}100%{opacity:0}}
@keyframes finalMessage{0%{opacity:0;transform:translate(-50%,-50%) scale(.82)}10%,88%{opacity:1;transform:translate(-50%,-50%) scale(1)}100%{opacity:0;transform:translate(-50%,-50%) scale(1.03)}}
.screen{position:absolute;z-index:20;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:26px;background:linear-gradient(155deg,rgba(5,25,60,.94),rgba(13,63,83,.93));backdrop-filter:blur(5px)}
.screen[hidden],.fact-toast[hidden]{display:none}
.start-screen img{width:132px;height:132px;object-fit:cover;object-position:47% 30%;border:5px solid white;border-radius:50%;box-shadow:0 0 35px rgba(255,255,255,.32)}
.mini-title{margin:14px 0 4px;color:#a7edb8;font-weight:900;letter-spacing:.08em;text-transform:uppercase;font-size:.78rem}
.screen h2,.fact-card h2{margin:4px 0 10px;font-size:clamp(2rem,6vw,3.8rem);line-height:1;color:#fff}
.screen>p:not(.mini-title,.controls,.final-message){max-width:590px;margin:5px auto 20px;font-size:1.06rem;line-height:1.5}
.primary-button{min-height:52px;padding:13px 25px;border:0;border-radius:999px;color:#092448;background:linear-gradient(#fff27e,#ffc942);font-weight:900;font-size:1.05rem;box-shadow:0 5px 0 #a76f07;cursor:pointer}.primary-button:active{transform:translateY(3px);box-shadow:0 2px 0 #a76f07}.primary-button.small{min-height:46px;font-size:.95rem}
.controls{margin:15px 0 0;font-size:.82rem;opacity:.78}
.fact-toast{position:absolute;z-index:12;left:50%;bottom:18px;width:min(620px,calc(100% - 24px));transform:translateX(-50%);display:flex;align-items:center;gap:14px;padding:13px 18px;border:3px solid #ffe78a;border-radius:22px;background:rgba(9,48,78,.94);box-shadow:0 12px 30px rgba(0,0,0,.38);animation:toastIn .3s ease}
.fact-toast .nugget{font-size:2.6rem;color:var(--gold);text-shadow:0 0 18px #ffdf59}.fact-toast p{margin:0;color:#ffe978;font-size:.7rem;font-weight:900;text-transform:uppercase;letter-spacing:.09em}.fact-toast h2{display:inline;margin:0 7px 0 0;color:white;font-size:1.02rem}.fact-toast span{font-size:.92rem;line-height:1.3}
@keyframes toastIn{from{opacity:0;transform:translate(-50%,18px)}to{opacity:1;transform:translate(-50%,0)}}
.sparkle-burst{color:#ffe66c;font-size:2rem}.collected-words{display:flex;flex-wrap:wrap;justify-content:center;gap:7px;max-width:650px;margin:5px 0 16px}.collected-words span{padding:7px 12px;border:2px solid #94daf6;border-radius:20px;background:#fff;color:#153958;font-weight:900;font-size:.85rem}.final-message{font-size:1.25rem;line-height:1.4;margin:0 0 18px}.final-message strong{color:#ffe76f;font-size:1.45rem}
footer{text-align:center;padding:11px;background:#0a3763;color:#fff4a5;font-weight:900;letter-spacing:.06em;font-size:.85rem}
@media(max-width:640px){.shell{padding:0}.game-card{border:0;border-radius:0;min-height:100vh}.game-header{padding:12px 14px 9px}.eyebrow{font-size:.66rem}.progress-panel{padding:8px 12px;grid-template-columns:1fr 1fr}.progress-track{grid-row:2;grid-column:1/3}.progress-item{justify-content:center;font-size:.72rem}.game{height:calc(100vh - 147px);min-height:480px}.roro{left:4%;width:126px;height:101px}.collectible.cloud{width:150px;min-height:60px;padding:11px 13px;font-size:.86rem}.collectible.cloud::before{width:54px;height:34px;left:20px;top:-18px}.collectible.cloud::after{width:63px;height:40px;right:17px;top:-23px}.collectible.gold-nugget{width:64px;height:58px;font-size:3.7rem}.message.show.finale{left:59%;width:52%;padding:16px 18px;font-size:1.12rem}.fact-toast{bottom:10px;padding:10px 12px}.fact-toast .nugget{font-size:2rem}.fact-toast h2{font-size:.9rem}.fact-toast span{font-size:.78rem}.screen{padding:20px}.start-screen img{width:110px;height:110px}.screen h2{font-size:2.35rem}}
@media(prefers-reduced-motion:reduce){.roro.flying{animation:none}.collectible{animation-duration:10s}}
