:root{font-family:"Trebuchet MS","Segoe UI",sans-serif;color:var(--navy);background:#f4f7fc;font-synthesis:none;--red:#e43433;--navy:#00245f;--blue:#3f7bbb;--yellow:#f7b935;--muted:#496084}*{box-sizing:border-box}body{margin:0}button,select{font:inherit}button{cursor:pointer;border:0;font-weight:800;transition:transform .15s,background .15s;touch-action:manipulation}button:hover:not(:disabled){transform:translateY(-2px);filter:brightness(.97)}button:active:not(:disabled){transform:translateY(1px)}button:focus-visible,a:focus-visible,select:focus-visible{outline:4px solid var(--red);outline-offset:4px}button:disabled{opacity:.45;cursor:default}button[aria-pressed="true"]{outline:3px solid var(--navy);outline-offset:2px}[hidden]{display:none!important}.app{max-width:1440px;margin:auto;padding:0 46px}header{min-height:110px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #d9e3f1;gap:20px}.brand{display:flex;align-items:center;gap:10px;color:var(--navy);text-decoration:none;font-size:32px;letter-spacing:-1.5px;font-weight:900}.brand img{width:58px;height:58px}.brand-accent{color:var(--blue)}.brand small{display:block;font-size:10px;letter-spacing:1.5px;margin-top:4px;color:var(--muted)}.utilities{display:flex;gap:10px}.utility{background:transparent;color:#334e76;font-size:14px;padding:12px 10px;border-radius:12px}.mission-bar{display:flex;align-items:center;justify-content:space-between;margin:24px 0 20px}.eyebrow{font-size:11px;letter-spacing:2px;font-weight:800;color:#496084}h1{font-size:28px;margin:5px 0 0;letter-spacing:-.6px}h1 span{font-weight:500}nav{display:flex;align-items:center;gap:10px}nav>span{font-size:12px;letter-spacing:1.5px;font-weight:800;margin-right:8px}nav button{width:46px;height:46px;border-radius:15px;background:#e8eef8;color:var(--navy);font-size:22px}nav button[aria-current="true"]{background:var(--navy);color:white;box-shadow:0 4px 0 #001738}.workspace{display:grid;grid-template-columns:1.08fr 1fr;gap:36px;align-items:stretch}.play-area{padding:18px 22px 12px;background:#e7effa;border:1px solid #cbdcf0;border-radius:25px;display:flex;flex-direction:column;align-items:center;justify-content:center}.board-wrap{position:relative;width:min(100%,420px);aspect-ratio:1}.board{display:grid;grid-template-columns:repeat(8,1fr);gap:6px;width:100%;height:100%;padding:6px;border-radius:17px;background:var(--blue);box-shadow:0 6px 0 #295d98}.cell{min-width:0;position:relative;border-radius:10px;background:#ffffff;display:grid;place-items:center;aspect-ratio:1;color:var(--navy);opacity:1!important}.cell:nth-child(even){background:#edf3fc}.cell .star{font-size:clamp(30px,4vw,55px);color:var(--yellow);filter:drop-shadow(0 3px 0 #9b6709);line-height:1}.cell .rock{width:60%;height:56%;background:#8294ae;clip-path:polygon(23% 12%,66% 0,100% 49%,87% 91%,29% 100%,0 64%,7% 37%);box-shadow:inset -12px -12px #5b6f8e;transform:rotate(-8deg)}.cell .start-marker{height:16px;width:16px;border:3px dashed #7398c5;border-radius:50%}.editing .cell{cursor:crosshair}.editing .cell:hover{outline:3px solid var(--navy);outline-offset:-3px}.robot{position:absolute;left:0;top:0;width:20%;height:20%;display:grid;place-items:center;pointer-events:none;transition:transform .48s ease;z-index:2}.robot-turn{width:85%;height:85%;position:relative;transition:transform .4s ease;display:grid;place-items:center}.robot img{width:100%;height:100%;filter:drop-shadow(0 3px 1px #00245f33)}.direction-arrow{position:absolute;top:-11%;left:40%;font-size:19px;color:var(--navy)}.robot.celebrate img{animation:bounce .5s ease 4}.board-caption{display:flex;justify-content:space-between;width:100%;font-size:14px;margin-top:18px;color:#405e84;gap:10px}.board-caption>span:first-child{color:var(--navy)}.board-caption strong{font-size:16px}.program-panel{padding:26px;background:#fff;border:1px solid #d9e3f1;border-radius:25px;display:flex;flex-direction:column;min-width:0;box-shadow:0 5px 0 #e0e8f5}.panel-heading{display:flex;align-items:center;justify-content:space-between;gap:10px}h2{margin:0;font-size:26px;letter-spacing:-.5px}.panel-heading>span{border-radius:20px;background:#edf2fa;padding:7px 12px;color:#405e84;font-size:14px;font-weight:800}.hint{color:var(--muted);font-size:15px;margin:10px 0 20px}.sequence{padding:0;margin:0;list-style:none;display:grid;grid-template-columns:repeat(6,1fr);gap:9px}.sequence li{height:66px;border:2px dashed #d2ddef;border-radius:13px;background:#f7f9fd;position:relative;display:grid;place-items:center;font-size:34px;font-weight:bold;color:var(--navy)}.sequence li.filled{border:2px solid var(--blue);background:#e8f1fc;box-shadow:0 3px 0 #c5d8f1}.sequence li.left{background:#fff3d7;border-color:var(--yellow);color:var(--navy);box-shadow:0 3px 0 #eed8a4}.sequence li.right{background:#feeeee;border-color:var(--red);color:var(--navy);box-shadow:0 3px 0 #f4c6c6}.sequence li.active{outline:4px solid var(--navy);outline-offset:1px;transform:translateY(-4px)}.sequence .number{position:absolute;top:3px;left:6px;font-size:10px;color:#496084}.status{background:#edf2fa;border-radius:13px;padding:15px;text-align:center;font-size:17px;font-weight:700;min-height:68px;display:grid;place-items:center;margin:22px 0 18px;flex:1}.status.success{background:#fff3d7;color:var(--navy);border:2px solid var(--yellow)}.status.warning{background:#feeeee;color:#9b2424;border:2px solid var(--red)}.program-actions{display:grid;grid-template-columns:1fr 1.35fr;gap:12px}.primary,.secondary{min-height:53px;border-radius:13px;padding:12px 16px;font-size:20px}.primary{background:var(--navy);color:white;box-shadow:0 4px 0 #001738}.secondary{background:#e8eef8;color:#334e76}.reset{background:transparent;color:#496084;font-size:15px;padding:14px 0 0;align-self:center}.commands{display:flex;align-items:center;gap:15px;margin-top:25px}.command-label{font-size:11px;line-height:1.6;letter-spacing:1.2px;color:#405e84;min-width:115px}.commands button{flex:1;border-radius:16px;min-height:72px;font-size:23px;display:flex;align-items:center;justify-content:center;gap:18px;border:1px solid #295d98;box-shadow:0 4px 0 #295d98;color:#ffffff;background:var(--blue)}.commands button span{font-size:40px;line-height:1}.commands .left{background:var(--yellow);border-color:#daa022;box-shadow:0 4px 0 #cf951c;color:var(--navy)}.commands .right{background:var(--red);border-color:#c72c2b;box-shadow:0 4px 0 #b92a29;color:#ffffff}footer{display:flex;justify-content:space-between;align-items:center;color:#496084;font-size:12px;padding:24px 0 18px}.footer-star{color:var(--yellow);font-size:20px;margin-left:8px}.editor-tools{display:grid;grid-template-columns:1fr 1fr;gap:12px}.editor-tools button{background:#e8eef8;color:var(--navy);min-height:46px;border-radius:11px;font-size:17px}.orientation{display:flex;align-items:center;justify-content:space-between;font-size:16px;gap:12px;margin:22px 0}.orientation select{padding:10px;border:1px solid #b8cbe5;border-radius:8px;background:white;color:var(--navy)}.editor-status{font-size:15px;color:#405e84;min-height:36px}.editing .board-caption{visibility:hidden}#confetti{position:fixed;inset:0;pointer-events:none;overflow:hidden;z-index:10}.confetti-piece{position:absolute;top:-25px;width:12px;height:19px;animation:fall 2.5s ease-in forwards}@keyframes fall{to{transform:translateY(110vh) rotate(680deg)}}@keyframes bounce{50%{transform:translateY(-12px)}}
@media(min-width:1100px) and (max-height:800px){header{height:82px}.mission-bar{margin:15px 0}.board-wrap{width:350px}.play-area{padding:15px 20px 10px}.program-panel{padding:21px}.sequence li{height:57px}.status{margin:16px 0 13px;min-height:60px}.commands{margin-top:20px}.commands button{min-height:64px}footer{padding:18px 0 10px}}
@media(min-width:1600px) and (min-height:900px){.app{max-width:1580px}header{height:115px}.board-wrap{width:510px}.program-panel{padding:34px}.sequence li{height:86px;font-size:44px}.hint{font-size:19px}.status{font-size:23px}.commands button{min-height:85px;font-size:27px}.primary,.secondary{font-size:24px;min-height:66px}.board-caption{font-size:18px}.board-caption strong{font-size:20px}}
@media(max-width:1050px){.app{padding:0 22px}.utilities{gap:0}.utility{font-size:13px}.brand small{display:none}.workspace{gap:20px}.play-area{padding:14px}.program-panel{padding:20px}.sequence{gap:6px}.sequence li{height:55px}.command-label{display:none}.commands button{font-size:20px;gap:10px}.board-caption{font-size:12px}.board-caption strong{font-size:14px}h1{font-size:23px}}
@media(max-width:740px){header{height:auto;min-height:88px;flex-wrap:wrap;padding:14px 0;gap:8px}.brand{font-size:27px}.brand img{width:43px;height:43px}.utilities{width:100%;justify-content:space-between}.utility{padding:8px 4px;font-size:12px}.mission-bar{gap:14px;flex-wrap:wrap;margin:20px 0}.eyebrow{font-size:10px}h1{font-size:22px}nav button{width:40px;height:40px}.workspace{grid-template-columns:1fr}.board-wrap{max-width:390px}.commands{flex-wrap:wrap;gap:10px}.commands button{font-size:17px;min-height:60px;gap:7px}.commands button span{font-size:28px}.sequence li{height:60px}footer{font-size:10px;gap:10px}.orientation{flex-wrap:wrap}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}

/* El logotipo original tiene letras blancas; el fondo azul permite leerlas. */
.brand-group{display:flex;align-items:center;gap:22px;min-width:0}
.school-logo{display:block;flex-shrink:0;width:180px;height:auto;padding:8px;background:var(--blue);border-radius:12px}
@media(max-width:1050px){.brand-group{gap:12px}.school-logo{width:145px}.brand{font-size:27px}}
@media(max-width:740px){.brand-group{width:100%;justify-content:space-between;gap:8px}.school-logo{width:124px;padding:6px}.brand{font-size:24px;gap:6px}}
@media(max-width:360px){.school-logo{width:106px}.app{padding:0 14px}}

/* RotherBot 2.0 */
.version{display:inline-block;background:var(--yellow);color:var(--navy);font-size:14px;letter-spacing:0;border-radius:9px;padding:5px 8px;vertical-align:middle}
.app{max-width:1480px;padding:0 32px}
header{min-height:96px}.brand-group{gap:16px}.school-logo{width:150px}.brand{font-size:30px}.brand small{font-size:9px}
.mission-bar{gap:20px;margin:20px 0 18px}.mission-bar>div{min-width:0}#mission-hint{font-size:14px;margin:8px 0 0;color:var(--muted)}nav{flex-shrink:0;gap:8px}nav button{width:42px;height:42px}h1{font-size:27px}
.workspace{grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:24px}.play-area{padding:16px 22px 12px}.board-wrap{width:min(100%,460px)}.board{gap:4px;padding:5px;border-radius:16px}.cell{padding:0;border-radius:7px}.cell .star{font-size:clamp(22px,3.4vw,43px)}.cell .rock{box-shadow:inset -7px -7px #5b6f8e}.robot{width:12.5%;height:12.5%}.robot-turn{width:94%;height:94%}.direction-arrow{font-size:14px;top:-13%}.board-caption{margin-top:14px;font-size:12px}.board-caption strong{font-size:14px}
.cell.danger{background:#fff0ee;outline:2px dotted var(--red);outline-offset:-4px}.cell.alien-cell{background:#ffe2d9;outline:2px solid var(--red)}.alien{width:85%;height:85%;object-fit:contain}.legend{display:flex;justify-content:center;gap:24px;align-items:center;margin-top:14px;font-size:13px;font-weight:bold}.legend>span{display:flex;align-items:center;gap:6px}.legend img{width:24px;height:24px}.legend-rock{display:inline-block;width:17px;height:17px;background:#8294ae;border-radius:5px;transform:rotate(-12deg)}.alien-rule{font-size:12px;color:var(--muted);text-align:center;line-height:1.5;margin:7px 0 0}
.program-panel{padding:22px}.hint{margin:10px 0 17px;font-size:14px}.sequence{gap:8px}.sequence li{height:66px;font-size:30px;padding-bottom:12px}.card-icon{line-height:1}.repeat-badge{position:absolute;bottom:4px;right:5px;background:white;color:var(--navy);padding:2px 5px;border-radius:6px;font-size:12px;line-height:1}.sequence li.jump{background:var(--navy);color:white;border-color:var(--navy);box-shadow:0 3px 0 #001738}.sequence li.jump .number{color:#fff}.sequence li.active{outline-color:var(--red)}.status{min-height:65px;font-size:16px;line-height:1.4;margin:18px 0 14px}.editor-status{line-height:1.5}.editor-tools button{font-size:16px}.orientation{font-size:14px}
.builder{margin-top:22px}.repeat-control{display:flex;align-items:center;justify-content:space-between;gap:18px;background:white;border:1px solid #d9e3f1;border-radius:16px;padding:12px 18px}.repeat-control strong{display:block;font-size:19px}.repeat-control small{display:block;color:var(--muted);font-size:12px;margin-top:4px}.stepper{display:flex;align-items:center;gap:8px;flex-shrink:0}.stepper button{width:42px;height:42px;border-radius:10px;background:#e8eef8;color:var(--navy);font-size:24px}.stepper select{border:2px solid var(--blue);border-radius:10px;padding:9px 8px;background:#f4f7fc;color:var(--navy);font-weight:bold;font-size:16px}.repeat-example{font-size:14px;color:var(--muted)}.commands{margin-top:12px;gap:12px}.commands button{min-height:65px;font-size:21px;gap:12px}.commands button span{font-size:33px}.commands .jump{background:var(--navy);border-color:#001738;box-shadow:0 4px 0 #001738;color:white}.jump-rule{font-size:13px;line-height:1.5;color:var(--muted);margin:13px 4px 0}.help{margin-top:18px;padding:13px 18px;background:#e8eef8;border-radius:13px;font-size:14px}.help summary{cursor:pointer;font-weight:bold}.help p{line-height:1.5}.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}.robot.jumping img{animation:hop .47s ease}.robot.absorbed .robot-turn{animation:absorb .65s ease forwards}.robot.absorbed{opacity:1}@keyframes hop{50%{transform:translateY(-22px) scale(1.08)}}@keyframes absorb{to{scale:0;opacity:0}}
@media(min-width:1100px) and (max-height:800px){header{min-height:86px;height:auto}.board-wrap{width:min(100%,370px)}.mission-bar{margin:14px 0}.sequence li{height:53px}.play-area{padding:12px 20px}.legend{margin-top:10px}.program-panel{padding:20px}.builder{margin-top:18px}.repeat-control{padding:10px 16px}.commands button{min-height:59px}.status{min-height:58px}}
@media(min-width:1600px) and (min-height:900px){.board-wrap{width:min(100%,540px)}.sequence li{height:83px;font-size:38px}.program-panel{padding:28px}.status{font-size:20px}.commands button{min-height:78px;font-size:25px}.repeat-control{padding:16px 22px}}
@media(max-width:1050px){.app{padding:0 22px}.brand{font-size:26px}.school-logo{width:130px}.workspace{gap:18px}.play-area{padding:14px}.program-panel{padding:18px}.sequence{gap:6px}.sequence li{height:56px}.repeat-example{display:none}}
@media(max-width:740px){.app{padding:0 16px}header{min-height:88px;padding:12px 0;height:auto}.brand{font-size:24px}.brand img{width:40px;height:40px}.brand-group{gap:8px}.school-logo{width:110px}.version{font-size:11px;padding:4px 5px}.mission-bar{flex-wrap:wrap;margin:18px 0}.mission-bar nav{width:100%}h1{font-size:23px}#mission-hint{font-size:13px;line-height:1.5}.workspace{grid-template-columns:minmax(0,1fr)}.board-wrap{width:100%;max-width:460px}.board{gap:3px;padding:4px}.cell{border-radius:5px}.cell.danger{outline-offset:-3px}.board-caption{font-size:11px}.board-caption strong{font-size:12px}.legend{gap:18px;font-size:12px}.alien-rule{font-size:11px}.sequence li{height:62px}.repeat-control{flex-wrap:wrap;gap:10px;padding:14px}.repeat-control>div:first-child{width:100%}.repeat-example{display:block;font-size:12px}.commands{display:grid;grid-template-columns:1fr 1fr;gap:12px}.commands button{min-height:62px;font-size:18px}.jump-rule{font-size:12px}.status{font-size:16px}.orientation{flex-wrap:wrap}footer{font-size:10px}.help{font-size:13px}}
@media(max-width:360px){.brand{font-size:21px}.brand img{width:32px;height:32px}.school-logo{width:92px}.utilities .utility{font-size:11px}.sequence{gap:5px}.sequence li{height:55px}.repeat-example{width:100%}.legend{gap:12px}}
@media(prefers-reduced-motion:reduce){.robot.absorbed .robot-turn{opacity:0}}

/* Mantiene juntos el nombre y la versión en pantallas de tablet. */
.brand>span{white-space:nowrap}
@media(min-width:741px) and (max-width:900px){.brand{font-size:22px;gap:8px}.brand img{width:44px;height:44px}.school-logo{width:105px}.brand-group{gap:12px}.utility{white-space:nowrap;font-size:12px;padding:10px 7px}}
@media(max-width:1050px){.program-actions button{font-size:18px;padding:12px 10px;white-space:nowrap}}

/* Vista de aula: tablero a la izquierda y todas las instrucciones a la derecha. */
@media(min-width:1100px) and (min-height:850px){
  .app{max-width:1840px;height:100dvh;padding:0 32px;display:flex;flex-direction:column}
  header{height:78px;min-height:78px;flex-shrink:0}
  .brand{font-size:29px}.brand small{display:none}.brand img{width:48px;height:48px}.school-logo{width:132px}
  main{flex:1;min-height:0;display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr);grid-template-rows:72px minmax(0,1fr) 236px 38px;grid-template-areas:"mission mission" "board program" "board builder" "help help";gap:12px 22px;padding:10px 0 0}
  .mission-bar{grid-area:mission;margin:0;gap:20px}.eyebrow{font-size:10px;letter-spacing:1.5px}h1{font-size:27px}#mission-hint{margin-top:5px;font-size:14px}
  nav button{width:44px;height:44px}
  .workspace{display:contents}
  .play-area{grid-area:board;min-height:0;padding:18px 22px 14px;justify-content:flex-start;border-radius:22px}
  .board-wrap{flex:1;width:100%;height:auto;min-height:0;max-width:none;aspect-ratio:auto}
  .board{grid-template-rows:repeat(8,minmax(0,1fr));gap:5px;padding:6px}
  .cell{aspect-ratio:auto;min-height:0;border-radius:8px}
  .cell .star{font-size:42px}.cell .rock{width:43%;height:59%}.cell .alien{width:76%;height:82%}
  .robot-turn{width:85%;height:85%}.robot img{object-fit:contain}.direction-arrow{font-size:16px;top:-10%}
  .board-caption{flex-shrink:0;font-size:15px;margin-top:12px}.board-caption strong{font-size:16px}
  .legend{flex-shrink:0;margin-top:10px;font-size:14px;gap:30px}.alien-rule{flex-shrink:0;font-size:13px;margin-top:5px}
  .program-panel{grid-area:program;min-height:0;padding:18px 22px;border-radius:22px}
  h2{font-size:25px}.hint{font-size:14px;margin:8px 0 14px}
  .sequence{gap:7px}.sequence li{height:56px;font-size:32px}.repeat-badge{font-size:13px}.sequence .number{font-size:11px}
  .status{min-height:48px;flex:1;font-size:17px;padding:9px 12px;margin:12px 0}
  .primary,.secondary{min-height:48px;font-size:20px;padding:10px 14px}.reset{font-size:14px;padding-top:10px}
  .builder{grid-area:builder;margin:0;padding:15px 20px;background:white;border:1px solid #d9e3f1;border-radius:22px;display:flex;flex-direction:column;gap:12px}
  .repeat-control{border:0;background:transparent;border-radius:0;padding:0;gap:12px;flex-wrap:nowrap;min-height:56px}
  .repeat-control strong{font-size:21px}.repeat-control small{font-size:12px;max-width:210px;line-height:1.4}.repeat-example{display:none}
  .stepper{gap:7px}.stepper button{width:40px;height:40px}.stepper select{font-size:17px;padding:8px}
  .commands{display:grid;grid-template-columns:1fr 1fr;gap:11px;margin:0;flex:1}.commands button{min-height:60px;font-size:23px;gap:14px;border-radius:13px}.commands button span{font-size:32px}
  .jump-rule{display:none}
  .help{grid-area:help;align-self:stretch;margin:0;padding:10px 16px;font-size:14px;line-height:18px;border-radius:11px}
  .help[open]{position:fixed;left:50%;bottom:42px;transform:translateX(-50%);width:min(620px,90vw);max-height:75vh;overflow:auto;background:white;border:2px solid var(--blue);box-shadow:0 8px 40px #00245f33;z-index:8;padding:18px 22px}
  footer{flex-shrink:0;height:30px;padding:0;font-size:11px}.footer-star{font-size:16px}
  .editing main{grid-template-rows:72px minmax(0,1fr) 38px;grid-template-areas:"mission mission" "board program" "help help"}
  .editing .program-panel{justify-content:flex-start;gap:0;padding:24px}
  .editing .editor-tools{gap:12px}.editing .editor-tools button{min-height:52px;font-size:19px}
  .editing .orientation{margin:22px 0;font-size:17px}.editing .editor-status{flex:1;min-height:48px;font-size:17px}
}
@media(min-width:1100px) and (min-height:850px) and (max-height:980px){
  main{grid-template-rows:64px minmax(0,1fr) 218px 34px;gap:10px 20px}header{height:68px;min-height:68px}
  .program-panel{padding:14px 18px}.sequence li{height:48px;font-size:28px}.hint{margin:7px 0 10px;font-size:13px}.status{font-size:15px;margin:10px 0;min-height:42px}
  .builder{padding:12px 18px;gap:10px}.commands button{min-height:55px;font-size:21px}.repeat-control{min-height:52px}
  .help{padding:8px 14px}.editing main{grid-template-rows:64px minmax(0,1fr) 34px}
}

/* Casillas cuadradas: 10 columnas y 8 filas, sin deformar el robot. */
.board-wrap{aspect-ratio:5 / 4}
.board{grid-template-columns:repeat(10,minmax(0,1fr));grid-template-rows:repeat(8,minmax(0,1fr));gap:4px;padding:2px}
.cell{aspect-ratio:auto;min-height:0}
.robot-turn{width:64%;height:64%;aspect-ratio:1}
.robot img{object-fit:contain;filter:drop-shadow(0 2px 1px #00245f33)}
.direction-arrow{top:-6%;left:50%;transform:translateX(-50%);font-size:clamp(7px,1vw,13px)}
@keyframes hop{50%{transform:translateY(-12%) scale(1.02)}}
@keyframes bounce{50%{transform:translateY(-10%)}}
@media(min-width:1100px) and (min-height:850px){
  .play-area{container-type:size;justify-content:center}
  .board-wrap{flex:none;width:min(100%,calc((100cqh - 100px) * 1.25));height:auto;aspect-ratio:5 / 4;min-height:0}
  .board{gap:4px;padding:2px}
  .robot-turn{width:64%;height:64%}.direction-arrow{top:-6%;font-size:13px}
}

/* RotherBot 2.1: edición directa por toque y controles de observación. */
.mission-picker{display:flex;align-items:center;gap:16px;flex-shrink:0}
.mission-picker select{min-height:48px;border:2px solid var(--blue);border-radius:12px;background:white;color:var(--navy);font:inherit;font-size:16px;font-weight:bold;padding:8px 12px;max-width:100%}
nav button{min-width:48px;min-height:48px}
.program-count{display:flex;align-items:center;gap:10px;white-space:nowrap}
.program-count small{font-size:13px;font-weight:normal;color:var(--muted)}
.card-button{width:100%;height:100%;min-height:0;padding:7px 2px 15px;border:0;border-radius:10px;background:transparent;color:inherit;display:grid;place-items:center;position:relative;font:inherit;touch-action:manipulation}
.card-button:disabled{opacity:1}
.card-button:hover:not(:disabled),.card-button:active:not(:disabled){transform:none}
.sequence li{padding:0}
.sequence .number{z-index:1;pointer-events:none}
.sequence li.chosen{outline:4px solid #9d4c00;outline-offset:2px}
.sequence li.failed{border:3px dashed #ac3022;background:#fff1e3}
.sequence li.failed.jump{color:var(--navy)}
.sequence li.failed.jump .number{color:var(--navy)}
.program-actions{grid-template-columns:1fr 1fr 1.1fr;gap:10px}
.program-actions button{font-size:18px;padding:10px 6px;min-height:50px}
.transport{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:8px}
.transport .reset{min-height:48px;padding:8px 4px;font-size:15px;align-self:auto;border-radius:10px}
.transport .reset:hover{background:#edf2fa}
.stepper button,.stepper select{min-height:48px;min-width:48px}
.editor-tools button{min-height:50px}
button:focus-visible,select:focus-visible{outline:4px solid #a54300;outline-offset:3px}

@media(min-width:1100px) and (min-height:650px){
 .app{max-width:1840px;height:100dvh;padding:0 24px;display:flex;flex-direction:column}
 header{height:60px;min-height:60px;flex-shrink:0}
 .brand{font-size:27px}.brand small{display:none}.brand img{width:44px;height:44px}.school-logo{width:116px}
 main{flex:1;min-height:0;display:grid;grid-template-columns:minmax(0,1.35fr) minmax(0,1fr);grid-template-rows:64px minmax(0,1fr) 136px 30px;grid-template-areas:"mission mission" "board program" "board builder" "help help";gap:10px 20px;padding:8px 0 0}
 .mission-bar{grid-area:mission;margin:0;gap:16px;min-width:0}.eyebrow{font-size:10px}h1{font-size:25px}#mission-hint{font-size:14px;margin-top:4px}
 .mission-picker{gap:12px}.mission-picker select{font-size:15px;padding:8px}
 nav{gap:8px}nav button{width:48px;height:48px}
 .workspace{display:contents}
 .play-area{grid-area:board;min-height:0;padding:16px 18px 12px;container-type:size;justify-content:center}
 .board-wrap{flex:none;width:min(100%,calc((100cqh - 110px) * 1.25));height:auto;aspect-ratio:5 / 4;min-height:0;max-width:none}
 .board{grid-template-columns:repeat(10,minmax(0,1fr));grid-template-rows:repeat(8,minmax(0,1fr));gap:4px;padding:2px}
 .cell{aspect-ratio:auto;min-height:0}.robot-turn{width:64%;height:64%}
 .board-caption{margin-top:12px;font-size:15px}.board-caption strong{font-size:16px}
 .legend{margin-top:8px;font-size:14px}.alien-rule{font-size:13px;margin:5px 0 0}
 .program-panel{grid-area:program;display:flex;flex-direction:column;min-height:0;padding:14px 16px}
 h2{font-size:24px}.panel-heading>span{padding:6px 9px;font-size:14px}
 .hint{font-size:14px;margin:6px 0 10px;line-height:1.3}
 .sequence{gap:6px;flex-shrink:0}.sequence li{height:56px;font-size:32px}
 .repeat-badge{font-size:14px}.sequence .number{font-size:11px}
 .status{flex:1;min-height:40px;font-size:16px;line-height:1.3;padding:8px 10px;margin:8px 0}
 .program-actions{gap:8px;flex-shrink:0}.program-actions button{min-height:50px;font-size:18px;padding:8px 5px}
 .transport{flex-shrink:0;gap:6px;margin-top:8px}.transport .reset{min-height:48px;font-size:15px;padding:7px 3px}
 .builder{grid-area:builder;margin:0;padding:8px 10px;border:1px solid #d9e3f1;background:white;border-radius:18px;display:flex;flex-direction:column;gap:8px;min-height:0}
 .repeat-control{border:0;background:transparent;border-radius:0;padding:0;gap:8px;flex-wrap:nowrap;min-height:48px}
 .repeat-control strong{font-size:18px}.repeat-control small{font-size:12px;line-height:1.25;max-width:200px;margin-top:1px}.repeat-example{display:none}
 .stepper{gap:6px}.stepper button{width:48px;height:48px}.stepper select{font-size:16px;padding:8px 6px;min-height:48px}
 .commands{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:0;flex:1}
 .commands button{flex-direction:column;min-height:60px;gap:2px;padding:5px 2px;border-radius:11px;font-size:16px;line-height:1.2}
 .commands button span{font-size:25px;line-height:1}
 .jump-rule{display:none}
 .help{grid-area:help;margin:0;padding:6px 14px;font-size:14px;line-height:18px;border-radius:10px}
 .help[open]{position:fixed;left:50%;bottom:32px;transform:translateX(-50%);width:min(680px,90vw);max-height:80vh;overflow:auto;background:white;border:2px solid var(--blue);box-shadow:0 8px 40px #00245f33;z-index:8;padding:16px 20px}
 footer{height:20px;padding:0;font-size:11px;flex-shrink:0}.footer-star{font-size:16px}
 .editing main{grid-template-rows:64px minmax(0,1fr) 30px;grid-template-areas:"mission mission" "board program" "help help"}
 .editing .program-panel{padding:20px;justify-content:flex-start}.editing .hint{display:block}
 .editing .editor-tools button{min-height:52px;font-size:18px}.editing .orientation{font-size:16px;margin:16px 0}.editing .editor-status{flex:1;font-size:16px;min-height:45px}
}
@media(min-width:1100px) and (min-height:650px) and (max-height:850px){
 .program-panel{padding:12px}.hint{display:none}.sequence li{height:48px;font-size:28px}
 h2{font-size:23px}.program-count small{font-size:12px}.status{font-size:15px}
 .mission-picker{gap:10px}.mission-picker select{font-size:14px}.mission-bar h1{font-size:23px}
 .repeat-control small{font-size:11px;max-width:150px}
 .editing .editor-tools{gap:10px}.editing .orientation{margin:12px 0}.editing .program-panel{padding:16px}
}
@media(min-width:1600px) and (min-height:1000px){
 main{grid-template-rows:72px minmax(0,1fr) 158px 34px;gap:12px 24px}
 .program-panel{padding:22px}.sequence li{height:68px;font-size:38px}.status{font-size:19px}
 .program-actions button{font-size:21px;min-height:56px}.transport .reset{font-size:17px;min-height:52px}
 .builder{padding:12px 16px;gap:10px}.commands button{min-height:72px;font-size:20px}.commands button span{font-size:30px}
 .repeat-control strong{font-size:21px}.repeat-control small{font-size:14px;max-width:280px}
 .program-count small{font-size:15px}h1{font-size:29px}.mission-picker select{font-size:17px}
}
@media(max-width:1099px){
 .mission-bar{flex-wrap:wrap}.mission-picker{gap:14px;flex-wrap:wrap}.mission-picker select{font-size:16px}
 .program-actions button{font-size:17px;min-height:52px;padding:8px 5px;white-space:normal}
 .sequence li{min-height:55px}.stepper button{width:48px;height:48px}
 .transport .reset{min-height:50px}.program-count small{font-size:13px}
}
@media(max-width:740px){
 .mission-picker{width:100%;justify-content:space-between;gap:10px}
 .mission-picker nav{width:auto;gap:7px}.mission-picker select{max-width:180px;font-size:14px;padding:8px}
 .mission-picker nav button{min-width:48px;min-height:48px;width:48px;height:48px}
 .sequence{grid-template-columns:repeat(4,minmax(0,1fr))}.sequence li{height:62px;font-size:30px}
 .program-count{gap:7px}.program-count small{font-size:12px}.program-actions button{white-space:normal;font-size:16px}
 .repeat-control{flex-wrap:wrap}.repeat-control>div:first-child{width:100%}
 .transport .reset{font-size:14px}.card-button{padding-bottom:15px}
}
@media(max-width:390px){
 .mission-picker{justify-content:flex-start}.mission-picker select{max-width:100%;width:100%}
 .panel-heading{gap:8px}h2{font-size:22px}.program-count{font-size:12px;padding:5px 7px!important;gap:5px}.program-count small{font-size:11px}
 .sequence{gap:6px}.sequence li{height:58px}.program-actions{gap:6px}.program-actions button{font-size:14px}
}

/* Diez misiones, también en pantallas pequeñas. */
.mission-bar{gap:16px;flex-wrap:wrap}nav{flex-wrap:wrap;max-width:100%}
.mission-picker{flex:1;min-width:0;flex-wrap:wrap;justify-content:flex-end}.mission-picker nav{gap:6px}.mission-picker nav button{flex-shrink:0}
@media(min-width:1100px) and (min-height:650px){main{grid-template-rows:auto minmax(0,1fr) 136px 30px}.mission-bar{min-height:64px}.mission-picker{flex-basis:700px}.editing main{grid-template-rows:auto minmax(0,1fr) 30px}}
@media(max-width:740px){.mission-picker{justify-content:flex-start}.mission-picker nav{width:100%}}
@media(max-width:740px){.mission-picker{flex:0 0 100%;width:100%}.mission-bar>div:first-child{width:100%}.mission-picker select{width:auto;max-width:100%}}

.mission-label{font-size:14px;font-weight:800;color:var(--muted);white-space:nowrap}.mission-picker{flex-basis:auto}@media(max-width:740px){.mission-picker{flex-basis:100%}}
