:root{font-family:ui-rounded,"Avenir Next",Avenir,system-ui,sans-serif;color:#4d5449;background:#d6e9df;font-synthesis:none}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;overflow:hidden}
body{height:100dvh;display:flex;align-items:center;justify-content:center;background:radial-gradient(circle at 20% 12%,#f6eed6,#c2dfd5 74%)}
button{font:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent}
button:focus-visible{outline:3px solid #344f86;outline-offset:3px}
#shell{position:relative;width:min(100vw,calc(100dvh * 390 / 720));height:min(100dvh,calc(100vw * 720 / 390));max-width:600px;max-height:100dvh;overflow:hidden;box-shadow:0 16px 60px #52695a55;background:#e8d0ad;touch-action:none;user-select:none}
#game{display:block;width:100%;height:100%;touch-action:none}
.hidden{display:none!important}
.overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:18px;background:linear-gradient(#325d5770,#324f5485);overflow:auto;touch-action:pan-y}
.overlay:empty{display:none}
.overlay.replay-overlay{background:transparent}
.panel{width:100%;max-height:100%;overflow:auto;text-align:center;background:#fff9eb;border:3px solid #fffdf4;border-radius:30px;padding:24px 19px 21px;box-shadow:0 18px 0 #a2644c33,0 24px 35px #493b3044;touch-action:pan-y}
.eyebrow{color:#a66352;font-size:11px;font-weight:900;letter-spacing:.15em;text-transform:uppercase;margin:0 0 6px}
h1,h2,p{margin:0}
h1{font-size:clamp(39px,11vw,55px);line-height:.92;letter-spacing:-.075em;color:#d36b55;text-shadow:0 3px #fff,0 5px #edc3a6;margin:6px 0 11px}
h2{font-size:29px;line-height:1.02;letter-spacing:-.045em;color:#bd654f;margin:4px 0 10px}
.subtitle{font-weight:750;font-size:15px;color:#536c62;line-height:1.42;margin:0 auto 14px;max-width:280px}
.hero-paper{height:60px;display:flex;align-items:center;justify-content:center;gap:16px;margin:7px 0 6px;filter:drop-shadow(0 4px 2px #b99e8066)}
.hero-paper i{display:block;width:37px;height:37px;background:#fffdf2;border:2px solid #d6a686;border-radius:3px;transform:rotate(-13deg);position:relative}
.hero-paper i:last-child{transform:rotate(14deg)}
.hero-paper i:after{content:'';position:absolute;inset:5px;border-left:1px solid #ead8bb;border-top:1px solid #ead8bb;transform:rotate(-45deg)}
.hero-paper b{font-size:33px;color:#d77e60}
.btn{display:block;width:100%;border:0;border-radius:17px;padding:13px 16px;margin:9px 0;font-weight:900;font-size:17px;min-height:50px;box-shadow:0 4px 0 #a3634d;transition:transform .12s,box-shadow .12s}
.btn:active{transform:translateY(3px);box-shadow:0 1px 0 #a3634d}
.primary{color:#fffdf6;background:#da7259}
.secondary{color:#426a60;background:#d6e9dd;box-shadow:0 4px 0 #9dbead}
.light{background:#f4e5cf;color:#805b4c;box-shadow:0 4px 0 #d8bfa4}
.row{display:flex;gap:9px}.row>.btn{flex:1;font-size:14px;padding:10px 6px}
.micro{font-size:11px;line-height:1.35;color:#8b7868;margin-top:9px}
.mode-label{display:flex;justify-content:space-between;gap:6px;align-items:center;margin:16px 1px 3px;font-size:12px;font-weight:900;color:#8e6e5d;text-transform:uppercase;letter-spacing:.08em}
.mode-label span:last-child{font-size:11px;color:#649380;letter-spacing:0;text-transform:none}
.hud{position:absolute;top:calc(10px + env(safe-area-inset-top));left:12px;right:12px;display:flex;align-items:start;gap:8px;pointer-events:none}
.hud-pill,.hud-button{border:2px solid #fff9e4;background:#fffaf0ed;border-radius:16px;box-shadow:0 3px 8px #624e3833;color:#496e64}
.hud-pill{min-width:70px;padding:5px 11px;display:flex;flex-direction:column;line-height:1.08}
.hud-pill small{font-size:9px;font-weight:900;letter-spacing:.1em;color:#a7755e}
.hud-pill strong{font-size:23px;font-weight:950}
.hud-pill.score{margin-left:auto;min-width:95px}
.hud-pill.score span{font-size:13px;color:#8d9b83}
.hud-button{min-width:42px;height:45px;font-size:21px;pointer-events:auto}
.practice-actions{position:absolute;top:calc(69px + env(safe-area-inset-top));right:14px}
.small-button{border:2px solid #fff8e5;border-radius:13px;background:#fff8e5df;color:#876757;font-weight:850;padding:8px 11px}
.score-big{font-size:72px;color:#d26d55;font-weight:950;line-height:1;letter-spacing:-.07em;margin:9px 0 2px}
.score-big span{font-size:28px;letter-spacing:-.03em;color:#8e9982}
.stats{display:flex;justify-content:center;gap:14px;color:#725f52;font-size:12px;margin:4px 0 10px;font-weight:800}
.best{background:#e8f0df;border-radius:13px;color:#5a7968;font-size:12px;font-weight:800;padding:8px;margin:8px 0}
.share-grid{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-top:6px}
.share-grid .btn{margin:2px 0;min-height:42px;font-size:13px;padding:7px}
.pattern-row{display:flex;gap:7px;justify-content:center;margin:9px 0}
.pattern{min-width:82px;padding:7px 8px;border-radius:12px;border:2px solid #dfcdb1;background:#fffef5;color:#7b6757;font-size:12px;font-weight:800}
.pattern.selected{border-color:#d4785c;background:#f9e5d6}
.level-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:7px;max-height:280px;overflow:auto;padding:3px}
.level-tile{aspect-ratio:1;border:0;border-radius:13px;background:#d6e9dd;color:#3c665d;font-weight:900;font-size:15px}
.level-tile.locked{background:#e7e2d7;color:#a5a096}
.level-tile.current{outline:3px solid #d47559}
.level-tile small{display:block;font-size:8px}
.setting{display:flex;align-items:center;justify-content:space-between;padding:12px;border-radius:12px;background:#f5ead8;margin:8px 0;font-size:14px;font-weight:800}
.setting input{width:21px;height:21px;accent-color:#d4785c}
.toast{position:absolute;bottom:108px;left:50%;transform:translateX(-50%);padding:9px 15px;white-space:nowrap;border-radius:15px;background:#3b675d;color:#fffdf0;font-weight:800;box-shadow:0 4px 12px #24433988;pointer-events:none}
.replay-pill{position:absolute;top:64px;left:50%;transform:translateX(-50%);border-radius:18px;background:#fffaf0e8;padding:9px 13px;color:#895e4a;font-weight:900;font-size:13px;white-space:nowrap}
@media(max-height:650px){.panel{padding-top:16px;padding-bottom:14px}.btn{min-height:43px;margin:6px 0}.hero-paper{font-size:38px}.subtitle{font-size:13px}.score-big{font-size:57px}}
@media(max-width:600px){#shell{width:100vw;height:100dvh;max-width:none;max-height:none;box-shadow:none}}
