*{box-sizing:border-box} :root{font-family:ui-rounded,"Trebuchet MS",Arial,sans-serif;color:#203c3b;background:#f7f4ec;font-synthesis:none}body{margin:0}button,input,select,textarea{font:inherit}button{color:inherit;cursor:pointer;border:1.5px solid #d5ded5;background:#fffdf8;border-radius:14px;font-weight:700;transition:background .15s,transform .15s}button:hover:not(:disabled){background:#e9eee3;transform:translateY(-1px)}button:active:not(:disabled){transform:translateY(2px)}button:focus-visible,input:focus-visible,textarea:focus-visible,summary:focus-visible,select:focus-visible{outline:4px solid #cf6d35;outline-offset:3px}button:disabled{opacity:.43;cursor:default}svg{width:32px;height:32px;fill:none;stroke:currentColor;stroke-width:3.6;stroke-linecap:round;stroke-linejoin:round}.svg-defs{position:absolute;width:0;height:0}.app-shell{max-width:1920px;margin:0 auto;padding:23px 32px 12px;height:100dvh;min-height:720px;display:flex;flex-direction:column;gap:18px}header{display:flex;align-items:center;gap:20px;justify-content:space-between;flex-shrink:0}.brand{display:flex;align-items:center;gap:13px}.brand-icon{display:grid;place-items:center;background:#236f60;color:#e0f1d7;width:58px;height:58px;border-radius:19px;transform:rotate(-5deg)}.brand-icon svg{width:43px;height:43px}.eyebrow{font-size:11px;font-weight:800;letter-spacing:1.7px;color:#637873}h1{font-size:27px;letter-spacing:-1px;margin:4px 0 0}h2{font-size:26px;letter-spacing:-.7px;margin:5px 0 0}.level-tabs{display:flex;gap:7px;padding:6px;background:#eaece2;border-radius:20px}.level-tabs button{font-size:14px;border:0;background:transparent;padding:9px 11px;white-space:nowrap}.level-tabs button.active{background:#fffdf8;box-shadow:0 3px 9px #273d3210}.level-tabs b{display:inline-grid;place-items:center;width:24px;height:24px;border-radius:50%;background:#d7e0d1;margin-right:5px}.level-tabs .active b{background:#236f60;color:white}.header-actions{display:flex;gap:7px}.small-button{padding:12px 13px;font-size:13px}main{display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:20px;flex:1;min-height:350px}.world-panel{position:relative;overflow:hidden;border:1.5px solid #dce5d6;border-radius:28px;background:#e7eedf;min-height:0}.world-panel::before{content:"";position:absolute;inset:0;background-image:radial-gradient(#acbba746 .9px,transparent .9px);background-size:20px 20px;pointer-events:none}.mission{position:absolute;z-index:2;top:24px;left:26px;right:26px;display:flex;align-items:center;justify-content:space-between;pointer-events:none}.key-badge{display:flex;align-items:center;gap:8px;border:1.5px solid #c5d1bb;border-radius:30px;background:#f9fbf1d9;font-size:15px;font-weight:bold;padding:9px 13px}.key-badge svg{width:23px;height:23px}.key-badge.owned{background:#ffe49b;border-color:#dbad45}#scene{position:absolute;inset:52px 0 25px}#scene canvas{display:block;width:100%;height:100%}.start-note{position:absolute;left:26px;bottom:65px;font-size:13px;background:#fffdf4d9;padding:9px 13px;border-radius:12px;line-height:1.5;max-width:230px}.world-bottom{position:absolute;bottom:20px;left:26px;right:26px;display:flex;justify-content:space-between;align-items:center;font-size:13px;font-weight:700}.triangle{color:#c0642d;font-size:22px;margin-right:6px}.nose-note{display:flex;align-items:center}#position-label{background:#d5e3cf;padding:7px 11px;border-radius:9px}.program-panel{position:relative;background:#fffdf8;border:1.5px solid #dfdfd4;border-radius:26px;padding:23px;display:flex;flex-direction:column;min-height:0}.program-heading{display:flex;justify-content:space-between;align-items:center}.program-heading h2{font-size:22px}.program-heading #queue-count{font-size:12px;padding:7px;border-radius:10px;background:#efeee7;white-space:nowrap}.queue-hint{font-size:11px;margin:9px 0 12px;color:#697770}#queue{list-style:none;padding:0;margin:0;display:grid;grid-template-columns:repeat(4,1fr);gap:7px;align-content:start;flex:1;overflow-y:auto;min-height:64px}#queue:empty{display:none}#queue li{position:relative;display:flex;align-items:center;justify-content:center;height:56px;border:2px solid transparent;border-radius:12px;background:#e2eddf}#queue li svg{width:30px;height:30px}#queue li.left,#queue li.right{background:#e9e1f1}#queue li.take{background:#ffebaf}#queue li.open{background:#f5d7c1}#queue li.done{opacity:.35}#queue li.current{border:3px solid #236f60;box-shadow:0 0 0 2px #9ac6b0}#queue li small{position:absolute;left:4px;top:2px;font-size:9px;font-weight:700}#empty-queue{flex:1;border:2px dashed #dee2d5;border-radius:18px;display:flex;flex-direction:column;justify-content:center;align-items:center;color:#728177;min-height:70px}#empty-queue span{font-size:25px;letter-spacing:9px;color:#8caa94}#empty-queue p{text-align:center;font-size:14px;line-height:1.5}.queue-edit{display:flex;justify-content:space-between;gap:7px;margin:13px 0}.queue-edit button{padding:7px 0;font-size:12px;border:0;background:transparent;color:#61736a}.primary{background:#246f5f;border-color:#246f5f;color:white;padding:16px;font-size:21px;box-shadow:0 4px 0 #164e43}.primary:hover:not(:disabled){background:#195647}.teacher-play{display:flex;gap:8px;margin:13px 0 8px}.teacher-play button{flex:1;padding:10px 3px;font-size:13px}.reset-button{padding:6px;border:0;background:transparent;font-size:13px;color:#65746b}.command-area{display:grid;grid-template-columns:210px 1fr;align-items:center;gap:24px;flex-shrink:0}.command-intro p{font-size:20px;line-height:1.3;margin:10px 0 0;font-weight:700}.command-cards{display:grid;grid-template-columns:repeat(5,1fr);gap:12px}.command{display:grid;grid-template-columns:auto 1fr;align-items:center;text-align:left;column-gap:10px;padding:17px 16px;border:2px solid #cfddc8;border-radius:20px;background:#e3eddb;min-height:100px;box-shadow:0 4px 0 #d1dbca}.command svg{grid-row:span 2;width:39px;height:39px}.command span{font-size:18px;white-space:nowrap}.command small{font-size:11px;font-weight:500;white-space:nowrap}.command.left,.command.right{background:#ece3f2;border-color:#dcd0e6;box-shadow:0 4px 0 #dcd0e6}.command.take{background:#ffecb4;border-color:#eed49b;box-shadow:0 4px 0 #eed49b}.command.open{background:#f7dcc6;border-color:#e7c4a9;box-shadow:0 4px 0 #e7c4a9}footer{display:flex;justify-content:space-between;font-size:11px;color:#798477;padding:0 4px;flex-shrink:0}.celebration{position:absolute;inset:110px 18% 60px;background:#fffbeeec;z-index:3;border:3px solid #e7c86a;border-radius:30px;text-align:center;align-content:center;box-shadow:0 15px 50px #3c543820}.celebration[hidden]{display:none}.celebration>span{font-size:70px;color:#ce941a;display:block}.celebration strong{font-size:34px}.celebration p{font-size:18px}.celebration button{background:#f7d779;border-color:#dbbd64;padding:12px 20px}dialog{border:1.5px solid #dbe0d4;border-radius:30px;background:#fffdf7;color:#203c3b;box-shadow:0 25px 100px #143c3c35;padding:30px;max-width:calc(100vw - 30px)}dialog::backdrop{background:#213a3759;backdrop-filter:blur(7px)}#welcome{text-align:center;width:465px;padding:36px}#welcome h2{font-size:36px;margin-top:12px}#welcome p{font-size:20px;line-height:1.5;margin:16px 0 24px}#welcome .primary{display:block;width:100%}#welcome small{display:block;font-size:11px;margin-top:18px;color:#697b70}.welcome-art{position:relative;margin:0 auto 22px;display:grid;place-items:center;width:120px;height:120px;background:#dcebd4;border-radius:38px;transform:rotate(-6deg)}.welcome-art svg{width:87px;height:87px;color:#206457}.welcome-art span{position:absolute;right:-8px;top:-15px;color:#c99423;font-size:43px}#welcome .boot-message{font-size:12px;margin:14px 0 0;color:#8b5e3b}#teacher-dialog{width:700px;max-height:90vh;overflow:auto}.dialog-heading{display:flex;align-items:center;justify-content:space-between}.dialog-heading button{padding:7px 12px}.dialog-heading h2{margin:0}.settings-grid{display:grid;grid-template-columns:1fr 1fr;gap:30px;margin:25px 0}.settings-grid label{font-weight:bold}.settings-grid output{float:right;color:#5f776a}.settings-grid input{display:block;width:100%;margin-top:12px;accent-color:#246f5f}.mode-label{display:flex;justify-content:space-between;align-items:center;gap:12px}select{padding:9px;border:1px solid #bcccbf;border-radius:10px;background:white;color:#203c3b}.teacher-tools{display:flex;gap:8px;flex-wrap:wrap;margin:15px 0}.teacher-tools button,.file-label{padding:10px 12px;font-size:13px}details{border-top:1px solid #dfe5d8;padding:18px 0}summary{cursor:pointer;font-weight:bold}details p,#teacher-dialog>p{font-size:13px;line-height:1.6}textarea{width:100%;display:block;padding:12px;font-family:monospace;font-size:13px;border:1px solid #c5d4c7;border-radius:10px;margin-top:8px;resize:vertical}details label{display:block;font-size:13px;margin-top:12px}details input[type=text]{display:block;width:100%;padding:12px;margin-top:7px;border:1px solid #c5d4c7;border-radius:10px}input[type=checkbox]{accent-color:#236f60}.file-label{border:1.5px solid #d5ded5;border-radius:13px;cursor:pointer;margin:0!important}.file-label input{display:none}#config-message{color:#95632d;font-weight:bold;min-height:20px}.teacher-footnote{color:#61776a}
@media(min-width:1650px){.app-shell{padding:30px 42px 20px;gap:24px}header h1{font-size:34px}.level-tabs button{font-size:18px}main{grid-template-columns:minmax(0,1fr) 390px}.program-heading h2{font-size:26px}.command{min-height:125px}.command span{font-size:24px}.command small{font-size:14px}.command svg{width:50px;height:50px}.command-area{grid-template-columns:260px 1fr}.command-intro p{font-size:25px}#queue li{height:70px}#queue li svg{width:39px;height:39px}.queue-hint{font-size:13px}.teacher-play button,.small-button{font-size:16px}.world-bottom,.key-badge{font-size:17px}.start-note{font-size:16px;max-width:290px}}
@media(max-width:1200px){.app-shell{padding:15px;gap:14px}.brand-icon{width:45px;height:45px}h1{font-size:22px}.eyebrow{font-size:9px}.level-tabs button{font-size:12px;padding:8px}.small-button{padding:10px}.command-area{grid-template-columns:160px 1fr;gap:15px}.command{padding:12px 10px;column-gap:6px}.command svg{width:28px}.command span{font-size:15px}.command small{font-size:9px}.command-intro p{font-size:16px}main{grid-template-columns:minmax(0,1fr) 290px;gap:14px}.program-panel{padding:18px}.mission{left:20px;right:20px}.mission h2{font-size:23px}.key-badge{font-size:12px}.world-bottom{font-size:11px}}
@media(max-width:850px){.app-shell{height:auto;min-height:100dvh}header{flex-wrap:wrap}.level-tabs{order:3;width:100%;justify-content:center}main{grid-template-columns:1fr}.world-panel{height:420px}.program-panel{min-height:300px}.command-area{display:block}.command-intro{margin-bottom:15px}.command-cards{gap:5px}.command{display:flex;flex-direction:column;text-align:center;padding:9px 2px;gap:5px;min-height:100px}.command span{font-size:12px}.command small{font-size:8px}.start-note{font-size:10px;bottom:55px}#queue{grid-template-columns:repeat(8,1fr);max-height:160px}.world-bottom{left:15px;right:15px}footer{font-size:9px}.settings-grid{gap:10px}.mode-label{display:block}.celebration{inset:90px 10% 50px}}
/* The 50-level library and explicit repeat blocks. */
#level-picker{background:#fffdf8;min-width:230px}#level-picker b{background:#236f60;color:white;width:29px;height:29px}#level-dialog{width:890px;max-height:90vh}#grade-tabs{display:flex;flex-wrap:wrap;gap:8px;margin:23px 0 18px}#grade-tabs button{padding:10px 17px;font-size:14px}#grade-tabs button.active{background:#246f5f;color:white;border-color:#246f5f}#grade-description{background:#eef0df;padding:15px 18px;border-radius:15px;font-size:15px;line-height:1.5;margin-bottom:18px}#level-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:11px}#level-grid button{text-align:left;padding:17px;min-height:112px;position:relative}#level-grid button.active{border:2px solid #246f5f;background:#edf4e7}#level-grid b{display:inline-grid;place-items:center;width:30px;height:30px;background:#dfe7d5;border-radius:10px;margin-bottom:10px}#level-grid strong{display:block;font-size:16px;line-height:1.3}#level-grid small{display:block;font-size:11px;line-height:1.5;color:#6c7e72;margin-top:6px}#level-grid .solved{position:absolute;right:15px;top:17px;color:#246f5f}.level-library-note{font-size:13px;color:#62786b;line-height:1.6}#repeat-controls{padding-top:10px}#repeat-toggle{padding:10px;width:100%;font-size:13px;background:#ece2f1;border-color:#d8c9e1}#repeat-editor{border:2px solid #b69bc7;border-radius:14px;padding:10px;background:#f4edf8}#repeat-editor label{font-size:13px;font-weight:bold;display:flex;justify-content:space-between;align-items:center}#repeat-editor select{padding:5px}#repeat-preview{display:flex;gap:3px;flex-wrap:wrap;min-height:33px;align-items:center;font-size:11px;margin:10px 0}#repeat-preview svg{width:23px;height:23px;padding:3px;border-radius:5px;background:white}#repeat-editor>div{display:flex;gap:6px}#repeat-editor button{padding:8px;flex:1;font-size:12px}#queue li.repeat-block{grid-column:span 2;min-height:76px;height:auto;display:block;padding:8px;background:#e9dff0}#queue li.repeat-block>strong{display:block;font-size:13px;padding-left:8px}#queue li.repeat-block>span{display:flex;flex-wrap:wrap;gap:2px;margin-top:7px}#queue li.repeat-block>span svg{width:23px;height:23px}#execution-detail{min-height:16px;line-height:1.4}#repeat-controls[hidden],#repeat-editor[hidden],#audio-retry[hidden]{display:none!important}.program-panel:has(#repeat-editor:not([hidden])) #empty-queue{min-height:50px}.program-panel:has(#repeat-editor:not([hidden])) #empty-queue p{display:none}
@media(max-width:1200px){#level-picker{min-width:180px}#repeat-toggle{font-size:12px;padding:8px}#level-grid{grid-template-columns:repeat(2,1fr)}}
@media(min-width:1650px){#repeat-toggle{font-size:16px}#repeat-editor label{font-size:16px}#queue li.repeat-block>strong{font-size:16px}#queue li.repeat-block>span svg{width:29px;height:29px}#repeat-preview svg{width:29px;height:29px}}
@media(max-width:850px){#level-picker{min-width:200px}#grade-tabs button{padding:8px 11px}#level-dialog{padding:20px}#level-dialog h2{font-size:23px}#level-grid button{padding:12px}#level-grid strong{font-size:14px}}
