@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Press+Start+2P&display=swap');
:root{font-family:Fredoka,system-ui,sans-serif;color:#31506b;background:#94d9ed;user-select:none;-webkit-user-select:none}*{box-sizing:border-box}body{margin:0;overscroll-behavior:none}.game{position:relative;overflow:hidden;min-height:100dvh;max-width:640px;margin:auto;background:linear-gradient(#a4e1f1 0%,#d4f4ef 77%,#d8f3d9 77%);display:flex;flex-direction:column;padding: max(20px,env(safe-area-inset-top)) 22px max(24px,env(safe-area-inset-bottom))}.topbar{position:relative;z-index:3;display:flex;align-items:flex-start;justify-content:space-between}.pixel-button,.coin-counter,.close-button{border:3px solid #31506b;box-shadow:0 4px 0 #31506b}.shop-button{background:#ffcf61;border-radius:12px;width:62px;height:53px;color:#31506b;display:flex;align-items:center;justify-content:center;flex-direction:column;cursor:pointer}.shop-button span{font-size:23px;line-height:20px}.shop-button small{font-size:9px;font-weight:700;letter-spacing:.5px}.level{text-align:center;font-family:'Press Start 2P',monospace;font-size:9px;line-height:1.6;color:#50849a}.level strong{display:block;color:#31506b;font-size:21px;margin-top:5px}.coin-counter{background:#fff8df;border-radius:30px;min-width:78px;height:44px;display:flex;align-items:center;gap:8px;padding:4px 12px 4px 5px;font-size:19px}.coin-icon{width:26px;height:26px;display:inline-grid;place-items:center;flex:none;border-radius:50%;background:#ffc84c;border:3px solid #e8a82d;color:#fff4ab;font-size:13px;box-shadow:inset 0 0 0 2px #ffe58a}.cloud{position:absolute;background:#fff;opacity:.5;height:22px;border-radius:30px}.cloud:before,.cloud:after{content:'';position:absolute;background:inherit;border-radius:50%}.cloud:before{width:34px;height:34px;bottom:0;left:15px}.cloud:after{width:25px;height:25px;bottom:0;left:40px}.cloud-one{width:86px;top:17%;left:-20px}.cloud-two{width:78px;top:29%;right:-25px}.game-heading{text-align:center;position:relative;z-index:1;margin:38px 0 0}.eyebrow{font-family:'Press Start 2P',monospace;font-size:8px;line-height:1.6;color:#ed9475;letter-spacing:.3px}.game-heading h1{font-size:clamp(28px,8vw,40px);line-height:.96;margin:12px 0;color:#31506b;letter-spacing:-1px}.game-heading h1 em{font-style:normal;color:#f39170}.game-heading p{font-size:15px;margin:12px 0 0;color:#658899}.play-area{position:relative;flex:1;min-height:260px;display:flex;align-items:center;justify-content:center;z-index:1}.window-stage{position:relative;width:100%;height:100%;min-height:260px;display:flex;align-items:center;justify-content:center}.window{position:absolute;width:var(--window-width);height:var(--window-height);max-width:100%;max-height:100%;border:10px solid #fff9e9;border-radius:5px;background:#a2e3ef;box-shadow:0 0 0 4px #52798a,0 9px 0 #52798a,0 15px 20px #6099a44d;overflow:hidden;touch-action:none}.window:before{content:'';position:absolute;inset:0;background:linear-gradient(135deg,transparent 35%,#ffffff62 35%,#ffffff62 42%,transparent 42%,transparent 55%,#ffffff4d 55%,#ffffff4d 59%,transparent 59%),linear-gradient(#a6e6f4,#d2f3ed);pointer-events:none}.window:after{content:'';position:absolute;left:50%;top:0;width:6px;height:100%;background:#fff9e9;transform:translateX(-50%);box-shadow:0 0 0 1px #7fabb2;pointer-events:none}.window canvas{position:absolute;inset:0;width:100%;height:100%;touch-action:none;z-index:2;cursor:crosshair}.window.enter{animation:enter .55s cubic-bezier(.2,.8,.2,1) both}.window.exit{animation:exit .55s cubic-bezier(.6,0,.8,.2) both;pointer-events:none}@keyframes enter{from{transform:translateX(-120vw) rotate(-5deg)}to{transform:translateX(0) rotate(0)}}@keyframes exit{to{transform:translateX(120vw) rotate(5deg)}}.reward{position:absolute;top:15%;left:50%;display:flex;align-items:center;gap:7px;opacity:0;color:#fff;font-size:28px;font-weight:700;text-shadow:2px 3px #be8736;pointer-events:none;z-index:5}.reward.show{animation:reward .9s ease-out both}@keyframes reward{0%{opacity:0;transform:translate(-50%,20px) scale(.5)}20%{opacity:1;transform:translate(-50%,0) scale(1.2)}75%{opacity:1}100%{opacity:0;transform:translate(-50%,-55px) scale(1)}}.bottom-ui{position:relative;z-index:2;width:min(100%,360px);margin:0 auto 30px}.progress-label{display:flex;justify-content:space-between;font-family:'Press Start 2P',monospace;font-size:9px;color:#52798a;margin-bottom:9px}.progress-track{height:16px;border:3px solid #52798a;border-radius:20px;background:#eaf9f4;overflow:hidden}.progress-track div{height:100%;width:0;background:#f8bc54;transition:width .15s}.tool-status{display:flex;align-items:center;gap:8px;margin-top:15px;color:#6b929b;font-size:12px}.tool-status strong{margin-left:auto;font-size:10px;letter-spacing:.4px}.tiny-squeegee{width:21px;height:8px;background:var(--tool-color,#ee9b7d);border:2px solid #52798a;border-radius:3px;position:relative}.tiny-squeegee:after{content:'';position:absolute;width:4px;height:13px;background:#52798a;left:7px;top:5px}.ground{position:absolute;bottom:0;left:0;right:0;height:31px;background:#a6dcb1;border-top:4px solid #8bc99e}.ground span{position:absolute;bottom:8px;width:17px;height:4px;border-radius:8px;background:#82c99a}.ground span:nth-child(1){left:14%}.ground span:nth-child(2){left:48%}.ground span:nth-child(3){right:12%}.modal-backdrop{position:fixed;inset:0;background:#294b60a8;display:grid;place-items:center;padding:20px;z-index:10}.modal-backdrop[hidden]{display:none}.shop{width:min(100%,440px);background:#fffaf0;border:4px solid #31506b;border-radius:22px;box-shadow:0 8px 0 #31506b;padding:24px}.shop-header{display:flex;justify-content:space-between;align-items:start}.shop h2{font-size:31px;line-height:1;margin:6px 0;color:#31506b}.close-button{width:40px;height:40px;border-radius:10px;background:#ffcf61;color:#31506b;font-size:28px;line-height:25px;cursor:pointer}.shop-intro{font-size:14px;color:#77939a;margin:8px 0 18px}.shop-balance{display:flex;align-items:center;justify-content:space-between;background:#e9f7ef;border-radius:12px;padding:10px 14px;font-size:10px;font-weight:700;letter-spacing:.5px}.shop-balance strong{display:flex;align-items:center;gap:6px;font-size:19px}.upgrade{display:flex;gap:11px;align-items:center;padding:18px 0;border-bottom:2px dashed #dbeae3}.upgrade-icon{width:50px;height:50px;flex:none;display:grid;place-items:center;border:3px solid #31506b;border-radius:12px;font-size:26px;font-weight:700}.width-icon{background:#a6e0e7}.power-icon{background:#ffd085}.upgrade-copy{flex:1;min-width:0}.upgrade h3{margin:0;font-size:17px}.upgrade p{margin:3px 0;font-size:12px;color:#77939a}.upgrade-copy span{font-size:10px;color:#e99977;font-weight:700}.buy-button{background:#ffca59;border:3px solid #31506b;border-radius:10px;box-shadow:0 3px 0 #31506b;color:#31506b;font-weight:700;padding:9px;white-space:nowrap;cursor:pointer}.buy-button:disabled{background:#dce7df;color:#91aaa7;box-shadow:none;cursor:default}.shop-footer{text-align:center;color:#91aaa7;font-size:12px;margin:18px 0 0}@media(max-height:700px){.game-heading{margin-top:20px}.game-heading h1{font-size:27px}.game-heading p{margin-top:7px}.bottom-ui{margin-bottom:20px}.play-area,.window-stage{min-height:210px}}

/* Herramienta dibujada sobre el dedo durante cada pasada. */
.squeegee{position:fixed;z-index:8;left:0;top:0;width:var(--blade-width,58px);height:72px;transform:translate(-50%,-50%);pointer-events:none;visibility:hidden;filter:drop-shadow(2px 3px 0 #31506b55)}
.squeegee.visible{visibility:visible}.squeegee-blade{position:absolute;top:28px;left:0;width:100%;height:14px;background:var(--tool-color,#f6a17e);border:3px solid #31506b;border-radius:4px;box-shadow:inset 0 3px #ffd0a8}.squeegee-blade:after{content:'';position:absolute;left:2px;right:2px;bottom:-6px;height:4px;background:#31506b;border-radius:0 0 3px 3px}.squeegee-handle{position:absolute;top:41px;left:50%;width:13px;height:30px;transform:translateX(-50%);background:#ffd065;border:3px solid #31506b;border-radius:0 0 5px 5px}

.shop{max-height:min(90dvh,800px);overflow-y:auto}.skins-title{font-size:16px;margin:18px 0 10px}.skins{display:grid;grid-template-columns:1fr 1fr;gap:8px}.skin-button{display:flex;align-items:center;gap:7px;min-width:0;padding:8px;border:2px solid #b5d2cd;border-radius:10px;background:#fff;color:#31506b;font:600 12px Fredoka,system-ui,sans-serif;cursor:pointer}.skin-button.selected{border-color:#e99977;background:#fff1e5}.skin-button:disabled{opacity:.5;cursor:default}.skin-swatch{width:20px;height:20px;flex:none;border:2px solid #31506b;border-radius:5px}.find-message{position:absolute;top:3%;left:50%;transform:translateX(-50%);z-index:6;white-space:nowrap;color:#31506b;font-weight:700;text-shadow:0 1px #fff;pointer-events:none}

.discovery p{color:#658899;line-height:1.45}.discovery .buy-button{margin-top:8px}

.coin-area{display:flex;flex-direction:column;align-items:flex-end;gap:6px;max-width:160px}.gift-actions{display:flex;flex-direction:column;align-items:flex-end;gap:5px}.gift-action{border:2px solid #31506b;border-radius:9px;background:#ffcf61;color:#31506b;padding:6px 8px;font:700 11px Fredoka,system-ui,sans-serif;cursor:pointer;box-shadow:0 2px 0 #31506b}.gift-action:disabled{opacity:.55;cursor:default}.effect-status{font-size:10px;font-weight:700;color:#31506b;text-align:right}.gift-icon{background:#ffdfaa}.upgrade-copy #giftResult{display:block;color:#b96b4d;font-size:11px;line-height:1.3;margin-top:5px}

.window.golden{border-color:#ffd359;box-shadow:0 0 0 4px #a77425,0 9px 0 #a77425,0 15px 20px #a7742555}.window.golden:after{background:#ffd359;box-shadow:0 0 0 1px #b88a37}.golden-badge{position:absolute;top:8px;left:50%;transform:translateX(-50%);z-index:3;white-space:nowrap;pointer-events:none;background:#fff2b6;border:2px solid #b5822e;border-radius:12px;padding:4px 8px;color:#8b5a16;font-size:10px;font-weight:700}

.hidden-drawing{position:absolute;inset:0;display:grid;place-items:center;color:#ef937a;font-size:clamp(70px,20vw,150px);line-height:1;pointer-events:none}.crack-mark{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);z-index:3;color:#526777;font-size:38px;line-height:1;pointer-events:none;text-shadow:1px 1px #fff}.sticker{position:absolute;top:26%;left:30%;z-index:4;width:48px;height:48px;border:3px solid #d87c65;border-radius:12px;background:#ffe681;color:#e38c60;font-size:27px;touch-action:none;cursor:pointer}.sticker.holding{transform:scale(.8);transition:transform 1s}.falling-coin{position:absolute;top:-35px;z-index:5;width:34px;height:34px;border:3px solid #e8a82d;border-radius:50%;background:#ffc84c;color:#fff4ab;font-size:18px;cursor:pointer;animation:coin-fall 3.5s linear forwards;touch-action:manipulation}@keyframes coin-fall{to{top:105%}}.drawing-album{background:#e9f7ef;border-radius:10px;padding:10px;color:#52798a;font-size:12px;line-height:1.6}

.topbar-buttons{display:flex;gap:8px}.menu-button{background:#a6e0e7}.menu-options{display:grid;gap:10px;margin-top:22px}.menu-option{display:flex;justify-content:space-between;align-items:center;width:100%;padding:12px 14px;border:2px solid #b5d2cd;border-radius:12px;background:#fff;color:#31506b;font:600 16px Fredoka,system-ui,sans-serif;text-align:left;cursor:pointer}.menu-option span{font-size:23px;line-height:1}.new-game-option{color:#b96b4d}.menu-content{margin-top:20px}.menu-content[hidden],.menu-options[hidden]{display:none}.menu-content h3{margin:0 0 10px;font-size:19px}.menu-content p{color:#658899;line-height:1.45;font-size:14px}.menu-confirm-buttons{display:flex;gap:10px;flex-wrap:wrap}.danger-button{background:#f1a28a}@media(max-width:360px){.topbar-buttons{gap:4px}.shop-button{width:53px}.level strong{font-size:18px}.coin-counter{min-width:68px}}

.bird{position:absolute;z-index:6;top:7%;left:-90px;width:80px;height:80px;object-fit:contain;pointer-events:none;animation:bird-fly 3.2s linear forwards;filter:drop-shadow(1px 3px 1px #31506b44)}@keyframes bird-fly{0%{left:-90px;transform:translateY(4px) rotate(-5deg)}45%{transform:translateY(-5px) rotate(3deg)}100%{left:calc(100% + 10px);transform:translateY(4px) rotate(-5deg)}}@media(prefers-reduced-motion:reduce){.bird{animation-duration:1.6s}}

.splash{position:fixed;inset:0;z-index:100;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;background:#a4e1f1;color:#31506b;text-align:center}.splash img{width:120px;height:120px;border-radius:26px;box-shadow:0 6px 0 #52798a}.splash strong{font-size:30px;line-height:1}.splash span{font-size:14px;color:#52798a}.splash[hidden]{display:none}.discovery p{white-space:pre-line}

.butterfly{position:absolute;top:15%;left:10%;width:58px;height:58px;z-index:6;border:0;background:transparent;padding:0;cursor:pointer;touch-action:manipulation;animation:butterfly-flight 9s ease-in-out forwards}.butterfly img{width:100%;height:100%;object-fit:contain;animation:butterfly-flap .5s ease-in-out infinite alternate}@keyframes butterfly-flight{0%{left:5%;top:20%}35%{left:70%;top:38%}70%{left:18%;top:58%}100%{left:85%;top:10%}}@keyframes butterfly-flap{to{transform:scaleX(.65)}}.window.windy{box-shadow:0 0 0 4px #52798a,0 9px 0 #52798a,0 15px 20px #6099a44d,inset 0 0 20px #fff8}.window.icy{border-color:#d4f4ff}body[data-tool="sponge"] .squeegee-blade{height:24px;border-radius:10px;background:#ffe284}body[data-tool="spray"] .squeegee-blade{height:19px;border-radius:8px;background:#a6e0e7}@media(prefers-reduced-motion:reduce){.butterfly,.butterfly img{animation:none}}

/* Alternativas para versiones de Safari sin unidades dinámicas de ventana. */
@supports not (height: 100dvh){.game{min-height:100vh;min-height:-webkit-fill-available}.shop{max-height:90vh}}
html{height:-webkit-fill-available}.shop{-webkit-overflow-scrolling:touch;overscroll-behavior:contain}.sticker,.window canvas,.butterfly,.falling-coin{-webkit-touch-callout:none}.modal-backdrop{padding: max(20px,env(safe-area-inset-top)) max(20px,env(safe-area-inset-right)) max(20px,env(safe-area-inset-bottom)) max(20px,env(safe-area-inset-left))}
