/* Pumpkin Catapult. 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:#f3d9a0;color:#3b2a1a;
  font-family:ui-rounded,"SF Pro Rounded","Nunito","Segoe UI Rounded","Trebuchet MS",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif}
#pc{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}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
.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 #7a3fd0;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(#fffaf0,#f6e3bf);box-shadow:0 3px 0 #c79a55,0 6px 14px #6b3f0a33,inset 0 1px 0 #fff;color:#7a4a17}
.hbtn svg{width:28px;height:28px}
.hbtn:active,.tbtn:active,.step:active{transform:translateY(2px)}
.hbtn.kav-off,.hbtn.off{color:#a7957f}
.lvl{flex:1 1 auto;min-width:0;height:46px;display:flex;align-items:center;gap:8px;padding:0 12px 0 4px;border-radius:23px;
  background:linear-gradient(#fffaf0,#fbecd0);box-shadow:0 3px 0 #c79a55,0 6px 14px #6b3f0a33}
.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%,#ffb35c,#e0661b);box-shadow:inset 0 -3px 0 #a8430c}
.lvl-t{flex:1 1 auto;min-width:0;font-weight:900;font-size:18px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#6b3a12}
.pill{flex:0 0 auto;height:42px;padding:0 12px 0 6px;border-radius:21px;display:flex;align-items:center;gap:4px;border:0;
  background:#fffaf2f0;box-shadow:0 3px 0 #c79a55,0 6px 14px #6b3f0a22;font-weight:900;font-size:19px;color:#a84f0b}
.pill small{font-size:14px;color:#b78a55;font-weight:800}
.pk-ic,.bell-ic,.crate-ic{width:30px;height:30px;background:center/contain no-repeat}
.pk-ic{background-image:url(assets/pumpkin.png)}
.bell-ic{background-image:url(assets/bell.png)}
.crate-ic{width:26px;height:26px;background-image:url(assets/crate.png)}
.pill.pop{animation:pop .5s}
.pill.low{animation:wig .8s ease-in-out 2}
.pill.inf b{font-size:24px;line-height:1}
@keyframes pop{40%{transform:scale(1.25)}}
@keyframes wig{20%{transform:rotate(-8deg)}40%{transform:rotate(7deg)}60%{transform:rotate(-4deg)}}
@media (max-width:620px){.hbtn{width:42px;height:42px}.hbtn svg{width:25px;height:25px}.lvl{height:42px;padding-right:8px}.lvl-n{width:34px;height:34px;font-size:17px}
  .lvl-t{font-size:15px}.pill{height:38px;font-size:17px;padding:0 8px 0 4px}.pk-ic,.bell-ic{width:26px;height:26px}.crate-ic{width:22px;height:22px}.blocks{display:none}}
@media (max-width:420px){.lvl-t{display:none}.lvl{flex:0 0 auto;padding-right:4px}.hud{justify-content:space-between}#btnSound{display:none}}

/* ---------- controls ---------- */
.ctrl{position:absolute;left:0;right:0;bottom:0;z-index:6;display:flex;align-items:flex-end;justify-content:center;gap:10px;pointer-events:none;
  padding:6px calc(env(safe-area-inset-right,0px) + 10px) calc(env(safe-area-inset-bottom,0px) + 8px) calc(env(safe-area-inset-left,0px) + 10px)}
