@font-face {
  font-family: Dubai;
  src: local("Dubai"), local("Dubai Regular"), local("Dubai-Regular"), url("../assets/reading-regular.woff") format("woff");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: Dubai;
  src: local("Dubai Bold"), local("Dubai-Bold"), url("../assets/reading-bold.woff") format("woff");
  font-weight: 700;
  font-display: swap;
}
:root{--ink:#343c47;--plum:#773244;--teal:#167b79;--coral:#ec7658;--cream:#fffaf0;--gold:#f6bb37;--paper:#fcf7ed;--muted:#777c78;--border:#e6ded1;font-family:Dubai,Arial,sans-serif;color:var(--ink);background:var(--paper);font-synthesis:none}*{box-sizing:border-box}body{margin:0;min-height:100vh;background:radial-gradient(ellipse at 0 0,#e5f0d75e,transparent 43%),var(--paper)}button,a,input{-webkit-tap-highlight-color:transparent}button{font:inherit;cursor:pointer;color:inherit}button{border:0;background:none}button:disabled{cursor:wait;opacity:.65}button:focus-visible,a:focus-visible,canvas:focus-visible{outline:3px solid #157e7c;outline-offset:5px}button{touch-action:manipulation}svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}.icons{position:absolute;width:0;height:0;overflow:hidden}a{color:inherit;text-decoration:none}.hidden,[hidden]{display:none!important}.site-header{max-width:1536px;padding:20px 34px 17px;margin:auto;display:flex;align-items:center;justify-content:space-between;gap:24px;height:94px}.brand{display:flex;align-items:center;gap:13px;font-size:26px;font-weight:700;line-height:1.05;color:var(--plum)}.brand b{font-size:32px}.brand small{display:block;font-size:11px;font-weight:400;color:#88796c;letter-spacing:.25px;margin-top:7px}.brand-spark{font-size:46px;color:#ecaa27;display:inline-block;transform:rotate(-12deg)}.header-center{font-size:14px;color:#828571;display:flex;align-items:center;gap:9px}.tiny-orbit{height:7px;width:7px;background:#77a577;border-radius:50%;box-shadow:0 0 0 5px #77a57713}.header-actions{display:flex;align-items:center;gap:12px}.text-button{display:flex;align-items:center;gap:8px;padding:8px 10px;font-size:14px}.text-button svg{width:21px;height:21px;color:var(--teal)}.text-button b{border-radius:20px;background:#eee8da;min-width:23px;height:23px;font-size:12px;line-height:25px}.icon-button{width:39px;height:39px;border:1px solid #e8e0d2;border-radius:50%;display:grid;place-items:center;transition:background .2s,transform .2s}.icon-button svg{width:18px;height:18px}.icon-button:hover{background:#f0e9db;transform:translateY(-1px)}main{max-width:1536px;margin:0 auto;padding:0 26px}.game-shell{isolation:isolate;position:relative;width:100%;aspect-ratio:16/9;max-height:calc(100dvh - 164px);min-height:620px;overflow:hidden;border-radius:26px;box-shadow:0 18px 50px -25px #324a4b4a,0 0 0 1px #c9d9cf;background:#b5e3e7;direction:ltr}#game{width:100%;height:100%;display:block;outline:none;touch-action:none;object-fit:cover}.menu-wash{position:absolute;inset:0;background:linear-gradient(90deg,transparent 24%,#fffaf008 39%,#fffaf0d9 58%,#fffaf0fa 76%);pointer-events:none}.menu{position:absolute;right:3.6%;top:22px;bottom:20px;width:42%;max-width:520px;display:flex;flex-direction:column;direction:rtl;justify-content:center}.edition{font-size:12px;display:flex;align-items:center;gap:9px;color:#8a8170}.edition span{font-size:11px;background:#edf0db;border:1px solid #d7dfb9;border-radius:7px;color:#64793d;padding:2px 8px;white-space:nowrap}.edition i{font-size:17px;font-style:normal;color:#d9a144}h1{margin:11px 0 6px;line-height:.98;letter-spacing:-1.8px;position:relative;align-self:flex-start}h1>span{display:block;font-size:clamp(42px,3.7vw,57px);font-weight:700;color:#388781}h1 strong{display:block;font-size:clamp(62px,5.1vw,80px);color:var(--plum);line-height:1.02}h1 strong:after{content:'';position:absolute;bottom:0;left:9px;right:8px;border-bottom:5px solid var(--gold);border-radius:0 0 50% 40%;transform:rotate(-4deg);z-index:-1}.title-star{font-size:40px;color:#e9a432;display:inline-block;position:absolute;left:-49px;top:27px;transform:rotate(12deg)}.intro{font-size:16px;line-height:1.65;color:#666f68;margin:12px 0 13px}.selection-label{display:flex;align-items:center;justify-content:space-between;font-size:13px;font-weight:700;margin:0 0 7px}.selection-label small{font-size:11px;color:#979686;font-weight:400}.hero-picker{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.hero-card{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:end;background:#fffdf8bb;border:1.5px solid #e1decf;border-radius:16px;padding:7px 5px 8px;transition:.2s;min-width:0;height:135px}.hero-card:before{content:'';position:absolute;top:11px;width:78px;height:78px;border-radius:50%;background:#f5e2c1;opacity:.42}.hero-card[data-hero=yasmine]:before{background:#c0ded4}.hero-card[data-hero=nada]:before{background:#d7c9e4}.hero-portrait{height:86px;width:98px;position:relative;overflow:hidden;display:block;margin-top:-7px}.hero-portrait canvas{width:100%;height:100%;object-fit:contain}.hero-name{font-weight:700;font-size:19px;line-height:1.15}.hero-trait{font-size:10px;color:#8e867a;margin-top:2px}.hero-card:hover{transform:translateY(-3px);border-color:#68a8a0}.hero-card.selected{border:2px solid #378c81;box-shadow:0 3px 0 #378c81;background:#f2f7ec}.selected-check{display:none;position:absolute;top:6px;right:7px;background:var(--teal);color:#fff;border-radius:50%;width:19px;height:19px;line-height:20px;font-size:11px;font-style:normal}.selected .selected-check{display:block}.world-select-label{margin-top:18px}.world-picker{display:grid;grid-template-columns:repeat(3,1fr);gap:9px}.world-card{border-radius:10px;border:1.5px solid #e3dfd2;background:#fffdf8;overflow:hidden;padding:0 0 3px;font-size:11px;transition:transform .2s,border-color .2s}.world-card.selected{border:2px solid var(--teal);background:#edf6ec}.world-card:hover{transform:translateY(-2px)}.world-thumb{height:39px;display:block;position:relative;overflow:hidden;background:#b6e0e0}.world-thumb:after{content:'';position:absolute;left:-8%;bottom:-24px;width:90%;height:42px;border-radius:50%;background:#76b8a0;box-shadow:60px -6px 0 #94c1a1}.world-thumb i{position:absolute;background:#f8dc7c;width:17px;height:17px;border-radius:50%;left:13px;top:7px}.world-thumb b{position:absolute;bottom:2px;left:40%;width:21px;height:27px;border-radius:3px 3px 0 0;background:#f1b27d;box-shadow:20px 7px 0 2px #efd6a1,-22px 10px 0 1px #f3cc94;z-index:1}.world-thumb em{position:absolute;bottom:3px;left:47%;height:14px;width:6px;background:#967d67;border-radius:5px 5px 0 0;z-index:2}.garden{background:#cfebbc}.garden b{border-radius:50%;background:#5d9f66;width:26px;height:26px;box-shadow:28px 4px 0 #89b669,-28px 7px 0 #398e74;bottom:10px}.garden em{background:#ad8159;width:4px;left:50%;height:12px}.garden:after{background:#69b17d;box-shadow:60px -6px 0 #a3c87c}.night{background:#444c86}.night i{background:#fae5ad;box-shadow:5px -3px 0 #444c86}.night b{background:#9a83b8;box-shadow:20px 7px 0 2px #716b9e,-22px 10px 0 1px #afa0c6}.night:after{background:#736b9f;box-shadow:60px -6px 0 #817daf}.night em{background:#ffdf9b}.start-button,.primary-button{display:flex;justify-content:center;align-items:center;gap:20px;background:#e9ad32;color:#493a25;border:1px solid #d99b22;border-bottom:4px solid #c88b25;border-radius:13px;font-weight:700;font-size:21px;min-height:53px;width:100%;transition:transform .16s,background .16s}.start-button{margin-top:18px}.start-button:hover,.primary-button:hover{background:#f4be43;transform:translateY(-2px)}.start-button:active,.primary-button:active{transform:translateY(2px);border-bottom-width:2px}.start-note{display:flex;gap:8px;align-items:center;justify-content:center;font-size:10px;color:#948772;margin-top:7px}.shuffle-icon{font-size:19px;line-height:1}.world-tag{position:absolute;left:26px;top:25px;display:flex;align-items:center;gap:8px;padding:6px 12px;border-radius:30px;background:#ffffffe6;box-shadow:0 2px 9px #436a6012;direction:rtl;font-size:12px;color:#50776c}.world-tag i{width:6px;height:6px;background:#72a577;border-radius:50%}.scene-caption{position:absolute;bottom:35px;left:38px;display:flex;align-items:center;gap:14px;direction:rtl;color:#255a54;font-size:18px;font-weight:700;text-shadow:0 1px #fff5}.scene-caption small{display:block;font-size:12px;font-weight:400;margin-top:2px}.caption-star{color:#e2a73d;font-size:33px}.game-footer{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:16px 4px 20px;color:#8b8e80;font-size:12px;direction:rtl}.control-legend{display:flex;gap:19px;direction:rtl}.control-legend>span{display:flex;align-items:center;gap:4px}kbd{font-family:inherit;font-size:11px;line-height:19px;min-width:22px;height:21px;padding:0 5px;background:#fffcf6;border:1px solid #dddccd;border-bottom:2px solid #d3d4c5;border-radius:5px;text-align:center;color:#6c7669;direction:ltr}.game-footer>button{font-size:12px;display:flex;align-items:center;gap:8px;color:var(--teal)}.game-footer>button span{border:1px solid #82a99b;border-radius:50%;width:19px;height:19px;line-height:18px}.footer-note{font-size:11px}.footer-note span{color:#c49a4e;padding-right:9px}
.hud{position:absolute;inset:0;pointer-events:none;direction:rtl}.hud-top{display:flex;align-items:start;justify-content:space-between;gap:20px;padding:22px}.player-hud{display:flex;align-items:center;gap:9px;background:#fffbeded;border:1px solid #fff;border-radius:19px;padding:8px 15px 8px 9px;box-shadow:0 4px 14px #2e616817;min-width:200px;height:73px}.player-hud canvas{width:44px;height:52px;object-fit:contain}.player-hud b{font-size:16px}.hearts{display:flex;gap:4px;margin-top:2px}.hearts svg{width:16px;height:16px;fill:#e97761;stroke:#c25e4d;stroke-width:1px}.hearts svg.empty{fill:#ddd7ca;stroke:#c8c4bc}.hud-divider{height:30px;border-left:1px solid #e3dbc6;margin:0 6px}.coin-total{display:flex;align-items:center;gap:6px;direction:ltr}.small-coin{display:grid;place-items:center;border-radius:50%;width:25px;height:25px;background:#ffcb4d;color:#a87825;border:2px solid #e4a033;box-shadow:inset 0 0 0 2px #ffe4a4}.coin-total b{font-size:23px;font-variant-numeric:tabular-nums}.word-hud{background:#fffbeded;box-shadow:0 5px 18px #3664631c;border:1px solid #fff;border-radius:18px;padding:10px 20px 12px;min-width:260px;position:absolute;left:50%;transform:translateX(-50%);top:22px}.word-heading{display:flex;align-items:center;justify-content:center;gap:7px;font-size:12px;white-space:nowrap;color:#858271}.word-heading strong{font-size:23px;color:#3c6f65;line-height:1.25}.word-heading>span:last-child{font-size:10px;opacity:.7;border-right:1px solid #d8d6c4;padding-right:8px}.letter-slots{display:flex;justify-content:center;gap:8px;margin-top:8px}.letter-slot{width:41px;height:42px;display:grid;place-items:center;border-radius:10px;background:#ebe9db;border:1px dashed #cccbbd;font-size:27px;font-weight:700;color:#b9b8aa;line-height:1}.letter-slot.collected{background:#ffdc7b;border:1px solid #e5b248;color:#83592a;box-shadow:0 3px 0 #d9a13e;animation:letterPop .38s cubic-bezier(.3,1.8,.6,1)}.letter-slot.next{border-color:#bc9b45;color:#c6b36e;background:#fcf2d2}.pause-button{pointer-events:auto;width:47px;height:47px;display:grid;place-items:center;background:#fffbeded;border:1px solid #fff;border-radius:15px;color:#4c726c;box-shadow:0 4px 14px #2e616817}.level-progress{position:absolute;bottom:24px;left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:12px;direction:ltr;background:#fffbedeb;border:1px solid #fff9;border-radius:24px;padding:7px 15px;font-size:11px;color:#4c7569}.progress-track{height:5px;width:140px;background:#dbdfc9;border-radius:9px;position:relative}.progress-track i{position:absolute;left:0;top:0;height:100%;width:0;background:#77a481;border-radius:9px}.progress-track b{position:absolute;left:0;top:-8px;color:#dfab3e;font-size:17px;font-weight:400}.goal-flag{font-size:20px;color:#bc7659}.game-tip{position:absolute;left:50%;transform:translateX(-50%);bottom:82px;padding:9px 20px;background:#fffaf0ed;border-radius:12px;border:1px solid #fff;box-shadow:0 4px 15px #45634b14;font-size:15px;color:#4b6f62;text-align:center;max-width:80%;transition:opacity .4s}.game-tip.faded{opacity:0}.speech-bubble{position:absolute;background:#fffdf3;border:2px solid #648c78;padding:9px 16px;border-radius:18px 18px 18px 3px;box-shadow:0 4px 0 #648c7830;color:#456452;font-weight:700;font-size:20px;transform:translate(-50%,-100%);white-space:nowrap;max-width:90%;z-index:2}.speech-bubble:after{content:'';position:absolute;left:13px;bottom:-8px;width:12px;height:12px;background:#fffdf3;border-bottom:2px solid #648c78;border-right:2px solid #648c78;transform:skew(10deg) rotate(45deg)}.celebration{position:absolute;left:50%;top:35%;transform:translate(-50%,-50%) rotate(-3deg);text-align:center;background:#fffcf1f5;border:3px solid #ecc056;box-shadow:0 10px 0 #97784420,0 15px 50px #8e954c24;border-radius:24px;padding:15px 55px;animation:celebrateIn .4s cubic-bezier(.3,1.5,.6,1)}.celebration>span{font-size:16px;color:#ba8742;display:block}.celebration strong{font-size:54px;line-height:1.2;color:var(--teal);display:block}.celebration small{font-size:14px;color:#7d8067}.game-fade{position:absolute;inset:0;background:#fff6e9;pointer-events:none;opacity:0;transition:opacity .2s}.game-fade.active{opacity:1}.loading-error{position:absolute;inset:30%;background:var(--cream);padding:30px;border-radius:16px;direction:rtl;text-align:center}.loading-error button{display:block;margin:20px auto 0;color:var(--teal);text-decoration:underline}
.modal{font-family:inherit;color:var(--ink);direction:rtl;max-width:min(480px,calc(100vw - 32px));max-height:calc(100dvh - 36px);width:100%;padding:35px 32px 25px;border:1px solid #f3e8ce;border-radius:27px;background:var(--cream);box-shadow:0 30px 100px #224a4b40;text-align:center}.modal::backdrop{background:#183f4980;backdrop-filter:blur(7px)}.modal-close{position:absolute;top:15px;left:15px;width:30px;height:30px;border-radius:50%;background:#eee8db;display:grid;place-items:center}.modal-close svg{width:15px;height:15px}.eyebrow{font-size:12px;letter-spacing:.1px;color:#b48a43;margin:5px 0 9px}.modal h2{font-size:32px;color:var(--teal);margin:4px 0 8px;line-height:1.3}.modal p{color:#827e6e;font-size:14px;line-height:1.8;margin:8px 0 22px}.modal-illustration{font-size:65px;color:#89b6b0;display:block;height:85px;line-height:80px}.primary-button{min-height:51px;font-size:18px;margin-top:18px}.primary-button svg{width:20px;height:20px}.secondary-button{width:100%;border:1px solid #d7dfce;border-bottom:3px solid #c8d3bd;border-radius:12px;background:#eaf0df;color:#5d7b61;font-size:16px;min-height:45px;margin-top:13px}.plain-button{font-size:13px;color:#9a8c74;text-decoration:underline;text-underline-offset:4px;margin-top:18px}.setting-row{display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #eae4d5;padding:13px 3px;font-size:14px;color:#66756a}.setting-row input{accent-color:var(--teal);width:18px;height:18px;cursor:pointer}.help-modal{max-width:min(530px,calc(100vw - 32px))}.help-step{display:flex;gap:15px;text-align:right;margin-top:20px}.help-step>b{display:grid;place-items:center;width:32px;height:32px;flex-shrink:0;background:#f8e4a8;color:#9b792c;border-radius:50%;font-size:19px}.help-step h3{margin:0;font-size:17px;font-weight:700;color:#4f7464}.help-step p{margin:3px 0;font-size:13px}.book-modal{max-width:min(550px,calc(100vw - 32px))}.book-modal h2{display:flex;align-items:center;justify-content:center;gap:10px}.book-modal h2 svg{width:27px;height:27px}.word-book{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;max-height:360px;overflow:auto;padding:5px}.word-book .entry{background:#f2eddd;border-radius:13px;min-height:87px;display:flex;flex-direction:column;justify-content:center;gap:4px;border:1px solid #e9dfc6}.entry b{font-size:25px;color:#52745d}.entry span{font-size:25px;line-height:1}.word-book .empty-book{grid-column:1/-1;color:#8f8b78;font-size:16px;padding:30px}.privacy-note{font-size:11px!important;margin:17px 0 0!important}.win-stars{color:#d9a229;font-size:30px;margin-bottom:8px}.win-stars b{font-size:68px;display:inline-block;transform:rotate(-7deg);line-height:1;vertical-align:middle;text-shadow:2px 3px #eac774}.win-words{display:flex;gap:10px;justify-content:center;flex-wrap:wrap}.win-words span{background:#f5e6b7;border:1px solid #e8d391;border-radius:14px;min-width:94px;padding:8px 13px;display:flex;flex-direction:column;font-size:26px;color:#7a6b3d}.win-words small{font-size:24px}.win-stats{display:flex;justify-content:space-around;margin:24px 0;gap:12px}.win-stats div{display:flex;flex-direction:column}.win-stats b{font-size:27px;color:var(--teal);line-height:1.2}.win-stats span{font-size:11px;color:#8f8a75}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
body.playing .game-shell{min-height:0;aspect-ratio:16/9;max-height:calc(100dvh - 160px)}body.playing #game{object-fit:cover}.game-shell:fullscreen{width:100vw;height:100dvh;max-height:none;min-height:0;border-radius:0}.game-shell:fullscreen .menu{max-width:560px;right:6%}.game-shell:fullscreen #game{object-fit:cover}.game-shell:fullscreen .hud-top{padding:30px}.game-shell:fullscreen .word-hud{top:30px}
.scene-caption{padding:9px 15px;border-radius:14px;background:#fffaf0df;box-shadow:0 3px 15px #4c58451a;text-shadow:none}.level-progress>span{white-space:nowrap}
.exit-fullscreen{position:absolute;top:24px;left:83px;z-index:8;width:43px;height:43px;border-radius:13px;background:#fffbedee;border:1px solid white;display:grid;place-items:center;color:#56756c}.exit-fullscreen svg{width:18px;height:18px}body.focus-mode{overflow:hidden}body.focus-mode .game-shell{position:fixed;inset:0;z-index:500;width:100vw;height:100dvh;max-height:none;min-height:0;border-radius:0;aspect-ratio:auto}body.focus-mode #game{object-fit:cover}body.focus-mode .menu{max-width:560px}body.focus-mode .site-header,body.focus-mode .game-footer{visibility:hidden}
@keyframes letterPop{from{transform:scale(.55) rotate(-15deg)}to{transform:scale(1) rotate(0)}}@keyframes celebrateIn{from{opacity:0;transform:translate(-50%,-30%) scale(.7) rotate(-6deg)}to{opacity:1;transform:translate(-50%,-50%) scale(1) rotate(-3deg)}}
@media(min-width:1600px){.game-shell{max-height:calc(100dvh - 170px)}.menu{right:4%;width:39%}.hero-card{height:147px}.hero-portrait{height:96px}.intro{margin-bottom:18px}.world-thumb{height:46px}.selection-label{font-size:14px}.start-button{min-height:57px}}
@media(max-width:1100px){.site-header{padding-inline:24px}.game-shell{min-height:595px}.menu{right:3%;width:45%}.title-star{left:-35px;font-size:30px}h1>span{font-size:43px}h1 strong{font-size:62px}.hero-card{height:122px}.hero-portrait{height:76px;width:85px}.hero-name{font-size:18px}.intro{font-size:14px;line-height:1.6}.edition{font-size:10px;gap:5px}.edition span{font-size:10px}.header-center{display:none}.footer-note{display:none}.scene-caption{font-size:16px;left:25px;bottom:28px}.hud-top{padding:15px}.word-hud{top:15px;padding:8px 15px}.player-hud{min-width:175px;height:65px;padding:5px 10px;gap:5px}.word-heading{font-size:11px}.word-heading strong{font-size:21px}.letter-slot{width:34px;height:36px;font-size:24px}.pause-button{width:42px;height:42px}.hud-divider{margin:0 3px}}
@media(max-width:740px){.site-header{height:78px;padding:14px 16px;gap:8px}.brand{font-size:20px;gap:7px}.brand b{font-size:25px}.brand-spark{font-size:34px}.brand small{font-size:9px;margin-top:5px}.header-actions{gap:6px}.text-button{padding:5px;font-size:12px;gap:5px}.text-button svg{width:17px}.icon-button{width:31px;height:31px}.icon-button svg{width:15px;height:15px}main{padding:0 12px}.game-shell{min-height:760px;max-height:none;border-radius:20px;aspect-ratio:auto}.menu-wash{background:linear-gradient(#fffaf0ec 0%,#fffaf0f2 70%,#fffaf05c 100%)}.menu{width:auto;max-width:440px;left:22px;right:22px;top:26px;bottom:100px;justify-content:flex-start;margin:auto}.edition{font-size:11px}.edition span{font-size:10px}h1{margin-top:15px}h1>span{font-size:49px}h1 strong{font-size:70px}.intro{font-size:15px;margin:14px 0 18px}.hero-card{height:135px}.hero-portrait{height:87px;width:95px}.hero-name{font-size:19px}.selection-label{font-size:13px}.world-select-label{margin-top:22px}.world-thumb{height:43px}.world-card{font-size:11px}.start-button{margin-top:21px;min-height:54px}.start-note{font-size:10px}.scene-caption{bottom:25px;left:24px;font-size:14px}.scene-caption small{font-size:11px}.world-tag{display:none}.game-footer{padding:15px 3px;gap:5px}.control-legend{gap:10px;font-size:10px;flex-wrap:wrap}.control-legend>span:nth-child(n+3){display:none}.game-footer>button{font-size:11px;white-space:nowrap}body.playing .game-shell{height:calc(100svh - 140px);min-height:350px;max-height:none;aspect-ratio:auto}body.playing #game{object-fit:cover}.hud-top{padding:12px;gap:7px}.player-hud{height:49px;min-width:135px;border-radius:13px;padding:5px 7px;gap:4px}.player-hud canvas{width:30px;height:38px}.player-hud b{font-size:13px}.hearts{gap:2px}.hearts svg{width:11px;height:11px}.hud-divider{height:24px}.coin-total{gap:4px}.coin-total b{font-size:17px}.small-coin{width:19px;height:19px;font-size:13px}.word-hud{top:74px;min-width:230px;border-radius:13px;padding:8px 14px}.word-heading{font-size:11px}.word-heading strong{font-size:22px}.letter-slot{width:32px;height:33px;font-size:23px}.letter-slots{gap:7px}.pause-button{width:39px;height:39px;border-radius:12px}.game-tip{bottom:134px;width:85%;max-width:90%;font-size:13px;padding:8px 13px}.level-progress{bottom:88px;width:auto;max-width:92%;font-size:10px;gap:8px;padding:4px 10px}.progress-track{width:88px}.speech-bubble{font-size:16px;padding:6px 12px}.celebration{padding:15px 30px;top:44%}.celebration strong{font-size:43px}.modal{padding:32px 25px 24px}.modal h2{font-size:28px}.game-shell:fullscreen .hud-top{padding:15px}.game-shell:fullscreen .word-hud{top:74px}}
@media(pointer:coarse){.level-progress{bottom:28px}.game-tip{bottom:105px}.control-legend{display:none}}
@media(max-width:740px) and (pointer:coarse){.level-progress{bottom:90px}.game-tip{bottom:140px}}
@media(max-height:570px) and (orientation:landscape){.site-header{height:58px;padding-block:8px}.brand small,.header-center{display:none}.game-shell{min-height:560px}body.playing .site-header,body.playing .game-footer{display:none}body.playing main{padding:0}body.playing .game-shell{height:100dvh;max-height:none;min-height:0;border-radius:0}.hud-top{padding:10px}.word-hud{top:10px}.word-heading{font-size:10px}.letter-slots{margin-top:5px}.letter-slot{width:30px;height:29px;font-size:22px}.level-progress{bottom:12px}.game-tip{bottom:70px}.modal{max-height:94dvh}.game-shell:fullscreen .word-hud{top:10px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:.01ms!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}

/* The Floating Book: one journey, six illustrated chapters. */
.campaign-map-button{border:1px solid #dedfc9;background:#fffdf3;padding:8px 15px;border-radius:30px;color:#557363;gap:8px}.campaign-map-button svg{width:17px;height:17px}.campaign-map-button>span{background:#e6edda;border-radius:10px;padding:1px 7px;font-size:10px;color:#5c7a58;direction:ltr}.menu h1{margin-bottom:0}.menu h1>span{font-size:45px}.menu h1 strong{font-size:67px}.adventure-subtitle{display:flex;align-items:center;gap:10px;font-weight:700;font-size:17px;color:#9d793d;margin-top:7px}.adventure-subtitle>span{font-size:16px;color:#d4a44c}.intro{font-size:14px;margin:9px 0 13px;line-height:1.6}.hero-card{height:126px}.hero-portrait{height:78px;width:96px}.world-select-label{margin-top:15px;margin-bottom:5px}.world-select-label>button{font-size:11px;color:#678778;padding:0}.world-select-label>button span{margin-right:3px}.campaign-strip{display:flex;align-items:center;justify-content:space-between;position:relative;gap:9px;padding:6px 4px}.campaign-strip:before{content:'';position:absolute;left:20px;right:20px;top:26px;border-bottom:2px dashed #c8d4bd;z-index:-1}.campaign-node{display:flex;align-items:center;justify-content:center;width:43px;height:41px;flex:1;max-width:62px;border-radius:12px;border:1px solid #d6ddc8;background:#fbf9ed;position:relative;transition:transform .2s}.campaign-node>span{font-size:18px;font-weight:700;line-height:1;color:#86a085}.campaign-node>i{position:absolute;bottom:2px;left:7px;font-size:10px;color:#93a58e;font-style:normal}.campaign-node.selected{background:#f9cf69;border-color:#d6a33f;box-shadow:0 3px 0 #d5a03d;transform:translateY(-2px)}.campaign-node.selected>span{color:#80622e}.campaign-node.done{background:#e1edcd;border-color:#91b589}.campaign-node.done>span{color:#44806b}.campaign-node.locked{opacity:.55;cursor:default;background:#eeeadd}.selected-chapter{display:flex;align-items:center;gap:12px;padding:10px 12px 7px;background:#f1f4e9c9;border:1px solid #dde3d1;border-radius:12px;margin-top:5px;min-height:54px}.selected-chapter>span:first-child{width:29px;height:29px;border-radius:9px;background:#e0e9d4;display:grid;place-items:center;color:#61906d;font-size:21px}.selected-chapter>div{flex:1}.selected-chapter b{display:block;font-size:15px;color:#50725e;line-height:1.2}.selected-chapter small{display:block;font-size:11px;color:#8b927b;line-height:1.7}.selected-chapter .chapter-number{font-size:28px;color:#c2cfb4;line-height:1}.start-button{margin-top:12px}.start-note{font-size:10px}.map-modal{max-width:min(820px,calc(100vw - 32px));padding:32px 35px 25px;background:#fffaed}.map-modal h2{font-size:32px}.map-modal>p{margin-bottom:24px}.map-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:17px}.map-chapter{border:2px solid #ddd9c4;border-radius:17px;background:#fffcf0;overflow:hidden;padding:0;text-align:right;transition:transform .2s,box-shadow .2s}.map-chapter:hover:not(:disabled){transform:translateY(-4px);box-shadow:0 8px 18px #6d8b742b}.map-art{height:112px;background-size:cover;background-position:center 55%;position:relative;isolation:isolate}.map-art:after{content:'';position:absolute;inset:0;z-index:-1;background:linear-gradient(0deg,#263e4b40,transparent 75%)}.map-number{position:absolute;right:9px;top:8px;width:29px;height:29px;line-height:30px;text-align:center;background:#fff8dc;border-radius:10px;font-weight:700;color:#557a65;font-size:17px;box-shadow:0 3px 0 #4f4c3a25}.map-type{position:absolute;left:8px;bottom:8px;border-radius:7px;padding:2px 7px;font-size:10px;color:#fff8e2;background:#4d6d62d4}.map-caption{padding:10px 12px}.map-caption b{display:block;font-size:17px;line-height:1.3;color:#4c725d}.map-caption small{display:block;margin-top:3px;font-size:11px;color:#8d987b}.map-chapter.locked{opacity:.72;cursor:default}.map-chapter.locked .map-art{filter:saturate(.45)}.map-lock{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);color:#fff5d4;stroke-width:2.2;width:30px;height:30px;filter:drop-shadow(0 2px 3px #1d302b)}.map-chapter.selected{border-color:#e4b146;box-shadow:0 3px 0 #d1a348}.map-chapter.done{border-color:#6b9d7a}.map-footer{display:flex;align-items:center;justify-content:space-between;font-size:14px;color:#65816b;margin-top:24px;padding-top:16px;border-top:1px dashed #d6d7bd}.map-footer small{font-size:12px;color:#a29a81}.spell-hud{position:absolute;top:105px;right:22px;border:1px solid #e0d49f;background:#fff9e9ed;border-radius:15px;display:flex;align-items:center;gap:10px;padding:9px 12px;min-width:200px;overflow:hidden;box-shadow:0 3px 12px #524e3921}.spell-icon{height:35px;width:35px;display:grid;place-items:center;border-radius:10px;background:linear-gradient(145deg,#5c807c,#315d66);color:#fbd97a;border:2px solid #cba85c;box-shadow:0 2px 0 #a88643}.spell-icon svg{width:23px;height:23px}.spell-hud b{font-size:14px;color:#597467;display:block;line-height:1.3}.spell-hud small{font-size:10px;color:#9b9278;display:block;line-height:1.4}.spell-hud kbd{margin-right:4px;background:#f5e1a2;color:#8c6e37;border-color:#dcbd70;width:25px;height:25px;font-size:13px;line-height:23px}.spell-hud>i{position:absolute;bottom:0;left:0;right:0;height:3px;background:#d5b459;transform-origin:right}.spell-hud.locked{opacity:.8;filter:saturate(.5)}.spell-hud.locked kbd{opacity:.3}.boss-hud{position:absolute;top:138px;left:50%;transform:translateX(-50%);width:240px;background:#352946e6;border:1px solid #c09bd8;border-radius:12px;padding:8px 14px 12px;text-align:center;box-shadow:0 4px 15px #402d6340}.boss-hud b{font-size:12px;color:#e7d0ed;display:block;margin-bottom:5px}.boss-hud>div{height:7px;border-radius:7px;background:#604c6e;overflow:hidden}.boss-hud i{display:block;height:100%;background:linear-gradient(90deg,#f1b183,#df82a1);border-radius:7px;transition:width .2s}.stage-intro{position:absolute;left:50%;top:42%;transform:translate(-50%,-50%);min-width:400px;text-align:center;padding:23px 35px;background:linear-gradient(120deg,#fffdf0f5,#fff8e3ef);border:1px solid #f3d899;border-radius:19px;box-shadow:0 8px 0 #7c74331a,0 15px 45px #244e5c21;animation:chapterIn .4s ease-out}.stage-intro>span{display:block;color:#b7964b;font-size:13px}.stage-intro strong{display:block;color:#407c73;font-size:38px;line-height:1.4}.stage-intro small{display:block;color:#837e68;font-size:13px;line-height:1.6}.game-shell:fullscreen .spell-hud{right:30px;top:111px}
@keyframes chapterIn{from{opacity:0;transform:translate(-50%,-42%) scale(.94)}to{opacity:1;transform:translate(-50%,-50%) scale(1)}}
@media(min-width:1600px){.menu{width:40%;max-width:535px}.menu h1>span{font-size:48px}.menu h1 strong{font-size:70px}.hero-card{height:132px}.hero-portrait{height:85px}.start-button{min-height:53px}.intro{font-size:15px}.selected-chapter{min-height:55px}}
@media(max-width:1100px){.menu h1>span{font-size:40px}.menu h1 strong{font-size:57px}.adventure-subtitle{font-size:15px}.hero-card{height:115px}.hero-portrait{height:70px}.intro{font-size:13px}.campaign-node{height:34px}.campaign-strip:before{top:22px}.selected-chapter{padding:7px 10px;min-height:48px}.spell-hud{right:15px;top:90px;min-width:175px;padding:7px 9px;gap:7px}.spell-hud small{font-size:9px}.spell-hud b{font-size:12px}.spell-icon{width:29px;height:29px}.spell-icon svg{width:19px;height:19px}}
@media(max-width:740px){.game-shell{min-height:815px}.menu{bottom:94px}.menu h1>span{font-size:43px}.menu h1 strong{font-size:65px}.adventure-subtitle{font-size:16px;margin-top:10px}.intro{font-size:14px;margin-top:9px}.hero-card{height:126px}.hero-portrait{height:81px}.world-select-label{margin-top:19px}.campaign-node{height:40px}.campaign-strip:before{top:26px}.selected-chapter{min-height:54px}.start-button{min-height:53px;margin-top:15px}.map-modal{padding:33px 18px 22px}.map-modal h2{font-size:25px}.map-grid{grid-template-columns:repeat(2,1fr);gap:12px}.map-art{height:95px}.map-caption{padding:8px}.map-caption b{font-size:15px}.map-caption small{font-size:10px}.map-footer{font-size:12px;gap:10px}.map-footer small{font-size:10px}.spell-hud{right:12px;top:174px;min-width:0;width:41px;height:43px;padding:0;display:grid;place-items:center;border-radius:12px;opacity:.85}.spell-hud>div,.spell-hud kbd{display:none}.spell-icon{width:31px;height:31px}.boss-hud{top:151px;width:200px}.boss-hud b{font-size:10px}.stage-intro{min-width:0;width:86%;padding:18px 20px;top:44%}.stage-intro strong{font-size:29px}.stage-intro small{font-size:12px}.game-shell:fullscreen .spell-hud{right:12px;top:174px}.control-legend>span:nth-child(n+3){display:none}}
@media(max-height:570px) and (orientation:landscape){.spell-hud{top:82px;right:12px;transform:scale(.85);transform-origin:top right}.boss-hud{top:103px;width:200px}.stage-intro{padding:12px 25px;min-width:310px;top:49%}.stage-intro strong{font-size:28px}.stage-intro small{font-size:11px}}
/* City adventure: health, found tools and an unobtrusive top progress rail. */
.health-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;font-weight:700;line-height:1.4;margin-top:3px;min-width:92px}.health-heading small{font-size:10px;color:#7d8875;font-weight:400}.health-heading span{font-size:12px;color:#438a67;font-variant-numeric:tabular-nums}.health-bar{height:9px;width:100%;min-width:92px;border-radius:6px;background:#e6e4d4;overflow:hidden;border:1px solid #d2d8c4;box-shadow:inset 0 1px 2px #334d4018;direction:ltr}.health-bar i{display:block;height:100%;background:linear-gradient(90deg,#68ae78,#9dcf79);border-radius:5px;transition:width .24s ease,background .2s}.health-bar.medium i{background:linear-gradient(90deg,#e9a343,#f0ce70)}.health-bar.low i{background:linear-gradient(90deg,#d25f5d,#f29c79)}
.level-progress,.game-shell:fullscreen .level-progress{top:0!important;bottom:auto!important;left:0!important;right:0!important;transform:none!important;width:100%!important;height:5px!important;padding:0!important;border:0!important;border-radius:0!important;background:#fff5cf33!important;box-shadow:none!important;gap:0!important;z-index:3}.level-progress>span,.level-progress #progress-hero{display:none!important}.level-progress .progress-track{height:5px!important;flex:1!important;margin:0!important;background:transparent!important;border:0!important;border-radius:0!important;overflow:hidden}.level-progress #progress-fill{height:100%;background:linear-gradient(90deg,#e5bd65,#f6dd99);border-radius:0}
.health-notice{position:absolute;top:100px;right:42px;border-radius:14px;padding:5px 14px;background:#fff4e9ed;color:#b6554c;border:1px solid #edb5a2;font-size:17px;font-weight:700;box-shadow:0 4px 14px #7f3d3421;z-index:7;pointer-events:none;direction:rtl}.health-notice.show{animation:healthLoss 1.3s ease-out both}@keyframes healthLoss{0%{opacity:0;transform:translateY(10px) scale(.8)}15%{opacity:1;transform:translateY(0) scale(1.05)}70%{opacity:1}100%{opacity:0;transform:translateY(-22px)}}.spell-hud{top:111px}.spell-hud.locked .spell-icon{background:#d2cfac}
@media(max-width:1100px){.health-heading,.health-bar{min-width:82px}.spell-hud{top:99px}}
@media(max-width:740px){.health-heading{margin-top:0;min-width:70px}.health-heading small{font-size:9px}.health-heading span{font-size:10px}.health-bar{height:7px;min-width:70px}.player-hud{padding:8px 10px!important}.spell-hud,.game-shell:fullscreen .spell-hud{top:174px}.health-notice{top:66px;right:22px;font-size:13px;padding:3px 10px}}
@media(prefers-reduced-motion:reduce){.health-notice.show{animation:none}.health-bar i{transition:none}}
.word-hud.wrong-pickup{animation:wrongLetter .65s ease-out}@keyframes wrongLetter{0%,100%{translate:0 0}12%,42%{translate:-8px 0;box-shadow:0 0 0 3px #e98670;background:#fff0e5}26%,56%{translate:7px 0}75%{translate:-3px 0}}
@media(prefers-reduced-motion:reduce){.word-hud.wrong-pickup{animation:none;outline:2px solid #e98670}}
/* Keep short instructions above the action, especially seated enemy reactions. */
body.playing .game-tip{top:140px;bottom:auto;max-width:64%;font-size:14px}
@media(max-width:740px){body.playing .game-tip{top:164px;bottom:auto;max-width:90%;font-size:13px}}
@media(max-height:570px) and (orientation:landscape){body.playing .game-tip{top:102px;bottom:auto;max-width:65%;font-size:12px}}

/* Touch controls: directional pad on the left, actions on the right. */
.touch-controls {
  --touch-size: clamp(44px, 12vmin, 62px);
  display: none;
  position: absolute;
  z-index: 4;
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  justify-content: space-between;
  gap: 14px;
  align-items: end;
  direction: ltr;
  pointer-events: none;
}

.touch-move,
.touch-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.touch-controls button {
  display: grid;
  place-items: center;
  flex: none;
  width: var(--touch-size);
  height: var(--touch-size);
  padding: 0;
  border: 1px solid #fff1c6;
  border-radius: 14px;
  background: #fff5dd;
  color: #174848;
  box-shadow: 0 3px 0 #9b8253;
  line-height: 1;
  touch-action: none;
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.touch-controls button svg {
  width: 24px;
  height: 24px;
  stroke-width: 2.65;
  pointer-events: none;
}

.touch-controls button:focus-visible {
  outline: 3px solid #ffe37a;
  outline-offset: 2px;
}

.touch-move [data-control="left"] svg { transform: rotate(180deg); }
.touch-crouch svg { transform: rotate(90deg); }
.touch-jump svg { transform: rotate(-90deg); }

.touch-controls .touch-spell {
  background: #30685d;
  color: #fff3c6;
  border-color: #99b48c;
  box-shadow: 0 3px 0 #183d36;
}

.touch-controls .touch-spell.locked {
  background: #435853;
  color: #e3dcc4;
  border-color: #829089;
}

.touch-controls .touch-dash,
.touch-controls .touch-crouch {
  background: #e1e9d1;
  border-color: #f0f1d4;
  box-shadow: 0 3px 0 #778e76;
}

.touch-controls .touch-jump {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: calc(var(--touch-size) + 31px);
  padding-inline: 6px;
  background: #ffcf5d;
  border-color: #ffeead;
  color: #573a1e;
  box-shadow: 0 3px 0 #ae7228;
  font-size: 15px;
  font-weight: 700;
  direction: rtl;
}

.touch-controls button:is(:active, [data-pressed="true"]) {
  transform: translateY(2px);
  background: #f8df90;
  color: #183f37;
  box-shadow: 0 1px 0 #7a683e;
}

@media (any-pointer: coarse), (max-width: 740px) {
  body.playing .touch-controls { display: flex; }
  .spell-hud kbd { display: none; }
  .control-legend { display: none; }
}

@media (orientation: portrait) and (max-width: 740px) {
  /* Keep the start button reachable when the selection menu wraps. */
  body:not(.playing) .game-shell {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  body:not(.playing) #game {
    position: absolute;
    inset: 0;
  }

  body:not(.playing) .game-shell .menu {
    position: relative;
    inset: auto;
    width: auto;
    max-width: none;
    align-self: start;
    margin: 61px 10px 16px;
  }

  body:not(.playing) .scene-caption { display: none; }

  /* Show the objective above the playfield and keep thumbs below it. */
  body.playing .game-shell {
    --portrait-status: 112px;
    display: grid;
    grid-template-areas: "status" "scene" "controls";
    grid-template-rows: var(--portrait-status) auto auto;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    height: auto;
    min-height: 0;
    max-height: none;
    aspect-ratio: auto;
    background: #143d3d;
  }

  body.playing #game {
    grid-area: scene;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
  }

  body.playing .hud { display: contents; }

  body.playing .game-shell .hud-top {
    grid-area: status;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "player pause" "word word";
    align-content: center;
    align-items: center;
    gap: 5px 10px;
    padding: 8px 10px 5px;
    background: #153f3e;
    direction: rtl;
  }

  body.playing .hud-top .player-hud {
    grid-area: player;
    justify-self: start;
    min-width: 0;
    height: 42px;
    gap: 5px;
    padding: 3px 8px !important;
  }

  body.playing .hud-top .player-hud canvas { width: 25px; height: 32px; }
  body.playing .hud-top .pause-button { grid-area: pause; width: 44px; height: 44px; }

  body.playing .hud-top .word-hud {
    grid-area: word;
    position: static;
    transform: none;
    min-width: 0;
    justify-self: center;
    padding: 3px 9px 5px;
    border-radius: 10px;
  }

  body.playing .word-heading strong { font-size: 18px; }
  body.playing .letter-slots { gap: 4px; margin-top: 2px; }
  body.playing .letter-slot { width: 24px; height: 23px; border-radius: 6px; font-size: 19px; }

  body.playing .touch-controls {
    --touch-size: clamp(46px, 15vw, 62px);
    position: static;
    grid-area: controls;
    width: 100%;
    min-width: 0;
    padding: 8px max(9px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(9px, env(safe-area-inset-left));
    background: linear-gradient(#215452, #143e41);
    border-top: 1px solid #649487;
    pointer-events: auto;
  }

  body.playing .touch-move,
  body.playing .touch-actions {
    display: grid;
    grid-template-columns: repeat(2, var(--touch-size));
    gap: 5px 7px;
  }

  body.playing .touch-crouch {
    grid-area: 1 / 1 / 2 / 3;
    justify-self: center;
    height: 44px;
  }

  body.playing .touch-spell,
  body.playing .touch-dash { height: 44px; }

  body.playing .touch-jump {
    grid-column: 1 / -1;
    width: 100%;
    gap: 6px;
    font-size: 17px;
  }

  body.playing .game-tip {
    top: calc(var(--portrait-status) + 9px);
    bottom: auto;
    width: max-content;
    max-width: 90%;
    padding: 4px 8px;
    font-size: 11px;
  }

  body.playing .stage-intro,
  body.playing .celebration { top: calc(var(--portrait-status) + 115px); }

  body.playing .game-shell .spell-hud {
    top: calc(var(--portrait-status) + 57px);
    right: 7px;
  }

  body.playing .health-notice {
    top: calc(var(--portrait-status) + 35px);
    right: 8px;
  }

  body.playing .boss-hud { top: calc(var(--portrait-status) + 56px); }
  body.playing .exit-fullscreen { top: 11px; left: 61px; }

  body.focus-mode.playing .game-shell,
  body.playing .game-shell:fullscreen {
    height: 100dvh;
    overflow: auto;
  }
}

@media (orientation: landscape) and (max-height: 570px) and (any-pointer: coarse),
       (orientation: landscape) and (max-height: 570px) and (max-width: 740px) {
  body.playing .game-shell {
    background: #163f3e;
    --landscape-dock: calc(62px + env(safe-area-inset-bottom, 0px));
  }

  body.playing #game {
    height: calc(100% - var(--landscape-dock));
    object-fit: contain;
  }

  body.playing .game-shell .hud-top {
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
  }

  body.playing .game-shell .pause-button { width: 44px; height: 44px; }
  body.playing .exit-fullscreen { left: calc(max(10px, env(safe-area-inset-left)) + 52px); }
  body.playing .touch-controls { bottom: max(8px, env(safe-area-inset-bottom)); }
}

@media (max-width: 320px) {
  .site-header { padding-inline: 10px; }
  .header-actions .text-button > span { display: none; }
  .header-actions .text-button { min-width: 38px; }
}
