:root{--ink:#202c2b;--paper:#f8f5e9;--rule:#32413d;--red:#be452d;--muted:#56625a;--accent:#f5b29a;--score:#384b45;font-family:"DM Sans","Avenir Next",Roboto,"Helvetica Neue",Arial,sans-serif;color:var(--ink);background:var(--paper);font-synthesis:none}
*{box-sizing:border-box}body{margin:0;-webkit-user-select:none;user-select:none}button{font:inherit;color:inherit;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent}button:focus-visible{outline:4px solid #096292;outline-offset:3px}[hidden]{display:none!important}
main{max-width:1720px;margin:auto;padding:clamp(14px,2.5vw,45px) clamp(18px,4.3vw,78px)}
.mast,.game-head{display:flex;align-items:center;gap:12px;border-bottom:2px solid var(--rule);padding-bottom:12px;font-weight:750;font-size:clamp(15px,1.3vw,21px)}
.mast-end{margin-left:auto;font-size:32px;line-height:1}.mark{display:inline-flex;align-items:center;gap:2px}.mark i{width:17px;height:17px;display:block;background:var(--ink)}.mark i:first-child{border-radius:50%}.mark i:nth-child(2){width:0;height:0;background:none;border-left:9px solid transparent;border-right:9px solid transparent;border-bottom:17px solid var(--red)}
.intro{display:flex;align-items:flex-end;justify-content:space-between;gap:18px;margin:clamp(18px,4vh,46px) 0 clamp(18px,3.6vh,38px)}
.intro h1{font-size:clamp(48px,7.8vw,126px);letter-spacing:-.081em;line-height:.91;margin:0;font-weight:850}.intro h1 span,.brand span{color:var(--red)}.intro p{font-size:clamp(16px,1.5vw,26px);line-height:1.26;margin:0 0 .12em;letter-spacing:-.025em}
#games{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:clamp(10px,1.4vw,26px)}
.game-card{display:flex;flex-direction:column;min-width:0;text-align:left;background:#fffdf4;border:2px solid var(--rule);padding:0;border-radius:12px;overflow:hidden;box-shadow:3px 4px 0 var(--ink);transition:transform .15s,box-shadow .15s}
.game-card:active{transform:translate(2px,3px);box-shadow:none}.game-card canvas{display:block;width:100%;height:clamp(135px,28vh,325px);border-bottom:2px solid var(--rule);background:var(--tile)}.card-body{flex:1;display:flex;flex-direction:column;gap:10px;width:100%;padding:clamp(13px,1.45vw,25px)}.card-body strong{font-size:clamp(22px,2.35vw,39px);letter-spacing:-.058em;line-height:1.02}.card-body .summary{font-size:clamp(14px,1.13vw,19px);line-height:1.43;color:#46554c}.card-tail{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:auto;padding-top:clamp(7px,1.8vh,22px);font-size:13px;font-weight:700}.card-tail b{border:1.5px solid var(--ink);border-radius:50%;width:37px;height:37px;display:grid;place-items:center;background:var(--tile);font-size:21px}
#play{height:calc(100vh - clamp(28px,5vw,90px));height:calc(100dvh - clamp(28px,5vw,90px));display:flex;flex-direction:column;gap:clamp(12px,2.1vh,24px);min-height:320px}
.game-head{gap:clamp(12px,1.5vw,24px)}.game-head button,.actions button{border:1.5px solid var(--ink);min-height:46px;padding:9px 17px;background:transparent;border-radius:8px;font-weight:750}.brand{font-size:clamp(19px,2.25vw,36px);letter-spacing:-.065em}.best{margin-left:auto;font-size:clamp(13px,1.13vw,19px);color:var(--muted);font-weight:550}.best strong{padding-left:.35em;font-weight:750;color:var(--ink);font-variant-numeric:tabular-nums}
.workbench{flex:1;min-height:0;display:grid;grid-template-columns:minmax(190px,25%) minmax(0,1fr);gap:clamp(16px,3vw,58px)}
.panel{min-height:0;overflow:auto;display:flex;flex-direction:column;padding:clamp(5px,1.2vh,18px) 4px 4px 0}
.mode-icon{display:grid;place-items:center;font-size:clamp(22px,2.5vw,38px);width:clamp(44px,4vw,65px);aspect-ratio:1;border-radius:50%;background:var(--accent);border:1.5px solid var(--ink);line-height:1}
.panel h1{font-weight:820;font-size:clamp(32px,4.15vw,72px);line-height:.97;letter-spacing:-.072em;margin:clamp(12px,2.3vh,24px) 0 .25em}
.panel p{font-size:clamp(15px,1.25vw,22px);line-height:1.4;margin:0;color:#48584e}.feedback{border-top:1.5px solid var(--ink);margin-top:clamp(16px,3.7vh,44px);padding-top:clamp(10px,1.8vh,22px)}#score-label,.stage-head,.stage-foot{font-size:clamp(12px,1.05vw,18px);font-weight:690}
#score{display:block;font-size:clamp(38px,4.5vw,82px);line-height:1.1;font-weight:780;font-variant-numeric:tabular-nums;letter-spacing:-.07em;color:var(--score)}
.meter{height:8px;background:#dfdfd1;border-radius:8px;overflow:hidden;margin:7px 0 11px}.meter i{display:block;background:var(--fill,#597866);height:100%;width:var(--accuracy,0);transition:width .35s ease-out}
.actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:auto;padding-top:14px}.actions button{flex:auto}.actions button:first-child{color:var(--paper);background:var(--ink)}
.stage{display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden;border:2px solid var(--ink);border-radius:12px;background:#fffdf2;box-shadow:3px 4px 0 var(--ink)}.stage-head,.stage-foot{display:flex;align-items:center;justify-content:space-between;padding:9px clamp(12px,1.3vw,23px);gap:12px}.stage-head{border-bottom:1.5px solid var(--ink);background:var(--accent)}.stage-head span{font-size:.9em}.stage-foot{border-top:1.5px solid var(--ink);color:var(--muted);font-size:clamp(12px,1vw,17px)}.spectrum{width:60px;height:7px;flex-shrink:0;background:linear-gradient(to right,#e46a51 0 25%,#f4aa49 25% 50%,#e2cf4a 50% 75%,#4e9e64 75%)}
#paper{position:relative;min-height:0;flex:1;background-image:radial-gradient(#d3d3c2 1px,transparent 1.3px);background-size:22px 22px}#board{display:block;width:100%;height:100%;position:absolute;inset:0;touch-action:none;cursor:crosshair}#empty{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:5px;pointer-events:none;color:#687467;font-weight:650}.draw-glyph{font-size:48px;color:#969f8f}
@media(max-width:960px){#games{grid-template-columns:repeat(2,minmax(0,1fr))}.game-card{flex-direction:row}.game-card canvas{width:41%;height:100%;min-height:135px;border:0;border-right:1.5px solid var(--ink)}.card-body{width:59%}.intro h1{font-size:clamp(49px,8.6vw,88px)}}
@media(max-height:640px) and (min-width:660px){main{padding-top:10px;padding-bottom:10px}#play{height:calc(100vh - 20px);height:calc(100dvh - 20px);gap:8px}.mode-icon{display:none}.game-head{padding-bottom:7px}.panel h1{margin-top:0}.feedback{margin-top:12px}.actions{padding-top:7px}.card-tail{padding-top:0}.intro{margin:12px 0 16px}}
@media(max-width:659px){main{padding:14px}.wide{display:none}.intro{display:block}.intro p{margin-top:12px}.game-card{display:flex;flex-direction:column}.game-card canvas{width:100%;height:clamp(94px,16vh,160px);min-height:0;border:0;border-bottom:1.5px solid var(--ink)}.card-body{width:100%;gap:6px}.card-tail{padding-top:0}.card-tail b{width:28px;height:28px;font-size:17px}.brand{display:none}.game-head{padding-bottom:7px}#play{min-height:485px;height:calc(100vh - 28px);height:calc(100dvh - 28px);gap:8px}.workbench{display:flex;flex-direction:column;gap:8px}.panel{overflow:visible;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 10px;align-items:start;padding:0}.panel h1{font-size:30px;margin:3px 0}.panel p{font-size:14px}.mode-icon,.meter{display:none}.feedback{margin:0;padding:0;border:0;text-align:right}.feedback p{max-width:128px;font-size:12px}#score{font-size:29px}.actions{grid-column:1/-1;flex-wrap:nowrap;margin:0;padding:0}.actions:empty,.actions:has(button[hidden]+button[hidden]){display:none}.actions button{min-height:44px;padding:5px 12px}.stage{flex:1;min-height:170px}.stage-head,.stage-foot{padding:6px 10px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{transition:none!important;scroll-behavior:auto!important}}
.intro h1{font-weight:760;letter-spacing:-.058em}.card-body strong{font-weight:720;letter-spacing:-.042em}.panel h1{font-weight:760;letter-spacing:-.048em}
@media(min-width:660px) and (max-width:960px) and (max-height:510px){
 #games{grid-template-columns:repeat(4,minmax(0,1fr))}
 .game-card{flex-direction:column}.game-card canvas{width:100%;height:95px;min-height:0;border:0;border-bottom:1.5px solid var(--ink)}
 .card-body{width:100%;padding:10px;gap:5px}.card-body strong{font-size:21px}.card-body .summary{font-size:13px}
 .card-tail b{width:26px;height:26px;font-size:16px}.intro h1{font-size:48px}.mast{padding-bottom:5px}
}
@media(max-width:659px){.mast{padding-bottom:5px}.intro{margin:14px 0}.intro h1{font-size:clamp(38px,10vw,59px)}.intro p{margin-top:7px}.game-card canvas{height:clamp(76px,13vh,120px)}.card-body{padding:10px}.card-body strong{font-size:22px}}
