:root{--text:#191919;--muted:#8b8b8b;--line:#dedede;--soft:#f1f2f2;--soft-2:#e3e5e5;--dark:#4b4b4b;--good:#4f9d5d;--bad:#c34c4c;color-scheme:light}*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:#fff;color:var(--text);font-family:Arial,Helvetica,sans-serif}button,input,select{font:inherit}button{color:inherit}.hidden{display:none!important}.app-shell{min-height:100vh;background:#fff}
.topbar{height:62px;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;padding:0 24px;border-bottom:1px solid #e5e5e5;background:#fff;position:sticky;top:0;z-index:20}.brand{display:flex;align-items:center;gap:9px;color:#222;text-decoration:none;font-size:12px;letter-spacing:.14em;font-weight:700}.brand-mark{width:30px;height:30px;background:#4d4d4d;border-radius:6px;display:flex;align-items:center;justify-content:center;gap:2px}.brand-mark i{display:block;width:3px;background:#fff;border-radius:2px}.brand-mark i:nth-child(1){height:8px}.brand-mark i:nth-child(2){height:14px}.brand-mark i:nth-child(3){height:10px}.score-strip{display:flex;align-items:center;justify-self:center}.score-strip>div{min-width:82px;text-align:center;padding:0 15px;border-right:1px solid #e4e4e4}.score-strip>div:last-child{border-right:0}.score-strip span{display:block;color:#999;font-size:8px;text-transform:uppercase;letter-spacing:.1em;margin-bottom:2px}.score-strip strong{font:600 16px/1.1 Arial,sans-serif}.score-strip strong b{font:inherit}.score-strip small{font-size:9px;margin-left:1px;color:#888}.secondary-stat{display:none}.header-actions{justify-self:end;display:flex;gap:6px}.pause-button,.icon-button{height:32px;border:1px solid #ddd;background:#fafafa;border-radius:6px;cursor:pointer;color:#666;font-size:11px}.pause-button{padding:0 10px}.icon-button{width:32px}.pause-button:hover,.icon-button:hover{background:#f2f2f2}
.workspace{min-height:calc(100vh - 62px);padding:0 16px}.settings-panel{width:min(860px,100%);margin:18px auto 0;padding:10px 12px;border:1px solid #e4e4e4;border-radius:9px;background:#fafafa;display:flex;align-items:center;justify-content:center;gap:22px}.panel-heading{display:none}fieldset{border:0;padding:0;margin:0}legend{display:block;color:#999;font-size:8px;text-transform:uppercase;letter-spacing:.08em;margin:0 0 5px}.segmented{display:grid;grid-template-columns:repeat(3,1fr);width:132px;padding:2px;border:1px solid #d9d9d9;background:#eee;border-radius:6px}.segmented button{border:0;background:transparent;padding:5px 9px;border-radius:4px;color:#777;font-size:11px;cursor:pointer}.segmented button.active{background:#fff;color:#111;box-shadow:0 1px 3px rgba(0,0,0,.12)}.toggle-row{display:grid;grid-template-columns:auto auto;gap:10px;align-items:center;cursor:pointer}.toggle-row span{display:flex;flex-direction:column;gap:1px}.toggle-row strong{font-size:10px;font-weight:600}.toggle-row small{font-size:8px;color:#999}.toggle-row input{opacity:0;width:31px;height:18px;margin:0;grid-column:2;grid-row:1;z-index:2;cursor:pointer}.toggle-row i{width:31px;height:18px;grid-column:2;grid-row:1;border-radius:12px;background:#ccc;position:relative}.toggle-row i:after{content:'';position:absolute;width:14px;height:14px;top:2px;left:2px;border-radius:50%;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.2);transition:.15s}.toggle-row input:checked+i{background:#5b5b5b}.toggle-row input:checked+i:after{transform:translateX(13px)}.restart-button{height:30px;border:1px solid #d8d8d8;border-radius:6px;background:#fff;color:#666;padding:0 10px;font-size:9px;cursor:pointer}.restart-button:hover{background:#f3f3f3}.clear-button,.shortcut-note{display:none}
.game-stage{width:min(760px,100%);margin:0 auto;padding:24px 0 40px;display:flex;flex-direction:column;align-items:center;position:relative}.stage-topline{width:100%;display:flex;align-items:center;justify-content:space-between;color:#999;font-size:8px;letter-spacing:.08em}.level-pill{display:inline-flex;align-items:center;gap:6px}.level-pill i{width:5px;height:5px;border-radius:50%;background:#777}.level-pill b{font-weight:500}.round-type{font-weight:600}.prompt-block{text-align:center;margin:22px 0 14px}.eyebrow{display:none}.prompt-block h1{font-size:17px;font-weight:500;margin:0}.prompt-block p{font-size:10px;color:#999;margin:6px 0 0}
.machine-card{width:min(680px,100%);min-height:318px;padding:12px 0;display:grid;grid-template-columns:1fr;grid-template-rows:88px 118px 88px;align-items:center;justify-items:center;border:0;background:transparent;box-shadow:none}.flow-row{display:flex;flex-direction:column;align-items:center;gap:9px}.row-label{color:#aaa;font-size:8px;letter-spacing:.12em}.sequence{display:flex;align-items:center;justify-content:center;gap:clamp(8px,1.5vw,15px)}.symbol-tile{width:52px;height:52px;border:0;border-radius:8px;background:#dedfdf;display:grid;place-items:center;box-shadow:0 2px 6px rgba(0,0,0,.16)}.symbol-tile.compact{width:39px;height:39px;border-radius:6px;box-shadow:none;background:#e1e2e2}.shape{--symbol-color:#222;display:block;width:22px;height:22px;background:var(--symbol-color)}.shape.circle{border-radius:50%}.shape.square{border-radius:1px}.shape.triangle{width:0;height:0;background:transparent;border-left:12px solid transparent;border-right:12px solid transparent;border-bottom:22px solid var(--symbol-color)}.shape.plus{clip-path:polygon(34% 0,66% 0,66% 34%,100% 34%,100% 66%,66% 66%,66% 100%,34% 100%,34% 66%,0 66%,0 34%,34% 34%);border-radius:2px}.shape.diamond{transform:rotate(45deg) scale(.82)}.shape.star{clip-path:polygon(50% 0,61% 36%,98% 36%,68% 57%,79% 95%,50% 72%,21% 95%,32% 57%,2% 36%,39% 36%)}.compact .shape{transform:scale(.72)}.compact .shape.diamond{transform:rotate(45deg) scale(.6)}
.machine-flow{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px}.flow-line{width:1px;height:24px;background:#aaa;position:relative}.flow-line:last-child:after{content:'';position:absolute;bottom:0;left:-3px;width:6px;height:6px;border-right:1px solid #888;border-bottom:1px solid #888;transform:rotate(45deg)}.code-stack{display:flex;align-items:center;gap:7px}.code-badge{display:inline-block;padding:8px 10px;border-radius:5px;background:#555;color:#fff;font:500 16px/1 ui-monospace,SFMono-Regular,Consolas,monospace;letter-spacing:.08em}.then{font-size:0;color:#999}.then:after{content:'→';font-size:15px}.hidden-output{display:flex;gap:10px}.hidden-output span{width:45px;height:45px;border:1px dashed #ccc;border-radius:7px;background:#fafafa;color:#bbb;display:grid;place-items:center;font-size:13px}
.answers{width:min(680px,100%);display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.answer-card{min-height:72px;border:1px solid #d5d5d5;border-radius:7px;background:#eceeee;display:flex;align-items:center;justify-content:center;padding:12px;cursor:pointer;position:relative;transition:.12s}.answer-card:hover:not(:disabled){background:#e3e5e5;border-color:#aaa}.answer-key{position:absolute;left:8px;top:7px;color:#999;font-size:8px}.answer-status{position:absolute;right:8px;bottom:6px;color:#aaa;font-size:7px}.answer-card.answer-correct{border-color:#6eaa78;background:#edf7ef}.answer-card.answer-correct .answer-status{color:var(--good);font-size:15px}.answer-card.answer-wrong{border-color:#d78989;background:#faeeee}.answer-card.answer-wrong .answer-status{color:var(--bad);font-size:16px}.answer-card.dimmed{opacity:.4}.answers .sequence.compact{gap:5px}.status-row{width:min(680px,100%);display:grid;grid-template-columns:170px 1fr;align-items:center;gap:12px;margin-top:11px;color:#999;font-size:9px}.timer-track{height:2px;background:#eee;overflow:hidden}.timer-track i{display:block;height:100%;width:100%;background:#777;transition:width .05s linear}
.overlay{position:fixed;inset:0;z-index:50;display:grid;place-items:center;background:rgba(255,255,255,.82);backdrop-filter:blur(4px);padding:16px}.game-stage>.overlay{position:absolute}.overlay>div{width:min(430px,100%);text-align:center;border:1px solid #ddd;background:#fff;padding:30px;border-radius:9px;box-shadow:0 12px 35px rgba(0,0,0,.12)}.overlay h2{font-size:20px;font-weight:500;margin:6px 0}.overlay p{color:#777;font-size:11px;line-height:1.5}.overlay button{border:0;background:#555;color:#fff;padding:9px 18px;border-radius:5px;font-size:10px;cursor:pointer}.help-card{position:relative}.close-help{position:absolute;right:10px;top:10px;width:28px;height:28px;padding:0!important;background:#f2f2f2!important;color:#777!important;font-size:17px!important}.help-card h2{font-size:21px}.help-card>p,.help-card ul{text-align:left;color:#666;font-size:11px;line-height:1.55}.help-card ul{padding-left:18px}.help-card>small{display:block;color:#999;font-size:8px;margin-top:11px}.example-row{display:flex;align-items:center;justify-content:center;gap:8px;background:#f5f5f5;border-radius:6px;padding:12px;margin:18px 0;font-size:11px}.example-input{color:#e5a900}.example-output{color:#26a8db}.example-arrow{color:#888}.example-arrow b{font-family:monospace;color:#333}.toast{position:fixed;left:50%;bottom:20px;transform:translateX(-50%);z-index:80;background:#555;color:#fff;padding:9px 12px;border-radius:5px;font-size:10px}noscript{position:fixed;bottom:15px;left:15px;background:#fff3f3;border:1px solid #e2aaaa;padding:10px;font-size:11px}
@media(max-width:720px){.topbar{height:56px;padding:0 12px;grid-template-columns:auto 1fr auto}.brand>span:last-child,.pause-button span,.icon-button{display:none}.brand-mark{width:28px;height:28px}.score-strip{justify-self:center}.score-strip>div{min-width:58px;padding:0 7px}.score-strip strong{font-size:14px}.score-strip>div:nth-child(4){display:none}.workspace{padding:0 10px}.settings-panel{margin-top:10px;padding:8px;gap:12px}.toggle-row small{display:none}.restart-button{display:none}.game-stage{padding-top:18px}.prompt-block{margin:18px 0 10px}.prompt-block h1{font-size:15px}.machine-card{grid-template-rows:76px 105px 76px;min-height:270px}.symbol-tile{width:43px;height:43px}.sequence{gap:6px}.shape{transform:scale(.86)}.shape.diamond{transform:rotate(45deg) scale(.7)}.code-badge{font-size:13px;padding:7px}.hidden-output{gap:5px}.hidden-output span{width:36px;height:38px}.answers{gap:6px}.answer-card{min-height:82px;padding:9px 3px}.answer-card .sequence{display:grid;grid-template-columns:repeat(3,31px);gap:3px}.answer-card .symbol-tile.compact{width:29px;height:29px}.answer-card .shape{transform:scale(.56)}.answer-card .shape.diamond{transform:rotate(45deg) scale(.48)}.answer-status{display:none}.status-row{grid-template-columns:110px 1fr}.overlay>div{padding:25px 18px}}
@media(max-width:430px){.settings-panel{justify-content:space-between}.toggle-row:first-of-type{display:none}.segmented{width:116px}.symbol-tile{width:38px;height:40px}.sequence{gap:4px}.shape{transform:scale(.76)}.shape.diamond{transform:rotate(45deg) scale(.64)}.machine-card{grid-template-rows:68px 100px 68px}.code-stack{gap:5px}.code-badge{font-size:12px}.answers .sequence.compact{grid-template-columns:repeat(3,27px)}.answer-card .symbol-tile.compact{width:26px;height:27px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:.01ms!important;transition-duration:.01ms!important}}
