/* Reading and stage layout, based on the children's first playtest. */
.app-play-stage{gap:24px;align-items:flex-start;max-width:1800px;margin-inline:auto}
.app-play-stage>.half-screen:first-child{flex:0 0 clamp(400px,34vw,520px);max-height:calc(100dvh - 110px);overflow-y:auto;position:sticky;top:95px;scrollbar-gutter:stable}
.app-play-stage>.half-screen:last-child{min-width:0}
.story-panel{padding:24px}.story-panel .byte-card{flex-direction:row;gap:16px;text-align:right}.story-panel .byte-portrait{width:105px;height:105px;flex-shrink:0}
.story-panel .byte-dialogue,.story-text-container,.skill-lesson,.play-mission,.mission-box{font-size:17px!important;line-height:1.95!important}
.story-text-container{max-height:none!important;overflow:visible!important;padding:18px 4px!important;text-align:start;letter-spacing:normal}
.skill-lesson{padding:18px}.skill-lesson summary{font-size:18px;line-height:1.7}.skill-lesson p{margin-block:12px}.lesson-example{padding:16px}
.reading-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px;flex-wrap:wrap}.reading-toolbar button{min-height:44px}.reading-toolbar span{color:#c3d5eb;font-size:14px}
.story-panel .byte-avatar-card{flex-direction:row;align-items:center;gap:16px;padding:16px}.story-panel .byte-avatar{flex-shrink:0;width:100px;height:100px}.story-panel .byte-dialogue-bubble{font-size:16px;line-height:1.8;padding:12px}.story-panel .byte-info{min-width:0}
.blocks-workspace-container{display:grid;grid-template-columns:minmax(180px,.8fr) minmax(240px,1.2fr);grid-template-rows:auto auto;gap:12px}.blocks-workspace-container>.palette-label:first-child{grid-column:1;grid-row:1}.blocks-palette{grid-column:1;grid-row:2;align-content:start;align-self:start;max-height:400px;overflow-y:auto;display:flex;flex-direction:column;padding:12px}.blocks-workspace-container>.palette-label:nth-of-type(3){grid-column:2;grid-row:1}.code-assembly-area{grid-column:2;grid-row:2;min-height:200px;max-height:400px;padding:12px}.blocks-palette>.scratch-block{width:100%;white-space:normal;line-height:1.7}.blocks-workspace-container .palette-label{font-size:13px;line-height:1.6;flex-wrap:wrap}.blocks-workspace-container[hidden]{display:none}
.reading-dialog{width:min(850px,94vw);max-height:90dvh;border:1px solid #18cfc0;border-radius:24px;color:#eaf3ff;background:#101e32;padding:28px;overflow-y:auto;direction:rtl;line-height:2;font-size:20px}.reading-dialog::backdrop{background:#020916cf;backdrop-filter:blur(6px)}.reading-dialog header{position:sticky;top:-28px;background:#101e32;display:flex;justify-content:space-between;align-items:center;gap:16px;padding-block:12px;z-index:2}.reading-dialog button{padding:10px 18px;border-radius:12px;cursor:pointer}.reading-dialog .skill-lesson{font-size:20px!important}.reading-dialog h2{font-size:24px}.reading-dialog .story-text-container{font-size:20px!important}.reading-dialog .book-link{font-size:17px}
.activity-tabs{gap:8px;display:flex;flex-wrap:wrap}.activity-tab{flex:1 1 160px;min-height:52px;font-size:15px;padding:12px}.activity-tab.active{box-shadow:0 0 0 2px #34e6cf,0 8px 24px #05d5b322}
.mini-world{height:360px;isolation:isolate;border:1px solid #3e627c;box-shadow:inset 0 -25px 60px #030b1880}
.scene-art{position:absolute;inset:0;width:100%;height:100%;z-index:-1}.world-stars{opacity:.35}.world-label{padding:8px 14px;font-size:15px;background:#071423bc;border-radius:12px;top:16px}
.world-actor{width:145px;height:175px;left:auto;right:6%;bottom:60px;transition:transform .55s cubic-bezier(.2,.8,.25,1);z-index:3}.world-actor .byte-sprite{width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 15px 12px #02091899)}
.world-props{right:auto;left:7%;bottom:74px;width:48%;z-index:2}.assembly-prop{font-size:80px;transition:transform .4s}.wallet{background:#06192ac9;border:1px solid #40d9cc;padding:20px;border-radius:20px}.wallet strong{font-size:44px}.value-meter i{transition:width .5s}.world-pattern{display:flex;flex-wrap:wrap;gap:8px;max-width:100%;padding:12px;background:#071421ab;border-radius:14px}.pattern-token{display:grid;place-items:center;min-width:38px;font-size:28px;animation:token-arrive .45s both}.world-ground{height:60px;opacity:.85}.mini-world #world-caption{bottom:8px;background:#081a2ced;border-radius:10px;padding:8px 12px;left:12px;right:12px;font-size:16px;line-height:1.6;z-index:5;margin:0;white-space:normal;overflow:visible}
.repair-bridges{gap:8px}.repair-bridges i{transition:background .4s,box-shadow .4s,transform .4s}.repair-bridges i.bridge-lit{transform:translateY(-10px);box-shadow:0 0 28px #34e9b6}.world-gate{min-height:100px}.world-gate i{transition:transform .55s,opacity .55s}.world-gate.gate-open i{transform:translateY(-85px);opacity:.3}
.scene-particle{position:absolute;left:var(--x);top:var(--y);z-index:6;font-size:24px;pointer-events:none;animation:scene-particle .8s ease-out forwards}.scene-trail{position:absolute;width:14px;height:14px;right:20%;bottom:65px;box-shadow:0 0 20px #4af4e5;background:#4af4e5;border-radius:50%;animation:scene-particle .7s both}.scene-progress{position:absolute;top:58px;left:16px;display:flex;gap:5px;z-index:4;max-width:70%;flex-wrap:wrap}.scene-progress i{width:15px;height:7px;border-radius:10px;background:#8695b555}.scene-progress i.done{background:#5bffcf;box-shadow:0 0 10px #5bffcf}
.scene-tree{font-style:normal;font-size:44px;transition:transform .5s;filter:grayscale(1);opacity:.5}.scene-tree.bridge-lit{filter:none;opacity:1}.sound-level{display:inline-flex;align-items:center;gap:8px;padding:8px 12px;font-size:13px}.sound-level input{width:85px;accent-color:#05d5b3}
.program-settings summary,.trace-details summary{font-size:17px;padding:14px}.field-label{font-size:16px;line-height:1.8}.mini-order-row{font-size:16px;min-height:54px}.field-label input,.field-label select{min-height:46px;font-size:16px}.sim-stage{min-height:390px}.book-reader p{line-height:2}.book-reader{box-shadow:0 18px 60px #0003}
.stage-stack>.byte-sprite,.stage-track>.byte-sprite{width:115px;height:135px;object-fit:contain;filter:drop-shadow(0 12px 10px #02091880)}.jump-track{width:min(560px,100%);height:215px}.jump-track .byte-sprite{width:100px;height:120px}.jump-track>span{font-size:70px!important}.stage-stack>.stage-track>span[id^="cr-"],.stage-stack>.stage-track>span[id^="b-"]{transition:opacity .4s,transform .4s,filter .4s}.collected{filter:brightness(1.8);transform:translateY(-18px) scale(.65)}
@media(max-width:600px){.jump-track .byte-sprite{width:75px;height:95px}.jump-track>span{font-size:52px!important}}
@keyframes token-arrive{from{transform:translateY(-40px) scale(.4);opacity:0}to{transform:none;opacity:1}}@keyframes scene-particle{from{transform:translate(0,0) scale(.3);opacity:1}to{transform:translate(var(--dx,50px),-95px) rotate(100deg) scale(1.1);opacity:0}}
@media(max-width:1200px){.app-play-stage>.half-screen:first-child{flex-basis:400px}.story-panel{padding:18px}.world-actor{width:120px;height:150px}.world-props{width:50%;left:5%}}
@media(max-width:980px){.app-play-stage{display:flex;flex-direction:column}.app-play-stage>.half-screen:first-child{flex:auto;width:100%;position:static;max-height:none;overflow:visible}.app-play-stage>.half-screen:last-child{width:100%}.story-text-container{max-height:none!important}.story-panel .byte-card{flex-direction:row}.mini-world{height:330px}}
@media(max-width:600px){.app-play-stage{gap:18px}.story-panel{padding:16px}.story-panel .byte-portrait{width:80px;height:80px}.activity-tab{flex-basis:130px;font-size:14px}.mini-world{height:310px}.world-actor{width:95px;height:125px;right:3%;bottom:68px}.world-props{left:4%;width:53%;bottom:88px}.assembly-prop{font-size:65px}.wallet{padding:10px}.wallet strong{font-size:34px}.mini-world #world-caption{font-size:14px}.pattern-token{font-size:22px;min-width:24px}.world-pattern{gap:4px;padding:7px}.reading-dialog{padding:18px;font-size:18px}.reading-dialog header{top:-18px}.reading-dialog h2{font-size:20px}.scene-tree{font-size:28px}.reading-toolbar span{font-size:13px}.sound-level{max-width:100%;flex-wrap:wrap}}
@media(prefers-reduced-motion:reduce){.world-actor,.world-gate i,.value-meter i,.assembly-prop,.repair-bridges i{transition:none}.scene-particle,.scene-trail{display:none}.pattern-token{animation:none}}
@media(max-width:1200px){.blocks-workspace-container{grid-template-columns:1fr}.blocks-workspace-container>.palette-label:first-child,.blocks-workspace-container>.palette-label:nth-of-type(3),.blocks-palette,.code-assembly-area{grid-column:auto;grid-row:auto}.blocks-palette{flex-direction:row;flex-wrap:wrap}.blocks-palette>.scratch-block{width:auto}}
@media(max-width:600px){.story-panel .byte-avatar-card{flex-direction:row;gap:12px;padding:12px}.story-panel .byte-avatar{width:75px;height:75px}.story-panel .byte-dialogue-bubble{font-size:15px}.world-actor{left:auto}.world-props{right:auto}}
