@font-face{font-family:Mi;src:url('assets/mi-bold.woff2?v=12')}@font-face{font-family:MiMedium;src:url('assets/mi-medium.woff2?v=12')}@font-face{font-family:KS;src:url('assets/ks.woff2');font-weight:100 900}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}html,body{margin:0;min-height:100%;background:#629735;overflow-x:hidden}body{font-family:Mi,'PingFang SC',sans-serif;color:#67370d;user-select:none;-webkit-user-select:none}button{font:inherit;color:inherit;border:0;padding:0;background:none;cursor:pointer;touch-action:manipulation}button:focus-visible{outline:3px solid white;outline-offset:2px}img{pointer-events:none;user-select:none}button:active:not(:disabled){filter:brightness(1.15);translate:0 2px}button:disabled{cursor:default} [hidden]{display:none!important}#viewport{position:relative;margin:0 auto;width:100%;max-width:520px;overflow:hidden}#game{position:absolute;width:414px;height:895px;transform-origin:top left}#world{position:absolute;inset:0;background:#629735 url('assets/background.webp') center/100% 100%;overflow:hidden}.status{position:absolute;left:0;top:0;width:414px;height:62px}.platform{position:absolute;left:0;top:70px;width:414px;height:49px}.platform>button{position:absolute;width:44px;height:44px;top:0}.platform>button img{width:100%;height:100%}#back{left:12px}#sound{right:12px}.progress{position:absolute;left:70px;width:273px;height:49px;background:rgba(59,10,2,.5);border-radius:8px;overflow:hidden;color:#ffe3ae}.current{position:absolute;width:49px;height:49px;background:rgba(59,10,2,.4);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;color:white}.current b{font:600 19px KS}.current span{font:11px MiMedium}.steps-clip{position:absolute;left:59px;top:5px;width:214px;height:41px;overflow:hidden}#steps{display:flex;gap:6px;transition:transform .4s ease}.step{position:relative;flex:0 0 63px;height:41px;font:11px MiMedium;line-height:18px}.step>div{height:21px;display:flex;align-items:center;gap:2px;color:#ffd65b;font:600 14px KS,MiMedium}.step .coin{width:14px;height:14px;border:1.5px solid #ffe383;box-shadow:inset 0 0 0 1px #d99b26;border-radius:50%;background:#f4c344}.step.done .coin{background:#ffe797}.step.done .coin:after{content:'✓';display:block;color:#9e681a;font:10px Mi;text-align:center}.step:after{content:'···';position:absolute;left:51px;top:0;color:#bc833b}.title{position:absolute;left:49px;top:138px;width:316px;height:auto}.plaque{position:absolute;top:202px;left:122px;width:170px;height:23px;background:url('assets/plaque.png') center/100% auto no-repeat;display:flex;align-items:center;justify-content:center;font-size:11px;letter-spacing:.3px}.hud{position:absolute;left:12px;top:230px;width:390px;height:50px;background:url('assets/hud.webp') center/100% auto no-repeat;display:flex;align-items:center;padding:0 11px;gap:8px;white-space:nowrap}.hud>.hud-level{font-size:17px;width:63px;text-align:center}.time{display:flex;align-items:center;gap:4px;border-left:1.5px solid #ac6b27;padding-left:8px;font-size:18px;width:95px;font-variant-numeric:tabular-nums}.time img{width:22px;height:22px;object-fit:contain}.time.urgent{color:#a82613}.score-wrap{border-left:1.5px solid #ac6b27;border-right:1.5px solid #ac6b27;text-align:center;width:83px;height:33px;font-size:14px;line-height:21px}.score-wrap small{display:block;font-size:8px;line-height:10px;opacity:.8}#score{display:inline-flex;height:20px;vertical-align:bottom;overflow:hidden;font:700 17px KS;line-height:20px}.digit{display:inline-block;width:10px;height:20px}.digit-strip{display:flex;flex-direction:column;transition:transform .42s cubic-bezier(.16,1,.3,1)}.digit-strip i{height:20px;font-style:normal;flex-shrink:0}.score-flash{animation:scoreflash .45s ease-out}@keyframes scoreflash{30%{filter:brightness(2);text-shadow:0 0 5px #fff09c}100%{filter:none}}.hud-pairs{font:600 16px KS;width:44px;text-align:center}#pause{width:34px;height:34px;flex-shrink:0}#pause img{width:100%;height:100%;object-fit:contain}.board-frame{position:absolute;left:12px;top:284px;width:390px;height:482px}.board-frame>img{width:100%;height:100%;object-fit:contain}#board{position:absolute;left:33px;top:305px;width:348px;height:440px;display:grid;grid-template-columns:repeat(6,58px);grid-template-rows:repeat(8,55px)}.tile{position:relative;width:58px;height:55px;background:url('assets/tile.png') center/100% 100% no-repeat}.tile>img{position:absolute;left:9px;top:7px;width:40px;height:40px;object-fit:contain;image-rendering:pixelated}.tile.empty{visibility:hidden}.tile.selected:after,.tile.hinted:after{content:'';position:absolute;inset:-2px;background:url('assets/selection.png') center/100% 100% no-repeat;pointer-events:none;filter:drop-shadow(0 0 4px #fff377)}.tile.hinted:after{animation:hintpulse .65s ease-in-out infinite alternate}@keyframes hintpulse{to{opacity:.35}}.tile.selected>img{transform:scale(1.08)}.tools{position:absolute;left:53px;right:53px;top:788px;display:flex;justify-content:space-between;align-items:flex-start}.tool{position:relative;width:72px;height:87px}.tool>img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}.tool>b{position:absolute;left:0;right:0;bottom:5px;font-size:17px;line-height:21px}.badge{position:absolute;right:-7px;top:-8px;width:26px;height:26px;background:url('assets/badge.png') center/contain no-repeat;color:white;font:600 22px KS;line-height:25px;text-align:center;text-shadow:0 1px #8c3319}.tool:disabled>img{filter:grayscale(.9);opacity:.7}.tool:disabled .badge{filter:grayscale(1)}#pause-screen{position:absolute;left:33px;top:305px;width:348px;height:440px;background:#274d35e8;display:grid;place-items:center;z-index:9}#resume{width:100px;height:45px;background:url('assets/plaque.png') center/contain no-repeat;font-size:17px}#fx{position:absolute;inset:0;pointer-events:none;z-index:12;overflow:hidden}.fx-item{position:absolute;object-fit:contain;pointer-events:none}.route{position:absolute;inset:0;width:414px;height:895px;overflow:visible}.route polyline{fill:none;stroke:#fff6b0;stroke-width:3;stroke-linejoin:round;filter:drop-shadow(0 0 5px #ffd51b)}.float-score{position:absolute;color:#fff19b;font:800 27px KS;text-shadow:2px 2px #7c4513,-1px -1px #7c4513;transform:translate(-50%,-50%)}.combo-fx{position:absolute;display:flex;align-items:center;gap:5px}.combo-fx img{width:60px}.combo-fx b{color:#ffdc3e;font:800 30px KS;text-shadow:2px 2px #174723}.overlay{position:absolute;inset:0;background:rgba(0,0,0,.7);z-index:30}.result-card{position:absolute;left:57px;top:268px;width:300px;height:360px;background:#1da5ff;border-radius:9px;color:white}.result-card.fail{background:#fddba5;color:#7b4300}.tagline{position:absolute;left:16px;top:12px;margin:0;font:600 16px/27px 'PingFang SC',Mi,sans-serif}.result-card h2{position:absolute;left:16px;top:43px;margin:0;font:600 28px/37px 'PingFang SC',Mi,sans-serif;white-space:pre-line}.modal-decoration{position:absolute;left:195px;top:-33px;width:137px;height:123px}.fail .modal-decoration{left:193px}.reward{position:absolute;left:83px;top:112px;width:133px;height:143px;display:flex;align-items:flex-start}.reward strong{font:600 119px/143px KS;width:109px}.reward span{font:24px/32px Mi;margin-top:100px}.result-actions{position:absolute;left:16px;top:296px;width:268px;height:48px;display:flex;gap:8px}.result-actions button{height:48px;border-radius:9px;background:#111a2c;color:white;font:18px Mi;flex:1}.result-card.fail #result-retry{display:block;flex:0 0 107px;background:white;color:#111a2d}.result-card.fail #result-primary{background:#911300}#result-retry{display:none}#result-close{position:absolute;left:130px;top:376px;width:40px;height:40px}#result-close img{width:100%;height:100%}#loading{position:absolute;inset:0;background:#629735 url('assets/background.webp') center/cover;z-index:50;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:25px}#loading>img{width:310px}#loading progress{width:220px;height:12px;accent-color:#ffd04c}#load-retry{font-size:17px;background:#ffe1a0;border-radius:4px;padding:8px 18px}@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:.01ms!important;transition-duration:.01ms!important}}
/* Preserve native image ratios; the small score target stays inside the existing HUD. */
.title{top:133px}.plaque{top:209px}.hud{top:237px}.board-frame{top:294px}#board,#pause-screen{top:315px}.tools{top:798px}
.step .coin{border:0;box-shadow:none;background:transparent url('assets/coin.svg') center/contain no-repeat}.step.done .coin{background:transparent url('assets/coin.svg') center/contain no-repeat}.step.done .coin:after{content:none}

.tool:disabled>img{filter:none;opacity:1}.combo-fx b{font-family:KS,Mi,sans-serif}
@font-face{font-family:PF;src:url('assets/pingfang-semibold.woff2');font-weight:600}.tagline,.result-card h2{font-family:PF,'PingFang SC',Mi,sans-serif}
.overlay{background:rgba(0,0,0,.8)}

/* Inner wooden surface is smaller than the transparent frame canvas. */
.board-frame{left:35px;top:300px;width:344px;height:450px;pointer-events:none}
#board,#pause-screen{left:60px;top:331px;width:294px;height:392px}
#board{grid-template-columns:repeat(6,49px);grid-template-rows:repeat(8,49px)}
.tile{width:49px;height:49px}
.tile>img{left:8.5px;top:8.5px;width:32px;height:32px;object-fit:contain}
.hud{display:grid;grid-template-columns:88px 131px 91px 34px;gap:0;padding:0 23px}
.hud>.hud-level{width:88px;font-size:18px}
.time{width:131px;justify-content:center;padding:0;font-size:20px;height:29px}
.hud-pairs{width:91px;border-left:1.5px solid #ac6b27;font-size:19px;line-height:29px}
.tool-label{position:absolute;left:6px;top:68px;width:60px;height:16px;overflow:hidden;pointer-events:none}
.tool-label text{font:13px Mi;fill:#67370d;text-anchor:middle}
.tools{top:787px}

/* Pause action: full-sized face, not the narrow reward ribbon. */
#resume{width:160px;height:52px;display:flex;align-items:center;justify-content:center;background:#ffe0a0;border:3px solid #96521c;border-radius:8px;box-shadow:inset 0 0 0 2px #fff0c5,0 4px 0 #67370d;color:#67370d;font:20px/1 Mi;text-align:center}
#resume:active{box-shadow:inset 0 0 0 2px #fff0c5,0 2px 0 #67370d}

/* Compact first board, with the same square cells and matching FX coordinates. */
.easy .board-frame{left:65px;top:325px;width:284px;height:406px}
.easy .board-frame>img{object-fit:fill}
.easy #board,.easy #pause-screen{left:89px;top:351px;width:236px;height:354px}
.easy #board{grid-template:repeat(6,59px)/repeat(4,59px)}
.easy .tile{width:59px;height:59px}
.easy .tile>img{inset:10.5px;width:38px;height:38px}
#tutorial{position:absolute;left:0;right:0;top:295px;margin:0;text-align:center;color:#fff5ca;font:14px/22px Mi;text-shadow:0 1px 3px #234814}
.tile.teaching::after{content:'';position:absolute;inset:0;border:3px solid #ffd452;box-shadow:inset 0 0 9px #ffd452;pointer-events:none}
.tile-back{position:absolute;inset:3px;display:grid;place-items:center;opacity:0;pointer-events:none;background:#a75b26;border:2px solid #ffda87;border-radius:5px;color:#ffe3a1}
.hud{top:217px;grid-template-columns:repeat(3,minmax(0,1fr)) 34px;align-items:center;padding:0 25px}
.hud>.hud-level,.hud .time,.hud .hud-pairs{width:auto;height:28px;display:flex;align-items:center;justify-content:center;font:18px/1 Mi;font-variant-numeric:tabular-nums}
.hud .time.urgent{color:#a82613}
.hud .time img{width:21px;height:21px}
.tools{left:96px;right:96px}
.pause-actions{display:grid;gap:12px;justify-items:center}
#pause-screen #restart{width:160px;height:52px;border:3px solid #96521c;border-radius:8px;background:#f2c985;color:#67370d;font:20px/1 Mi;box-shadow:inset 0 0 0 2px #fff0c5,0 4px 0 #67370d}

#rule-demo{display:grid;place-items:center;z-index:40}
.rule-card{width:312px;padding:22px 18px;text-align:center;color:#67370d;background:#ffe2a5;border:4px solid #9b5720;border-radius:12px;box-shadow:inset 0 0 0 2px #fff1c8}
.rule-card h2{margin:0;font-size:21px}
.rule-card p{margin:0 0 15px;font-size:14px}
.rule-stage{height:102px;display:flex;gap:70px;align-items:center;justify-content:center;position:relative}
.rule-tile{position:relative;width:57px;height:57px;display:grid;place-items:center;background:url('assets/tile.png') center/100% 100%}
.rule-tile img{width:36px;height:36px;object-fit:contain}
.rule-tile i{position:absolute;inset:0;border-radius:7px;border:3px solid #fff078;box-shadow:0 0 10px #faaa28;animation:rule-tap 3.4s infinite both}
.rule-right i{animation-name:rule-tap-right}
.rule-tile{animation:rule-clear 3.4s infinite both}
.rule-line{position:absolute;left:50%;width:74px;height:4px;background:#fff8ac;box-shadow:0 0 8px #ff9500;transform:translateX(-50%);animation:rule-link 3.4s infinite both}
#rule-start{width:160px;height:48px;border:2px solid #a3591e;border-radius:7px;background:#ffbd4b;font-size:18px}
@keyframes rule-tap{0%,11%,70%,100%{opacity:0}16%,65%{opacity:1}}
@keyframes rule-tap-right{0%,33%,70%,100%{opacity:0}38%,65%{opacity:1}}
@keyframes rule-link{0%,38%,72%,100%{opacity:0}44%,65%{opacity:1}}
@keyframes rule-clear{0%,60%,100%{opacity:1;transform:scale(1)}74%,95%{opacity:0;transform:scale(.55)}}
@media(prefers-reduced-motion:reduce){.rule-stage *{animation:none!important}}
@font-face{font-family:BoardPixel;src:url('assets/hud-pixel.woff2')}
.hud{padding:0 15px 3px;grid-template-columns:1fr 1.35fr 1fr 36px;align-items:center}
.hud>.hud-level,.hud .time,.hud .hud-pairs{font:18px/24px BoardPixel,Mi,sans-serif;height:28px;text-align:center}
#pause{position:relative;top:-0.4px;display:grid;place-items:center;width:32px;height:32px}
#pause img{display:block}
#help{position:absolute;right:20px;top:163px;width:38px;height:38px;border:2px solid #84501a;border-radius:50%;background:#ffe19d;font:22px BoardPixel,Mi;z-index:2}
.tile{transform-style:preserve-3d}
.tile-back{opacity:1;backface-visibility:hidden;transform:rotateY(180deg) translateZ(3px)}
.tile>img{backface-visibility:hidden;transform:translateZ(3px)}
.tile::before{content:'';position:absolute;left:50%;top:0;width:6px;height:100%;background:#ab742e;transform:translateX(-50%) rotateY(90deg) translateZ(24px)}
.easy .tile::before{transform:translateX(-50%) rotateY(90deg) translateZ(29px)}
.tile.demo-pick{outline:3px solid #ffef63;filter:brightness(1.25);z-index:1}
.tile.demo-clear{transition:opacity .5s .12s;opacity:0}
#loading>strong,#loading>small,#loading>progress,#loading>img{position:absolute;left:50%;transform:translateX(-50%)}
#loading>strong{top:183px;font-size:22px}#loading>img{top:252px;width:302px}#loading>progress{top:657px}#loading>small{top:693px}
.hud>.hud-level,.hud .time,.hud .hud-pairs{font-weight:700;-webkit-text-stroke:.45px currentColor;color:#552c0b}
.tools{left:53px;right:53px}
.tools #help{position:relative;inset:auto;width:72px;height:87px;border:0;border-radius:0;background:url('assets/plaque.png') center bottom/100% 22px no-repeat}
.rule-icon{position:absolute;inset:0 0 auto;height:66px;display:grid;place-items:center;background:url('assets/tile.png') center/100% 100%;font:bold 38px BoardPixel,Mi;color:#864b16}
#world:has(.demo-pick) #tutorial{position:absolute;top:272px;left:50%;right:auto;transform:translateX(-50%);margin:0;padding:4px 12px;border-radius:6px;background:#375024;color:white;font:14px/20px Mi;white-space:nowrap;z-index:5}
#board:has(.demo-pick) .tile:not(.demo-pick){filter:brightness(.62)}
.tile.demo-pick:after{content:'☞';position:absolute;inset:auto -8px -7px auto;background:none;color:white;font:bold 25px/1 sans-serif;text-shadow:1px 2px 2px #633800;transform:rotate(-30deg);pointer-events:none}
.tools #help{background:none}
.wood-question{position:absolute;left:14px;right:14px;top:7px;height:52px;display:grid;place-items:center;background:#f8be57 url('assets/hint.png') 10% 35%/660px 87px no-repeat;color:#fff17e;font:bold 36px/1 BoardPixel,Mi;-webkit-text-stroke:1.3px #85410b;text-shadow:2px 3px #b76b19}
.tile.demo-pick:after{content:none}
.demo-pointer{position:absolute;z-index:2;font:30px/1 sans-serif;color:white;text-shadow:1px 2px 3px #613408;pointer-events:none}
#board .tile{transition:filter .32s,opacity .45s,scale .35s}
#board .demo-clear{scale:.72}
.wood-question{background-position:-52px -7px}

.hud>.hud-level,.hud .time,.hud .hud-pairs{font:18px/24px Mi,"PingFang SC",sans-serif;-webkit-text-stroke:0}
.hud #level,.hud #time,.hud #pairs{position:relative;top:-1px}

.rule-card h2,.tool-label text,#tutorial,#world:has(.demo-pick) #tutorial{font-family:Mi,sans-serif;font-weight:normal;font-synthesis:none}
.rule-card p,#rule-start{font-family:MiMedium,sans-serif;font-weight:normal;font-synthesis:none}
.wood-question svg{display:block;filter:drop-shadow(1px 2px 0 #a56325)}
@font-face{font-family:RuleBold;src:url('assets/ui-bold.woff2') format('woff2');font-display:swap}
@font-face{font-family:RuleMedium;src:url('assets/ui-medium.woff2') format('woff2');font-display:swap}
.rule-card h2,.tool-label text,#tutorial,#world:has(.demo-pick) #tutorial{font-family:RuleBold,sans-serif}
.rule-card p,#rule-start{font-family:RuleMedium,sans-serif}

.wood-question{filter:none;text-shadow:none;-webkit-text-stroke:0}.wood-question svg{filter:none}
/* One wooden face and caption plate; only the foreground symbol varies. */
.tools .tool,.tools #help{background: url('assets/hint.png') center/100% 100% no-repeat}
.tools .tool::before{content:'';position:absolute;left:14px;right:14px;top:7px;height:52px;background:#f8be57 url('assets/hint.png') -52px -7px/660px 87px no-repeat}
.tools .wood-question{background:none}
.tools #help>img{display:none}
.tools #hint>img{clip-path:polygon(22% 28%,25% 21%,31% 16%,40% 12%,49% 10%,59% 11%,68% 16%,75% 23%,78% 31%,76% 39%,64% 47%,61% 60%,56% 67%,44% 67%,39% 61%,37% 48%,25% 40%)}
.tools #shuffle>img{clip-path:polygon(15% 19%,40% 19%,48% 27%,60% 20%,65% 20%,65% 14%,74% 14%,86% 26%,76% 37%,65% 38%,65% 33%,59% 37%,66% 44%,66% 40%,75% 40%,85% 50%,74% 61%,64% 61%,64% 56%,54% 55%,48% 50%,39% 56%,16% 56%,16% 43%,33% 42%,38% 38%,32% 33%,16% 33%)}

#revive-ad{display:grid;place-items:center;z-index:45}#revive-ad p{margin:20px}#ad-close{background:#ffbd4b;border-radius:7px;padding:10px 28px}

#after-win{position:absolute;left:50%;top:527px;transform:translate(-50%,-50%);z-index:10;width:160px;height:52px;border-radius:8px;border:3px solid #96521c;background:#ffe0a0;color:#67370d;box-shadow:inset 0 0 0 2px #fff0c5,0 4px #67370d;font:20px Mi}

#board .tile.selected::after{inset:1px;box-sizing:border-box;border:3px solid #fff485;border-radius:5px;background:rgba(255,212,38,.16);box-shadow:inset 0 0 0 2px #d99216,0 0 7px #ffd947;z-index:2}
.tools .badge{display:grid;place-items:center;line-height:1;font-family:RuleBold,Mi,sans-serif;font-size:16px;font-weight:normal;padding:0;text-shadow:none;font-variant-numeric:tabular-nums}

