:root{--screen:#151b2a;--panel:#212b40;--outline:#101523;--rim:#60728d;--chalk:#fff2cb;--gold:#ffcf6f;--terminal:#121a2b}
body{background:#101522;background-image:linear-gradient(#26314860 1px,transparent 1px),linear-gradient(90deg,#26314860 1px,transparent 1px);background-size:18px 18px;color:var(--chalk);font-family:ui-monospace,monospace}
main{padding-top:24px}
header h1{font-size:clamp(1.6rem,4vw,3.45rem);line-height:1.1;letter-spacing:-.075em;text-shadow:3px 4px #0c101b;color:#ffdf89}h1 span{color:#a9e5cf}
button,select{color:var(--chalk);background:#344761;border:2px solid #0e1421;border-radius:0;box-shadow:inset 2px 2px #7286a2,0 3px #0e1421;font-family:inherit}
button:hover:not(:disabled),select:hover:not(:disabled){filter:brightness(1.16)}
button:active:not(:disabled){transform:translateY(2px);box-shadow:inset 2px 2px #0e1421}
button:focus-visible,select:focus-visible{outline-color:#ffdf89}
.layout,.intro{border:4px solid var(--rim);border-radius:0;box-shadow:0 0 0 3px #0d1220,0 10px #080d17;overflow:hidden}
.editor{background:var(--panel);border-right:4px solid var(--rim);box-shadow:4px 0 #12192960}
.palette{border:2px solid #51617c;border-radius:0;background:#1a2438;padding:9px}
.stack{border:2px dashed #77859d;border-radius:0;background:var(--terminal)}
.stack:empty::after{color:#9aaec1}
.command,.block{--ink:#285e97;color:#fff5d6;border:2px solid #0e1421;border-bottom:4px solid #0e1421;border-radius:0;box-shadow:inset 2px 2px #ffffff54}
.command kbd{color:#e4eefc}.turn{--ink:#68478d}.jump{--ink:#9a4f22}.duck{--ink:#236a58}
.block::after{border-radius:0}
.toolbar .run{color:#1b221a;background:#aee783;border:2px solid #1d422d;box-shadow:inset 2px 2px #e3ffc5,0 3px #0e1421}
.playfield,.intro{background:#789247 url(courtyard.png) center/cover no-repeat;image-rendering:pixelated}
.playfield::before{background:linear-gradient(#14241520,#14241520)}
.cell,.path,.low,.gap{border-radius:0}
.path,.low{border:2px solid #695139;background:#c29163;box-shadow:0 4px #3e503a,inset 3px 3px #e2bd83,inset -3px -3px #855f49}
.path::before,.low::before{inset:17%;border-radius:0;background:repeating-linear-gradient(0deg,#ebcd9a55 0 3px,transparent 3px 9px)}
.path.start{background:#80ab71;box-shadow:0 4px #3e503a,inset 3px 3px #c5dc98,inset -3px -3px #537b59}
.path.finish{color:#fff7be;background:#b87930;text-shadow:2px 2px #54341c;box-shadow:0 4px #513a28,inset 3px 3px #ffe3a0,inset -3px -3px #915723}
.path.finish::before{display:none}
.low{border-top:6px solid #6b4028;color:#432a20}
.gap{border:2px solid #2c4a6a;background:repeating-linear-gradient(0deg,#356b90 0 5px,#438ba1 5px 8px)}
.figure{inset:auto 4% 10%;height:150%;display:grid;place-items:end center;filter:drop-shadow(2px 3px #1c24206e)}
.figure img,.portrait{display:block;image-rendering:pixelated;object-fit:contain}
.figure img{height:100%;max-width:100%;object-position:center bottom}
.figure img.face-left{transform:scaleX(-1)}
.avatar small{right:-5%;bottom:-11%;border:2px solid #e5f2bc;border-radius:0;background:#173332;font-variant-emoji:text}
.intro h2,.status{color:var(--chalk);background:var(--screen);border:2px solid var(--rim);border-radius:0;box-shadow:0 3px #101523}
.choices button{min-width:128px;background:#263752;border:2px solid #0e1421;box-shadow:inset 2px 2px #7286a2,0 4px #111524}
.choices .portrait{width:80px;height:108px;margin:0 auto 10px}
@media(max-width:650px){header h1{text-shadow:2px 2px #0c101b}.layout,.intro{border-width:3px}.editor{border-right-width:2px}.palette{padding:4px}.low{border-top-width:3px}.avatar small{border-width:1px}.choices button{min-width:108px;padding:10px}}
.command,.block{cursor:grab;user-select:none;touch-action:none;text-align:center}
.command{display:grid;place-items:center;min-height:42px}
.stack,.palette{position:relative}
.stack:empty::after{content:'⇣';font-size:2.6rem}
.drag-source{opacity:.42}.locked .command,.locked .block{cursor:default}
.drag-ghost{position:fixed;z-index:99;margin:0;pointer-events:none;transform:translate(-50%,-50%);width:86px;height:42px;box-shadow:0 4px #111827}
.drop-ready{border-color:#aee783}.remove-ready{outline:2px dashed #ffa491;outline-offset:-4px}
.drop-before::before,.drop-end::before{content:'';position:absolute;background:#aee783;height:3px;left:8px;right:8px;pointer-events:none}
.drop-before::before{top:-5px}.drop-end::before{bottom:4px}
.palette{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
.command,.block,.drag-ghost{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;border-radius:5px;box-shadow:inset 0 2px #ffffff59,inset 0 -4px #10152328,0 2px #0d1220}
.command{min-width:0;min-height:62px;padding:5px 2px}
.command-icon{font-size:1.5rem;line-height:1}
.command-label{font-size:.72rem;font-weight:800;line-height:1.08;overflow-wrap:anywhere}
.block{width:min(138px,100%);height:52px;margin-bottom:4px;padding:4px 2px}
.block .command-icon{font-size:1.24rem}
.drag-ghost{width:115px;height:56px}
.toolbar .run{border-radius:5px;min-width:82px;min-height:43px}
@media(max-width:650px){.command-label{font-size:.62rem}.palette{gap:3px;padding:3px}.command{min-height:57px}.command-icon{font-size:1.25rem}}

:root{--screen:#28314c;--panel:#313957;--rim:#899ec7;--chalk:#fff1d7;--terminal:#242c47}
body{background-color:#202842;background-image:linear-gradient(#61769b2b 1px,transparent 1px),linear-gradient(90deg,#61769b2b 1px,transparent 1px)}
header{padding:10px 12px;background:#313a58;border:2px solid #899ec7;box-shadow:0 4px #151e35}
header h1{color:#ffe3a0}header h1 span{color:#92e5d2}
.palette{border-color:#8396bd;background:#27324f}
.stack{border-color:#7088b2}.stack:empty::after{color:#acbfdf}
.command,.block{--ink:#7dd9c3;color:#182b36;border-color:#202a42}
.turn{--ink:#ccb1f6}.jump{--ink:#ffca83}.duck{--ink:#a9d894}
.command-icon{color:#172943;text-shadow:0 1px #ffffff65}
.command:hover,.block:hover{filter:brightness(1.08)}
.toolbar button,header button,header select{color:#172942;background:#a9c9f2;border-color:#17213c;box-shadow:inset 2px 2px #e2edff,0 3px #141e32}
.editor>.toolbar{background:#28344f;border:2px solid #8296bd;padding:7px}
.toolbar .run{color:#19372e;background:#a3e7a7;border-color:#294f40;box-shadow:inset 2px 2px #e2ffd4,0 3px #142637}
.toolbar button:disabled{opacity:.63}
.board{position:relative;--tile-gap:2px;gap:var(--tile-gap)}
.avatar.actor{top:0;left:0;width:var(--unit);height:var(--unit);transform:translate(calc(var(--actor-x) * (var(--unit) + var(--tile-gap))),calc(var(--actor-y) * (var(--unit) + var(--tile-gap))));pointer-events:none}
/* Anchor every pose to the same footprint, regardless of the source image dimensions. */
/* The shadow marks the tile footprint while the upright sprite can extend above it. */
.avatar.actor::before{content:'';position:absolute;inset:auto 8% 8%;height:19%;border-radius:50%;background:#1e302b55}
.actor .figure{
  inset:auto -20% 12%;
  height:min(calc(var(--unit) * 2.2),clamp(96px,calc(var(--unit) * 1.85),144px));
  display:block;
  transform-origin:center bottom;
  will-change:transform;
}
.actor .figure img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;object-position:center bottom;image-rendering:auto}
@media(max-width:650px){header{padding:7px}.board{--tile-gap:1px}}