.ctrl > *{pointer-events:auto}
.grp{display:flex;align-items:center;gap:4px;height:62px;padding:4px;border-radius:22px;
  background:linear-gradient(#fffaf0,#f3dfb8);box-shadow:0 4px 0 #b9874a,0 8px 18px #4a2a0a40}
.step{width:52px;height:52px;border:0;border-radius:16px;display:grid;place-items:center;padding:0;color:#fff;
  background:radial-gradient(circle at 35% 25%,#ffb766,#e3701f);box-shadow:inset 0 -4px 0 #a8480f,0 2px 0 #7a3208}
.power .step{background:radial-gradient(circle at 35% 25%,#8fd16a,#3f9a2e);box-shadow:inset 0 -4px 0 #276b1b,0 2px 0 #1d4f14}
.step svg{width:30px;height:30px}
.step:disabled{filter:grayscale(1) opacity(.45);cursor:default}
.readout{position:relative;min-width:74px;display:flex;flex-direction:column;align-items:center;justify-content:center;line-height:1}
.readout small{font-size:12px;font-weight:900;letter-spacing:.06em;text-transform:uppercase;color:#a0723a}
.readout b{font-size:27px;font-weight:900;color:#5a2f0c}
.angle .readout b{color:#c4560f}
.power .readout b{color:#2f7d22}
.meter{display:flex;gap:2px;margin-top:3px;height:7px}
.meter i{display:block;width:5px;height:7px;border-radius:2px;background:#e4d3b3}
.meter i.on{background:linear-gradient(#a6e07a,#3f9a2e)}
.meter i.on.hi{background:linear-gradient(#ffc56a,#e3701f)}
.lock{position:absolute;top:-8px;right:-6px;width:22px;height:22px;border-radius:50%;background:#7a4a17;display:grid;place-items:center}
.lock svg{width:14px;height:14px}
.grp.locked .step{filter:grayscale(1) opacity(.4)}
.grp.wig,.pill.wig{animation:wig .5s}
.tbtn{height:62px;min-width:62px;border:0;border-radius:20px;padding:4px 8px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;
  background:linear-gradient(#fffaf0,#f3dfb8);box-shadow:0 4px 0 #b9874a,0 8px 18px #4a2a0a40;font-weight:900;font-size:13px;color:#6b3a12}
.tbtn .ic svg{width:30px;height:30px}
.tbtn[aria-pressed="true"]{background:linear-gradient(#fff6c8,#ffd75a)}
.fling{height:74px;min-width:132px;border:0;border-radius:37px;padding:0 20px 0 10px;display:flex;align-items:center;gap:8px;color:#fff;font-weight:900;font-size:24px;
  background:radial-gradient(circle at 40% 25%,#ff9a3c,#d9510f 70%);box-shadow:inset 0 -6px 0 #9c3507,0 5px 0 #6e2604,0 10px 22px #5a1e0050;text-shadow:0 2px 0 #9c3507}
.fling:active{transform:translateY(3px);box-shadow:inset 0 -3px 0 #9c3507,0 2px 0 #6e2604}
.fling:disabled{filter:saturate(.35) brightness(1.05);cursor:default}
.fling-pk{width:52px;height:52px;background:url(assets/pumpkin.png) center/contain no-repeat;filter:drop-shadow(0 2px 0 #9c3507)}
body.little .grp,body.little #btnIdea{display:none}
body.little .fling{height:96px;min-width:220px;border-radius:48px;font-size:32px}
body.little .fling-pk{width:72px;height:72px}
body.busy .step,body.busy #btnIdea{pointer-events:none;opacity:.6}

/* landscape phones: one tight row; portrait: two rows on the soil under the field */
@media (max-height:460px){.grp{height:54px}.step{width:44px;height:44px}.readout{min-width:64px}.readout b{font-size:23px}
  .tbtn{height:54px;min-width:54px}.fling{height:60px;min-width:112px;font-size:21px}.fling-pk{width:42px;height:42px}
  body.little .fling{height:70px;min-width:180px;font-size:26px}body.little .fling-pk{width:54px;height:54px}}
@media (orientation:portrait){
  .ctrl{flex-wrap:wrap;align-content:flex-end;gap:12px 10px;padding-bottom:calc(env(safe-area-inset-bottom,0px) + 14px)}
  .grp{flex:1 1 40%;justify-content:space-between;max-width:300px}
  .fling{order:5;flex:1 1 60%;max-width:380px;justify-content:center;height:80px}
  #btnIdea{order:4;height:80px}
}
@media (orientation:portrait) and (max-width:400px){.grp{flex-basis:100%;max-width:none}.step{width:56px}}

/* ---------- speech bubble ---------- */
.bubble{position:absolute;z-index:8;left:50%;top:calc(env(safe-area-inset-top,0px) + 62px);transform:translateX(-50%);width:max-content;max-width:min(560px,92vw);
  display:flex;align-items:center;gap:10px;padding:8px 16px 8px 8px;border-radius:24px;background:#fffdf6f2;box-shadow:0 4px 0 #d8b47a,0 10px 24px #4a2a0a33;
  animation:bub .3s ease-out;pointer-events:none}
.bub-face{flex:0 0 auto;width:52px;height:52px;border-radius:50%;background:#ffe9c2 url(assets/hazel.png) 46% 12%/185% auto no-repeat;box-shadow:inset 0 0 0 3px #e7b86a}
.bubble p{margin:0;font-size:18px;font-weight:800;line-height:1.25;color:#4a2a10}
@keyframes bub{from{opacity:0;transform:translate(-50%,-8px) scale(.96)}}
@media (max-height:460px){.bubble{top:calc(env(safe-area-inset-top,0px) + 54px)}.bubble p{font-size:15px}.bub-face{width:40px;height:40px}}

/* ---------- title ---------- */
.title-card{position:absolute;inset:0;z-index:10;display:flex;align-items:flex-start;justify-content:center;overflow:hidden;background:#f7dca0}
.title-art{position:absolute;inset:0;background:url(assets/title-wide.jpg) center/cover no-repeat;animation:kb 18s ease-in-out infinite alternate}
@media (orientation:portrait){.title-art{background-image:url(assets/title.jpg);background-position:center bottom}}
@keyframes kb{to{transform:scale(1.06) translateY(-1%)}}
.title-box{position:relative;margin-top:max(4vh,calc(env(safe-area-inset-top,0px) + 14px));text-align:center;padding:16px 26px 20px;border-radius:30px;
  background:#fffaf0d9;box-shadow:0 6px 0 #d1a160,0 16px 40px #5a33103a;max-width:min(600px,92vw)}
.title-box h1{margin:0;font-size:clamp(34px,7vmin,64px);line-height:1.02;font-weight:900;letter-spacing:.01em;color:#d9510f;
  text-shadow:0 3px 0 #fff,0 5px 0 #f3c47d}
.lead{margin:8px 0 14px;font-size:clamp(16px,2.6vmin,21px);font-weight:800;color:#5a3414}
.title-row{display:flex;align-items:center;justify-content:center;gap:12px}
.go{height:62px;padding:0 30px;border:0;border-radius:31px;font-weight:900;font-size:24px;color:#fff;
  background:radial-gradient(circle at 40% 25%,#ff9a3c,#d9510f 70%);box-shadow:inset 0 -5px 0 #9c3507,0 5px 0 #6e2604,0 10px 22px #5a1e0050;text-shadow:0 2px 0 #9c3507}
.go:active{transform:translateY(3px)}
@media (orientation:landscape){.title-box{margin-top:max(3vh,calc(env(safe-area-inset-top,0px) + 10px));max-width:min(560px,52vw);padding:12px 22px 16px}}
@media (orientation:landscape) and (max-height:460px){.title-box{padding:10px 18px 14px}.lead{margin:4px 0 10px}.go{height:54px;font-size:21px}}

/* ---------- menu ---------- */
.menu{position:absolute;inset:0;z-index:9;display:flex;background:url(assets/bg-fair.jpg) center/cover no-repeat;
  padding:calc(env(safe-area-inset-top,0px) + 8px) calc(env(safe-area-inset-right,0px) + 8px) calc(env(safe-area-inset-bottom,0px) + 8px) calc(env(safe-area-inset-left,0px) + 8px)}
.menu-in{flex:1;min-height:0;display:flex;flex-direction:column;gap:8px;padding:10px 12px;border-radius:26px;background:#fffaf0d0;box-shadow:0 6px 0 #d1a160,0 14px 36px #5a33103a}
.menu-head{flex:0 0 auto;display:flex;align-items:center;gap:8px}
.menu-head h2{flex:1 1 auto;margin:0 0 0 6px;font-size:clamp(20px,3.4vmin,30px);font-weight:900;color:#a8430c;white-space:nowrap}
button.little{flex:0 1 auto;display:flex;align-items:center;gap:8px;min-height:48px;padding:4px 12px 4px 6px;border:0;border-radius:24px;text-align:left;
  background:linear-gradient(#fffaf0,#f3dfb8);box-shadow:0 3px 0 #c79a55;color:#5a3414}
button.little b{display:block;font-size:16px;font-weight:900}
button.little small{display:block;font-size:12px;font-weight:700;color:#8a6338}
.sw{position:relative;flex:0 0 auto;width:52px;height:30px;border-radius:15px;background:#d8c4a2;box-shadow:inset 0 2px 3px #0003;transition:background .2s}
.knob{position:absolute;top:3px;left:3px;width:24px;height:24px;border-radius:50%;background:#fff;box-shadow:0 2px 3px #0004;transition:left .2s}
button.little[aria-checked="true"] .sw{background:#4fae3a}
button.little[aria-checked="true"] .knob{left:25px}
.grid{flex:1 1 auto;min-height:0;display:grid;grid-template-columns:repeat(6,1fr);grid-template-rows:repeat(2,1fr);gap:10px}
@media (orientation:portrait){.grid{grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(4,1fr)}}
@media (orientation:portrait) and (max-width:520px){.menu-head{flex-wrap:wrap}.menu-head h2{flex-basis:calc(100% - 110px)}button.little{order:5;flex:1 1 100%}}
.card{position:relative;min-height:0;min-width:0;border:0;padding:0;border-radius:18px;overflow:hidden;display:flex;flex-direction:column;justify-content:flex-end;
  background:#cfe8f5 center 70%/cover no-repeat;box-shadow:0 4px 0 #b9874a,0 8px 16px #4a2a0a33;color:#fff;text-align:left}
.card.fair{background-image:url(assets/bg-fair.jpg)}
.card.castle{background-image:url(assets/bg-castle.jpg)}
.card.sunset{background-image:url(assets/bg-sunset.jpg)}
.card .num{position:absolute;top:6px;left:6px;width:clamp(28px,5vmin,40px);height:clamp(28px,5vmin,40px);border-radius:50%;display:grid;place-items:center;
  font-weight:900;font-size:clamp(15px,2.6vmin,21px);background:radial-gradient(circle at 35% 30%,#ffb35c,#e0661b);box-shadow:inset 0 -3px 0 #a8430c}
.card .tw{position:absolute;right:6px;top:4px;width:30%;height:52%;background:url(assets/bell.png) center/contain no-repeat;filter:drop-shadow(0 2px 2px #0006)}
.card .nm{display:block;padding:4px 8px 2px;font-weight:900;font-size:clamp(12px,2.1vmin,17px);line-height:1.1;background:linear-gradient(transparent,#3a1d06cc 40%);text-shadow:0 1px 2px #000a}
.card .st{display:flex;gap:2px;padding:0 8px 6px;background:#3a1d06cc}
.card .st svg{width:clamp(14px,2.6vmin,22px);height:clamp(14px,2.6vmin,22px)}
.card.locked{filter:grayscale(.85) brightness(.85)}
.card.locked .num{background:#8a7a6a;box-shadow:none}
.card:active{transform:translateY(2px)}
.star path{fill:#ffffff40;stroke:#fff9;stroke-width:1.5}
.star.on path{fill:#ffcf3a;stroke:#b7790b}
.menu-note{flex:0 0 auto;margin:0;text-align:center;font-size:13px;font-weight:700;color:#6b4a2a}
.menu-note a{color:#a8430c}
@media (max-height:460px){.menu-in{padding:6px 8px;gap:6px}button.little small{display:none}button.little{min-height:42px}.grid{gap:7px}.menu-note{font-size:11px}}

/* ---------- result ---------- */
.result{position:absolute;inset:0;z-index:11;display:grid;place-items:center;background:#2a160866;padding:12px;animation:fade .3s}
@keyframes fade{from{opacity:0}}
.res-in{position:relative;width:min(470px,94vw);max-height:94%;overflow:hidden;text-align:center;padding:18px 20px 18px;border-radius:30px;background:#fffaf0;
  box-shadow:0 7px 0 #d1a160,0 20px 50px #2a160860;animation:popin .45s cubic-bezier(.2,1.4,.4,1)}
@keyframes popin{from{transform:scale(.7);opacity:0}}
.res-hazel{position:absolute;left:-6px;bottom:-10px;width:96px;height:140px;background:url(assets/hazel.png) center bottom/contain no-repeat;pointer-events:none}
.res-stars{display:flex;justify-content:center;gap:8px;height:56px}
.res-stars svg{width:52px;height:52px;animation:popin .5s backwards}
.res-stars svg:nth-child(2){animation-delay:.25s;transform:translateY(-8px)}
.res-stars svg:nth-child(3){animation-delay:.5s}
.result h2{margin:6px 0 4px;font-size:28px;font-weight:900;color:#d9510f}
.result p{margin:0 0 8px;font-size:17px;font-weight:800;color:#5a3414}
.res-list{list-style:none;margin:0 0 12px;padding:0 0 0 70px;text-align:left;font-size:15px;font-weight:700;color:#6b4a2a}
.res-list li{margin:3px 0;padding-left:20px;position:relative}
.res-list li::before{content:"";position:absolute;left:0;top:5px;width:12px;height:12px;border-radius:50%;background:#f2a03c}
.res-row{display:flex;justify-content:center;gap:10px;padding-left:60px}
@media (max-height:460px){.res-in{padding:10px 16px}.res-stars{height:40px}.res-stars svg{width:38px;height:38px}.result h2{font-size:22px;margin:2px 0}.result p{font-size:15px;margin-bottom:4px}
  .res-list{font-size:13px;margin-bottom:6px}.res-hazel{width:70px;height:100px}}
