@font-face{font-family:Chaos;src:url('./assets/art/SpaceGrotesk.ttf') format('truetype');font-display:swap}
@font-face{font-family:Mono;src:url('./assets/art/DMMono.ttf') format('truetype');font-display:swap}
:root{font-family:Chaos,sans-serif;color:#171717;background:#171717;--yellow:#f5ed35;--red:#f33c49;--ink:#171717;--paper:#f5f4ec;letter-spacing:0}
*{box-sizing:border-box}body{margin:0}button,input,a{-webkit-tap-highlight-color:transparent}button{font:inherit;cursor:pointer;color:inherit;border:3px solid var(--ink);border-radius:0;background:var(--paper);touch-action:manipulation}button:disabled{cursor:default}button:focus-visible,a:focus-visible,input:focus-visible{outline:4px solid #ff3e99;outline-offset:3px}button:not(:disabled):active{filter:brightness(.86)}[hidden]{display:none!important}
#game{position:relative;width:100%;height:100dvh;min-height:300px;display:flex;flex-direction:column;overflow:hidden;background:var(--paper)}
.hud{height:60px;flex:none;display:flex;align-items:center;justify-content:space-between;padding:4px max(12px,env(safe-area-inset-right)) 4px max(12px,env(safe-area-inset-left));gap:10px;border-bottom:3px solid var(--ink);z-index:8;background:var(--paper)}
#phase-count{font-family:Mono,monospace;font-size:15px;white-space:nowrap}#lives{display:flex;gap:7px}#lives i{display:block;width:22px;height:24px;background:var(--red);clip-path:polygon(0 0,35% 0,50% 20%,65% 0,100% 0,100% 58%,50% 100%,0 58%)}#lives i.empty{background:#b8b6b4}.tools{display:flex;gap:6px}.icon-button{height:44px;width:44px;display:grid;place-items:center;background:transparent;border:0}.icon-button img{width:23px;height:23px}.icon-button:disabled{opacity:.3}
#prompt{font-size:26px;line-height:1.1;text-align:center;margin:0;height:52px;flex:none;display:grid;place-items:center;padding:6px 12px;z-index:2;text-transform:uppercase;background:var(--paper)}
#playfield{position:relative;flex:1;min-height:0;overflow:hidden}#stage,#controls{position:absolute;inset:0}#stage canvas{display:block}#controls{touch-action:none}#controls button{position:absolute;display:grid;place-items:center;font-weight:700}#controls .image-hit{background:transparent;border:0}#controls .image-hit.selected{box-shadow:inset 0 0 0 7px #171717;background:#f5ed3540}#controls .image-hit.selected::after{content:'✓';font-size:42px;background:var(--yellow);width:48px;height:48px;line-height:1;border:3px solid #171717}
.rotate-hit{background:transparent!important;border:0!important}.rotate-hit img{width:100%;height:100%;object-fit:contain;pointer-events:none;transition:transform 90ms linear}.piece-hit{background:transparent!important;border:0!important;cursor:grab}.piece-hit:active{cursor:grabbing}.slider{position:absolute;accent-color:#171717;height:48px;touch-action:none}.check-hit{background:#fff!important;border:5px solid #171717!important;box-shadow:7px 7px 0 #171717;font-size:44px}.number-hit{font-family:Mono,monospace!important;font-size:32px;box-shadow:5px 5px 0 #171717}.popup{position:absolute;border:4px solid #171717;background:#e8e8e8;box-shadow:7px 7px 0 #171717;overflow:hidden}.popup-bar{height:48px;background:#264df4;color:#fff;display:flex;align-items:center;padding:0 8px;font-family:Mono,monospace;font-size:13px}.popup .close-hit{position:absolute!important;right:0;top:0;width:48px;height:44px;background:#fff;font-size:32px;line-height:1}.popup-body{padding:8px;display:flex;align-items:center;justify-content:space-around;gap:8px;font-size:18px;font-weight:700;height:calc(100% - 48px)}.popup-body img{height:75%;max-width:45%;object-fit:contain}
.timer{position:relative;height:26px;flex:none;margin-bottom:max(12px,env(safe-area-inset-bottom,0px));background:#171717;border-top:3px solid #171717;overflow:hidden}#time-bar{height:100%;background:var(--yellow);transform-origin:left center}#time{position:absolute;right:10px;top:1px;color:#fff;mix-blend-mode:difference;font-family:Mono,monospace;font-size:16px}.timer.urgent #time-bar{background:var(--red)}
.screen{position:absolute;inset:60px 0 0;z-index:6;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:24px;overflow:auto}.menu{background:var(--yellow);background-image:repeating-linear-gradient(0deg,transparent 0 39px,#17171712 40px 41px)}.title-art{position:relative;width:min(740px,100%);display:flex;align-items:center;justify-content:center;gap:10px}.title-art h1{font-size:88px;line-height:.88;margin:0;text-align:left;font-weight:900;transform:rotate(-3deg);z-index:1}.title-art h1 span{color:var(--paper);-webkit-text-stroke:2px #171717;text-shadow:6px 5px 0 #171717}.mascot{width:230px;height:240px;object-fit:contain;transform:rotate(12deg);animation:entrance 320ms ease-out}.level-select{margin-top:40px}.level-select h2{font-family:Mono,monospace;font-size:17px;margin:0 0 14px}#levels{display:grid;grid-template-columns:repeat(6,68px);gap:12px}#levels button{position:relative;height:70px;font-size:38px;font-weight:700;background:var(--paper);box-shadow:5px 5px 0 #171717;transform:rotate(-3deg)}#levels button:nth-child(even){transform:rotate(3deg)}#levels button:disabled{background:#d3cc30;color:#6b6715;box-shadow:none;border-style:dashed}.credits{font-family:Mono,monospace;color:inherit;font-size:12px;margin-top:32px}
.instruction{background:var(--ink);color:var(--yellow);overflow:hidden}.instruction::before{content:'';position:absolute;inset:0;background:repeating-linear-gradient(115deg,transparent 0 50px,#ffffff08 51px 54px);pointer-events:none}.instruction h2{font-size:64px;line-height:1.05;max-width:900px;margin:26px 0;transform:rotate(-4deg);text-transform:uppercase;animation:entrance 160ms ease-out}.instruction span{font:18px Mono,monospace;color:var(--paper)}.count-in{display:flex;gap:16px}.count-in i{height:14px;width:50px;background:var(--yellow);transform:skew(-15deg)}.count-in i.off{opacity:.15}
.result-screen{z-index:7;gap:36px;background:#f5ed35;background-image:repeating-linear-gradient(-12deg,transparent 0 48px,#1717170b 49px 51px);color:var(--ink)}.result-screen.bad{background-color:#f33c49;color:#fff}.result-screen h2{font-size:100px;line-height:1;margin:0;transform:rotate(-5deg);text-shadow:4px 4px 0 #ffffff55}.result-screen.bad h2{text-shadow:4px 4px 0 #171717}#result-lives{display:flex;gap:18px;height:74px;align-items:flex-start}#result-lives i{display:block;width:50px;height:56px;flex:none;background:#171717;clip-path:polygon(0 0,35% 0,50% 20%,65% 0,100% 0,100% 58%,50% 100%,0 58%)}#result-lives i.empty{background:#17171730}#game[data-state=resolving] #prompt,#game[data-state=resolving] .timer,#game[data-state=resolving] #lives{visibility:hidden}.overlay{z-index:10;background:var(--yellow);background-image:repeating-linear-gradient(-15deg,transparent 0 50px,#17171712 51px 53px)}.overlay h2{font-size:60px;line-height:1;margin:0 0 20px;max-width:800px;transform:rotate(-3deg)}.overlay p{font:18px Mono,monospace;line-height:1.5}.overlay p:empty{display:none}.overlay-actions{display:flex;gap:16px;flex-wrap:wrap;justify-content:center}.overlay-actions button{font-size:20px;font-weight:700;padding:12px 24px;min-height:52px;box-shadow:4px 4px 0 #171717}
[data-theme=grid] #prompt{background:#ff6764}[data-theme=slider] #prompt{background:#57dfdc}[data-theme=rotate] #prompt{background:#ff8ec1}[data-theme=checkbox] #prompt{background:#d8f759}[data-theme=count] #prompt{background:#f5f4ec}[data-theme=popups] #prompt{background:#668cff}
@keyframes entrance{from{opacity:0;scale:.8}to{opacity:1;scale:1}}
@media(max-width:600px){.hud{height:56px;padding-inline:8px;gap:4px}#phase-count{font-size:12px}#lives{gap:4px}#lives i{width:18px;height:21px}.tools{gap:0}.screen{inset:56px 0 0;padding:20px}.title-art{flex-direction:column;gap:12px}.title-art h1{font-size:64px}.mascot{width:160px;height:160px;position:absolute;right:-25px;top:90px;opacity:.95}.level-select{margin-top:70px;z-index:1}#levels{grid-template-columns:repeat(3,72px);gap:14px}#levels button{height:66px}.instruction h2{font-size:42px}.overlay h2{font-size:44px}.overlay p{font-size:16px}#verdict{font-size:50px}#prompt{font-size:23px;height:48px}.credits{margin-top:24px}}
@media(max-height:500px) and (min-width:601px){.hud{height:48px}.screen{inset:48px 0 0;padding:16px}.menu{display:grid;grid-template-columns:1fr 1fr;gap:10px}.title-art h1{font-size:54px}.mascot{width:100px;height:120px}.level-select{margin:0}#levels{grid-template-columns:repeat(3,56px);gap:10px}#levels button{height:55px;font-size:30px}.credits{position:absolute;bottom:10px;margin:0}.instruction h2{font-size:46px;margin:16px 0}.overlay h2{font-size:42px}.overlay p{margin:4px 0 20px}#prompt{height:38px;font-size:24px}.timer{height:22px}#verdict{font-size:54px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}
.credits-page{min-height:100dvh;background:var(--paper);padding:40px max(24px,calc((100% - 780px)/2));font-size:18px;line-height:1.6}.credits-page h1{font-size:42px;line-height:1}.credits-page h2{font-size:24px}.credits-page a{color:#bb173b}
@media(max-width:600px){.mascot{width:112px;height:112px;right:0;top:108px}.level-select{margin-top:120px}}
.human-check{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);display:flex;align-items:center;gap:18px;width:min(360px,calc(100% - 32px));padding:22px 18px;background:#fff;border:3px solid var(--ink);box-shadow:6px 6px 0 var(--ink);font-size:23px;line-height:1.2;cursor:pointer}.human-check input{appearance:auto;width:44px;height:44px;flex:none;margin:0;accent-color:#171717;cursor:pointer}.human-check span{min-width:0}.rotation-control{box-shadow:4px 4px 0 var(--ink)}.rotation-control img{width:30px;height:30px}.symbol-hit{background:#fff;box-shadow:4px 4px 0 var(--ink);padding:12px}.symbol-hit[aria-pressed=true]{background:var(--yellow);border-width:6px}.symbol-art{display:block;width:100%;height:100%;background-image:url('./assets/art/symbols.svg');background-repeat:no-repeat;background-size:500% 100%;pointer-events:none}[data-theme=match] #prompt{background:var(--paper)}
[data-theme=slider] #prompt{background:#e3e5e5}
[data-theme=circle] #prompt{background:#dceee6}
.slider{appearance:none;-webkit-appearance:none;height:76px;margin:0;padding:0 12px;border:0;border-radius:0;background:transparent;cursor:ew-resize}
.slider::-webkit-slider-runnable-track{height:10px;background:#65786d;border:1px solid #35483d;border-radius:2px}
.slider::-webkit-slider-thumb{appearance:none;-webkit-appearance:none;box-sizing:border-box;width:32px;height:44px;margin-top:-18px;border:2px solid #171717;border-radius:2px;background:#f5f4ec;box-shadow:0 2px 0 #17171730;cursor:grab}
.slider::-moz-range-track{height:8px;background:#65786d;border:1px solid #35483d;border-radius:2px}
.slider::-moz-range-thumb{box-sizing:border-box;width:32px;height:44px;border:2px solid #171717;border-radius:2px;background:#f5f4ec;box-shadow:0 2px 0 #17171730;cursor:grab}
.slider:active::-webkit-slider-thumb{cursor:grabbing}.slider:active::-moz-range-thumb{cursor:grabbing}.slider:disabled{opacity:.5;cursor:default}
.overlay.defeat{background:#18191c;background-image:repeating-linear-gradient(-15deg,transparent 0 50px,#ff50620a 51px 53px);color:#f5f4ec}
.overlay.defeat h2{font-size:56px;line-height:1.05;transform:none;color:#ff6470;max-width:680px}
.overlay.defeat .overlay-actions button{background:#2c2b31;color:#f5f4ec;border-color:#77727d;box-shadow:3px 3px 0 #08090a}
.overlay.defeat #overlay-action{background:#f33c49;color:#171717;border-color:#f33c49}
@media(max-width:600px),(max-height:500px){.overlay.defeat h2{font-size:40px}}
@media(forced-colors:active){.slider{background:Canvas;border-color:CanvasText}.slider::-webkit-slider-runnable-track{background:CanvasText}.slider::-moz-range-track{background:CanvasText}.slider::-webkit-slider-thumb{background:ButtonFace;border-color:ButtonText}.slider::-moz-range-thumb{background:ButtonFace;border-color:ButtonText}}
.human-check{cursor:default}.symbol-art{background-size:800% 100%}
#game[data-state=resolving] #lives{visibility:visible}
.result-screen:not(.bad){background-color:#6bdf85}.result-screen h2{font-size:64px}.ready-screen{color:#fff;background-color:#d52743}.ready-screen h2{transform:none}
#game[data-state=ready] #prompt,#game[data-state=ready] .timer{visibility:hidden}
.menu{padding-bottom:76px}.menu .credits{position:absolute;bottom:max(20px,env(safe-area-inset-bottom));margin:0;left:0;right:0;text-align:center}
@media(max-width:600px){.result-screen h2{font-size:42px}#result-lives{gap:14px}#result-lives i{width:44px;height:50px}}
@media(max-width:360px){.result-screen h2{font-size:36px}.ready-screen h2{font-size:36px}}
@media(max-height:500px){.result-screen{gap:20px}.menu{padding-bottom:48px}.menu .credits{bottom:12px}}