/* Code Quest — original self-contained Kira Labs educational adventure. */
.cq-page{margin:0;background:#071324;color:#eff6ff;min-height:100vh}
.cq-page main{background:radial-gradient(ellipse 75% 38% at 78% 6%,#223952 0%,transparent 75%),linear-gradient(#091628,#071324)}
.cq-page button,.cq-page textarea{font:inherit}
.cq-page a:focus-visible,.cq-page button:focus-visible,.cq-page textarea:focus-visible{outline:3px solid #ffcd7b;outline-offset:3px}
.cq-page button{cursor:pointer}
.cq-page [hidden]{display:none!important}
.cq-shell{width:min(1230px,calc(100% - 40px));margin:auto;padding:42px 0 80px}
.cq-header{display:flex;justify-content:space-between;gap:32px;align-items:flex-end;margin-bottom:26px}
.cq-overline,.cq-code-eyebrow{color:#f3c382;letter-spacing:.15em;font-size:.72rem;font-weight:850;margin:0 0 12px}
.cq-header h1{font-size:clamp(2.8rem,5.8vw,5.35rem);line-height:1;margin:0 0 9px;color:#fff;letter-spacing:-.065em}
.cq-header h1 em{font-style:normal;color:#f4c47b}.cq-star{color:#8fceff;font-size:.46em;vertical-align:top;margin-left:8px}
.cq-subtitle{color:#c9d9ea;margin:0;font-size:1.09rem}
.cq-header-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.cq-pill-link{border:1px solid #52718b;border-radius:100px;color:#e6f3ff;text-decoration:none;padding:11px 17px;font-size:.86rem;font-weight:760;background:#172e45}
.cq-pill-link:hover{background:#284b67;color:#fff}
.cq-progress{background:#14263c;border:1px solid #34516a;border-radius:15px;padding:17px 20px;margin:24px 0 20px;box-shadow:0 9px 36px #01081740}
.cq-progress-top{display:flex;justify-content:space-between;gap:14px;color:#d2e5f7;font-weight:750;font-size:.91rem;margin-bottom:11px}
.cq-progress-track{height:9px;background:#2e455d;border-radius:30px;overflow:hidden}
#progressFill{height:100%;width:0%;background:linear-gradient(90deg,#53c4c4,#ffca7c);border-radius:30px;transition:width .4s ease}
.cq-layout{display:grid;grid-template-columns:minmax(0,1.03fr) minmax(0,.97fr);gap:22px;align-items:start}
.cq-story,.cq-editor-card{border:1px solid #35536c;border-radius:24px;overflow:hidden;background:#112239;box-shadow:0 18px 55px #0004}
.cq-card-top{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;padding:19px 20px 12px}
.cq-chip{font-size:.72rem;letter-spacing:.08em;color:#c5e5f6;font-weight:800;padding:8px 12px;border-radius:30px;border:1px solid #447087;background:#1b3c52}
.cq-chip-gold{color:#ffe2aa;background:#4a3a36;border-color:#937251}
.cq-stage{height:350px;position:relative;overflow:hidden;background:linear-gradient(180deg,#123054 0%,#304b73 66%,#416b75 66%,#193c52 100%);isolation:isolate;border-top:1px solid #496686;border-bottom:1px solid #496686}
.cq-stage:before{content:"";position:absolute;inset:0;background:radial-gradient(ellipse at 18% 22%,#abcfff25,transparent 65%),linear-gradient(180deg,transparent 58%,#0d2334bb);z-index:0}
.cq-sky{position:absolute;inset:0}
.cq-moon{position:absolute;right:12%;top:18px;width:70px;height:70px;border-radius:50%;background:#ffecc3;box-shadow:0 0 60px #ffe0a76b}
.cq-star-s1,.cq-star-s2,.cq-star-s3{position:absolute;color:#fff4bf;font-size:1.4rem;animation:cq-twinkle 3s ease-in-out infinite}
.cq-star-s1{top:13%;left:14%}.cq-star-s2{top:32%;left:41%;animation-delay:1s}.cq-star-s3{top:12%;left:70%;animation-delay:1.7s}
.cq-hills{position:absolute;left:-30%;bottom:10%;width:106%;height:145px;background:#426577;border-radius:50% 80% 0 0;transform:rotate(-9deg);z-index:1;opacity:.8}
.cq-lighthouse{position:absolute;right:5%;bottom:19%;height:150px;width:94px;z-index:2;opacity:.86}
.cq-tower{position:absolute;bottom:0;left:27px;height:113px;width:43px;background:linear-gradient(90deg,#c9d6cf,#faf5e1 45%,#8c9c9d);clip-path:polygon(20% 0,80% 0,100% 100%,0 100%);border-radius:3px}
.cq-roof{position:absolute;left:22px;top:10px;border-left:27px solid transparent;border-right:27px solid transparent;border-bottom:0;border-top:0;width:0;height:0}
.cq-roof:before{content:"";position:absolute;left:-27px;top:-8px;border-left:27px solid transparent;border-right:27px solid transparent;border-bottom:23px solid #bc735e;transform:translateY(0)}
.cq-beam{position:absolute;left:36px;top:25px;width:24px;height:22px;background:#7b8ba0;border:3px solid #314b60;border-radius:6px;z-index:3;transition:box-shadow .35s,background .35s}
.cq-stage.is-lit .cq-beam{background:#fff4b8;box-shadow:0 0 25px 8px #ffde82,0 0 105px 35px #ffe1949c}
.cq-stage.is-lit{background:linear-gradient(180deg,#243763 0%,#566d8c 66%,#71968c 66%,#1b4058 100%)}
.cq-board{position:absolute;left:4%;bottom:55px;display:grid;grid-template-columns:repeat(7,minmax(0,1fr));grid-template-rows:repeat(4,1fr);gap:5px;width:min(68%,385px);max-height:235px;aspect-ratio:7/4;z-index:4;transform:perspective(800px) rotateX(8deg)}
.cq-tile{display:grid;place-items:center;border:1px solid #a4c2cd3e;background:#132e47aa;border-radius:10px;color:#f9eabf;font-size:1.2rem;text-shadow:0 0 14px #ffe1a28f;user-select:none}
.cq-tile.is-trail{background:#356a7775}
.cq-tile.is-path{background:#4d9eaeaa;border-color:#98f4f7a2}
.cq-tile.is-goal{background:#725e70a0;border-color:#e9b97a}
.cq-tile.is-robot{outline:2px solid #a4f4f7;background:#204c69;color:#a6f7ff}
.cq-tile.is-robot:after{content:"◆";position:absolute;font-size:.63rem;color:#fff5be;margin-top:24px}
.cq-sprite{position:absolute;right:22%;bottom:36px;transform:rotate(-4deg);z-index:7;animation:cq-float 3s ease-in-out infinite;filter:drop-shadow(0 13px 14px #05172988);pointer-events:none}
.cq-head{width:74px;height:52px;border-radius:23px;background:linear-gradient(145deg,#a1edec,#568fb8);border:5px solid #294b6e;display:flex;align-items:center;justify-content:center;gap:15px;position:relative}
.cq-head i{width:12px;height:17px;border-radius:50%;background:#142840;box-shadow:0 0 8px #f7f6da}
.cq-antenna{position:absolute;top:-19px;left:37px;height:23px;width:5px;background:#7bc8d7;z-index:-1}
.cq-antenna:before{content:"";position:absolute;top:-9px;left:-5px;height:15px;width:15px;border-radius:50%;background:#fbe6a5;box-shadow:0 0 15px #ffe0a3}
.cq-bodybot{margin:0 auto;width:61px;height:60px;background:linear-gradient(120deg,#4c8fb0,#2a5679);border:5px solid #294b6e;border-radius:13px;text-align:center;line-height:50px}
.cq-bodybot span{color:#f9e0a1;font-size:1.7rem}
.cq-feet{width:46px;height:11px;border-radius:5px;background:#254961;box-shadow:21px 0 #254961;margin:0 auto}
.cq-scene-caption{position:absolute;bottom:9px;left:14px;font-size:.72rem;color:#d3ebf5;background:#163c57b8;padding:5px 10px;border-radius:18px;z-index:5}
.cq-storycopy{padding:29px 29px 30px}
.cq-speaker{color:#9cd9de;letter-spacing:.16em;font-size:.72rem;font-weight:800;margin:0 0 10px}
.cq-storycopy h2{font-size:clamp(1.9rem,2.4vw,2.5rem);line-height:1.1;letter-spacing:-.045em;color:#fff;margin:0 0 14px}
#storyText{font-size:1.04rem;line-height:1.78;color:#ccdaeb;margin:0 0 21px}
.cq-goal{display:flex;gap:13px;background:#213b51;border:1px solid #456582;border-radius:15px;padding:18px}
.cq-goal-symbol{color:#ffd392;font-size:2rem;line-height:1}
.cq-goal strong{display:block;color:#ffdb9c;font-size:.91rem;margin-bottom:5px}
.cq-goal p{color:#e0e9f5;font-size:.94rem;line-height:1.5;margin:0}
.cq-editor-card{padding:25px 26px 23px}
.cq-editor-top{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:21px}
.cq-code-eyebrow{color:#98d6d5;margin:0 0 4px}
.cq-editor-top h2{font-size:1.6rem;color:#fff;line-height:1.2;letter-spacing:-.025em;margin:0}
.cq-js-badge{font-weight:800;font-size:.74rem;letter-spacing:.04em;background:#efd386;color:#2c2c32;border-radius:8px;padding:9px 12px}
.cq-coach{display:flex;gap:13px;background:#1d3950;border-left:3px solid #85d7df;border-radius:12px;padding:15px;margin-bottom:23px}
.cq-coach-icon{height:28px;width:28px;background:#aadce2;color:#11283e;border-radius:50%;display:grid;place-items:center;flex:none;font-weight:850}
.cq-coach strong{display:block;color:#f4fcff;font-size:.97rem;margin:0 0 5px}
.cq-coach p{font-size:.87rem;color:#cbdde8;line-height:1.6;margin:0}
.cq-editor-label{display:block;color:#e7eef9;font-weight:770;font-size:.87rem;margin-bottom:9px}
.cq-codewrap{background:#071221;border:1px solid #53728d;border-radius:13px;overflow:hidden}
.cq-codechrome{height:37px;background:#122d42;color:#9eb2c7;font-size:.76rem;padding:0 13px;display:flex;align-items:center;gap:7px}
.cq-codechrome span:last-child{margin-left:6px;font-family:ui-monospace,SFMono-Regular,Consolas,monospace}
.cq-dot{height:9px;width:9px;border-radius:50%;background:#e17c77}.cq-dot:nth-child(2){background:#edc56a}.cq-dot:nth-child(3){background:#73bd9a}
#codeInput{display:block;width:100%;min-height:191px;max-height:500px;resize:vertical;background:#081526;color:#d3ecff;border:0;padding:18px 19px;outline:0;font-family:ui-monospace,SFMono-Regular,Consolas,"Liberation Mono",monospace;font-size:.95rem;line-height:1.7;tab-size:2;white-space:pre;box-sizing:border-box}
#codeInput:focus{box-shadow:inset 0 0 0 2px #7ed9e2}
.cq-keyboard{color:#abc3d8;font-size:.76rem;line-height:1.5;margin:10px 0 16px}
.cq-controls,.cq-navigation,.cq-end-actions{display:flex;flex-wrap:wrap;gap:10px}
.cq-btn{min-height:43px;padding:11px 16px;border-radius:11px;border:1px solid transparent;display:inline-flex;align-items:center;justify-content:center;gap:7px;text-decoration:none;transition:transform .15s ease,background .15s ease;font-weight:800;font-size:.89rem;line-height:1.3;text-align:center}
.cq-btn:hover:not(:disabled){transform:translateY(-1px)}
.cq-btn-main{background:#f3c57f;color:#1e2838;border-color:#f3c57f}
.cq-btn-main:hover{background:#ffe2ad}
.cq-btn-soft{background:#2a5366;color:#f6fcff;border-color:#537f93}
.cq-btn-soft:hover{background:#366b7d;color:#fff}
.cq-btn-plain{background:#162c42;color:#d8e7f4;border-color:#3e5c76}
.cq-btn-plain:hover{background:#21465f}
.cq-btn-next{background:#9ee0cc;color:#102c33;border-color:#9ee0cc;margin-left:auto}
.cq-btn-next:disabled{background:#1f3945;color:#8c9da8;border-color:#385060;cursor:not-allowed}
.cq-btn:disabled{opacity:.68;cursor:not-allowed}
.cq-hint{margin-top:15px;border:1px solid #8d754a;border-radius:12px;background:#3b342b;padding:16px}
.cq-hint strong{color:#ffdf9f}
.cq-hint p{color:#fff0d0;line-height:1.5;margin:7px 0 10px}
.cq-hint button{border:0;background:transparent;color:#fbe1a9;text-decoration:underline;font-weight:750;padding:3px 0}
.cq-output{border:1px solid #4a6680;border-radius:14px;background:#0b1b2c;margin-top:19px;padding:15px 17px;min-height:108px}
.cq-output-heading{display:flex;align-items:center;gap:9px;color:#d9ecff}
.cq-output-heading span{color:#b8e2f0}
.cq-output p{font-size:.91rem;line-height:1.65;color:#bdd1e4;margin:10px 0 0}
.cq-output[data-state="success"]{background:#143b3e;border-color:#57a69c}.cq-output[data-state="success"] .cq-output-heading{color:#b6ffe6}
.cq-output[data-state="error"]{background:#3b2635;border-color:#a67e87}.cq-output[data-state="error"] .cq-output-heading{color:#ffe2e2}
.cq-action-log{display:flex;gap:6px;flex-wrap:wrap;margin-top:10px}
.cq-action-log:empty{display:none}
.cq-action-log code{font-size:.73rem;background:#203f53;color:#daf3ff;border:1px solid #3d6377;border-radius:7px;padding:5px 8px;max-width:100%;overflow-wrap:anywhere}
.cq-navigation{border-top:1px solid #314a62;padding-top:20px;margin-top:21px}
.cq-storage-note{font-size:.73rem;color:#9bb4ca;line-height:1.6;margin:16px 0 0}
.cq-ending{margin-top:27px;text-align:center;border:1px solid #deb86d;background:radial-gradient(ellipse at 50% 0%,#53687f 0%,#182f4c 50%,#162239 100%);border-radius:27px;padding:46px 32px;box-shadow:0 0 60px #f5d1832e}
.cq-ending-stars{font-size:2.8rem;letter-spacing:.3em;color:#ffde9e;animation:cq-twinkle 3s infinite}
.cq-ending h2{font-size:clamp(2rem,4vw,3.5rem);letter-spacing:-.04em;color:#fff;margin:5px 0 16px}
.cq-ending p:not(.cq-overline){color:#dcebf7;font-size:1.09rem;line-height:1.7;max-width:710px;margin:0 auto 20px}
.cq-end-stats{display:flex;flex-direction:column;gap:8px;color:#c8def2;font-size:.95rem;margin-bottom:26px}
.cq-end-stats strong{color:#ffe1a5;font-size:1.2rem}
.cq-end-actions{justify-content:center}
.cq-about{padding:37px 5px 0;max-width:900px}
.cq-about h2{font-size:1.45rem;color:#fff;margin:0 0 10px}
.cq-about p{color:#afc6dd;line-height:1.65;font-size:.92rem}
.cq-about a{color:#f6ce8b}
@keyframes cq-float{0%,100%{transform:translateY(0) rotate(-4deg)}50%{transform:translateY(-8px) rotate(-2deg)}}
@keyframes cq-twinkle{0%,100%{opacity:.5;transform:scale(.8)}50%{opacity:1;transform:scale(1.1)}}
@media(max-width:1000px){.cq-layout{grid-template-columns:1fr}.cq-storycopy{padding:25px}.cq-stage{height:330px}.cq-board{width:min(65%,420px)}}
@media(max-width:700px){.cq-shell{width:min(100% - 24px,1230px);padding-top:24px}.cq-header{display:block}.cq-header-actions{justify-content:flex-start;margin-top:20px}.cq-header h1{font-size:3.25rem}.cq-card-top{padding:16px 13px 11px}.cq-chip{font-size:.66rem}.cq-stage{height:285px}.cq-board{width:65%;left:2%;gap:3px}.cq-sprite{right:15%;transform:scale(.8);transform-origin:bottom center}.cq-lighthouse{right:0;transform:scale(.8);transform-origin:bottom center}.cq-storycopy{padding:22px 18px}.cq-editor-card{padding:21px 17px}.cq-controls .cq-btn-main{flex-basis:100%}.cq-navigation{justify-content:space-between}.cq-btn-next{margin:0}.cq-ending{padding:34px 20px}.cq-progress{padding:15px}}
@media(max-width:400px){.cq-board{width:70%;bottom:61px}.cq-tile{font-size:.95rem;border-radius:6px}.cq-sprite{right:7%;bottom:25px;transform:scale(.72)}.cq-js-badge{font-size:.65rem}.cq-controls .cq-btn{flex-grow:1}}
@media(prefers-reduced-motion:reduce){.cq-sprite,.cq-star-s1,.cq-star-s2,.cq-star-s3,.cq-ending-stars{animation:none!important}#progressFill,.cq-btn{transition:none}}

/* The Last Light: scene art and interaction, scoped to Code Quest. */
.cq-page{--gold:#f3c57f;--mint:#b6e8d2;--ink:#081322}
.cq-shell{max-width:1310px;padding-top:28px}
.cq-header{margin-bottom:22px;align-items:center}
.cq-header h1{font-size:clamp(2.7rem,5vw,4.4rem)}
.cq-subtitle{font-size:.95rem}
.cq-journey{padding:17px 20px 12px;border:1px solid #385466;border-radius:18px;background:#112336;margin-bottom:20px}
.cq-progress-top{margin-bottom:9px;font-size:.8rem}
.cq-map{display:flex;gap:8px;justify-content:space-between;padding-top:12px;flex-wrap:wrap}
.cq-map button{border-radius:50%;min-width:30px;min-height:30px;width:30px;height:30px;border:1px solid #4f6e7b;background:#1d3b4c;color:#d4ecea;font-size:.7rem;font-weight:800;padding:0}
.cq-map button:disabled{background:#142938;color:#728a98;border-color:#2e4353;cursor:default}
.cq-map button[aria-current]{background:#f3c57f;border-color:#ffe3ac;color:#132637;box-shadow:0 0 0 4px #f3c57f22}
.cq-layout{grid-template-columns:minmax(0,1.13fr) minmax(0,1fr);gap:20px}
.cq-story,.cq-editor-card{border-radius:20px}
.cq-stage{height:365px;background:#1a3648}
.cq-world{position:absolute;inset:0;z-index:1}
.cq-world svg{width:100%;height:100%;display:block}
.cq-world svg>g{display:none}
.cq-world svg>.world-stars,.cq-world svg>.world-fireflies,.cq-world svg>.world-mira{display:block}
[data-theme="workshop"] .world-workshop,[data-theme="courtyard"] .world-village,[data-theme="river"] .world-river,[data-theme="archive"] .world-archive,[data-theme="rail"] .world-rail,[data-theme="meadow"] .world-meadow,[data-theme="beacon"] .world-beacon{display:block}
.world-stars,.world-fireflies{animation:cq-shimmer 4s ease-in-out infinite}
.world-fireflies{animation:cq-drift 7s ease-in-out infinite}
.world-ripples{animation:cq-ripple 3s ease-in-out infinite}
.world-lamp{opacity:.22;transition:opacity .8s}
.is-success .world-lamp{opacity:1}
.world-windows{opacity:.3;transition:opacity .8s}
.is-success .world-windows{opacity:1}
.world-gate{transform-origin:519px 180px;transition:transform 1.3s,opacity 1s}
.gate-open .world-gate{transform:scaleX(.1);opacity:.1}
.world-train{animation:cq-train 5s ease-in-out infinite}
.world-fallen-stars{animation:cq-shimmer 3s ease-in-out infinite;transition:transform 1s,opacity 1s}
.stars-collected .world-fallen-stars{transform:translateY(-75px);opacity:.2}
.is-lit .world-beam{opacity:.38;animation:cq-shimmer 5s ease-in-out infinite}
.is-lit .world-light{fill:#fff4ba;filter:drop-shadow(0 0 14px #ffd77c)}
.cq-stage.is-lit{background:#244c61}
.cq-stage:before{z-index:2;pointer-events:none;background:linear-gradient(transparent 40%,#07152544)}
.cq-cinematic{position:absolute;z-index:5;top:16px;left:16px;right:16px;display:flex;gap:8px;align-items:center;color:#fff0ce;font-size:.72rem;letter-spacing:.03em;text-shadow:0 2px 8px #000}
.cq-live-dot{width:6px;height:6px;border-radius:50%;background:#f4cd89;box-shadow:0 0 12px #ffe1a9;flex:none}
.cq-world-status{position:absolute;left:16px;top:44px;z-index:5;color:#d2e8e9;font-size:.69rem;max-width:80%;text-shadow:0 2px 8px #000}
.cq-board{left:5%;bottom:42px;width:60%;height:auto;aspect-ratio:7/4;max-height:180px;gap:3px;transform:perspective(850px) rotateX(14deg);z-index:4}
.cq-tile{border-radius:7px;border:1px solid #b4d7d12f;background:#102d3a40;font-size:1.2rem;position:relative;text-shadow:0 0 10px #efce87}
.cq-tile.is-path{background:#6cbaae59;border-color:#99ebd9b0}
.cq-tile.is-goal{background:#d7a55c2f;border-color:#e5c584;box-shadow:0 0 10px #efc28030}
.cq-tile.is-robot{outline:0;background:#81c7c440;overflow:visible}
.cq-tile.is-robot svg{width:100%;height:160%;position:absolute;bottom:0;filter:drop-shadow(0 4px 3px #0005);animation:cq-pix-idle 3s ease-in-out infinite}
.cq-tile.is-robot:after{content:"";position:absolute;bottom:1px;right:-3px;width:0;height:0;border:3px solid transparent;border-left-color:#ffe7ad;margin:0}
.cq-tile[data-direction="south"]:after{transform:rotate(90deg)}
.cq-tile[data-direction="west"]:after{transform:rotate(180deg)}
.cq-tile[data-direction="north"]:after{transform:rotate(270deg)}
.cq-speech{position:absolute;left:10%;bottom:210px;z-index:7;max-width:68%;background:#f6e8ca;color:#233a48;font-weight:750;border-radius:14px 14px 14px 0;padding:10px 15px;font-size:.84rem;box-shadow:0 8px 24px #0004;overflow-wrap:anywhere}
.cq-energy{position:absolute;right:22px;bottom:42px;display:flex;gap:5px;z-index:5;border:1px solid #a5d8d755;padding:8px;border-radius:20px;background:#132a3ca8}
.cq-energy i{height:13px;width:9px;background:#48666d;clip-path:polygon(50% 0,100% 40%,50% 100%,0 40%);transition:background .5s,filter .5s}
.cq-energy i.charged{background:#ffe6a6;filter:drop-shadow(0 0 6px #ffe6a6)}
.cq-scene-caption{font-size:.65rem;bottom:10px;left:16px}
.cq-stage.is-success:after{content:"";position:absolute;inset:0;z-index:6;pointer-events:none;box-shadow:inset 0 0 60px #ffe1a43b;animation:cq-arrival 1s ease-out}
.cq-storycopy{padding:24px}
.cq-storycopy h2{font-size:2rem}
#storyText{font-size:.94rem;line-height:1.75;margin-bottom:16px}
.cq-voice{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:20px;align-items:center}
.cq-voice .cq-btn{font-size:.75rem;min-height:36px;padding:7px 12px}
#voiceStatus{display:block;flex-basis:100%;font-size:.68rem;color:#9eb9ca;line-height:1.5}
.cq-goal{padding:14px}
.cq-goal p{font-size:.86rem}
.cq-editor-card{padding:22px}
.cq-editor-top{margin-bottom:16px}
.cq-editor-top h2{font-size:1.42rem}
.cq-js-badge{font-size:.64rem;text-align:center;line-height:1.4}
.cq-coach{padding:13px;margin-bottom:15px}
.cq-coach p{font-size:.84rem}
.cq-guided{border:1px solid #b5945c;border-radius:12px;background:#343329;padding:14px;margin-bottom:17px}
.cq-guided>strong{color:#ffe1a7;font-size:.86rem}
.cq-guided>p{font-size:.82rem;line-height:1.65;color:#f5e8ca;margin:6px 0 10px}
.cq-guided .cq-btn{font-size:.8rem;min-height:38px}
.cq-worked{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:12px;color:#ffd68c}
.cq-worked code{background:#102b3d;padding:5px 10px;border-radius:6px;color:#f8dca5;border:1px solid #8c825f;font-size:.9rem}
.cq-worked code:first-child{color:#c7d5de;border-color:#576267}
.cq-worked p{flex-basis:100%;font-size:.77rem;line-height:1.55;color:#d5dfdc;margin:0}
.cq-editor-label{font-size:.8rem}
#codeInput{min-height:155px;font-size:.9rem;padding:13px 15px;line-height:1.7}
.cq-keyboard{font-size:.68rem;margin:8px 0 13px}
.cq-controls{gap:8px}
.cq-controls .cq-btn{font-size:.79rem;padding:10px 12px}
.cq-output{padding:13px 15px;min-height:100px;margin-top:16px}
.cq-output-heading{font-size:.86rem}
.cq-output p{font-size:.82rem;line-height:1.65}
.cq-navigation{padding-top:16px;margin-top:16px;align-items:center}
.cq-navigation .cq-btn{font-size:.77rem;padding:10px 12px}
.cq-hint button{font-size:.79rem;text-align:left;min-height:35px}
.cq-hint p{font-size:.83rem}
.cq-text-button{border:0;background:none;padding:0;color:#f6ce8b;text-decoration:underline;font:inherit}
.cq-about{max-width:950px}
.cq-storage-note{font-size:.66rem}
.cq-page .kira-iris-widget{position:relative;right:auto;bottom:auto;margin:16px auto 30px;width:fit-content}
.cq-page .kira-iris-panel{position:fixed;right:max(13px,env(safe-area-inset-right));bottom:max(18px,env(safe-area-inset-bottom));max-height:calc(100dvh - 35px);z-index:1201}
.cq-page .kira-iris-launcher-label{position:static;clip:auto;clip-path:none;width:auto;height:auto;overflow:visible}
.cq-stage,.cq-output,.cq-navigation{scroll-margin-top:24px;scroll-margin-bottom:24px}
@keyframes cq-shimmer{0%,100%{opacity:.55}50%{opacity:1}}
@keyframes cq-drift{0%,100%{transform:translate(0,0);opacity:.4}50%{transform:translate(6px,-12px);opacity:1}}
@keyframes cq-ripple{0%,100%{transform:translateX(-4px);opacity:.3}50%{transform:translateX(7px);opacity:.6}}
@keyframes cq-train{0%,100%{transform:translate(0,0)}50%{transform:translate(-5px,1px)}}
@keyframes cq-pix-idle{0%,100%{transform:translateY(0)}50%{transform:translateY(-2px)}}
@keyframes cq-arrival{from{opacity:0}to{opacity:1}}
@media(max-width:1000px){.cq-layout{grid-template-columns:1fr}.cq-stage{height:380px}.cq-board{max-height:190px;width:53%}.cq-editor-card{padding:24px}.cq-storycopy{padding:24px}.cq-storycopy h2{font-size:2rem}.cq-stage svg{object-position:center}.cq-map{justify-content:flex-start;gap:10px}}
@media(max-width:700px){.cq-shell{width:calc(100% - 24px);padding-top:22px}.cq-header{display:flex;gap:12px}.cq-header h1{font-size:2.6rem}.cq-overline{font-size:.59rem;letter-spacing:.1em}.cq-subtitle{font-size:.78rem;line-height:1.6}.cq-pill-link{font-size:.72rem;padding:8px 10px;white-space:nowrap}.cq-journey{padding:13px}.cq-map{gap:7px}.cq-map button{min-height:29px;min-width:29px;width:29px;height:29px}.cq-stage{height:300px}.cq-board{width:60%;max-height:145px;left:3%;bottom:42px}.cq-cinematic{font-size:.65rem;top:12px;left:12px}.cq-world-status{left:12px;top:37px;font-size:.61rem}.cq-speech{bottom:190px;left:7%;font-size:.76rem}.cq-energy{right:12px;bottom:40px}.cq-storycopy{padding:20px 17px}.cq-storycopy h2{font-size:1.75rem}#storyText{font-size:.87rem}.cq-editor-card{padding:20px 17px}.cq-editor-top h2{font-size:1.35rem}.cq-controls .cq-btn-main{flex-basis:100%}.cq-navigation{flex-wrap:nowrap;gap:6px}.cq-navigation .cq-btn{font-size:.71rem;padding:11px 10px;min-height:44px}.cq-guided>p{font-size:.8rem}.cq-about p{font-size:.82rem}.cq-scene-caption{max-width:90%}}
@media(max-width:380px){.cq-header h1{font-size:2.3rem}.cq-stage{height:275px}.cq-map{gap:6px}.cq-map button{min-width:28px;width:28px}.cq-cinematic{font-size:.59rem}.cq-world-status{font-size:.57rem}.cq-navigation .cq-btn{padding:10px 8px}.cq-energy{right:9px}.cq-speech{bottom:176px}}
@media(prefers-reduced-motion:reduce){.cq-page *,.cq-page *:before,.cq-page *:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

.cq-worked pre{flex-basis:100%;margin:0;background:#0c2434;border:1px solid #658687;padding:11px;border-radius:8px;color:#d2eef4;font-size:.88rem;white-space:pre-wrap}
.cq-worked mark{background:#ffe2a4;color:#132d3a;border-radius:3px;padding:2px 3px;box-shadow:0 0 0 3px #f3c57f25}
.cq-skip-animation{position:absolute;z-index:8;right:12px;bottom:10px;border:1px solid #91b2ba;background:#193c4e;color:#eaf5ed;font-size:.68rem;border-radius:8px;padding:6px 10px;min-height:30px}
.cq-stage:not(.is-spatial) .cq-tile{border-color:transparent;background:transparent}
.cq-stage:not(.is-spatial) .cq-tile.is-robot svg{height:210%;width:140%}
.is-asleep .cq-tile.is-robot svg circle:not(:first-of-type){opacity:.16}
.cq-header + .cq-voice{margin:-7px 0 18px}
/* Keep the landed no-typing route available alongside guided code editing. */
.cq-choice-panel{padding:14px;border:1px solid #54808b;border-radius:12px;background:#153347;margin-bottom:17px}
.cq-choice-panel summary{cursor:pointer;color:#c7edeb;font-weight:750;font-size:.82rem;min-height:30px;line-height:1.55}
#easyInstruction{font-size:.8rem;line-height:1.6;color:#c3dce2;margin:9px 0 12px}
.cq-choice-grid{display:grid;gap:9px;margin-bottom:12px}
.cq-choice-option{border:1px solid #62818c;border-radius:10px;background:#10293b;color:#effbfa;text-align:left;padding:13px;min-height:60px}
.cq-choice-option:hover{background:#234758;border-color:#a0c9c9}
.cq-choice-option strong{font-size:.82rem;display:block;margin-bottom:6px}
.cq-choice-option code{font-size:.72rem;line-height:1.6;white-space:pre-wrap;display:block;color:#dce8ca;overflow-wrap:anywhere}
.cq-choice-panel .cq-text-button{font-size:.78rem;min-height:35px;text-align:left}
.cq-easy-continue{width:100%;margin-top:15px;min-height:48px}
/* Scoped navigation contrast; preserve global site navigation elsewhere. */
.cq-page .site-header .menubtn,.cq-page .site-header .nav a.contact{color:#e4f3fb;background:#142d43;border:1px solid #526f82}
.cq-page .site-header .menubtn:hover,.cq-page .site-header .nav a.contact:hover{color:#fff;background:#284a60}
.cq-voice #startLessonButton{font-size:.78rem;min-height:40px}

/* Stoneward: persistent rendered dungeon, exploration and rescue state. */
.cq-shell{max-width:1370px;width:min(1370px,calc(100% - 40px))}
.cq-world-card{border:1px solid #506274;border-radius:18px;overflow:hidden;background:#102238;box-shadow:0 24px 65px #0006;margin-bottom:22px}
.cq-world-card>.cq-card-top{padding:14px 18px}
.cq-stage{height:550px;min-height:350px;background:#121c29}
.cq-world{z-index:1;inset:0}
.cq-world canvas{display:block;width:100%;height:100%;touch-action:pan-y}
.cq-stage:before{z-index:2;background:linear-gradient(#05111b99,transparent 32%,transparent 74%,#07111a88);pointer-events:none}
.cq-stage .cq-board{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);clip-path:inset(50%);white-space:nowrap;left:0;top:0;transform:none;border:0}
.cq-cinematic{top:18px;left:22px;font-size:.82rem;max-width:85%;text-shadow:0 2px 5px #000}
.cq-world-status{top:48px;left:22px;max-width:90%;font-size:.77rem;color:#dfebe5;text-shadow:0 2px 6px #000}
.cq-scene-caption{left:20px;bottom:14px;font-size:.73rem;background:#0c2235c9;padding:6px 11px}
.cq-speech{left:17%;bottom:auto;top:28%;max-width:55%;font-size:.9rem;z-index:6}
.cq-energy{right:22px;bottom:18px}
.cq-skip-animation{right:20px;bottom:59px;font-size:.75rem}
.cq-render-status{display:flex;gap:12px;justify-content:space-between;padding:10px 18px;background:#0c1d2c;color:#9db7c6;font-size:.68rem;border-bottom:1px solid #385263}
.cq-quest-hud{display:grid;grid-template-columns:1.7fr 1fr;gap:12px 25px;border:1px solid #7e6253;background:linear-gradient(115deg,#342831,#182d3c);border-radius:16px;padding:17px 21px;margin:0 0 20px}
.cq-quest-hud .cq-overline{display:block;font-size:.62rem;letter-spacing:.12em;color:#ebaf8d;margin-bottom:6px}
#threatTitle{display:block;font-size:.98rem;line-height:1.4;color:#ffe3cb}
#questNeed{color:#d0dbe0;font-size:.8rem;line-height:1.5;margin:7px 0 0}
.cq-defense{align-self:center}
.cq-defense label{display:flex;justify-content:space-between;color:#d3e7e4;font-size:.77rem;gap:10px;margin-bottom:10px}
.cq-defense strong{color:#f5d698}
.cq-defense progress{display:block;width:100%;height:11px;border:0;border-radius:20px;overflow:hidden;background:#263d48}
.cq-defense progress::-webkit-progress-bar{background:#263d48}
.cq-defense progress::-webkit-progress-value{background:linear-gradient(90deg,#75b8b3,#f3d189);border-radius:20px}
.cq-defense progress::-moz-progress-bar{background:#90cdc0}
.cq-inventory{grid-column:1/-1;display:flex;gap:6px;flex-wrap:wrap;border-top:1px solid #a6b3b42a;padding-top:10px}
.cq-inventory-item{padding:5px 9px;border-radius:6px;border:1px solid #7a8e7a;background:#102a32;color:#e8dfba;font-size:.68rem}
.cq-inventory-empty{font-size:.72rem;color:#b0bec6}
.cq-encounter{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,1fr);gap:15px 25px;padding:23px;background:#152a3c}
.cq-encounter h2{font-size:1.5rem;line-height:1.3;letter-spacing:-.02em;color:#f3e6c5;margin:0 0 9px}
.cq-encounter .cq-overline{font-size:.62rem;margin:0 0 7px}
#encounterText{color:#cfdee6;font-size:.88rem;line-height:1.7;margin:0}
.cq-route-choices{display:grid;gap:9px;align-content:start}
.cq-route{display:block;text-align:left;border:1px solid #77848a;background:linear-gradient(110deg,#263d4b,#1a3042);padding:14px 16px;border-radius:10px;color:#f9e8bd;min-height:75px}
.cq-route:hover{background:#31505c;border-color:#c4c9ac}
.cq-route[aria-pressed="true"]{border-color:#e6c58a;box-shadow:inset 3px 0 #e6c58a;background:#394c4c}
.cq-route strong{display:block;font-size:.88rem;line-height:1.45;margin-bottom:5px}
.cq-route span{display:block;color:#c6d7df;font-size:.75rem;line-height:1.5}
.cq-route:disabled{opacity:.65;cursor:wait}
.cq-encounter>.cq-controls{grid-column:1/-1}
.cq-gate-status{grid-column:1/-1;margin:0;padding:12px 15px;border:1px solid #6f7880;border-radius:9px;color:#d9e1e5;background:#102538;font-size:.79rem;line-height:1.6}
.cq-gate-status[data-state="blocked"]{border-color:#a27b5c;color:#f9dfba;background:#3d302e}
.cq-gate-status[data-state="cleared"]{border-color:#76ab98;color:#c1f2db;background:#143b3a}
.cq-layout{grid-template-columns:minmax(0,.72fr) minmax(0,1.28fr)}
.cq-layout .cq-story{height:fit-content}
.cq-storycopy h2{font-size:1.9rem}
.cq-storycopy{padding:24px}
#storyText{font-size:.92rem}
.cq-editor-card{padding:24px}
.cq-about{max-width:1000px}
#graphicsStatus[data-mode="webgl"]{color:#b7dacc}
@media(max-width:1000px){.cq-stage{height:480px}.cq-layout{grid-template-columns:1fr}.cq-encounter{grid-template-columns:1fr}.cq-encounter>.cq-controls,.cq-gate-status{grid-column:auto}.cq-storycopy{padding:22px}.cq-quest-hud{grid-template-columns:1.5fr 1fr}}
@media(max-width:700px){.cq-shell{width:calc(100% - 24px)}.cq-stage{height:370px;min-height:300px}.cq-world-card>.cq-card-top{padding:12px}.cq-cinematic{left:13px;top:13px;font-size:.68rem}.cq-world-status{left:13px;top:36px;font-size:.65rem}.cq-quest-hud{grid-template-columns:1fr;gap:13px;padding:16px}#threatTitle{font-size:.87rem}#questNeed{font-size:.75rem}.cq-defense{grid-column:auto}.cq-inventory{grid-column:auto}.cq-inventory-item{font-size:.6rem;padding:4px 7px}.cq-render-status{font-size:.6rem;padding:9px 12px;display:block;line-height:1.7}.cq-render-status span{display:block}.cq-encounter{padding:19px 15px;gap:14px}.cq-encounter h2{font-size:1.35rem}#encounterText{font-size:.81rem}.cq-route{padding:12px;min-height:78px}.cq-route strong{font-size:.81rem}.cq-route span{font-size:.72rem}.cq-gate-status{font-size:.75rem;padding:11px}.cq-encounter>.cq-controls .cq-btn{flex-basis:100%;min-height:44px;font-size:.8rem}.cq-speech{top:25%;font-size:.77rem;max-width:66%;left:9%}.cq-scene-caption{font-size:.61rem;left:10px;bottom:10px;max-width:72%}.cq-energy{right:10px;bottom:12px}.cq-skip-animation{right:10px;bottom:47px}.cq-editor-card{padding:20px 17px}.cq-storycopy h2{font-size:1.75rem}}
@media(max-width:380px){.cq-stage{height:340px;min-height:300px}.cq-cinematic{font-size:.6rem}.cq-world-status{font-size:.6rem}}
/* Explicit actions reveal the entire scene above a sticky navigation bar. */
.cq-world-card .cq-stage{scroll-margin-top:90px;scroll-margin-bottom:20px}
@media(min-width:701px){.cq-world-card .cq-stage{height:min(550px,calc(100dvh - 150px));min-height:300px}}
