.robot-game{padding:16px 0 56px;}
.robot-game-wrap{display:grid;gap:16px;max-width:1080px;}
.robot-game-intro .eyebrow{display:block;font-size:10px;line-height:1.2;}
.robot-game-intro h1{font-size:clamp(28px,3.2vw,40px);line-height:1.1;letter-spacing:-.035em;margin:6px 0 8px;color:var(--ink);}
.robot-game-intro>p{color:var(--muted);font-size:14px;line-height:1.5;}
.robot-game-console{padding:18px;border:1px solid var(--line);border-radius:18px;background:var(--panel);box-shadow:0 18px 60px #0002;}
.robot-game-levelbar,.robot-game-program-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;font:12px var(--mono);}
.robot-game-levelbar{color:var(--teal-deep);margin-bottom:6px;}
.robot-game-console h2{font-size:24px;line-height:1.2;letter-spacing:-.02em;}
.robot-game-workspace{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,400px);grid-template-areas:'program maze';gap:28px;align-items:start;margin-top:16px;}
.robot-game-program-panel{grid-area:program;min-width:0;}
.robot-game-maze{grid-area:maze;min-width:0;width:100%;max-width:400px;justify-self:center;}
.robot-board{--board-gap:4px;--board-padding:6px;position:relative;aspect-ratio:1;display:grid;grid-template-columns:repeat(var(--maze-size),minmax(0,1fr));gap:var(--board-gap);padding:var(--board-padding);background:#080f20;border:1px solid #335077;border-radius:12px;}
.robot-cell{display:grid;place-items:center;background:#142644;border:1px solid #29476e;border-radius:6px;font-size:28px;min-width:0;aspect-ratio:1;}
.robot-cell-wall{color:#94a4c2;background:repeating-linear-gradient(135deg,#37435c 0 8px,#2a364b 8px 16px);border-color:#617391;}
.robot-cell-goal{background:#433823;border-color:#eec867;color:#ffe290;}
.robot-cell-current{outline:2px solid #91d9ff;outline-offset:-2px;background:#1d3c59;}
.robot-cell-goal.robot-cell-current{outline-color:#ffe290;background:#67532c;}
html.light-mode-pending .robot-board,
body.light-mode .robot-board{background:#fff;border-color:#8799ad;}
html.light-mode-pending .robot-cell,
body.light-mode .robot-cell{background:#f1f5f9;border-color:#b4c3d2;}
html.light-mode-pending .robot-cell-wall,
body.light-mode .robot-cell-wall{color:#fff;background:repeating-linear-gradient(135deg,#64748b 0 8px,#536378 8px 16px);border-color:#475569;}
html.light-mode-pending .robot-cell-goal,
body.light-mode .robot-cell-goal{background:#fff2c2;border-color:#a76b0a;color:#805000;}
html.light-mode-pending .robot-cell-current,
body.light-mode .robot-cell-current{outline-color:#17649b;background:#d7edff;}
html.light-mode-pending .robot-cell-goal.robot-cell-current,
body.light-mode .robot-cell-goal.robot-cell-current{outline-color:#a76500;background:#ffe49a;}
.maze-robot{--cell-size:calc((100% - 2 * var(--board-padding) - (var(--maze-size) - 1) * var(--board-gap)) / var(--maze-size));position:absolute;z-index:1;display:grid;place-items:center;width:var(--cell-size);height:var(--cell-size);left:calc(var(--board-padding) + var(--robot-x) * (100% - 2 * var(--board-padding) + var(--board-gap)) / var(--maze-size));top:calc(var(--board-padding) + var(--robot-y) * (100% - 2 * var(--board-padding) + var(--board-gap)) / var(--maze-size));pointer-events:none;}
.maze-robot svg{width:82%;height:90%;overflow:visible;filter:drop-shadow(0 2px 2px #0009);}
.maze-heading{position:absolute;top:-2px;right:-2px;display:grid;place-items:center;width:18px;height:18px;border:1px solid #12283e;border-radius:5px;background:#b7eeff;color:#102b38;font:900 15px/1 var(--body);}
.ainex-leg,.ainex-arm{transform-box:fill-box;transform-origin:50% 0;}
.is-walking .ainex-leg-left,.is-walking .ainex-arm-right{animation:ainex-step 360ms ease-in-out;}
.is-walking .ainex-leg-right,.is-walking .ainex-arm-left{animation:ainex-step 360ms ease-in-out reverse;}
@keyframes ainex-step{0%,100%{transform:translateY(0) rotate(0)}25%{transform:translateY(-5px) rotate(-9deg)}75%{transform:translateY(2px) rotate(9deg)}}
.robot-game-position{font:11px/1.4 var(--mono);margin-top:8px;text-align:center;color:var(--muted);}
.robot-game-program-heading h3{font:600 15px var(--body);}
.robot-game-program{height:112px;overflow:auto;margin:10px 0 16px;padding:8px;background:#0002;border:1px solid var(--line);border-radius:10px;}
.robot-game-program p{font-size:13px;color:var(--muted);padding:8px;}
.robot-game-program ol{display:flex;flex-wrap:wrap;gap:6px;list-style:none;}
.robot-game-program li{flex-shrink:0;}
.robot-game-program li[aria-current] button{outline:2px solid #73c6ff;outline-offset:0;background:#123961;color:#fff;}
.robot-game fieldset{border:0;min-width:0;}
.robot-game legend{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;}
.robot-command-buttons,.robot-run-buttons{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-bottom:8px;}
.robot-game-console button{min-height:44px;padding:8px 6px;border:1px solid var(--line);border-radius:8px;background:var(--paper);color:var(--ink);font:600 13px var(--body);cursor:pointer;}
.robot-run-buttons{grid-template-columns:repeat(2,minmax(0,1fr));}
.robot-game-program button{display:flex;align-items:center;justify-content:center;gap:6px;min-width:64px;font:600 14px var(--mono);}
.robot-game-program button:hover:not(:disabled){border-color:var(--teal-deep);}
.robot-game-remove-icon{font-size:16px;}
.robot-game-program button:disabled .robot-game-remove-icon{opacity:.35;}
.robot-command-buttons button{display:flex;flex-direction:column;gap:2px;align-items:center;justify-content:center;min-height:62px;}
.robot-command-buttons button span{font-size:24px;line-height:1;}
.robot-run-buttons [data-game-run]{background:#9be8e1;color:#0c2935;border-color:#9be8e1;}
.robot-game button:disabled{opacity:.45;cursor:default;}
.robot-game-program button:disabled{opacity:1;}
.robot-game button:focus-visible,.robot-game a:focus-visible,.robot-game summary:focus-visible{outline:3px solid #a979ec;outline-offset:3px;}
.robot-game-feedback{min-height:42px;font-size:13px;line-height:1.5;margin:12px 0 8px;color:var(--ink);}
.robot-game-storage{font-size:12px;color:var(--muted);}
.robot-game-storage:empty{display:none;}
.robot-game-details{font-size:13px;line-height:1.6;color:var(--muted);}
.robot-game-help summary{width:max-content;cursor:pointer;min-height:44px;padding-block:10px;color:var(--ink);font-weight:600;}
.robot-game-hint{margin:8px 0;}
.robot-game-instructions{padding-left:22px;display:grid;gap:6px;margin-bottom:14px;}
.robot-game-offer{white-space:pre-line;border-top:1px solid var(--line);padding-top:14px;}
.robot-game-notice{display:flex;align-items:flex-start;gap:16px;padding:22px;border:1px solid var(--teal-deep);border-radius:16px;background:var(--panel);box-shadow:0 8px 30px #0002;scroll-margin-top:calc(var(--site-nav-height,80px) + 16px);}
.robot-game-notice>div{min-width:0;flex:1;}
.robot-game-notice-icon{display:grid;place-items:center;flex-shrink:0;width:40px;height:40px;border-radius:50%;background:#9be8e1;color:#0c2935;font-size:24px;}
.robot-game-notice .eyebrow{font-size:11px;color:var(--teal-deep);}
.robot-game-notice h2{font-size:clamp(20px,2.4vw,28px);line-height:1.25;margin:6px 0 8px;}
.robot-game-notice p{white-space:pre-line;font-size:14px;line-height:1.6;color:var(--muted);}
.robot-game-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin-top:16px;}
.robot-game-actions>*{min-height:44px;}
@media(max-width:849px){
  .robot-game{padding-top:12px;}
  .robot-game-wrap{gap:12px;max-width:640px;padding-inline:14px;}
  .robot-game-intro h1{font-size:28px;margin:4px 0 6px;}
  .robot-game-intro>p{font-size:12px;line-height:1.4;}
  .robot-game-console{padding:12px;}
  .robot-game-console h2{font-size:20px;}
  .robot-game-levelbar{font-size:10px;margin-bottom:4px;}
  .robot-game-workspace{grid-template-columns:minmax(0,1fr);grid-template-areas:'maze' 'program';gap:10px;margin-top:10px;}
  .robot-game-maze{max-width:260px;}
  .robot-board{--board-gap:3px;--board-padding:5px;}
  .robot-cell{font-size:23px;border-radius:4px;}
  .maze-heading{width:15px;height:15px;font-size:12px;}
  .robot-game-position{font-size:10px;margin-top:5px;}
  .robot-game-program-heading h3{font-size:13px;}
  .robot-game-program{height:auto;min-height:82px;overflow:visible;margin:6px 0 8px;padding:6px;}
  .robot-game-program p{padding:4px;font-size:12px;}
  .robot-game-program button{min-width:54px;padding-inline:2px;gap:2px;font-size:12px;}
  .robot-command-buttons,.robot-run-buttons{gap:6px;margin-bottom:6px;}
  .robot-command-buttons button{flex-direction:row;gap:5px;min-height:44px;}
  .robot-command-buttons button span{font-size:20px;}
  .robot-game-console button{font-size:12px;}
  .robot-game-feedback{min-height:36px;margin:8px 0 0;font-size:12px;}
  .robot-game-notice{padding:16px;gap:10px;}
  .robot-game-notice-icon{width:28px;height:28px;font-size:19px;}
  .robot-game-actions>*{width:100%;text-align:center;}
}
@media(prefers-reduced-motion:reduce){.is-walking .ainex-leg,.is-walking .ainex-arm{animation:none;}}
