*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#080d29;color:#fff;font-family:Arial,sans-serif;user-select:none;-webkit-user-select:none}button,a{-webkit-tap-highlight-color:transparent}button{font:700 17px Arial;cursor:pointer;border:1px solid #f9d88f66;color:#fff;background:linear-gradient(#30325c,#171c3e);border-radius:17px;padding:13px 22px;box-shadow:0 4px 0 #080d26, inset 0 1px #ffffff24;transition:filter .15s,transform .15s}button:hover{filter:brightness(1.2)}button:active{transform:translateY(3px)}button:focus-visible,a:focus-visible{outline:3px solid #fff6b0;outline-offset:4px}#app{position:relative;width:100%;height:100%;max-width:1600px;margin:auto;isolation:isolate}canvas{width:100%;height:100%;display:block}header{position:absolute;top:max(12px,env(safe-area-inset-top));left:14px;right:14px;display:flex;gap:8px;align-items:center;z-index:3;direction:ltr}header button{padding:8px;width:43px;height:43px;font-size:23px;border-radius:14px}#hud{display:flex;flex-direction:column;flex:1;text-align:center;direction:rtl;font-size:16px;color:#ffe49e;text-shadow:0 2px 6px #000}#progress{font-size:20px;letter-spacing:3px}#lives{font-size:21px;white-space:nowrap}.screen{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;z-index:4;background:#090d29a6;backdrop-filter:blur(9px)}.cover{background:linear-gradient(#070b3066,transparent 45%,#060b27 95%),url('assets/cover.webp') center 44%/cover;backdrop-filter:none;justify-content:space-between;padding:75px 15px 25px}.brand{text-align:center;padding:18px 28px;border-radius:30px;background:#080e34d9;box-shadow:0 8px 60px #060b34}.eyebrow{color:#d6bcf8;font-size:14px;letter-spacing:2px}h1{margin:8px 0;font-size:clamp(36px,6vw,76px);color:#ffe6a4;text-shadow:0 4px #7e441a,0 0 35px #ffbf4c66}p{line-height:1.7;color:#dddff7}.brand p{margin:4px}.menuBottom{display:flex;flex-direction:column;align-items:center;gap:15px}.primary{background:linear-gradient(#fff0b6,#ffc65d 48%,#dc8a30);border:2px solid #ffe9a0;color:#603610;box-shadow:0 6px 0 #854417,0 0 35px #ffbd4d38;font-size:23px;padding:17px 40px}.row{display:flex;gap:10px}a{color:#ddd6ee;font-size:14px}.hidden{display:none!important}#modal{z-index:6;padding:20px}.card{text-align:center;border:1px solid #c8a46780;border-radius:30px;background:radial-gradient(ellipse at top,#393165,#151b3b 70%);padding:28px;max-width:620px;width:100%;max-height:90%;overflow:auto;box-shadow:0 30px 120px #0009,inset 0 1px #fff3}.card h2{font-size:32px;color:#ffe5a1;margin:10px 0}.card p{font-size:18px}.card button{margin:8px}.petGrid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin:20px 0}.petItem{border-radius:16px;background:#ffffff0b;padding:10px 3px;font-size:13px}.petItem img{width:80px;max-width:100%}.petItem.locked{opacity:.35}.reward{width:160px;height:160px;filter:drop-shadow(0 0 25px #ffd36599)}footer{position:absolute;bottom:max(12px,env(safe-area-inset-bottom));left:15px;right:15px;text-align:center;z-index:2}#hint{color:#ffe5a7;font-size:15px;margin:9px;text-shadow:0 2px 6px #000}#jump{touch-action:none;width:310px;max-width:90%;background:linear-gradient(#714590,#382b67);border:2px solid #c79cdd;box-shadow:0 5px 0 #20163c,0 0 25px #be83f333;padding:12px 20px}#jump.charging{background:linear-gradient(#997047,#6e4528);border-color:#ffdc7c}.meter{height:7px;margin-top:9px;background:#100e27;border-radius:9px;overflow:hidden;direction:ltr}.meter i{display:block;width:0;height:100%;background:linear-gradient(90deg,#ffeab3,#f4ad39);border-radius:9px}small{display:block;margin-top:8px;color:#aaa9cb;font-size:11px}#toast{position:absolute;top:90px;left:10%;right:10%;text-align:center;z-index:3;color:#ffe5a5;font-size:22px;font-weight:bold;text-shadow:0 3px 6px #000;pointer-events:none;transition:opacity .2s;opacity:0}@media(max-width:600px){.cover{background-position:center;padding-top:80px}.brand{padding:15px}.brand h1{font-size:40px}.row button{font-size:14px;padding:12px 17px}.primary{font-size:21px}.card{padding:18px}.card h2{font-size:27px}#hud{font-size:12px}#progress{font-size:15px;letter-spacing:1px}#lives{font-size:15px}header{gap:5px;left:8px;right:8px}header button{width:35px;height:37px;font-size:20px}#toast{font-size:18px}.petGrid{grid-template-columns:repeat(3,1fr)}}
body:has(#modal:not(.hidden)) canvas{filter:saturate(1.15)}.card:has(.reward){border-color:#f7cf78;box-shadow:0 0 60px #db9d3b28,0 30px 120px #0009}.reward{animation:float 2s ease-in-out infinite}.card:has(.reward)::before{content:'✦ ✧ ✦ ✧ ✦';display:block;color:#ffda7e;font-size:24px;letter-spacing:18px;animation:shimmer 1.5s ease-in-out infinite alternate}@keyframes float{50%{transform:translateY(-9px) rotate(4deg)}}@keyframes shimmer{to{opacity:.4;transform:scale(.95)}}
.gamepad{display:flex;direction:ltr;justify-content:space-between;align-items:center;max-width:850px;margin:auto;gap:12px}.directions{display:flex;gap:12px}.gamepad button{touch-action:none;width:70px;height:62px;font-size:25px;border:2px solid #cab2df;background:linear-gradient(#584d87,#28264f);box-shadow:0 5px 0 #17172e,0 0 20px #ad7df026}.gamepad #jump{width:145px;max-width:none;margin:0;background:linear-gradient(#ffe7a0,#e1a043);color:#60370f;border-color:#fff0bd;font-size:21px}.gamepad button.pressed{transform:translateY(4px);filter:brightness(1.3)}.controlNote{font-size:13px;line-height:1.6;color:#e0d8f3;direction:rtl}.gamepad .meter{display:none}#lives{font-size:22px;color:#ffe6a1;background:#14182bba;border:1px solid #e5c17c66;border-radius:14px;padding:7px 13px;direction:rtl;min-width:90px;text-align:center}#lives small{margin-top:1px;color:#e5d0f3;font-size:12px}#hint{background:#101531cc;border:1px solid #c6ad6733;border-radius:20px;width:fit-content;max-width:95%;padding:7px 20px;margin:0 auto 10px;font-size:15px}header{pointer-events:none}header button{pointer-events:auto}footer{bottom:max(14px,env(safe-area-inset-bottom))}.card:has(.reward){background:radial-gradient(ellipse at top,#45346f,#111a38 80%)}@media(max-width:700px){.controlNote{display:none}.gamepad button{width:61px;height:59px}.gamepad #jump{width:125px}.directions{gap:9px}#hint{font-size:12px;padding:7px 12px}#lives{min-width:65px;font-size:18px;padding:4px 8px}.gamepad{max-width:500px}}@media(max-height:500px){.cover{padding-top:55px;padding-bottom:10px}.brand{padding:6px 25px}.brand h1{font-size:32px}.brand p{display:none}.menuBottom{gap:7px}.primary{padding:10px 25px}.menuBottom a{display:none}.gamepad button{height:44px;width:60px}.gamepad #jump{height:44px;padding:5px}.controlNote{display:none}#hint{font-size:12px;margin-bottom:5px;padding:4px 12px}footer{bottom:7px}.row button{padding:8px 18px}}
.cover{background:linear-gradient(#080c3330,transparent 40%,#060b27dc 95%),url('assets/night.webp') center/cover}.cover::before{content:'';position:absolute;inset:25% 14% 18%;background:url('assets/menorah.webp') center/contain no-repeat;pointer-events:none}.cover .brand,.cover .menuBottom{position:relative;z-index:1}.brand{background:#080e34b8}.gamepad button{font-family:Arial,sans-serif}#left,#right{font-variant-emoji:text}@media(max-width:700px){.cover::before{inset:27% 2% 24%}}
#sparkCounter{position:absolute;right:22px;bottom:145px;z-index:2;width:330px;max-width:calc(100% - 30px);padding:15px 20px;border-radius:22px;border:2px solid #edcb83;background:linear-gradient(135deg,#262048f5,#101b3ef5);box-shadow:0 5px 30px #0008,inset 0 1px #fff3;text-align:center;pointer-events:none}.sparkCounterTitle{display:flex;justify-content:center;align-items:center;gap:10px;color:#ffe39c;font-size:26px}.sparkCounterTitle span{font-size:37px;text-shadow:0 0 14px #ffc64c}#sparkMeter{height:12px;border-radius:10px;background:#090d23;border:1px solid #9e805855;overflow:hidden;margin:9px 0;direction:rtl}#sparkFill{display:block;width:0;height:100%;border-radius:10px;background:linear-gradient(90deg,#f0aa39,#fff0aa);transition:width .2s}#sparkStatus{font-size:16px;font-weight:700;color:#eee1c4;line-height:1.4}#sparkCounter.ready{border-color:#b1f9bc;background:linear-gradient(135deg,#1d523cf7,#142a3cf7);box-shadow:0 0 25px #7fe8a050}#sparkCounter.ready #sparkStatus{color:#c4ffd1}#sparkCounter.ready #sparkFill{background:linear-gradient(90deg,#5ac77b,#dcffb3)}@media(max-width:700px){#sparkCounter{bottom:139px;right:50%;transform:translateX(50%);width:300px;padding:10px 15px}.sparkCounterTitle{font-size:23px}.sparkCounterTitle span{font-size:30px}#sparkStatus{font-size:14px}}@media(max-height:500px){#sparkCounter{bottom:95px;right:12px;width:240px;padding:7px 12px;transform:none}.sparkCounterTitle{font-size:19px}.sparkCounterTitle span{font-size:24px}#sparkStatus{font-size:12px}#sparkMeter{height:8px;margin:5px 0}}
#sparkCounter{right:50%;left:auto;transform:translateX(50%);bottom:140px;width:350px}#modal:has(.rewardStage){background:radial-gradient(ellipse at top,#342555ed,#070e2cf5);backdrop-filter:blur(12px)}.card:has(.rewardStage){background:radial-gradient(ellipse at 50% 35%,#493b7d,#182343 68%);border:2px solid #e7c47c;max-width:600px;box-shadow:0 0 80px #d7aa4840,inset 0 1px #fff4}.rewardStage{position:relative;width:260px;height:240px;margin:12px auto 0;border-radius:50%;background:radial-gradient(ellipse,#f6d87938,transparent 70%)}.rewardStage:after{content:'';position:absolute;bottom:1px;left:20%;right:20%;height:24px;border-radius:50%;background:#c9a65155;box-shadow:0 0 30px #ffda8655}.rewardStage .reward{position:relative;z-index:1;width:230px;height:230px;object-fit:contain;filter:drop-shadow(0 8px 20px #ffd47455)}.rewardSpark{position:absolute;color:#ffe7a1;font-size:36px;animation:shimmer 1.5s infinite alternate}.rewardSpark.one{left:-8px;top:44px}.rewardSpark.two{right:-8px;top:115px;animation-delay:.7s}.rewardBadge{display:inline-block;padding:6px 18px;border-radius:20px;background:#286b5655;border:1px solid #8bddaa77;color:#baffd0;font-size:14px;font-weight:bold;margin-top:12px}.winStats{display:flex;justify-content:center;gap:12px;margin:20px 0}.winStats>div{min-width:95px;background:#ffffff0b;border:1px solid #bfb2ec26;border-radius:16px;padding:12px}.winStats b{font-size:24px;display:block;color:#ffe9ad}.winStats span{display:block;font-size:14px;margin-top:5px;color:#d4cee5}.petItem img{width:100px;filter:drop-shadow(0 3px 10px #ccb2ff33)}@media(max-width:700px){#sparkCounter{width:300px;bottom:139px}.rewardStage{width:220px;height:205px}.rewardStage .reward{width:200px;height:200px}.winStats{gap:8px}.winStats>div{min-width:75px;padding:9px}}@media(max-height:500px){#sparkCounter{right:50%;transform:translateX(50%);bottom:96px;width:270px}.rewardStage{width:170px;height:145px}.rewardStage .reward{width:150px;height:150px}.card:has(.rewardStage){padding:12px}.winStats{margin:10px 0}}

/* Compact reward screen with actions always at the top. */
#modal:has(.rewardStage){padding:12px}
.card:has(.rewardStage){display:flex;flex-direction:column;padding:16px 20px;max-width:480px;max-height:100%;border-radius:24px}
.card:has(.rewardStage)::before{display:none}
.card:has(.rewardStage) #modalButtons{order:-1;display:flex;justify-content:center;gap:10px;margin:0 0 16px;flex-shrink:0}
.card:has(.rewardStage) #modalButtons button{margin:0;padding:10px 18px;font-size:16px;border-radius:13px}
.card:has(.rewardStage) #modalButtons .primary{font-size:18px}
.card:has(.rewardStage) .eyebrow{font-size:11px;letter-spacing:1px}
.card:has(.rewardStage) .rewardHeading{font-size:26px;margin:7px 0}
.card:has(.rewardStage) .rewardStage{width:180px;height:165px;margin:8px auto 0}
.card:has(.rewardStage) .reward{width:165px;height:165px}
.card:has(.rewardStage) .rewardSpark{font-size:25px}
.card:has(.rewardStage) .rewardSpark.two{top:95px}
.card:has(.rewardStage) .rewardBadge{font-size:12px;padding:4px 12px;margin-top:5px}
.card:has(.rewardStage) .rewardName{font-size:23px;margin:7px 0}
.card:has(.rewardStage) .winStats{margin:10px 0 0;gap:8px}
.card:has(.rewardStage) .winStats>div{min-width:72px;padding:8px 12px;border-radius:12px}
.card:has(.rewardStage) .winStats b{font-size:21px}
.card:has(.rewardStage) .winStats span{font-size:12px;margin-top:3px}
@media(max-height:520px){
 .card:has(.rewardStage){max-width:550px;padding:12px 16px}
 .card:has(.rewardStage) #modalButtons{margin-bottom:12px}
 .card:has(.rewardStage) #modalContent{display:grid;grid-template-columns:165px 1fr;column-gap:12px;align-items:center}
 .card:has(.rewardStage) .eyebrow{grid-column:1/-1}
 .card:has(.rewardStage) .rewardHeading{grid-column:1/-1;font-size:23px;margin:5px 0}
 .card:has(.rewardStage) .rewardStage{grid-column:1;grid-row:3/6;width:155px;height:145px;margin:0}
 .card:has(.rewardStage) .reward{width:145px;height:145px}
 .card:has(.rewardStage) .rewardBadge{grid-column:2;justify-self:center;margin:0}
 .card:has(.rewardStage) .rewardName{grid-column:2;font-size:21px;margin:4px 0}
 .card:has(.rewardStage) .winStats{grid-column:2;margin:0;gap:5px}
 .card:has(.rewardStage) .winStats>div{min-width:0;flex:1;padding:6px}
 .card:has(.rewardStage) .winStats b{font-size:18px}
}
@media(max-width:380px){
 .card:has(.rewardStage){padding:12px}
 .card:has(.rewardStage) #modalButtons{gap:7px}
 .card:has(.rewardStage) #modalButtons button{font-size:14px;padding:10px 12px}
 .card:has(.rewardStage) #modalButtons .primary{font-size:16px}
}
/* Full-adventure celebration. */
#modal:has(.finale){background:radial-gradient(ellipse at 50% 35%,#403273,#111832 75%);padding:12px}
.card:has(.finale){position:relative;isolation:isolate;max-width:650px;padding:22px 24px 18px;max-height:100%;background:radial-gradient(ellipse at 50% 35%,#53458180,#192444 80%);border:2px solid #e7c47c;box-shadow:0 0 90px #efc26926}
.finale h2{font-size:clamp(25px,4vw,38px);margin:7px 0;color:#ffdf80;text-shadow:0 3px #66422c}
.finaleEyebrow{font-size:14px;color:#e6d5ff;font-weight:bold;letter-spacing:1px}
.card .finaleSubtitle{font-size:16px;margin:8px 0;color:#f5e8ff}
.finaleScene{position:relative;height:240px;margin:8px auto 0;max-width:520px}
.finaleHalo{position:absolute;inset:0 12%;background:radial-gradient(ellipse,#ffdc7d60,transparent 68%);animation:shimmer 2s infinite alternate}
.happyHero{position:absolute;left:50%;top:14px;transform:translateX(-50%);width:112px;z-index:3;animation:heroCelebrate 1s ease-in-out infinite}
.happyHero img{width:100%;height:146px;object-fit:contain;filter:drop-shadow(0 0 16px #ffe9a7aa)}
.heroCheer{position:absolute;top:-12px;left:50%;transform:translateX(-50%) rotate(-5deg);white-space:nowrap;background:#fff0b6;color:#794315;border:2px solid #ffcf66;padding:5px 11px;border-radius:14px;font-weight:bold;font-size:14px}
.happyCandles{position:absolute;bottom:22px;inset-inline:12px;display:flex;justify-content:space-between;align-items:end;gap:10px;z-index:2}
.happyCandle{position:relative;width:35px;height:62px;border-radius:9px 9px 6px 6px;background:linear-gradient(90deg,#fff9,var(--c) 35%,var(--c) 70%,#0003);box-shadow:inset 0 3px #fff8,0 0 20px #ffcc5633;animation:candleDance .85s ease-in-out infinite alternate;animation-delay:calc(var(--i)*-.13s)}
.partyFlame{position:absolute;left:9px;top:-30px;width:19px;height:30px;border-radius:80% 15% 60% 45%;background:radial-gradient(ellipse at 40% 75%,#fffbd1 15%,#ffd447 45%,#ff8f2b 75%);transform:rotate(-18deg);box-shadow:0 0 21px #ffb92e;animation:shimmer .6s infinite alternate}
.candleEyes{position:absolute;top:20px;left:7px;width:7px;height:7px;border:2px solid #49324e;border-bottom:0;border-radius:8px 8px 0 0}
.candleEyes:after{content:'';position:absolute;left:12px;top:-2px;width:7px;height:7px;border:2px solid #49324e;border-bottom:0;border-radius:8px 8px 0 0}
.candleSmile{position:absolute;top:32px;left:12px;width:12px;height:8px;background:#743c4a;border-radius:2px 2px 10px 10px;border-bottom:3px solid #ff95a4}
.candleArm{position:absolute;top:28px;width:19px;height:13px;border-bottom:3px solid var(--c);border-radius:0 0 20px 20px}.leftArm{left:-15px;transform:rotate(35deg)}.rightArm{right:-15px;transform:rotate(-35deg)}
.finalePedestal{position:absolute;bottom:4px;left:0;right:0;height:20px;border-radius:50%;background:linear-gradient(#ffd688,#926139);box-shadow:0 8px 24px #080d2e}
.finaleStar{position:absolute;top:45px;color:#ffe499;font-size:40px;animation:shimmer 1s infinite alternate}.starLeft{left:17%}.starRight{right:17%;animation-delay:.4s}
.finaleReward{display:flex;align-items:center;justify-content:center;gap:9px;margin:8px auto 0;padding:5px 18px;width:fit-content;border:1px solid #d0ac6744;border-radius:18px;background:#10182c66}.finaleReward img{width:65px;height:65px;object-fit:contain}.finaleReward span{display:block;font-size:13px;color:#dcd4eb}.finaleReward strong{display:block;font-size:22px;color:#ffe49b;margin-top:4px}
.card .finaleMessage{font-size:18px;color:#ffedbc;margin:9px 0 0;font-weight:bold}.previewLabel{display:block;font-size:12px;color:#c4bfd9;margin-top:7px}
.card:has(.finale) #modalButtons{display:flex;justify-content:center;gap:10px;margin-top:14px;position:relative;z-index:3}.card:has(.finale) #modalButtons button{margin:0;font-size:17px;padding:11px 19px}
.finaleConfetti{position:absolute;inset:0;overflow:hidden;pointer-events:none;z-index:-1;border-radius:28px}.finaleConfetti i{position:absolute;left:var(--x);top:-20px;width:8px;height:13px;background:var(--color);animation:finaleConfetti var(--duration) linear var(--delay) infinite}
@keyframes finaleConfetti{to{transform:translate(25px,700px) rotate(var(--turn))}}
@keyframes heroCelebrate{0%,100%{transform:translate(-50%,0) rotate(-5deg)}50%{transform:translate(-50%,-15px) rotate(5deg)}}
@keyframes candleDance{from{transform:translateY(0) rotate(-7deg)}to{transform:translateY(-12px) rotate(7deg)}}
@media(max-width:420px){.card:has(.finale){padding:17px 12px}.happyCandles{gap:7px;inset-inline:4px}.happyCandle{width:28px;height:54px}.candleEyes{left:4px}.candleSmile{left:9px}.partyFlame{left:6px}.candleArm{width:11px}.leftArm{left:-9px}.rightArm{right:-9px}.finaleScene{height:225px}.finaleReward img{width:52px;height:52px}.card:has(.finale) #modalButtons button{font-size:15px;padding:10px 12px}}
@media(max-height:580px){.card:has(.finale){max-width:750px;padding:12px 20px}.finaleScene{height:170px;width:49%;float:right;margin:5px 0 0 12px}.happyHero{width:80px;top:12px}.happyHero img{height:100px}.happyCandle{width:25px;height:43px}.happyCandles{gap:6px;bottom:18px}.partyFlame{height:22px;top:-22px;width:15px;left:5px}.candleEyes{left:3px;top:12px}.candleSmile{left:8px;top:24px}.candleArm{top:20px;width:11px}.leftArm{left:-9px}.rightArm{right:-9px}.finaleStar{font-size:25px;top:25px}.finaleReward{margin-top:25px;padding:4px 10px}.finaleReward img{width:50px;height:50px}.finaleReward strong{font-size:20px}.card .finaleMessage{font-size:16px}.card:has(.finale) #modalButtons{clear:both;margin-top:8px}.finale h2{font-size:26px}.card .finaleSubtitle{margin:4px 0;font-size:14px}}
@media(prefers-reduced-motion:reduce){.happyHero,.happyCandle,.partyFlame,.finaleStar,.finaleHalo,.finaleConfetti i{animation:none}.finaleConfetti{display:none}}

.gamepad .directions button{display:flex;align-items:center;justify-content:center;padding:0;line-height:1}
.directions svg{display:block;width:28px;height:28px;fill:currentColor;pointer-events:none}
.card:has(.finale) #modalButtons{flex-wrap:wrap}

/* Extra outward touch space belongs to each directional button. */
.gamepad .directions{gap:22px}
.gamepad .directions button{position:relative;overflow:visible}
.gamepad .directions button::after{content:'';position:absolute;top:-6px;bottom:-6px;left:0;right:0;touch-action:none}
.gamepad .directions #left::after{left:-22px}
.gamepad .directions #right::after{right:-22px}

#adLoading{position:absolute;inset:0;z-index:20;display:flex;align-items:center;justify-content:center;background:#111832f5;color:#ffe4a1;font-size:24px;font-weight:bold}
.brand h1{font-size:clamp(32px,5vw,66px)}
