/* Monkey Vines. System fonts only, no inline styles. */
[hidden]{display:none!important}
*{box-sizing:border-box}
html,body{margin:0;padding:0;height:100%;width:100%;overflow:hidden;overscroll-behavior:none;touch-action:none;
  -webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent}
body{position:fixed;inset:0;height:100dvh;background:#2f7a3c;color:#2b3a22;
  font-family:ui-rounded,"SF Pro Rounded","Nunito","Segoe UI Rounded","Trebuchet MS",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif}
#mv{position:fixed;inset:0;height:100dvh;width:100vw;overflow:hidden;overscroll-behavior:none;touch-action:none}
#world{position:absolute;inset:0;width:100%;height:100%;display:block;touch-action:none;outline:none}
#world:focus-visible{box-shadow:inset 0 0 0 4px #ffffffaa}
button,a{touch-action:manipulation;font:inherit;color:inherit}
button{cursor:pointer}
svg{display:block}
.nojs{position:absolute;inset:40% 10% auto;text-align:center;font-weight:800;background:#fff;padding:16px;border-radius:16px}
:focus-visible{outline:4px solid #ffcf3a;outline-offset:2px}

/* ---------- HUD ---------- */
.hud{position:absolute;left:0;right:0;top:0;display:flex;align-items:center;gap:6px;z-index:7;pointer-events:none;
  padding:calc(env(safe-area-inset-top,0px) + 6px) calc(env(safe-area-inset-right,0px) + 8px) 6px calc(env(safe-area-inset-left,0px) + 8px)}
.hud > *{pointer-events:auto}
.hbtn{flex:0 0 auto;width:46px;height:46px;border-radius:16px;border:0;display:grid;place-items:center;padding:0;text-decoration:none;
  background:linear-gradient(#fffdf3,#f1e3bd);box-shadow:0 3px 0 #a9824a,0 6px 14px #1d2f0f44,inset 0 1px 0 #fff;color:#6b4220}
.hbtn svg{width:28px;height:28px}
.hbtn:active,.tbtn:active{transform:translateY(2px)}
.hbtn.kav-off,.hbtn.off{color:#a3967f}
.lvl{flex:1 1 auto;min-width:0;height:46px;display:flex;align-items:center;gap:8px;padding:0 8px 0 4px;border-radius:23px;
  background:linear-gradient(#fffdf3,#f6ecd2);box-shadow:0 3px 0 #a9824a,0 6px 14px #1d2f0f33}
.lvl-n{flex:0 0 auto;width:38px;height:38px;border-radius:50%;display:grid;place-items:center;font-weight:900;font-size:19px;color:#fff;
  background:radial-gradient(circle at 35% 30%,#8fdc6a,#3f9a2e);box-shadow:inset 0 -3px 0 #2c6e20}
.lvl-tx{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;line-height:1.05}
.lvl-t{font-weight:900;font-size:18px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#4a2a10}
.lvl-l{font-weight:800;font-size:13px;color:#3f8a2e;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.lil{flex:0 0 auto;width:34px;height:34px;background:url(assets/mango-cheer.png) center/contain no-repeat}
.pill{flex:0 0 auto;height:44px;padding:0 12px 0 6px;border-radius:22px;display:flex;align-items:center;gap:4px;border:0;
  background:#fffdf3f2;box-shadow:0 3px 0 #a9824a,0 6px 14px #1d2f0f22;font-weight:900;font-size:22px;color:#8a5a00}
.pill small{font-size:14px;color:#a98a5a;font-weight:800}
.ban-ic{width:34px;height:34px;background:url(assets/banana.png) center/contain no-repeat;transform:rotate(-10deg)}
.pill.pop{animation:pop .5s}
@keyframes pop{40%{transform:scale(1.22)}}
@media (max-width:560px){.hbtn{width:42px;height:42px}.hbtn svg{width:25px;height:25px}.lvl{height:42px}.lvl-n{width:34px;height:34px;font-size:17px}
  .lvl-t{font-size:15px}.lvl-l{font-size:11px}.pill{height:40px;font-size:19px;padding:0 9px 0 4px}.ban-ic{width:28px;height:28px}.lil{width:28px;height:28px}}
@media (max-width:420px){.lvl-t{font-size:14px}.lvl{gap:5px;padding-left:12px}.lvl-n{display:none}}
@media (max-width:380px){.pill small{display:none}#btnSound{display:none}}

/* ---------- the big hand button (let go / grab) ---------- */
.hand{position:absolute;z-index:6;right:calc(env(safe-area-inset-right,0px) + 12px);bottom:calc(env(safe-area-inset-bottom,0px) + 12px);
  width:104px;height:104px;border-radius:50%;border:0;padding:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0;
  background:radial-gradient(circle at 38% 30%,#ffe9a0,#ffc23a 55%,#e8930f);box-shadow:0 6px 0 #a8620a,0 12px 26px #1d2f0f55,inset 0 3px 0 #fff5cf;
  color:#5a2e00;font-weight:900;font-size:17px;text-shadow:0 1px 0 #fff3c4}
.hand-ic{width:52px;height:46px;background:url(assets/mango-fly.png) center/contain no-repeat}
.hand.air{background:radial-gradient(circle at 38% 30%,#c9f5b0,#79d457 55%,#3f9a2e);box-shadow:0 6px 0 #2c6e20,0 12px 26px #1d2f0f55,inset 0 3px 0 #eaffdf;color:#123c08;text-shadow:0 1px 0 #e8ffd8}
.hand.air .hand-ic{background-image:url(assets/mango-swing.png)}
.hand.ready{animation:handGlow .9s ease-in-out infinite}
.hand.nudge{animation:handNudge .7s ease-in-out 3}
.hand:active{transform:translateY(4px)}
@keyframes handGlow{50%{box-shadow:0 6px 0 #a8620a,0 0 0 10px #fff3a088,0 12px 26px #1d2f0f55}}
@keyframes handNudge{50%{transform:scale(1.12) rotate(-6deg)}}
@media (max-width:560px),(max-height:520px){.hand{width:86px;height:86px;font-size:15px}.hand-ic{width:44px;height:38px}}

/* ---------- banner (adding / counting) ---------- */
.banner{position:absolute;left:50%;top:calc(env(safe-area-inset-top,0px) + 62px);z-index:6;transform:translateX(-50%);pointer-events:none;white-space:nowrap;
  padding:6px 20px;border-radius:24px;background:#fffdf3f0;box-shadow:0 4px 0 #a9824a,0 10px 22px #1d2f0f44;font-weight:900;font-size:clamp(24px,5vw,40px);color:#6b3a0a;
  animation:banIn .4s cubic-bezier(.2,1.6,.4,1)}
.banner .eq{color:#2f8a2e}
.banner.tip{font-size:clamp(16px,3.2vw,22px);white-space:normal;max-width:min(560px,92vw);text-align:center;color:#3a2f1f}
@keyframes banIn{from{opacity:0;transform:translateX(-50%) scale(.7)}}
@media (max-height:520px) and (orientation:landscape){.banner{top:54px;font-size:26px;padding:3px 16px}.banner.tip{font-size:16px}}

/* ---------- title ---------- */
.title-card{position:absolute;inset:0;z-index:10;display:flex;align-items:flex-end;justify-content:center;background:#2f7a3c}
.title-art{position:absolute;inset:0;background:url(assets/title.jpg) 50% 20%/cover no-repeat}
.title-box{position:relative;margin-bottom:calc(env(safe-area-inset-bottom,0px) + 6vh);text-align:center;padding:16px 22px 20px;border-radius:28px;max-width:min(92vw,560px);
  background:#fffdf3e6;box-shadow:0 8px 0 #a9824a88,0 18px 40px #1d2f0f55;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}
.title-box h1{margin:0;font-size:clamp(34px,8vw,58px);font-weight:900;color:#6b3a0a;letter-spacing:.5px;text-shadow:0 3px 0 #ffd23f,0 6px 0 #e8930f55}
.lead{margin:6px 0 14px;font-weight:800;font-size:clamp(16px,2.6vw,20px);color:#3a4a2a}
.title-row{display:flex;justify-content:center;align-items:center;gap:12px}
.go{border:0;border-radius:26px;padding:16px 34px;font-weight:900;font-size:24px;color:#fff;background:linear-gradient(#8fe07a,#3aa62e);
  box-shadow:0 5px 0 #23701b,0 12px 24px #1d2f0f44;text-shadow:0 2px 0 #23701b99}
.go:active{transform:translateY(3px)}
@media (orientation:landscape) and (max-height:520px){.title-box{margin-bottom:10px;padding:8px 18px 12px}.title-box h1{font-size:34px}.lead{margin:2px 0 8px;font-size:15px}.go{padding:10px 28px;font-size:21px}}
@media (orientation:portrait){.title-art{background-position:51% 30%}}

/* ---------- menu (fits the screen; nothing scrolls) ---------- */
.menu{position:absolute;inset:0;z-index:9;overflow:hidden;background:linear-gradient(#3f8f3a,#2a6a2c 60%,#1f5426)}
.menu-in{position:absolute;inset:0;display:flex;flex-direction:column;overflow:hidden;overscroll-behavior:none;touch-action:none;
  padding:calc(env(safe-area-inset-top,0px) + 8px) calc(env(safe-area-inset-right,0px) + 12px) calc(env(safe-area-inset-bottom,0px) + 8px) calc(env(safe-area-inset-left,0px) + 12px)}
.menu-head{display:flex;align-items:center;gap:8px;max-width:980px;width:100%;margin:0 auto;flex:0 0 auto}
.menu-head h2{flex:1;margin:0;font-size:clamp(20px,3.6vh,30px);font-weight:900;color:#fff6d8;text-shadow:0 2px 0 #1a4a1a}
.little{display:flex;align-items:center;gap:10px;max-width:980px;width:100%;margin:clamp(6px,1.4vh,14px) auto;flex:0 0 auto;border:0;border-radius:20px;padding:6px 12px 6px 6px;text-align:left;
  background:linear-gradient(#fffdf3,#f1e3bd);box-shadow:0 3px 0 #a9824a,0 8px 16px #0a200a44;color:#4a2a10}
.lil-ic{flex:0 0 auto;width:clamp(36px,6vh,52px);height:clamp(36px,6vh,52px);background:url(assets/mango-cheer.png) center/contain no-repeat}
.little-tx{flex:1;min-width:0;display:flex;flex-direction:column}
.little-tx b{font-size:clamp(16px,2.4vh,20px);font-weight:900}
.little-tx small{font-size:clamp(12px,1.7vh,14px);font-weight:800;color:#6b5a3a}
.sw{flex:0 0 auto;width:58px;height:32px;border-radius:16px;background:#c9b99a;position:relative;box-shadow:inset 0 2px 4px #0003;transition:background .2s}
.sw i{position:absolute;left:3px;top:3px;width:26px;height:26px;border-radius:50%;background:#fff;box-shadow:0 2px 3px #0004;transition:left .2s}
.little[aria-pressed="true"]{background:linear-gradient(#fff8d8,#ffe38a);box-shadow:0 3px 0 #d39b1e,0 0 0 3px #ffcf3a}
.little[aria-pressed="true"] .sw{background:#3fa62e}
.little[aria-pressed="true"] .sw i{left:29px}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));grid-auto-rows:1fr;gap:clamp(6px,1.2vh,12px);max-width:980px;width:100%;margin:0 auto;flex:1 1 auto;min-height:0;align-content:start}
.lv{position:relative;border:0;border-radius:18px;padding:0;overflow:hidden;text-align:left;background:#fffdf3;box-shadow:0 3px 0 #a9824a,0 8px 16px #0a200a44;color:#4a2a10;min-height:0;display:flex;flex-direction:column}
.lv .th{display:block;width:100%;flex:1 1 auto;min-height:clamp(30px,7vh,96px);background:center/cover no-repeat;position:relative}
.th.morning{background-image:url(assets/bg-morning.jpg)}.th.waterfall{background-image:url(assets/bg-waterfall.jpg)}.th.river{background-image:url(assets/bg-river.jpg)}
.th.sunset{background-image:url(assets/bg-sunset.jpg)}.th.night{background-image:url(assets/bg-night.jpg)}
.lv .th canvas{position:absolute;inset:0;width:100%;height:100%}
.lv b{display:block;padding:4px 8px 0;font-size:clamp(13px,2vh,17px);font-weight:900;line-height:1.15}
.lv .meta{display:block;padding:0 8px;font-size:clamp(11px,1.6vh,14px);font-weight:800;color:#3f8a2e;line-height:1.2}
.lv .num{position:absolute;left:6px;top:6px;width:28px;height:28px;border-radius:50%;display:grid;place-items:center;font-weight:900;font-size:14px;color:#fff;background:#3f9a2e;box-shadow:0 2px 0 #2c6e20,0 0 0 2px #fff}
.lv .st{display:flex;gap:1px;padding:1px 6px 5px}
.star{width:22px;height:22px}
.star path{fill:#e3e0d6;stroke:#bdb5a0;stroke-width:1.5}
.star.on path{fill:#ffcf3a;stroke:#d99a0b}
.lv .star{width:clamp(14px,2.3vh,22px);height:clamp(14px,2.3vh,22px)}
.lv.next{box-shadow:0 3px 0 #d39b1e,0 0 0 4px #ffcf3a,0 8px 16px #0a200a44}
.lv:active{transform:translateY(2px)}
.menu-note{max-width:980px;width:100%;margin:clamp(4px,1.2vh,12px) auto 0;font-size:clamp(11px,1.6vh,13px);font-weight:700;color:#e8f5d8;flex:0 0 auto}
.menu-note a{color:#fff6b0}
@media (max-width:460px){.grid{grid-template-columns:repeat(2,1fr)}}
@media (max-height:520px) and (orientation:landscape){
  .grid{grid-template-columns:repeat(4,1fr);gap:6px}
  .lv .meta{display:none}.lv .th{min-height:24px}
  .little{margin:6px auto;padding:3px 10px 3px 4px}.little-tx small{display:none}
  .menu-note{display:none}
}
@media (max-height:700px) and (max-width:460px){.lv .meta{display:none}.menu-note{display:none}}

/* ---------- quiz ---------- */
.quiz{position:absolute;inset:0;z-index:9;display:grid;place-items:center;background:#0a200a55;padding:10px}
.quiz-in{width:min(560px,96vw);max-height:calc(100dvh - 20px);display:flex;flex-direction:column;align-items:center;gap:8px;overflow:hidden;
  background:linear-gradient(#fffdf3,#f6e7bf);border-radius:28px;padding:12px 16px 16px;box-shadow:0 8px 0 #a9824a,0 20px 50px #0a200a66;animation:bubIn .45s cubic-bezier(.2,1.6,.4,1)}
.quiz-top{display:flex;align-items:center;gap:8px;width:100%}
.tika{flex:0 0 auto;width:64px;height:60px;background:url(assets/toucan.png) center/contain no-repeat;animation:tika 1.4s ease-in-out infinite}
@keyframes tika{50%{transform:translateY(-4px) rotate(-4deg)}}
.quiz-top h2{flex:1;margin:0;font-size:clamp(19px,3.4vh,26px);font-weight:900;color:#4a2a10;line-height:1.15}
#quizPic{width:100%;height:clamp(90px,26vh,220px);display:block}
.choices{display:flex;gap:12px;justify-content:center;width:100%}
.choice{flex:1 1 0;max-width:150px;height:clamp(64px,11vh,92px);border:0;border-radius:22px;font-weight:900;font-size:clamp(30px,5.5vh,44px);color:#4a2a10;
  background:linear-gradient(#ffffff,#f1e3bd);box-shadow:0 5px 0 #a9824a,0 10px 18px #0a200a33}
.choice:active{transform:translateY(3px)}
.choice.no{background:linear-gradient(#f3eee4,#dcd3c0);color:#a3967f;box-shadow:0 2px 0 #b9ab8f;animation:wig .5s}
.choice.yes{background:linear-gradient(#c9f5b0,#79d457);color:#123c08;box-shadow:0 5px 0 #2c6e20,0 0 0 4px #ffcf3a}
@keyframes wig{20%{transform:rotate(-6deg)}40%{transform:rotate(5deg)}60%{transform:rotate(-3deg)}}
@keyframes bubIn{from{opacity:0;transform:scale(.8) translateY(8px)}}

/* ---------- result ---------- */
.result{position:absolute;inset:0;z-index:9;display:grid;place-items:center;background:#0a200a55;padding:12px}
.res-in{position:relative;width:min(460px,94vw);max-height:calc(100dvh - 24px);overflow:hidden;text-align:center;background:linear-gradient(#fffdf3,#f6e7bf);border-radius:28px;padding:14px 18px 18px;
  box-shadow:0 8px 0 #a9824a,0 20px 50px #0a200a66;animation:bubIn .45s cubic-bezier(.2,1.6,.4,1)}
.res-mango{display:block;width:clamp(70px,16vh,120px);height:clamp(70px,16vh,120px);margin:0 auto -4px;background:url(assets/mango-cheer.png) center/contain no-repeat;animation:tika 1s ease-in-out infinite}
.res-stars{display:flex;justify-content:center;gap:6px}
.res-stars .star{width:clamp(40px,8vh,58px);height:clamp(40px,8vh,58px)}
.res-stars .star.on{animation:starIn .5s cubic-bezier(.2,1.8,.4,1) both}
.res-stars .star:nth-child(2){animation-delay:.25s}.res-stars .star:nth-child(3){animation-delay:.5s}
@keyframes starIn{from{transform:scale(0) rotate(-90deg)}}
.res-in h2{margin:6px 0 2px;font-size:clamp(22px,4vh,28px);font-weight:900;color:#6b3a0a}
.res-in p{margin:0 0 10px;font-weight:800;color:#4a4030;font-size:clamp(15px,2.4vh,18px)}
.res-row{display:flex;gap:10px;justify-content:center;align-items:center}
.tbtn{width:72px;height:68px;border-radius:18px;border:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;padding:0;
  background:linear-gradient(#ffffff,#f1e3bd);box-shadow:0 4px 0 #a9824a,0 8px 16px #0a200a33;font-weight:900;font-size:13px;color:#4a2a10}
.tbtn .ic svg{width:30px;height:30px}
@media (max-height:520px) and (orientation:landscape){.res-mango{display:none}.res-in{padding:10px 16px 12px}.quiz-in{padding:8px 12px 10px;gap:4px}.tika{width:48px;height:44px}#quizPic{height:30vh}}
