:root{color-scheme:light;font-family:"Yu Gothic UI","Hiragino Sans",system-ui,sans-serif;background:#182b26;color:#22352b}
*{box-sizing:border-box}
body{margin:0;overflow:hidden;overscroll-behavior:none}
button{font:inherit;color:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent}
button:focus-visible{outline:3px solid #faab47;outline-offset:3px}
#game{width:min(100vw,510px);height:100vh;height:100dvh;margin:auto;position:relative;isolation:isolate;overflow:hidden;background:#addde5;box-shadow:0 0 80px #0b16148c;user-select:none}
#world,#world canvas{position:absolute;inset:0;width:100%;height:100%;display:block;touch-action:none}
.hud{position:absolute;z-index:2;top:max(16px,env(safe-area-inset-top));inset-inline:16px;display:grid;gap:10px;pointer-events:none}
.brand-row{display:flex;justify-content:space-between;align-items:center;gap:8px}
.brand{padding:9px 14px 10px;background:#fff8e9;border:1px solid #fffdf5;border-radius:15px;box-shadow:0 4px 0 #33452c2b}
.eyebrow{font-size:9px;font-weight:900;letter-spacing:.22em;color:#735234;display:block}
h1,h2,p{margin:0}
h1{font-size:24px;letter-spacing:.035em;line-height:1.15;font-weight:950;margin-top:2px}
.tools{display:flex;gap:8px;pointer-events:auto}
.icon{display:grid;place-items:center;width:44px;height:44px;background:#fff8e9;color:#344537;border:1px solid #fffdf5;border-radius:13px;box-shadow:0 4px 0 #33452c2b;font:900 24px/1 system-ui}
#mapButton span{display:block;width:20px;height:18px;font-size:0;border:2px solid currentColor;clip-path:polygon(0 12%,33% 0,67% 13%,100% 0,100% 88%,67% 100%,33% 87%,0 100%);background:linear-gradient(90deg,transparent 27%,currentColor 28% 36%,transparent 37% 62%,currentColor 63% 70%,transparent 71%);transform:rotate(-9deg)}
#soundButton[aria-pressed="true"]{background:#e6f2c7}
#soundButton[aria-pressed="false"] span{opacity:.68}
.quest{display:flex;align-items:center;gap:11px;width:min(100%,280px);padding:9px 12px;border-radius:14px;background:#263e31ef;color:#fff7e5;box-shadow:0 3px 0 #25322932}
.acorn-icon{flex:0 0 21px;height:25px;position:relative;background:#f2b85c;border-radius:50% 50% 54% 54%;transform:rotate(-15deg);border-top:8px solid #935331;box-shadow:inset -3px -1px 0 #c58037}
.acorn-icon:before{content:"";position:absolute;top:-12px;left:10px;background:#935331;width:3px;height:6px;border-radius:2px}
.quest-info{flex:1}
#objective{font-size:12px;font-weight:850;display:block}
#progress{display:flex;gap:3px;margin-top:5px}
#progress span{background:#ffffff35;height:4px;flex:1;border-radius:4px}
#progress span.filled{background:#ffd275}
#count{font-size:22px;white-space:nowrap;font-variant-numeric:tabular-nums}
#count small{font-size:12px;color:#e5dec7;font-weight:700}
#area{position:absolute;z-index:1;top:max(142px,calc(env(safe-area-inset-top) + 126px));left:17px;background:#fff7ddde;color:#435039;border-radius:30px;padding:5px 10px;font-size:10px;font-weight:800;pointer-events:none}
#toast{position:absolute;bottom:calc(max(92px,env(safe-area-inset-bottom) + 78px) + 61px);inset-inline:24px;text-align:center;pointer-events:none;font-weight:850;color:#fffaf0;text-shadow:0 1px 5px #263622;opacity:0;transition:opacity .2s}
#toast.show{opacity:1}
.controls{position:absolute;inset-inline:23px;bottom:max(34px,calc(env(safe-area-inset-bottom) + 20px));display:flex;align-items:flex-end;justify-content:space-between;pointer-events:none}
.control-group{display:grid;justify-items:center;gap:5px}
.control-label{color:#fff7e7;font-weight:850;font-size:10px;letter-spacing:.05em;text-shadow:0 1px 5px #19382a}
#joystick,#jumpButton{display:grid;place-items:center;border-radius:50%;touch-action:none;pointer-events:auto}
#joystick{width:88px;height:88px;background:#243c319e;border:2px solid #fff8e497;box-shadow:inset 0 0 0 5px #fff9e51c,0 3px 12px #193c2d47;cursor:grab}
#stick{pointer-events:none;width:40px;height:40px;border-radius:50%;background:#fff4d9;border:2px solid #fff9eb;box-shadow:0 3px 0 #b9a880}
#jumpButton{width:66px;height:66px;background:#fff4d9;border:2px solid #fffcf1;box-shadow:0 4px 0 #ab864f;font:900 31px/1 system-ui}
#jumpButton:active{transform:translateY(3px);box-shadow:0 1px 0 #ab864f}
.keys{position:absolute;inset-inline:0;bottom:max(6px,env(safe-area-inset-bottom));text-align:center;color:#fff7e7;font-size:10px;text-shadow:0 1px 5px #203e27;pointer-events:none}
.keys i{display:inline-block;width:3px;height:3px;margin:0 5px 2px;background:#fff7e7;border-radius:50%}
kbd{font:750 10px system-ui}
@media(pointer:coarse){.keys{display:none}.controls{bottom:max(21px,calc(env(safe-area-inset-bottom) + 10px))}}
dialog{width:min(calc(100% - 34px),430px);max-height:calc(100% - 28px);border:1px solid #fdf4dc;border-radius:22px;color:#22352b;background:#fff9ea;padding:17px;box-shadow:0 16px 50px #152d267c}
dialog::backdrop{background:#152d267b;backdrop-filter:blur(4px)}
.dialog-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}
dialog h2{font-size:25px}
.close{width:36px;height:36px;box-shadow:none;background:#eee6d1}
#mapCanvas{display:block;width:100%;height:auto;max-height:53dvh;object-fit:contain;background:#d6e6b8;border-radius:12px}
.legend{display:flex;justify-content:space-between;font-size:11px;font-weight:800;padding:9px 2px}
.primary,.secondary{width:100%;border:0;border-radius:11px;padding:12px;font-weight:850}
.primary{background:#344f3b;color:#fff8e7}
.secondary{background:#eee5cf;margin-top:8px}
#clear{padding:0}
.result-art{height:min(31vh,230px);background:#afcc9d url("assets/cover.webp") center 54%/cover}
.result-copy{padding:18px}
.result-copy p{font-size:13px;margin:8px 0 15px}
#error{position:absolute;z-index:5;inset:40% 20px auto;padding:18px;background:#fff6dd;border-radius:15px}
@media(max-height:570px){#joystick{width:65px;height:65px}#jumpButton{width:52px;height:52px}#area{display:none}.hud{top:8px}}
